ERC-721
Overview
Max Total Supply
425 CREC
Holders
237
Total Transfers
-
Market
Volume (24H)
0.13 ETH
Min Price (24H)
$199.09 @ 0.065000 ETH
Max Price (24H)
$199.09 @ 0.065000 ETH
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
CE_mint
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.22; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./CE01_Helper.sol"; import "./CE03_Stitcher.sol"; import {Freezable} from "./Freezable.sol"; interface IChaosRoads { function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function getEntropy(uint256 tokenId) external view returns (uint256 entropy); } contract CE_mint is ERC721Enumerable, Ownable, Freezable, Helper { using MerkleProof for bytes32[]; /// CONSTANTS uint256 public constant MAX_TOTAL_SUPPLY = 2000; // But only allowlist, so will be hardcapped lower uint256 public constant END_MINT_TIME = 1798757999; // End of 2026 timestamp string[3] private VALID_MESSAGES = [ "Nothing justifies genocide", "Free Palestine", "Ceasefire NOW"]; uint256 public constant MIN_DONATION = 0.005 ether; /// Addresses address public donationAddy = 0x46dd470CD5E4dfce2b774dCf99742601266b47F6; IChaosRoads public constant crContract = IChaosRoads(0x18Adc812fE66B9381700C2217f0c9DC816c879E6); // Contracts Stitcher public stitcher; // State variables bytes32 public allowlistMerkleRoot; uint128 public collective; uint256 public tokenCounter; bool public allowlistSaleIsActive; struct BloodState { uint128 peace; uint128 rand; } mapping(uint256 => BloodState) public bloodStates; mapping(address => bool) public hasAllowlistMinted; constructor(address _stitcher, address initialOwner) ERC721("Crimson Echo", "CREC") Freezable(initialOwner) { stitcher = Stitcher(_stitcher); } /////////////////////////////////////////////////// //////////////////// MODIFIERS //////////////////// /////////////////////////////////////////////////// modifier tokenExists(uint256 _tokenId) { require(_ownerOf(_tokenId) != address(0), "Invalid token"); _; } modifier activeAllowlistSale { require(allowlistSaleIsActive, "Sale inactive"); _; } modifier notMinted { require(!hasAllowlistMinted[msg.sender], "Already minted"); _; } modifier allowlisted(bytes32[] calldata proof, uint256 amount) { require( _isAddressAllowlisted(proof, msg.sender, amount), "Not allowlisted" ); _; } modifier amountWithinMaxSupply(uint8 amount) { require(tokenCounter + amount <= MAX_TOTAL_SUPPLY, "Exceeds supply"); _; } modifier withinMintPeriod { require(block.timestamp <= END_MINT_TIME, "Mint ended"); _; } modifier humanitarian(string calldata mintMsg) { require(_isValidMessage(mintMsg), "Invalid msg"); _; } modifier minDonationAboveLimit() { require(msg.value >= MIN_DONATION, "Min 0.005E"); _; } /////////////////////////////////////////////////// ///////////////// OWNER FUNCTIONS ///////////////// /////////////////////////////////////////////////// function upgradeRenderer(Stitcher _stitcher) external onlyOwner notFrozen { stitcher = _stitcher; } function setDonationAddress(address _donationAddy) external onlyOwner notFrozen { donationAddy = _donationAddy; } function setAllowlistSale(bool _allowlistSaleIsActive) external onlyOwner { allowlistSaleIsActive = _allowlistSaleIsActive; } function setAllowlistMerkleRoot(bytes32 merkleRoot) external onlyOwner { allowlistMerkleRoot = merkleRoot; } /////////////////////////////////////////////////// ////////////////// MINT MECHANICS ///////////////// /////////////////////////////////////////////////// function reserveMint(uint8 amount) external onlyOwner { _mint(amount); } function allowlistMint(uint8 amount, bytes32[] calldata proof, string calldata mintMsg) external activeAllowlistSale humanitarian(mintMsg) notMinted allowlisted(proof,amount) { hasAllowlistMinted[msg.sender] = true; _mint(amount); } function _mint(uint8 amount) internal amountWithinMaxSupply(amount) withinMintPeriod { unchecked { if (amount == 0) return; uint256 i; do { tokenCounter = tokenCounter + 1; bloodStates[tokenCounter].rand = randomize(tokenCounter); _safeMint(msg.sender, tokenCounter); } while (++i < amount); } } /////////////////////////////////////////////////// ///////////////// INTERNAL FUNCTIONS ////////////// /////////////////////////////////////////////////// function _isAddressAllowlisted(bytes32[] memory proof, address _address, uint256 amount) internal view returns (bool) { return proof.verify(allowlistMerkleRoot, keccak256(abi.encodePacked(_address, amount))); } function _isValidMessage(string calldata mintMsg) internal view returns (bool) { for (uint256 i = 0; i < VALID_MESSAGES.length;) { if (keccak256(abi.encodePacked(mintMsg)) == keccak256(abi.encodePacked(VALID_MESSAGES[i]))) { return true; } unchecked { ++i; } } return false; } /////////////////////////////////////////////////// ///////////////// PROGRAMMABILITY ///////////////// /////////////////////////////////////////////////// function donate(uint256 _tokenId) external payable minDonationAboveLimit tokenExists(_tokenId) { BloodState storage bloodState = bloodStates[_tokenId]; uint128 addedPeace = uint128(msg.value/MIN_DONATION); uint128 totalPeace = bloodState.peace + addedPeace; bloodState.peace = totalPeace < 1000 ? totalPeace : 1000; collective = collective + addedPeace; } /////////////////////////////////////////////////// /////////////// RENDERING MECHANICS /////////////// /////////////////////////////////////////////////// function getCRentropy(uint256 tokenId) public view returns (uint256) { address owner = _ownerOf(tokenId); return crContract.balanceOf(owner) > 0 ? crContract.getEntropy(crContract.tokenOfOwnerByIndex(owner, 0)) : 499; } function tokenURI(uint256 tokenId) public view override tokenExists(tokenId) returns (string memory) { uint256 entropy = getCRentropy(tokenId); return stitcher.generateTokenURI( tokenId, bloodStates[tokenId].rand, entropy, bloodStates[tokenId].peace, collective ); } function withdraw() external { require(address(this).balance > 0, "No balance"); payable(donationAddy).transfer(address(this).balance); } function withdrawERC20(IERC20 token, address to) external onlyOwner { uint256 balance = token.balanceOf(address(this)); token.transfer(to, balance); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.20; import {ERC721} from "../ERC721.sol"; import {IERC721Enumerable} from "./IERC721Enumerable.sol"; import {IERC165} from "../../../utils/introspection/ERC165.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds enumerability * of all the token ids in the contract as well as all token ids owned by each account. * * CAUTION: `ERC721` extensions that implement custom `balanceOf` logic, such as `ERC721Consecutive`, * interfere with enumerability and should not be used together with `ERC721Enumerable`. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens; mapping(uint256 tokenId => uint256) private _ownedTokensIndex; uint256[] private _allTokens; mapping(uint256 tokenId => uint256) private _allTokensIndex; /** * @dev An `owner`'s token query was out of bounds for `index`. * * NOTE: The owner being `address(0)` indicates a global out of bounds index. */ error ERC721OutOfBoundsIndex(address owner, uint256 index); /** * @dev Batch mint is not allowed. */ error ERC721EnumerableForbiddenBatchMint(); /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) { if (index >= balanceOf(owner)) { revert ERC721OutOfBoundsIndex(owner, index); } return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual returns (uint256) { if (index >= totalSupply()) { revert ERC721OutOfBoundsIndex(address(0), index); } return _allTokens[index]; } /** * @dev See {ERC721-_update}. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { address previousOwner = super._update(to, tokenId, auth); if (previousOwner == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (previousOwner != to) { _removeTokenFromOwnerEnumeration(previousOwner, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (previousOwner != to) { _addTokenToOwnerEnumeration(to, tokenId); } return previousOwner; } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = balanceOf(to) - 1; _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = balanceOf(from); uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } /** * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch */ function _increaseBalance(address account, uint128 amount) internal virtual override { if (amount > 0) { revert ERC721EnumerableForbiddenBatchMint(); } super._increaseBalance(account, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.20; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the Merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates Merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** *@dev The multiproof provided is not valid. */ error MerkleProofInvalidMultiproof(); /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Sorts the pair (a, b) and hashes the result. */ function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } /** * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory. */ function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.22; import "@openzeppelin/contracts/utils/math/Math.sol"; contract Helper { function uint2str(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function randomize(uint256 seed) internal view returns (uint128) { return uint128(uint256(keccak256(abi.encodePacked(seed, block.timestamp, msg.sender)))); } function randConvert(uint128 rand) public pure returns (uint256[3] memory){ uint256[3] memory rands; for (uint256 i = 0; i < 3; ++i) { rands[i] = uint256(keccak256(abi.encodePacked(rand+i)))%1000; } return rands; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.22; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Base64.sol"; import "./CE01_Helper.sol"; import "./ICE00_Structs.sol"; interface ITraitGenerator { function generateTraits(uint128 rand, uint256 entropy, uint128 peace, uint128 collective) external view returns (Structs.TreeDetails memory, Structs.CorpseDetails memory, string[9] memory); } interface IArtFactory { function buildAssets(uint128 rand, uint256 entropy, uint128 peace, uint128 collective, string[9] memory palette) external view returns (bytes memory); } interface ICorpse { function drawCorpses(Structs.CorpseDetails memory corpse_deets, string[9] memory palette) external pure returns (string memory); } interface ITreeMaster { function drawTree(Structs.TreeDetails memory tree_deets, string[9] memory palette) external view returns (string memory mainArt, string memory image); } interface IMetadataGenerator { function buildFullMeta(string[9] memory palette, Structs.CorpseDetails memory corpse_deets, Structs.TreeDetails memory tree_deets) external pure returns (string memory); } contract Stitcher is Ownable, Helper, Structs { using Base64 for bytes; ITraitGenerator public traitGenerator; IArtFactory public artFactory; ICorpse public corpseGenerator; ITreeMaster public treeGenerator; IMetadataGenerator public metadataGenerator; constructor( address initialOwner, address _traitGenerator, address _artFactory, address _corpseGenerator, address _treeGenerator, address _metadataGenerator ) Ownable(initialOwner) { traitGenerator = ITraitGenerator(_traitGenerator); artFactory = IArtFactory(_artFactory); corpseGenerator = ICorpse(_corpseGenerator); treeGenerator = ITreeMaster(_treeGenerator); metadataGenerator = IMetadataGenerator(_metadataGenerator); } // Setter functions function setTraitGenerator(address _traitGenerator) external onlyOwner { traitGenerator = ITraitGenerator(_traitGenerator); } function setArtFactory(address _artFactory) external onlyOwner { artFactory = IArtFactory(_artFactory); } function setCorpseGenerator(address _corpseGenerator) external onlyOwner { corpseGenerator = ICorpse(_corpseGenerator); } function setTreeGenerator(address _treeGenerator) external onlyOwner { treeGenerator = ITreeMaster(_treeGenerator); } function setMetadataGenerator(address _metadataGenerator) external onlyOwner { metadataGenerator = IMetadataGenerator(_metadataGenerator); } // Optimized to get all data in one call function getAllTokenData(uint128 rand, uint256 entropy, uint128 peace, uint128 collective) internal view returns ( TreeDetails memory tree_deets, CorpseDetails memory corpse_deets, string[9] memory palette, bytes memory otherAssets, string memory corpseAsset, string memory treeMainArt, string memory treeImage ) { // Get traits once (tree_deets, corpse_deets, palette) = traitGenerator.generateTraits(rand, entropy, peace, collective); // Get all assets in parallel otherAssets = artFactory.buildAssets(rand, entropy, peace, collective, palette); corpseAsset = corpseGenerator.drawCorpses(corpse_deets, palette); (treeMainArt, treeImage) = treeGenerator.drawTree(tree_deets, palette); } // Main function to generate complete tokenURI with single trait generation function generateTokenURI(uint256 tokenId, uint128 rand, uint256 entropy, uint128 peace, uint128 collective) public view returns (string memory) { ( TreeDetails memory tree_deets, CorpseDetails memory corpse_deets, string[9] memory palette, bytes memory otherAssets, string memory corpseAsset, string memory treeMainArt, string memory treeImage ) = getAllTokenData(rand, entropy, peace, collective); // Build animation URL content string memory mainArt = string(abi.encodePacked( otherAssets, corpseAsset, treeMainArt, "</script></body></html>" )); return string(abi.encodePacked( "data:application/json;utf8,", '{"name":"Crimson Echo #', uint2str(tokenId), '","description":"Crimson Echo is a political, fully on-chain, dynamic and programmable short film, procedurally generated by Ethereum Virtual Machine. Donations to Palestinian relief funds (and a few other factors) will affect donor\'s and other\'s films","image": "data:image/svg+xml;base64,', Base64.encode(bytes(treeImage)), '","animation_url":"data:text/html;base64,', Base64.encode(bytes(mainArt)), '",', metadataGenerator.buildFullMeta(palette, corpse_deets, tree_deets) ) ); } // Keep individual getters for API convenience, but they now use the optimized path function getMetadata(uint128 rand, uint256 entropy, uint128 peace, uint128 collective) public view returns (string memory) { (TreeDetails memory tree_deets, CorpseDetails memory corpse_deets, string[9] memory palette,,,,) = getAllTokenData(rand, entropy, peace, collective); return metadataGenerator.buildFullMeta(palette, corpse_deets, tree_deets); } function getImage(uint128 rand, uint256 entropy, uint128 peace, uint128 collective) public view returns (string memory) { (,,,,,, string memory treeImage) = getAllTokenData(rand, entropy, peace, collective); return treeImage; } function getAnimationUrl(uint128 rand, uint256 entropy, uint128 peace, uint128 collective) public view returns (string memory) { (,,, bytes memory otherAssets, string memory corpseAsset, string memory treeMainArt,) = getAllTokenData(rand, entropy, peace, collective); string memory mainArt = string(abi.encodePacked( otherAssets, corpseAsset, treeMainArt, "</script></body></html>" )); return mainArt; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.22; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; error Frozen(); /** * @dev Extension of Ownable that has ability to freeze parts of the contract * decorated with `notFrozen` and allows turning parts of the contract * to be immutable. * Copy-pasted from Tokenfox's Panopticon by Teto contract. Big thanks to him! */ contract Freezable is Ownable { bool public frozen; constructor(address initialOwner) Ownable(initialOwner) {} /** * @dev Throws if called after the contract is frozen */ modifier notFrozen() { if (frozen) { revert Frozen(); } _; } /** * @dev Freezes contract */ function freeze() external onlyOwner notFrozen { frozen = true; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "./IERC721.sol"; import {IERC721Receiver} from "./IERC721Receiver.sol"; import {IERC721Metadata} from "./extensions/IERC721Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {Strings} from "../../utils/Strings.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint256 tokenId => address) private _owners; mapping(address owner => uint256) private _balances; mapping(uint256 tokenId => address) private _tokenApprovals; mapping(address owner => mapping(address operator => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual returns (uint256) { if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { return _tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { unchecked { _balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { _balances[from] -= 1; } } if (to != address(0)) { unchecked { _balances[to] += 1; } } _owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } _tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC721InvalidOperator(operator); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.20; import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.2) (utils/Base64.sol) pragma solidity ^0.8.20; /** * @dev Provides a set of functions to operate with Base64 strings. */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 0x20) let dataPtr := data let endPtr := add(data, mload(data)) // In some cases, the last iteration will read bytes after the end of the data. We cache the value, and // set it to zero to make sure no dirty bytes are read in that section. let afterPtr := add(endPtr, 0x20) let afterCache := mload(afterPtr) mstore(afterPtr, 0x00) // Run over the input, 3 bytes at a time for { } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 byte (24 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F to bitmask the least significant 6 bits. // Use this as an index into the lookup table, mload an entire word // so the desired character is in the least significant byte, and // mstore8 this least significant byte into the result and continue. mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // Reset the value that was cached mstore(afterPtr, afterCache) // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.22; interface Structs { struct CorpseDetails{ uint256 seed; uint256 max_opacity; uint256 max_size; uint256 max_complexity; uint256 num_shapes; uint256 crowd; string stroke; uint8 glow; } struct Trunk1Details { uint256 num_lines; uint256 stroke; uint256 height; uint256 curve; } struct Trunk2Details { uint256 num_branches; uint256 num_lines; uint256 stroke; uint256 convergance; uint256 curvature; uint256 root_distance; string iteration; uint256 max_x; uint256 max_y; } struct LeafDetails { uint256 num_leaves; uint256 maxx; uint256 maxy; uint256 fluff; } struct TreeDetails { uint256 seed; uint256 entropy; uint256 collective; Trunk1Details trunk1deets; Trunk2Details trunk2deets; LeafDetails leaf_deets; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be * reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
{ "remappings": [ "@openzeppelin/=lib/openzeppelin-contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_stitcher","type":"address"},{"internalType":"address","name":"initialOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ERC721EnumerableForbiddenBatchMint","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"ERC721OutOfBoundsIndex","type":"error"},{"inputs":[],"name":"Frozen","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"END_MINT_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TOTAL_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_DONATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"amount","type":"uint8"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"string","name":"mintMsg","type":"string"}],"name":"allowlistMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowlistSaleIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bloodStates","outputs":[{"internalType":"uint128","name":"peace","type":"uint128"},{"internalType":"uint128","name":"rand","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collective","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crContract","outputs":[{"internalType":"contract IChaosRoads","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"donate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"donationAddy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freeze","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"frozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getCRentropy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasAllowlistMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"rand","type":"uint128"}],"name":"randConvert","outputs":[{"internalType":"uint256[3]","name":"","type":"uint256[3]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"amount","type":"uint8"}],"name":"reserveMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"setAllowlistMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_allowlistSaleIsActive","type":"bool"}],"name":"setAllowlistSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_donationAddy","type":"address"}],"name":"setDonationAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stitcher","outputs":[{"internalType":"contract Stitcher","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract Stitcher","name":"_stitcher","type":"address"}],"name":"upgradeRenderer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080346200057f576001600160401b03601f6200294938819003918201601f191684019183831185841017620003825780859260409485528339810103126200057f576200005b60206200005384620005a4565b9301620005a4565b916200006662000584565b92600c84526b4372696d736f6e204563686f60a01b60208501526200008a62000584565b9360048552634352454360e01b60208601528051908482116200038257620000b4600054620005b9565b601f81116200053e575b50602090601f8311600114620004c557620000f3929160009183620002bf575b50508160011b916000199060031b1c19161790565b6000555b835183811162000382576200010e600154620005b9565b601f811162000466575b50602094601f8211600114620003f9576200014f929394958291600092620002bf5750508160011b916000199060031b1c19161790565b6001555b6001600160a01b039081168015620003e057600a80546001600160a01b03198116831790915582167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a360405160608101818110858211176200038257604052620001c062000584565b601a81527f4e6f7468696e67206a75737469666965732067656e6f6369646500000000000060208201528152620001f662000584565b600e81526d467265652050616c657374696e6560901b602082015260208201526200022062000584565b600d81526c436561736566697265204e4f5760981b60208201526040820152600091600b915b6003841015620003985780518051908782116200038257620002698554620005b9565b601f811162000340575b50602090601f8311600114620002cb5792620002af83600195946020948796600092620002bf5750508160011b916000199060031b1c19161790565b86555b0193019301929162000246565b015190503880620000de565b908560005260206000209160005b601f198516811062000327575083602093600196938796938794601f198116106200030d575b505050811b018655620002b2565b015160001960f88460031b161c19169055388080620002ff565b91926020600181928685015181550194019201620002d9565b62000370908660005260206000206005601f8601811c8201926020871062000377575b601f01901c0190620005f6565b3862000273565b919250829162000363565b634e487b7160e01b600052604160045260246000fd5b50837346dd470cd5e4dfce2b774dcf99742601266b47f660018060a01b0319600e541617600e551660018060a01b0319600f541617600f556040516123199081620006108239f35b604051631e4fbdf760e01b815260006004820152602490fd5b601f19821695600160005260206000209160005b8881106200044d5750836001959697981062000433575b505050811b0160015562000153565b015160001960f88460031b161c1916905538808062000424565b919260206001819286850151815501940192016200040d565b6001600052620004b3907fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6601f840160051c81019160208510620004ba575b601f0160051c0190620005f6565b3862000118565b9091508190620004a5565b600080805260008051602062002929833981519152929190601f198516905b8181106200052557509084600195949392106200050b575b505050811b01600055620000f7565b015160001960f88460031b161c19169055388080620004fc565b92936020600181928786015181550195019301620004e4565b60008052620005789060008051602062002929833981519152601f850160051c81019160208610620004ba57601f0160051c0190620005f6565b38620000be565b600080fd5b60408051919082016001600160401b038111838210176200038257604052565b51906001600160a01b03821682036200057f57565b90600182811c92168015620005eb575b6020831014620005d557565b634e487b7160e01b600052602260045260246000fd5b91607f1691620005c9565b81811062000602575050565b60008155600101620005f656fe60806040908082526004908136101561001757600080fd5b600092833560e01c91826301ffc9a7146114af575081630479734f14611487578163054f7d9c1461146057816306fdde03146113b0578163081812fc14611373578163095ea7b3146112975781630a4e8b301461127857816318160ddd1461125957816323b872dd14611241578163293108e0146112225781632a03c098146111f95781632f745c591461117457816333039d3d146111575781633ccfd60b146110d857816342842e0e146110a95781634f6ccce71461105357816362a5af3b146110145781636352211e14610fe25781636f48e79b14610f9057816370a0823114610f6a578163715018a614610f0d578163717edf2814610ede5781637aad09a814610ea05781638da5cb5b14610e77578382639456fbcc14610d495750816395d89b4114610c5f578163a22cb46514610bc2578163a7e33e1a14610b5f578163b71faaf714610b28578163b88d4fde14610a97578163c141f0e5146109e1578163c87b56dd146108a0578163d082e38114610881578163d14cd15d146105a7578163d63d122e146104bd578163db45810e1461049b578163e0347e5714610461578163e985e9c514610413578163e9cdc021146103ef578163ea517f91146103c4578163f14faf6f146102e9578163f2fde38b14610259578163f4e2e08814610230575063f95df4141461020c57600080fd5b3461022c57602036600319011261022c57610225611c3f565b3560105580f35b5080fd5b83903461022c578160031936011261022c57600f5490516001600160a01b039091168152602090f35b919050346102e55760203660031901126102e55761027561157d565b9061027e611c3f565b6001600160a01b039182169283156102cf575050600a54826001600160601b0360a01b821617600a55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b51631e4fbdf760e01b8152908101849052602490fd5b8280fd5b905060203660031901126102e55781356611c37937e0800092833410610394575080845260026020528184205461032a906001600160a01b03161515611a13565b835260146020528220906001600160801b0380809234041692805461035185848316611be9565b6103e8808583161060001461038d57505b6001600160801b031994859116911617905561038360115493828516611be9565b1691161760115580f35b9050610362565b606490602084519162461bcd60e51b8352820152600a6024820152694d696e20302e3030354560b01b6044820152fd5b905082346103ec5760203660031901126103ec57506103e560209235611a72565b9051908152f35b80fd5b83903461022c578160031936011261022c5760209060ff6013541690519015158152f35b83903461022c578060031936011261022c5760ff8160209361043361157d565b61043b611598565b6001600160a01b0391821683526005875283832091168252855220549151911615158152f35b919050346102e55760203660031901126102e557918192358152601460205220548151906001600160801b038116825260801c6020820152f35b83903461022c578160031936011261022c57602090516611c37937e080008152f35b9050346102e55760209060206003193601126105a3578235926001600160801b03841680940361059f57606082959495516104f781611615565b36903781519461050686611615565b6060368737845b60038110610541575050505192839092905b6003821061052c57606085f35b8280600192865181520194019101909261051f565b61054e8183989798611a4f565b845186810191825286815285810181811067ffffffffffffffff82111761058c5786525190206103e89006600582901b87015294959460010161050d565b634e487b7160e01b8a526041865260248afd5b8480fd5b8380fd5b9050346102e55760603660031901126102e5576105c261166f565b9160249283359067ffffffffffffffff9081831161087d573660238401121561087d578284013593828511610879578460051b92878486010190368211610875576044358181116108715736602382011215610871578084013591821161087157368a83830101116108715760ff601354161561083f57908961064592016121eb565b1561080f573389526020946015865260ff888b2054166107dc5760ff841696610672878a51970187611631565b85528801858086015b8383106107cc5750505050601054968651858101903360601b8252876034820152603481526106a981611615565b5190209589965b85518810156106ee57868860051b87010151908181106000146106df578b5286526001888b205b9701966106b0565b908b5286526001888b206106d7565b8a955086918a8a92036107985761071f6107d09133895260158552838920600160ff19825416179055601254611a4f565b1161076857636b36de6f421161073c578561073986611daf565b80f35b5162461bcd60e51b815292830152600a9082015269135a5b9d08195b99195960b21b6044820152606490fd5b5162461bcd60e51b815292830152600e908201526d4578636565647320737570706c7960901b6044820152606490fd5b815162461bcd60e51b8152808601849052600f818601526e139bdd08185b1b1bdddb1a5cdd1959608a1b6044820152606490fd5b823581529181019187910161067b565b875162461bcd60e51b8152808401879052600e818b01526d105b1c9958591e481b5a5b9d195960921b6044820152606490fd5b865162461bcd60e51b8152602081840152600b818a01526a496e76616c6964206d736760a81b6044820152606490fd5b885162461bcd60e51b8152602081860152600d818c01526c53616c6520696e61637469766560981b6044820152606490fd5b8a80fd5b8980fd5b8780fd5b8680fd5b83903461022c578160031936011261022c576020906012549051908152f35b9050346102e557602091826003193601126105a3578381358082526002855260a460018060a01b03936108d98587862054161515611a13565b6108e283611a72565b94600f541683855260148852868520546001600160801b0380601154169189519889978896636fa63adf60e01b88528701528160801c6024870152604486015216606484015260848301525afa9384156109d6578094610956575b50506109529051928284938452830190611558565b0390f35b909193503d8082843e6109698184611631565b820191838184031261022c5780519067ffffffffffffffff82116102e5570182601f8201121561022c5780519161099f83611653565b936109ac87519586611631565b8385528584840101116103ec575082916109ce91858061095296019101611535565b92903861093d565b8251903d90823e3d90fd5b919050346102e55760203660031901126102e5576109fd61166f565b91610a06611c3f565b6107d0610a1960125460ff861690611a4f565b11610a6357636b36de6f4211610a33578361073984611daf565b906020606492519162461bcd60e51b8352820152600a602482015269135a5b9d08195b99195960b21b6044820152fd5b906020606492519162461bcd60e51b8352820152600e60248201526d4578636565647320737570706c7960901b6044820152fd5b9050346102e55760803660031901126102e557610ab261157d565b610aba611598565b60443591856064359567ffffffffffffffff871161022c573660238801121561022c5786013595610af6610aed88611653565b96519687611631565b868652366024888301011161022c5786610739976024602093018389013786010152610b238383836116b9565b611c6b565b50503461022c57602036600319011261022c573580151580910361022c57610b4e611c3f565b60ff80196013541691161760135580f35b919050346102e55760203660031901126102e55780356001600160a01b03811692908390036105a357610b90611c3f565b60ff600a5460a01c16610bb55750506001600160601b0360a01b600f541617600f5580f35b5163a8cab3d160e01b8152fd5b9050346102e557806003193601126102e557610bdc61157d565b906024359182151580930361059f576001600160a01b0316928315610c4a5750338452600560205280842083855260205280842060ff1981541660ff8416179055519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b836024925191630b61174360e31b8352820152fd5b83346103ec57806003193601126103ec57815191828260019360015494610c858661167f565b9182855260209687600182169182600014610d22575050600114610cc6575b5050506109529291610cb7910385611631565b51928284938452830190611558565b9190869350600183527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b828410610d0a5750505082010181610cb7610952610ca4565b8054848a018601528895508794909301928101610cf1565b60ff19168782015293151560051b86019093019350849250610cb791506109529050610ca4565b92915034610e735780600319360112610e735781356001600160a01b03811690819003610e6e57610d78611598565b90610d81611c3f565b8251916370a0823160e01b835230858401526020948584602481865afa938415610e64578794610e2f575b50845163a9059cbb60e01b81526001600160a01b039092169082019081526020810193909352948492869291839182906040015b03925af1908115610e265750610df4578280f35b81813d8311610e1f575b610e088183611631565b8101031261022c5751801515036103ec5738808280f35b503d610dfe565b513d85823e3d90fd5b935091908584813d8311610e5d575b610e488183611631565b8101031261087d579251929091610de0610dac565b503d610e3e565b85513d89823e3d90fd5b505050fd5b5050fd5b83903461022c578160031936011261022c57600a5490516001600160a01b039091168152602090f35b83903461022c57602036600319011261022c5760209160ff9082906001600160a01b03610ecb61157d565b1681526015855220541690519015158152f35b83903461022c578160031936011261022c57602090517318adc812fe66b9381700c2217f0c9dc816c879e68152f35b83346103ec57806003193601126103ec57610f26611c3f565b600a80546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b83903461022c57602036600319011261022c576020906103e5610f8b61157d565b6119da565b919050346102e55760203660031901126102e557610fac61157d565b91610fb5611c3f565b60ff600a5460a01c16610bb557505060018060a01b03166001600160601b0360a01b600e541617600e5580f35b905082346103ec5760203660031901126103ec575061100360209235611c04565b90516001600160a01b039091168152f35b919050346102e557826003193601126102e55761102f611c3f565b600a549160ff8360a01c16610bb557505060ff60a01b1916600160a01b17600a5580f35b919050346102e55760203660031901126102e55780359260085484101561108e576020836110808661198d565b91905490519160031b1c8152f35b6044939192519263295f44f760e21b84528301526024820152fd5b83903461022c57610739906110bd366115ae565b919251926110ca846115e3565b858452610b238383836116b9565b919050346102e557826003193601126102e557471561112857508180808060018060a01b03600e5416479082821561111f575bf115611115575080f35b51903d90823e3d90fd5b506108fc61110b565b6020606492519162461bcd60e51b8352820152600a6024820152694e6f2062616c616e636560b01b6044820152fd5b83903461022c578160031936011261022c57602090516107d08152f35b905082346103ec57816003193601126103ec5761118f61157d565b926024359061119d856119da565b8210156111cd57506001600160a01b03909316815260066020908152828220938252928352819020549051908152f35b925163295f44f760e21b81526001600160a01b0390941692840192835260208301525081906040010390fd5b83903461022c578160031936011261022c57600e5490516001600160a01b039091168152602090f35b83903461022c578160031936011261022c576020906010549051908152f35b83346103ec57610739611253366115ae565b916116b9565b83903461022c578160031936011261022c576020906008549051908152f35b83903461022c578160031936011261022c5760209051636b36de6f8152f35b9050346102e557806003193601126102e5576112b161157d565b916024356112be81611c04565b33151580611360575b80611337575b611321576001600160a01b039485169482918691167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258880a48452602052822080546001600160a01b031916909117905580f35b835163a9fbf51f60e01b81523381850152602490fd5b506001600160a01b03811686526005602090815284872033885290528386205460ff16156112cd565b506001600160a01b0381163314156112c7565b919050346102e55760203660031901126102e55791826020933561139681611c04565b50825283528190205490516001600160a01b039091168152f35b83346103ec57806003193601126103ec57815191828283546113d18161167f565b9081845260209560019187600182169182600014610d22575050600114611405575050506109529291610cb7910385611631565b91908693508280527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106114485750505082010181610cb7610952610ca4565b8054848a01860152889550879490930192810161142f565b83903461022c578160031936011261022c5760209060ff600a5460a01c1690519015158152f35b83903461022c578160031936011261022c576020906001600160801b03601154169051908152f35b849084346102e55760203660031901126102e5573563ffffffff60e01b81168091036102e5576020925063780e9d6360e01b81149081156114f2575b5015158152f35b6380ac58cd60e01b811491508115611524575b8115611513575b50836114eb565b6301ffc9a760e01b1490508361150c565b635b5e139f60e01b81149150611505565b60005b8381106115485750506000910152565b8181015183820152602001611538565b9060209161157181518092818552858086019101611535565b601f01601f1916010190565b600435906001600160a01b038216820361159357565b600080fd5b602435906001600160a01b038216820361159357565b6060906003190112611593576001600160a01b0390600435828116810361159357916024359081168103611593579060443590565b6020810190811067ffffffffffffffff8211176115ff57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176115ff57604052565b90601f8019910116810190811067ffffffffffffffff8211176115ff57604052565b67ffffffffffffffff81116115ff57601f01601f191660200190565b6004359060ff8216820361159357565b90600182811c921680156116af575b602083101461169957565b634e487b7160e01b600052602260045260246000fd5b91607f169161168e565b6001600160a01b0382811693918415611974576000948386526020956002875260409684888320541696331515806118e6575b50871580156118b3575b84845260038352898420805460010190558784526002835289842080546001600160a01b0319168617905587858a7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8780a4156118375760085487845260098352808a852055600160401b811015611823578761177c826001611795940160085561198d565b90919082549060031b91821b91600019901b1916179055565b8388036117d1575b5050505016928383036117b05750505050565b6064945051926364283d7b60e01b8452600484015260248301526044820152fd5b6117da906119da565b60001981019390841161180f5782916007918a945260068152838320858452815287848420558783525220553880808061179d565b634e487b7160e01b83526011600452602483fd5b634e487b7160e01b84526041600452602484fd5b87841461179557611847886119da565b878452600783528984205481810361187c575b50878452838a8120558884526006835289842090845282528289812055611795565b898552600684528a852082865284528a8520548a8652600685528b86208287528552808c8720558552600784528a8520553861185a565b600088815260046020526040902080546001600160a01b03191690558884526003835289842080546000190190556116f6565b80611933575b156118f757386116ec565b888789611914576024915190637e27328960e01b82526004820152fd5b905163177e802f60e01b81523360048201526024810191909152604490fd5b503388148015611958575b806118ec57508683526004825233868a85205416146118ec565b5087835260058252888320338452825260ff898420541661193e565b604051633250574960e11b815260006004820152602490fd5b6008548110156119c45760086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30190600090565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b031680156119fa57600052600360205260406000205490565b6040516322718ad960e21b815260006004820152602490fd5b15611a1a57565b60405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b6044820152606490fd5b91908201809211611a5c57565b634e487b7160e01b600052601160045260246000fd5b600090815260206002815260409160018060a01b038382205416918351926370a0823160e01b84528060048501527318adc812fe66b9381700c2217f0c9dc816c879e6938281602481885afa908115611bdf578491611bb2575b5015611ba757845190632f745c5960e01b825260048201528260248201528181604481875afa908115611b9d579082918491611b6e575b5060248651809681936374e6a46960e01b835260048301525afa938415611b6357508193611b32575b50505090565b9091809350813d8311611b5c575b611b4a8183611631565b810103126103ec575051388080611b2c565b503d611b40565b51913d9150823e3d90fd5b82819392503d8311611b96575b611b858183611631565b810103126102e55781905138611b03565b503d611b7b565b85513d85823e3d90fd5b50505050506101f390565b90508281813d8311611bd8575b611bc98183611631565b810103126105a3575138611acc565b503d611bbf565b86513d86823e3d90fd5b9190916001600160801b0380809416911601918211611a5c57565b6000818152600260205260409020546001600160a01b0316908115611c27575090565b60249060405190637e27328960e01b82526004820152fd5b600a546001600160a01b03163303611c5357565b60405163118cdaa760e01b8152336004820152602490fd5b813b611c78575b50505050565b604051630a85bd0160e11b8082523360048301526001600160a01b03928316602483015260448201949094526080606482015260209592909116939092908390611cc6906084830190611558565b039285816000958187895af1849181611d6f575b50611d3a575050503d600014611d32573d611cf481611653565b90611d026040519283611631565b81528091843d92013e5b80519283611d2d57604051633250574960e11b815260048101849052602490fd5b019050fd5b506060611d0c565b919450915063ffffffff60e01b1603611d57575038808080611c72565b60249060405190633250574960e11b82526004820152fd5b9091508681813d8311611da8575b611d878183611631565b8101031261059f57516001600160e01b03198116810361059f579038611cda565b503d611d7d565b60ff8116156121e8576000916001903315928315925b156121d2575b600094601260018154019081815560405191602083018181524260408501523360601b60608501526054845283608081011067ffffffffffffffff6080860111176121be576080840160405283519020908952601460205260408920906001600160801b0382549181199060801b1691161790555495611e4d608083016115e3565b8760808301526121a5578587526002602081905260408820546001600160a01b031696908715801591888361216e575b612156575b838b5260205260408a20336001600160601b0360a01b82541617905582338a7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8d80a4156120c8576008805490838b5260096020528160408c2055600160401b8210156120b45761177c8285926001611efd9501905561198d565b88973303612061575b61204857333b611f19575b505094611dc5565b611f57916020916040519384928392630a85bd0160e11b84523360048501528c60248501526044840152608060648401526080608484019101611558565b03818a335af1879181612003575b50611fc157863d15611fb9573d611f7b81611653565b90611f896040519283611631565b8152809160203d92013e5b80519081611fb457604051633250574960e11b8152336004820152602490fd5b602001fd5b506060611f94565b630a85bd0160e1979293949596971b9063ffffffff60e01b1603611feb5794939291903880611f11565b604051633250574960e11b8152336004820152602490fd5b9091506020813d602011612040575b8161201f60209383611631565b8101031261087957516001600160e01b031981168103610879579038611f65565b3d9150612012565b6040516339e3563760e11b815260048101899052602490fd5b61206a336119da565b60001981019081116120a057338a52600660205260408a20818b526020528260408b2055828a52600760205260408a2055611f06565b634e487b7160e01b8a52601160045260248afd5b634e487b7160e01b8b52604160045260248bfd5b338814611efd576120d8886119da565b828a5260078060205260408b205490828203612117575b5050828a52896040812055888a52600660205260408a20908a52602052886040812055611efd565b8a8c528b8b60406006928360205281812087825260205281812054938493825260205281812086825260205220558c5260205260408b205538806120ef565b338b52600360205260408b2060018154019055611e82565b50600084815260046020526040902080546001600160a01b0319169055898b52600360205260408b20805460001901905588611e7d565b604051633250574960e11b815260048101889052602490fd5b634e487b7160e01b8a52604160045260248afd5b936001019360ff81168510611dcb575092505050565b50565b60005b600381106121fe57505050600090565b604090815160209081810190868683376122278382898101600083820152038084520182611631565b5190209082600b019351818101918160008754976122448961167f565b906001998a811690816000146122c65750600114612287575b5050612272925003601f198101835282611631565b5190201461228057016121ee565b5091505090565b90915060005282600020886000915b8383106122af575050509161227292820101388061225d565b8054878401870152869450918501918a9101612296565b91505061227294925060ff1916865280151502820101388061225d56fea26469706673582212208cd46e2e8c69133c77808eede75eae391df2b1240669fb62b3b9ca5567e709f164736f6c63430008160033290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563000000000000000000000000492a6e2b85e5c13daa3ea893829a7db3c68e72a00000000000000000000000000ba040e2c8e395862e31f32b72722cf17ff9ea33
Deployed Bytecode
0x60806040908082526004908136101561001757600080fd5b600092833560e01c91826301ffc9a7146114af575081630479734f14611487578163054f7d9c1461146057816306fdde03146113b0578163081812fc14611373578163095ea7b3146112975781630a4e8b301461127857816318160ddd1461125957816323b872dd14611241578163293108e0146112225781632a03c098146111f95781632f745c591461117457816333039d3d146111575781633ccfd60b146110d857816342842e0e146110a95781634f6ccce71461105357816362a5af3b146110145781636352211e14610fe25781636f48e79b14610f9057816370a0823114610f6a578163715018a614610f0d578163717edf2814610ede5781637aad09a814610ea05781638da5cb5b14610e77578382639456fbcc14610d495750816395d89b4114610c5f578163a22cb46514610bc2578163a7e33e1a14610b5f578163b71faaf714610b28578163b88d4fde14610a97578163c141f0e5146109e1578163c87b56dd146108a0578163d082e38114610881578163d14cd15d146105a7578163d63d122e146104bd578163db45810e1461049b578163e0347e5714610461578163e985e9c514610413578163e9cdc021146103ef578163ea517f91146103c4578163f14faf6f146102e9578163f2fde38b14610259578163f4e2e08814610230575063f95df4141461020c57600080fd5b3461022c57602036600319011261022c57610225611c3f565b3560105580f35b5080fd5b83903461022c578160031936011261022c57600f5490516001600160a01b039091168152602090f35b919050346102e55760203660031901126102e55761027561157d565b9061027e611c3f565b6001600160a01b039182169283156102cf575050600a54826001600160601b0360a01b821617600a55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b51631e4fbdf760e01b8152908101849052602490fd5b8280fd5b905060203660031901126102e55781356611c37937e0800092833410610394575080845260026020528184205461032a906001600160a01b03161515611a13565b835260146020528220906001600160801b0380809234041692805461035185848316611be9565b6103e8808583161060001461038d57505b6001600160801b031994859116911617905561038360115493828516611be9565b1691161760115580f35b9050610362565b606490602084519162461bcd60e51b8352820152600a6024820152694d696e20302e3030354560b01b6044820152fd5b905082346103ec5760203660031901126103ec57506103e560209235611a72565b9051908152f35b80fd5b83903461022c578160031936011261022c5760209060ff6013541690519015158152f35b83903461022c578060031936011261022c5760ff8160209361043361157d565b61043b611598565b6001600160a01b0391821683526005875283832091168252855220549151911615158152f35b919050346102e55760203660031901126102e557918192358152601460205220548151906001600160801b038116825260801c6020820152f35b83903461022c578160031936011261022c57602090516611c37937e080008152f35b9050346102e55760209060206003193601126105a3578235926001600160801b03841680940361059f57606082959495516104f781611615565b36903781519461050686611615565b6060368737845b60038110610541575050505192839092905b6003821061052c57606085f35b8280600192865181520194019101909261051f565b61054e8183989798611a4f565b845186810191825286815285810181811067ffffffffffffffff82111761058c5786525190206103e89006600582901b87015294959460010161050d565b634e487b7160e01b8a526041865260248afd5b8480fd5b8380fd5b9050346102e55760603660031901126102e5576105c261166f565b9160249283359067ffffffffffffffff9081831161087d573660238401121561087d578284013593828511610879578460051b92878486010190368211610875576044358181116108715736602382011215610871578084013591821161087157368a83830101116108715760ff601354161561083f57908961064592016121eb565b1561080f573389526020946015865260ff888b2054166107dc5760ff841696610672878a51970187611631565b85528801858086015b8383106107cc5750505050601054968651858101903360601b8252876034820152603481526106a981611615565b5190209589965b85518810156106ee57868860051b87010151908181106000146106df578b5286526001888b205b9701966106b0565b908b5286526001888b206106d7565b8a955086918a8a92036107985761071f6107d09133895260158552838920600160ff19825416179055601254611a4f565b1161076857636b36de6f421161073c578561073986611daf565b80f35b5162461bcd60e51b815292830152600a9082015269135a5b9d08195b99195960b21b6044820152606490fd5b5162461bcd60e51b815292830152600e908201526d4578636565647320737570706c7960901b6044820152606490fd5b815162461bcd60e51b8152808601849052600f818601526e139bdd08185b1b1bdddb1a5cdd1959608a1b6044820152606490fd5b823581529181019187910161067b565b875162461bcd60e51b8152808401879052600e818b01526d105b1c9958591e481b5a5b9d195960921b6044820152606490fd5b865162461bcd60e51b8152602081840152600b818a01526a496e76616c6964206d736760a81b6044820152606490fd5b885162461bcd60e51b8152602081860152600d818c01526c53616c6520696e61637469766560981b6044820152606490fd5b8a80fd5b8980fd5b8780fd5b8680fd5b83903461022c578160031936011261022c576020906012549051908152f35b9050346102e557602091826003193601126105a3578381358082526002855260a460018060a01b03936108d98587862054161515611a13565b6108e283611a72565b94600f541683855260148852868520546001600160801b0380601154169189519889978896636fa63adf60e01b88528701528160801c6024870152604486015216606484015260848301525afa9384156109d6578094610956575b50506109529051928284938452830190611558565b0390f35b909193503d8082843e6109698184611631565b820191838184031261022c5780519067ffffffffffffffff82116102e5570182601f8201121561022c5780519161099f83611653565b936109ac87519586611631565b8385528584840101116103ec575082916109ce91858061095296019101611535565b92903861093d565b8251903d90823e3d90fd5b919050346102e55760203660031901126102e5576109fd61166f565b91610a06611c3f565b6107d0610a1960125460ff861690611a4f565b11610a6357636b36de6f4211610a33578361073984611daf565b906020606492519162461bcd60e51b8352820152600a602482015269135a5b9d08195b99195960b21b6044820152fd5b906020606492519162461bcd60e51b8352820152600e60248201526d4578636565647320737570706c7960901b6044820152fd5b9050346102e55760803660031901126102e557610ab261157d565b610aba611598565b60443591856064359567ffffffffffffffff871161022c573660238801121561022c5786013595610af6610aed88611653565b96519687611631565b868652366024888301011161022c5786610739976024602093018389013786010152610b238383836116b9565b611c6b565b50503461022c57602036600319011261022c573580151580910361022c57610b4e611c3f565b60ff80196013541691161760135580f35b919050346102e55760203660031901126102e55780356001600160a01b03811692908390036105a357610b90611c3f565b60ff600a5460a01c16610bb55750506001600160601b0360a01b600f541617600f5580f35b5163a8cab3d160e01b8152fd5b9050346102e557806003193601126102e557610bdc61157d565b906024359182151580930361059f576001600160a01b0316928315610c4a5750338452600560205280842083855260205280842060ff1981541660ff8416179055519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b836024925191630b61174360e31b8352820152fd5b83346103ec57806003193601126103ec57815191828260019360015494610c858661167f565b9182855260209687600182169182600014610d22575050600114610cc6575b5050506109529291610cb7910385611631565b51928284938452830190611558565b9190869350600183527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b828410610d0a5750505082010181610cb7610952610ca4565b8054848a018601528895508794909301928101610cf1565b60ff19168782015293151560051b86019093019350849250610cb791506109529050610ca4565b92915034610e735780600319360112610e735781356001600160a01b03811690819003610e6e57610d78611598565b90610d81611c3f565b8251916370a0823160e01b835230858401526020948584602481865afa938415610e64578794610e2f575b50845163a9059cbb60e01b81526001600160a01b039092169082019081526020810193909352948492869291839182906040015b03925af1908115610e265750610df4578280f35b81813d8311610e1f575b610e088183611631565b8101031261022c5751801515036103ec5738808280f35b503d610dfe565b513d85823e3d90fd5b935091908584813d8311610e5d575b610e488183611631565b8101031261087d579251929091610de0610dac565b503d610e3e565b85513d89823e3d90fd5b505050fd5b5050fd5b83903461022c578160031936011261022c57600a5490516001600160a01b039091168152602090f35b83903461022c57602036600319011261022c5760209160ff9082906001600160a01b03610ecb61157d565b1681526015855220541690519015158152f35b83903461022c578160031936011261022c57602090517318adc812fe66b9381700c2217f0c9dc816c879e68152f35b83346103ec57806003193601126103ec57610f26611c3f565b600a80546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b83903461022c57602036600319011261022c576020906103e5610f8b61157d565b6119da565b919050346102e55760203660031901126102e557610fac61157d565b91610fb5611c3f565b60ff600a5460a01c16610bb557505060018060a01b03166001600160601b0360a01b600e541617600e5580f35b905082346103ec5760203660031901126103ec575061100360209235611c04565b90516001600160a01b039091168152f35b919050346102e557826003193601126102e55761102f611c3f565b600a549160ff8360a01c16610bb557505060ff60a01b1916600160a01b17600a5580f35b919050346102e55760203660031901126102e55780359260085484101561108e576020836110808661198d565b91905490519160031b1c8152f35b6044939192519263295f44f760e21b84528301526024820152fd5b83903461022c57610739906110bd366115ae565b919251926110ca846115e3565b858452610b238383836116b9565b919050346102e557826003193601126102e557471561112857508180808060018060a01b03600e5416479082821561111f575bf115611115575080f35b51903d90823e3d90fd5b506108fc61110b565b6020606492519162461bcd60e51b8352820152600a6024820152694e6f2062616c616e636560b01b6044820152fd5b83903461022c578160031936011261022c57602090516107d08152f35b905082346103ec57816003193601126103ec5761118f61157d565b926024359061119d856119da565b8210156111cd57506001600160a01b03909316815260066020908152828220938252928352819020549051908152f35b925163295f44f760e21b81526001600160a01b0390941692840192835260208301525081906040010390fd5b83903461022c578160031936011261022c57600e5490516001600160a01b039091168152602090f35b83903461022c578160031936011261022c576020906010549051908152f35b83346103ec57610739611253366115ae565b916116b9565b83903461022c578160031936011261022c576020906008549051908152f35b83903461022c578160031936011261022c5760209051636b36de6f8152f35b9050346102e557806003193601126102e5576112b161157d565b916024356112be81611c04565b33151580611360575b80611337575b611321576001600160a01b039485169482918691167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258880a48452602052822080546001600160a01b031916909117905580f35b835163a9fbf51f60e01b81523381850152602490fd5b506001600160a01b03811686526005602090815284872033885290528386205460ff16156112cd565b506001600160a01b0381163314156112c7565b919050346102e55760203660031901126102e55791826020933561139681611c04565b50825283528190205490516001600160a01b039091168152f35b83346103ec57806003193601126103ec57815191828283546113d18161167f565b9081845260209560019187600182169182600014610d22575050600114611405575050506109529291610cb7910385611631565b91908693508280527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106114485750505082010181610cb7610952610ca4565b8054848a01860152889550879490930192810161142f565b83903461022c578160031936011261022c5760209060ff600a5460a01c1690519015158152f35b83903461022c578160031936011261022c576020906001600160801b03601154169051908152f35b849084346102e55760203660031901126102e5573563ffffffff60e01b81168091036102e5576020925063780e9d6360e01b81149081156114f2575b5015158152f35b6380ac58cd60e01b811491508115611524575b8115611513575b50836114eb565b6301ffc9a760e01b1490508361150c565b635b5e139f60e01b81149150611505565b60005b8381106115485750506000910152565b8181015183820152602001611538565b9060209161157181518092818552858086019101611535565b601f01601f1916010190565b600435906001600160a01b038216820361159357565b600080fd5b602435906001600160a01b038216820361159357565b6060906003190112611593576001600160a01b0390600435828116810361159357916024359081168103611593579060443590565b6020810190811067ffffffffffffffff8211176115ff57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176115ff57604052565b90601f8019910116810190811067ffffffffffffffff8211176115ff57604052565b67ffffffffffffffff81116115ff57601f01601f191660200190565b6004359060ff8216820361159357565b90600182811c921680156116af575b602083101461169957565b634e487b7160e01b600052602260045260246000fd5b91607f169161168e565b6001600160a01b0382811693918415611974576000948386526020956002875260409684888320541696331515806118e6575b50871580156118b3575b84845260038352898420805460010190558784526002835289842080546001600160a01b0319168617905587858a7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8780a4156118375760085487845260098352808a852055600160401b811015611823578761177c826001611795940160085561198d565b90919082549060031b91821b91600019901b1916179055565b8388036117d1575b5050505016928383036117b05750505050565b6064945051926364283d7b60e01b8452600484015260248301526044820152fd5b6117da906119da565b60001981019390841161180f5782916007918a945260068152838320858452815287848420558783525220553880808061179d565b634e487b7160e01b83526011600452602483fd5b634e487b7160e01b84526041600452602484fd5b87841461179557611847886119da565b878452600783528984205481810361187c575b50878452838a8120558884526006835289842090845282528289812055611795565b898552600684528a852082865284528a8520548a8652600685528b86208287528552808c8720558552600784528a8520553861185a565b600088815260046020526040902080546001600160a01b03191690558884526003835289842080546000190190556116f6565b80611933575b156118f757386116ec565b888789611914576024915190637e27328960e01b82526004820152fd5b905163177e802f60e01b81523360048201526024810191909152604490fd5b503388148015611958575b806118ec57508683526004825233868a85205416146118ec565b5087835260058252888320338452825260ff898420541661193e565b604051633250574960e11b815260006004820152602490fd5b6008548110156119c45760086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30190600090565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b031680156119fa57600052600360205260406000205490565b6040516322718ad960e21b815260006004820152602490fd5b15611a1a57565b60405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b6044820152606490fd5b91908201809211611a5c57565b634e487b7160e01b600052601160045260246000fd5b600090815260206002815260409160018060a01b038382205416918351926370a0823160e01b84528060048501527318adc812fe66b9381700c2217f0c9dc816c879e6938281602481885afa908115611bdf578491611bb2575b5015611ba757845190632f745c5960e01b825260048201528260248201528181604481875afa908115611b9d579082918491611b6e575b5060248651809681936374e6a46960e01b835260048301525afa938415611b6357508193611b32575b50505090565b9091809350813d8311611b5c575b611b4a8183611631565b810103126103ec575051388080611b2c565b503d611b40565b51913d9150823e3d90fd5b82819392503d8311611b96575b611b858183611631565b810103126102e55781905138611b03565b503d611b7b565b85513d85823e3d90fd5b50505050506101f390565b90508281813d8311611bd8575b611bc98183611631565b810103126105a3575138611acc565b503d611bbf565b86513d86823e3d90fd5b9190916001600160801b0380809416911601918211611a5c57565b6000818152600260205260409020546001600160a01b0316908115611c27575090565b60249060405190637e27328960e01b82526004820152fd5b600a546001600160a01b03163303611c5357565b60405163118cdaa760e01b8152336004820152602490fd5b813b611c78575b50505050565b604051630a85bd0160e11b8082523360048301526001600160a01b03928316602483015260448201949094526080606482015260209592909116939092908390611cc6906084830190611558565b039285816000958187895af1849181611d6f575b50611d3a575050503d600014611d32573d611cf481611653565b90611d026040519283611631565b81528091843d92013e5b80519283611d2d57604051633250574960e11b815260048101849052602490fd5b019050fd5b506060611d0c565b919450915063ffffffff60e01b1603611d57575038808080611c72565b60249060405190633250574960e11b82526004820152fd5b9091508681813d8311611da8575b611d878183611631565b8101031261059f57516001600160e01b03198116810361059f579038611cda565b503d611d7d565b60ff8116156121e8576000916001903315928315925b156121d2575b600094601260018154019081815560405191602083018181524260408501523360601b60608501526054845283608081011067ffffffffffffffff6080860111176121be576080840160405283519020908952601460205260408920906001600160801b0382549181199060801b1691161790555495611e4d608083016115e3565b8760808301526121a5578587526002602081905260408820546001600160a01b031696908715801591888361216e575b612156575b838b5260205260408a20336001600160601b0360a01b82541617905582338a7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8d80a4156120c8576008805490838b5260096020528160408c2055600160401b8210156120b45761177c8285926001611efd9501905561198d565b88973303612061575b61204857333b611f19575b505094611dc5565b611f57916020916040519384928392630a85bd0160e11b84523360048501528c60248501526044840152608060648401526080608484019101611558565b03818a335af1879181612003575b50611fc157863d15611fb9573d611f7b81611653565b90611f896040519283611631565b8152809160203d92013e5b80519081611fb457604051633250574960e11b8152336004820152602490fd5b602001fd5b506060611f94565b630a85bd0160e1979293949596971b9063ffffffff60e01b1603611feb5794939291903880611f11565b604051633250574960e11b8152336004820152602490fd5b9091506020813d602011612040575b8161201f60209383611631565b8101031261087957516001600160e01b031981168103610879579038611f65565b3d9150612012565b6040516339e3563760e11b815260048101899052602490fd5b61206a336119da565b60001981019081116120a057338a52600660205260408a20818b526020528260408b2055828a52600760205260408a2055611f06565b634e487b7160e01b8a52601160045260248afd5b634e487b7160e01b8b52604160045260248bfd5b338814611efd576120d8886119da565b828a5260078060205260408b205490828203612117575b5050828a52896040812055888a52600660205260408a20908a52602052886040812055611efd565b8a8c528b8b60406006928360205281812087825260205281812054938493825260205281812086825260205220558c5260205260408b205538806120ef565b338b52600360205260408b2060018154019055611e82565b50600084815260046020526040902080546001600160a01b0319169055898b52600360205260408b20805460001901905588611e7d565b604051633250574960e11b815260048101889052602490fd5b634e487b7160e01b8a52604160045260248afd5b936001019360ff81168510611dcb575092505050565b50565b60005b600381106121fe57505050600090565b604090815160209081810190868683376122278382898101600083820152038084520182611631565b5190209082600b019351818101918160008754976122448961167f565b906001998a811690816000146122c65750600114612287575b5050612272925003601f198101835282611631565b5190201461228057016121ee565b5091505090565b90915060005282600020886000915b8383106122af575050509161227292820101388061225d565b8054878401870152869450918501918a9101612296565b91505061227294925060ff1916865280151502820101388061225d56fea26469706673582212208cd46e2e8c69133c77808eede75eae391df2b1240669fb62b3b9ca5567e709f164736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000492a6e2b85e5c13daa3ea893829a7db3c68e72a00000000000000000000000000ba040e2c8e395862e31f32b72722cf17ff9ea33
-----Decoded View---------------
Arg [0] : _stitcher (address): 0x492a6E2b85E5c13DaA3eA893829A7Db3C68E72A0
Arg [1] : initialOwner (address): 0x0BA040E2c8e395862e31F32b72722cF17ff9EA33
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000492a6e2b85e5c13daa3ea893829a7db3c68e72a0
Arg [1] : 0000000000000000000000000ba040e2c8e395862e31f32b72722cf17ff9ea33
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.