Overview
TokenID
963
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
SeoriGenerative
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; import "erc721a/contracts/ERC721A.sol"; import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; import "./AntiScam/RestrictApprove/RestrictApprove.sol"; //tokenURI interface interface ITokenURI { function tokenURI(uint256 _tokenId) external view returns (string memory); } contract SeoriGenerative is ERC2981, DefaultOperatorFilterer, Ownable, ERC721A, AccessControl, RestrictApprove { constructor() ERC721A("SeoriGenerative", "SEORI") { //Role initialization _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(MINTER_ROLE, msg.sender); _setupRole(AIRDROP_ROLE, msg.sender); //first mint and burn _mint(msg.sender, 5); //for test //setOnlyAllowlisted(false); //setMintCount(false); //setPause(false); //setMaxSupply(6); // Set royalty as 10% _setDefaultRoyalty(withdrawAddress, 1000); // Initialize RestrictApprove // To save deployment size, not use initializerAntiScam and initialize directly. //__RestrictApprove_init(); _setCALLevel(1); _setRestrictEnabled(true); _setCAL(0xdbaa28cBe70aF04EbFB166b1A3E8F8034e5B9FC7);//Ethereum mainnet proxy // _setCAL(0xb506d7BbE23576b8AAf22477cd9A7FDF08002211);//Goerli testnet proxy } /////////////////////////////////////////////////////////////////////////// // Withdraw function /////////////////////////////////////////////////////////////////////////// function withdraw() public payable onlyOwner { (bool os, ) = payable(withdrawAddress).call{ value: address(this).balance }(""); require(os); } /////////////////////////////////////////////////////////////////////////// // Variables and Constants /////////////////////////////////////////////////////////////////////////// address public constant withdrawAddress = 0xddf110763eBc75419A39150821c46a58dDD2d667; uint256 public constant maxSupply = 5000; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); bytes32 public constant AIRDROP_ROLE = keccak256("AIRDROP_ROLE"); uint256 public cost = 0.001 ether; uint8 public maxMintAmountPerTransaction = 100; uint16 public publicSaleMaxMintAmountPerAddress = 300; bool public paused = true; bool public onlyAllowlisted = true; bool public mintCount = true; bool public burnAndMintMode;// = false; bool public isSBT = false; //0 : Merkle Tree //1 : Mapping uint8 public allowlistType;// = 0; uint16 public saleId;// = 0; bytes32 public merkleRoot = 0xa5b07db99cc7e790aea5121ef230a1781b181eee17ba26a12a469781c539419a; mapping(uint256 => mapping(address => uint256)) public userMintedAmount; mapping(uint256 => mapping(address => uint256)) public allowlistUserAmount; ITokenURI public interfaceOfTokenURI; modifier callerIsUser() { require(tx.origin == msg.sender, "The caller is another contract."); _; } /////////////////////////////////////////////////////////////////////////// // Override internal mint function to restrict supply /////////////////////////////////////////////////////////////////////////// function _mint(address to, uint256 quantity) internal virtual override { if (totalSupply() + quantity > maxSupply) revert ("max NFT limit exceeded"); super._mint(to, quantity); } /////////////////////////////////////////////////////////////////////////// // Mint function for sale /////////////////////////////////////////////////////////////////////////// function mint( uint256 _mintAmount, uint256 _maxMintAmount, bytes32[] calldata _merkleProof, uint256 _burnId ) public payable callerIsUser { require(!paused, "the contract is paused"); // Double check // require(0 < _mintAmount, "need to mint at least 1 NFT"); require( _mintAmount <= maxMintAmountPerTransaction, "max mint amount per session exceeded" ); /* change check supply in _mint() require( _nextTokenId() + _mintAmount <= maxSupply, "max NFT limit exceeded" ); */ require(cost * _mintAmount <= msg.value, "insufficient funds"); uint256 maxMintAmountPerAddress; if (onlyAllowlisted == true) { if (allowlistType == 0) { //Merkle tree bytes32 leaf = keccak256( abi.encodePacked(msg.sender, _maxMintAmount) ); require( MerkleProof.verify(_merkleProof, merkleRoot, leaf), "user is not allowlisted" ); maxMintAmountPerAddress = _maxMintAmount; } else if (allowlistType == 1) { //Mapping require( allowlistUserAmount[saleId][msg.sender] != 0, "user is not allowlisted" ); maxMintAmountPerAddress = allowlistUserAmount[saleId][ msg.sender ]; } } else { maxMintAmountPerAddress = uint256(publicSaleMaxMintAmountPerAddress); } if (mintCount == true) { require( _mintAmount <= maxMintAmountPerAddress - userMintedAmount[saleId][msg.sender], "max NFT per address exceeded" ); userMintedAmount[saleId][msg.sender] += _mintAmount; } if (burnAndMintMode == true) { require(_mintAmount == 1, ""); require(msg.sender == ownerOf(_burnId), "Owner is different"); _burn(_burnId); } // Under callerIsUser, safeMint wastes gas without meanings. //_safeMint(msg.sender, _mintAmount); _mint(msg.sender, _mintAmount); } function airdropMint( address[] calldata _airdropAddresses, uint256[] memory _UserMintAmount ) public { require( hasRole(AIRDROP_ROLE, msg.sender), "Caller is not a air dropper" ); uint256 _mintAmount = 0; for (uint256 i = 0; i < _UserMintAmount.length; i++) { _mintAmount += _UserMintAmount[i]; } require(0 < _mintAmount, "need to mint at least 1 NFT"); require( totalSupply() + _mintAmount <= maxSupply, "max NFT limit exceeded" ); for (uint256 i = 0; i < _UserMintAmount.length; i++) { _safeMint(_airdropAddresses[i], _UserMintAmount[i]); } } function setBurnAndMintMode(bool _burnAndMintMode) public onlyOwner { burnAndMintMode = _burnAndMintMode; } function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner { merkleRoot = _merkleRoot; } function setPause(bool _state) public onlyOwner { paused = _state; } function setAllowListType(uint256 _type) public onlyOwner { require(_type == 0 || _type == 1, "Allow list type error"); allowlistType = uint8(_type); } function setAllowlistMapping( uint256 _saleId, address[] memory addresses, uint256[] memory saleSupplies ) public onlyOwner { require(addresses.length == saleSupplies.length); for (uint256 i = 0; i < addresses.length; i++) { allowlistUserAmount[_saleId][addresses[i]] = saleSupplies[i]; } } function getAllowlistUserAmount( address _address ) public view returns (uint256) { return allowlistUserAmount[saleId][_address]; } function getUserMintedAmountBySaleId( uint256 _saleId, address _address ) public view returns (uint256) { return userMintedAmount[_saleId][_address]; } function getUserMintedAmount( address _address ) public view returns (uint256) { return userMintedAmount[saleId][_address]; } function setSaleId(uint256 _saleId) public onlyOwner { saleId = uint8(_saleId); } /* maxSupply changed to constant function setMaxSupply(uint256 _maxSupply) public onlyOwner { maxSupply = _maxSupply; } */ function setPublicSaleMaxMintAmountPerAddress( uint256 _publicSaleMaxMintAmountPerAddress ) public onlyOwner { publicSaleMaxMintAmountPerAddress = uint16(_publicSaleMaxMintAmountPerAddress); } function setCost(uint256 _newCost) public onlyOwner { cost = _newCost; } function setOnlyAllowlisted(bool _state) public onlyOwner { onlyAllowlisted = _state; } function setMaxMintAmountPerTransaction( uint256 _maxMintAmountPerTransaction ) public onlyOwner { maxMintAmountPerTransaction = uint8(_maxMintAmountPerTransaction); } function setMintCount(bool _state) public onlyOwner { mintCount = _state; } /////////////////////////////////////////////////////////////////////////// // tokenURI Descriptor /////////////////////////////////////////////////////////////////////////// function setInterfaceOfTokenURI(address _address) public onlyOwner { interfaceOfTokenURI = ITokenURI(_address); } function tokenURI( uint256 tokenId ) public view override returns (string memory) { _exists(tokenId); if (address(interfaceOfTokenURI) != address(0)) { return interfaceOfTokenURI.tokenURI(tokenId); } return ""; } /////////////////////////////////////////////////////////////////////////// // ERC721A set start TokenID /////////////////////////////////////////////////////////////////////////// function _startTokenId() internal view virtual override returns (uint256) { return 1; } /////////////////////////////////////////////////////////////////////////// // external Mint / Burn function /////////////////////////////////////////////////////////////////////////// function externalMint(address _address, uint256 _amount) external payable { require(hasRole(MINTER_ROLE, msg.sender), "Caller is not a minter"); /* require( _nextTokenId() - 1 + _amount <= maxSupply, "max NFT limit exceeded" ); */ _safeMint(_address, _amount); } function externalBurn(uint256[] memory _burnTokenIds) external { require(hasRole(BURNER_ROLE, msg.sender), "Caller is not a burner"); for (uint256 i = 0; i < _burnTokenIds.length; i++) { uint256 tokenId = _burnTokenIds[i]; // For future extension, comment out the following check since it restricts burning byself. // require(msg.sender == ownerOf(tokenId), "Owner is different"); _burn(tokenId); } } /////////////////////////////////////////////////////////////////////////// // IERC721RestrictApprove Override setter functions /////////////////////////////////////////////////////////////////////////// /** * @dev Set CAL Level. */ function setCALLevel(uint256 level) external onlyOwner { _setCALLevel(level); } /** * @dev Set `calAddress` as the new proxy of the contract allow list. */ function setCAL(address calAddress) external onlyOwner { _setCAL(calAddress); } /** * @dev Add `transferer` to local contract allow list. */ function addLocalContractAllowList(address transferer) external onlyOwner { _addLocalContractAllowList(transferer); } /** * @dev Remove `transferer` from local contract allow list. */ function removeLocalContractAllowList(address transferer) external onlyOwner { _removeLocalContractAllowList(transferer); } /** * @dev Set which the restriction by CAL is enabled. */ function setRestrictEnabled(bool value) external onlyOwner { _setRestrictEnabled(value); } /////////////////////////////////////////////////////////////////////////// // SBTizer /////////////////////////////////////////////////////////////////////////// function setIsSBT(bool _state) public onlyOwner { isSBT = _state; } function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal virtual override onlyTransferable(from, to, startTokenId, quantity) { require( isSBT == false || from == address(0) || to == address(0x000000000000000000000000000000000000dEaD), "transfer is prohibited" ); super._beforeTokenTransfers(from, to, startTokenId, quantity); } function setApprovalForAll(address operator, bool approved) public virtual override onlyAllowedOperatorApproval(operator) onlyWalletApprovable(operator, msg.sender, approved) { require(isSBT == false, "setApprovalForAll is prohibited"); super.setApprovalForAll(operator, approved); } function approve(address to, uint256 tokenId) public payable virtual override onlyAllowedOperatorApproval(to) onlyTokenApprovable(to, tokenId) { require(isSBT == false, "approve is prohibited"); super.approve(to, tokenId); } /////////////////////////////////////////////////////////////////////////// // ERC2981 Royalty /////////////////////////////////////////////////////////////////////////// function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyOwner { _setDefaultRoyalty(receiver, feeNumerator); } /////////////////////////////////////////////////////////////////////////// // ERC165 Override /////////////////////////////////////////////////////////////////////////// function supportsInterface( bytes4 interfaceId ) public view override(ERC2981, ERC721A, AccessControl) returns (bool) { return ERC2981.supportsInterface(interfaceId) || AccessControl.supportsInterface(interfaceId) || ERC721A.supportsInterface(interfaceId); } /////////////////////////////////////////////////////////////////////////// // override transfer functions /////////////////////////////////////////////////////////////////////////// /** * @dev See {IERC721-transferFrom}. * In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function transferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. * In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function safeTransferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. * In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** * @title Upgradeable RestrictApprove with contract-allow-list * @author 0xedy * */ import "../AntiScamInitializable.sol"; import "./storage/RestrictApproveStorage.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "contract-allow-list/contracts/proxy/interface/IContractAllowListProxy.sol"; import "contract-allow-list/contracts/ERC721AntiScam/restrictApprove/IERC721RestrictApprove.sol"; import "../AntiScamAbstract.sol"; abstract contract RestrictApprove is AntiScamAbstract, AntiScamInitializable, IERC721RestrictApprove { using RestrictApproveStorage for RestrictApproveStorage.Layout; using EnumerableSet for EnumerableSet.AddressSet; // ============================================================= // CONSTRUCTOR // ============================================================= /* function _initializeAntiScam() internal virtual override { RestrictApproveStorage.layout().CALLevel = 1; RestrictApproveStorage.layout().restrictEnabled = true; } */ function __RestrictApprove_init() internal onlyInitializingAntiScam { __RestrictApprove_init_unchained(); } function __RestrictApprove_init_unchained() internal onlyInitializingAntiScam { RestrictApproveStorage.layout().CALLevel = 1; RestrictApproveStorage.layout().restrictEnabled = true; } // ============================================================= // IERC721RestrictApprove // ============================================================= function CAL() public view virtual returns (IContractAllowListProxy) { return RestrictApproveStorage.layout().CAL; } function CALLevel() public view virtual returns (uint256) { return RestrictApproveStorage.layout().CALLevel; } function restrictEnabled() public view virtual returns (bool) { return RestrictApproveStorage.layout().restrictEnabled; } // ============================================================= // Internal setter functions // ============================================================= function _addLocalContractAllowList(address transferer) internal virtual { RestrictApproveStorage.layout().localAllowedAddresses.add(transferer); emit LocalCalAdded(msg.sender, transferer); } function _removeLocalContractAllowList(address transferer) internal virtual { RestrictApproveStorage.layout().localAllowedAddresses.remove(transferer); emit LocalCalRemoved(msg.sender, transferer); } function _setCALLevel(uint256 value) internal virtual { RestrictApproveStorage.layout().CALLevel = value; emit CalLevelChanged(msg.sender, value); } function _setCAL(address calAddress) internal virtual { RestrictApproveStorage.layout().CAL = IContractAllowListProxy(calAddress); } function _setRestrictEnabled(bool enabled) internal virtual { RestrictApproveStorage.layout().restrictEnabled = enabled; } // ============================================================= // IERC721RestrictApprove // ============================================================= function getLocalContractAllowList() public virtual view returns(address[] memory) { return RestrictApproveStorage.layout().localAllowedAddresses.values(); } // ============================================================= // Allowed status // ============================================================= function isLocalAllowed(address transferer) public view virtual returns (bool) { return RestrictApproveStorage.layout().localAllowedAddresses.contains(transferer); } function isAllowed(address transferer) public view virtual returns (bool) { if (!RestrictApproveStorage.layout().restrictEnabled) { return true; } return isLocalAllowed(transferer) || RestrictApproveStorage.layout().CAL.isAllowed( transferer, RestrictApproveStorage.layout().CALLevel ); } // ============================================================= // AntiScam Approve logic function // ============================================================= function _isTokenApprovable(address transferer, uint256 /*tokenId*/) internal view virtual override returns (bool) { return isAllowed(transferer); } function _isWalletApprovable(address transferer, address /*holder*/) internal view virtual override returns (bool) { return isAllowed(transferer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFilterer} from "./OperatorFilterer.sol"; import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol"; /** * @title DefaultOperatorFilterer * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. * @dev Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract DefaultOperatorFilterer is OperatorFilterer { /// @dev The constructor that is called when the contract is being deployed. constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @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 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} * * _Available since v4.7._ */ 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. * * _Available since v4.4._ */ 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} * * _Available since v4.7._ */ 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. * * _Available since v4.7._ */ 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. * * _Available since v4.7._ */ 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). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild 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 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // 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 for 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) { 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. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild 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 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // 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 for 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) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } 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 v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../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. * * By default, the owner account will be the one that deploys the contract. 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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @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 { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _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 v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @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, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @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) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @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 caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @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 memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E; address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol"; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. * Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract OperatorFilterer { /// @dev Emitted when an operator is not allowed. error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS); /// @dev The constructor that is called when the contract is being deployed. constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } /** * @dev A helper function to check if an operator is allowed. */ modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } /** * @dev A helper function to check if an operator approval is allowed. */ modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } /** * @dev A helper function to check if an operator is allowed. */ function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { // under normal circumstances, this function will revert rather than return false, but inheriting contracts // may specify their own OperatorFilterRegistry implementations, which may behave differently if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @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`, * 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 be 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, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * 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 payable; /** * @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 payable; /** * @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 caller. * * 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); // ============================================================= // IERC721Metadata // ============================================================= /** * @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); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** * @title Upgradeable interface(abstract contract) for approval and transfer control mechanism * @author 0xedy * @notice This abstract contract is base for RestrcitApprove, Lockcable, etc.. */ abstract contract AntiScamAbstract { error ApproveToNotAllowedTransferer(); error TransferForNotAllowedToken(); modifier onlyTokenApprovable (address transferer, uint256 tokenId) virtual { _checkTokenApprovable(transferer, tokenId); _; } modifier onlyWalletApprovable (address transferer, address holder, bool approved) virtual { _checkWalletApprovable(transferer, holder, approved); _; } modifier onlyTransferable ( address from, address to, uint256 startTokenId, uint256 quantity ) virtual { _checkTransferable(from, to, startTokenId, quantity); _; } // ============================================================= // CONSTRUCTOR // ============================================================= function _initializeAntiScam() internal virtual { } // ============================================================= // INTERNAL LOGIC FUNCTIONS // ============================================================= function _isTokenApprovable (address /*transferer*/, uint256 /*tokenId*/) internal view virtual returns (bool) { return true; } function _checkTokenApprovable (address transferer, uint256 tokenId) internal view virtual { // Approving to Zero adress is alwayd allowed because it is disapproving. if (transferer != address(0)) { if (!_isTokenApprovable(transferer, tokenId)) revert ApproveToNotAllowedTransferer(); } } function _isWalletApprovable(address /*transferer*/, address /*holder*/) internal view virtual returns (bool) { return true; } function _checkWalletApprovable (address transferer, address holder, bool approved) internal view virtual { // Disapproving is always if (approved) { if (!_isWalletApprovable(transferer, holder)) revert ApproveToNotAllowedTransferer(); } } function _isTransferable ( address /*from*/, address /*to*/, uint256 /*startTokenId*/, uint256 /*quantity*/ ) internal view virtual returns (bool) { return true; } function _checkTransferable ( address from, address to, uint256 startTokenId, uint256 quantity ) internal view virtual { if (!_isTransferable(from, to, startTokenId, quantity)) revert TransferForNotAllowedToken(); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; /// @title IERC721RestrictApprove /// @dev Approve抑制機能付きコントラクトのインターフェース /// @author Lavulite interface IERC721RestrictApprove { /** * @dev CALレベルが変更された場合のイベント */ event CalLevelChanged(address indexed operator, uint256 indexed level); /** * @dev LocalContractAllowListnに追加された場合のイベント */ event LocalCalAdded(address indexed operator, address indexed transferer); /** * @dev LocalContractAllowListnに削除された場合のイベント */ event LocalCalRemoved(address indexed operator, address indexed transferer); /** * @dev CALを利用する場合のCALのレベルを設定する。レベルが高いほど、許可されるコントラクトの範囲が狭い。 */ function setCALLevel(uint256 level) external; /** * @dev CALのアドレスをセットする。 */ function setCAL(address calAddress) external; /** * @dev CALのリストに無い独自の許可アドレスを追加する場合、こちらにアドレスを記載する。 */ function addLocalContractAllowList(address transferer) external; /** * @dev CALのリストにある独自の許可アドレスを削除する場合、こちらにアドレスを記載する。 */ function removeLocalContractAllowList(address transferer) external; /** * @dev CALのリストにある独自の許可アドレスの一覧を取得する。 */ function getLocalContractAllowList() external view returns(address[] memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; interface IContractAllowListProxy { function isAllowed(address _transferer, uint256 _level) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "contract-allow-list/contracts/proxy/interface/IContractAllowListProxy.sol"; library RestrictApproveStorage { struct Layout { // CAL Proxy address IContractAllowListProxy CAL; // stores local allowed addresses EnumerableSet.AddressSet localAllowedAddresses; // flag of restriction by CAL bool restrictEnabled;// = true; // stores CAL restriction level uint256 CALLevel;// = 1; } bytes32 internal constant STORAGE_SLOT = keccak256('RestrictApprove.contracts.storage.facet'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable diamond facet contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ import {AntiScamInitializableStorage} from "./AntiScamInitializableStorage.sol"; abstract contract AntiScamInitializable { using AntiScamInitializableStorage for AntiScamInitializableStorage.Layout; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializerAntiScam() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require( AntiScamInitializableStorage.layout()._initializing ? _isConstructor() : !AntiScamInitializableStorage.layout()._initialized, 'AntiScamInitializable: contract is already initialized' ); bool isTopLevelCall = !AntiScamInitializableStorage.layout()._initializing; if (isTopLevelCall) { AntiScamInitializableStorage.layout()._initializing = true; AntiScamInitializableStorage.layout()._initialized = true; } _; if (isTopLevelCall) { AntiScamInitializableStorage.layout()._initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializingAntiScam() { require( AntiScamInitializableStorage.layout()._initializing, 'AntiScamInitializable: contract is not initializing' ); _; } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./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); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @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), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @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) { 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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { /** * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns * true if supplied registrant address is not registered. */ function isOperatorAllowed(address registrant, address operator) external view returns (bool); /** * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner. */ function register(address registrant) external; /** * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes. */ function registerAndSubscribe(address registrant, address subscription) external; /** * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another * address without subscribing. */ function registerAndCopyEntries(address registrant, address registrantToCopy) external; /** * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. * Note that this does not remove any filtered addresses or codeHashes. * Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes. */ function unregister(address addr) external; /** * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered. */ function updateOperator(address registrant, address operator, bool filtered) external; /** * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates. */ function updateOperators(address registrant, address[] calldata operators, bool filtered) external; /** * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered. */ function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; /** * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates. */ function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; /** * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous * subscription if present. * Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, * subscriptions will not be forwarded. Instead the former subscription's existing entries will still be * used. */ function subscribe(address registrant, address registrantToSubscribe) external; /** * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes. */ function unsubscribe(address registrant, bool copyExistingEntries) external; /** * @notice Get the subscription address of a given registrant, if any. */ function subscriptionOf(address addr) external returns (address registrant); /** * @notice Get the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscribers(address registrant) external returns (address[] memory); /** * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscriberAt(address registrant, uint256 index) external returns (address); /** * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr. */ function copyEntriesOf(address registrant, address registrantToCopy) external; /** * @notice Returns true if operator is filtered by a given address or its subscription. */ function isOperatorFiltered(address registrant, address operator) external returns (bool); /** * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription. */ function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); /** * @notice Returns true if a codeHash is filtered by a given address or its subscription. */ function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); /** * @notice Returns a list of filtered operators for a given address or its subscription. */ function filteredOperators(address addr) external returns (address[] memory); /** * @notice Returns the set of filtered codeHashes for a given address or its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashes(address addr) external returns (bytes32[] memory); /** * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredOperatorAt(address registrant, uint256 index) external returns (address); /** * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); /** * @notice Returns true if an address has registered */ function isRegistered(address addr) external returns (bool); /** * @dev Convenience method to compute the code hash of an arbitrary contract */ function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base storage for the initialization function for upgradeable diamond facet contracts **/ library AntiScamInitializableStorage { struct Layout { /* * Indicates that the contract has been initialized. */ bool _initialized; /* * Indicates that the contract is in the process of being initialized. */ bool _initializing; } bytes32 internal constant STORAGE_SLOT = keccak256("AntiScam.contracts.storage.initializable.facet"); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @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 v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @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 up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (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; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 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. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); 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 (rounding == Rounding.Up && 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 down. * * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * 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 10, 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 + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApproveToNotAllowedTransferer","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferForNotAllowedToken","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","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":"operator","type":"address"},{"indexed":true,"internalType":"uint256","name":"level","type":"uint256"}],"name":"CalLevelChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"transferer","type":"address"}],"name":"LocalCalAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"transferer","type":"address"}],"name":"LocalCalRemoved","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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":"AIRDROP_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CAL","outputs":[{"internalType":"contract IContractAllowListProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CALLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"transferer","type":"address"}],"name":"addLocalContractAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_airdropAddresses","type":"address[]"},{"internalType":"uint256[]","name":"_UserMintAmount","type":"uint256[]"}],"name":"airdropMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowlistType","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"allowlistUserAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnAndMintMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_burnTokenIds","type":"uint256[]"}],"name":"externalBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"externalMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getAllowlistUserAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLocalContractAllowList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getUserMintedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleId","type":"uint256"},{"internalType":"address","name":"_address","type":"address"}],"name":"getUserMintedAmountBySaleId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interfaceOfTokenURI","outputs":[{"internalType":"contract ITokenURI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"transferer","type":"address"}],"name":"isAllowed","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":[{"internalType":"address","name":"transferer","type":"address"}],"name":"isLocalAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSBT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintAmountPerTransaction","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"uint256","name":"_maxMintAmount","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"_burnId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintCount","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":"onlyAllowlisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleMaxMintAmountPerAddress","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"transferer","type":"address"}],"name":"removeLocalContractAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"restrictEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"safeTransferFrom","outputs":[],"stateMutability":"payable","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":"payable","type":"function"},{"inputs":[],"name":"saleId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_type","type":"uint256"}],"name":"setAllowListType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleId","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"saleSupplies","type":"uint256[]"}],"name":"setAllowlistMapping","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":"bool","name":"_burnAndMintMode","type":"bool"}],"name":"setBurnAndMintMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"calAddress","type":"address"}],"name":"setCAL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"setCALLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCost","type":"uint256"}],"name":"setCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setInterfaceOfTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setIsSBT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxMintAmountPerTransaction","type":"uint256"}],"name":"setMaxMintAmountPerTransaction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setMintCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setOnlyAllowlisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_publicSaleMaxMintAmountPerAddress","type":"uint256"}],"name":"setPublicSaleMaxMintAmountPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setRestrictEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleId","type":"uint256"}],"name":"setSaleId","outputs":[],"stateMutability":"nonpayable","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":"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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userMintedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdrawAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405266038d7ea4c68000600c55600d805467ff00ffffffffffff191665010101012c641790557fa5b07db99cc7e790aea5121ef230a1781b181eee17ba26a12a469781c539419a600e553480156200005957600080fd5b50604080518082018252600f81526e53656f726947656e6572617469766560881b6020808301919091528251808401909352600583526453454f524960d81b9083015290733cc6cdda760b79bafa08df41ecfa224f810dceb660016daaeb6d7670e522a718067333cd4e3b15620001f95780156200014757604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200012857600080fd5b505af11580156200013d573d6000803e3d6000fd5b50505050620001f9565b6001600160a01b03821615620001985760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af2903906044016200010d565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b158015620001df57600080fd5b505af1158015620001f4573d6000803e3d6000fd5b505050505b5062000207905033620002fd565b6005620002158382620008cd565b506006620002248282620008cd565b5050600160035550620002396000336200034f565b620002657f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336200034f565b620002917f3a2f235c9daaf33349d300aadff2f15078a89df81bcfdd45ba11c8f816bddc6f336200034f565b6200029e3360056200035f565b620002c073ddf110763ebc75419a39150821c46a58ddd2d6676103e8620003e7565b620002cc6001620004e8565b620002d8600162000532565b620002f773dbaa28cbe70af04ebfb166b1a3e8f8034e5b9fc76200055d565b620009bb565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6200035b828262000594565b5050565b60045460035461138891839103600019016200037c919062000999565b1115620003d05760405162461bcd60e51b815260206004820152601660248201527f6d6178204e4654206c696d69742065786365656465640000000000000000000060448201526064015b60405180910390fd5b6200035b82826200061e60201b620020f21760201c565b6127106001600160601b0382161115620004575760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401620003c7565b6001600160a01b038216620004af5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620003c7565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b80620004fe6200070e60201b620021d91760201c565b60040155604051819033907f8962277f6a1fe666523bc8356e92ca0332d6cbbc6ac21edbbcbb5ceaa258536a90600090a350565b80620005486200070e60201b620021d91760201c565b600301805460ff191691151591909117905550565b80620005736200070e60201b620021d91760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620005a0828262000732565b6200035b576000828152600b602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620005da3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6003546000829003620006445760405163b562e8dd60e01b815260040160405180910390fd5b6200065360008483856200075f565b6001600160a01b03831660008181526008602090815260408083208054680100000000000000018802019055848352600790915281206001851460e11b4260a01b178317905582840190839083906000805160206200466b8339815191528180a4600183015b818114620006e257808360006000805160206200466b833981519152600080a4600101620006b9565b50816000036200070457604051622e076360e81b815260040160405180910390fd5b600355505b505050565b7f7182bc540a919506f5dbc9f55afae7cdd4ca476499f0017cee40bdc99f34a61d90565b6000828152600b602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b83838383620007718484848462000823565b600d54670100000000000000900460ff1615806200079657506001600160a01b038816155b80620007ac57506001600160a01b03871661dead145b620007fa5760405162461bcd60e51b815260206004820152601660248201527f7472616e736665722069732070726f68696269746564000000000000000000006044820152606401620003c7565b62000813888888886200081d60201b6200113c1760201c565b5050505050505050565b50505050565b6200081d565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200085457607f821691505b6020821081036200087557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200070957600081815260208120601f850160051c81016020861015620008a45750805b601f850160051c820191505b81811015620008c557828155600101620008b0565b505050505050565b81516001600160401b03811115620008e957620008e962000829565b6200090181620008fa84546200083f565b846200087b565b602080601f831160018114620009395760008415620009205750858301515b600019600386901b1c1916600185901b178555620008c5565b600085815260208120601f198616915b828110156200096a5788860151825594840194600190910190840162000949565b5085821015620009895787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156200075957634e487b7160e01b600052601160045260246000fd5b613ca080620009cb6000396000f3fe6080604052600436106104505760003560e01c80636352211e1161023f578063a72193b611610139578063d5391393116100b6578063e985e9c51161007a578063e985e9c514610e09578063f2fde38b14610e52578063f48824db14610e72578063fcd1aac914610eaa578063ff76821214610eca57600080fd5b8063d539139314610d5f578063d547741f14610d93578063d5abeb0114610db3578063d728312a14610dc9578063e39e026914610de957600080fd5b8063bbb89744116100fd578063bbb8974414610c93578063bedb86fb14610cad578063c84c038714610ccd578063c87b56dd14610cef578063d04f32d214610d0f57600080fd5b8063a72193b614610bed578063a9e2acd514610c20578063b5f94d0614610c40578063b88d4fde14610c60578063babcc53914610c7357600080fd5b80637ee3b2ac116101c757806395d89b411161018b57806395d89b4114610b6d5780639659867e14610b8257806399f9889814610ba5578063a217fddf14610bb8578063a22cb46514610bcd57600080fd5b80637ee3b2ac14610acf578063877984cb14610aef5780638da5cb5b14610b0f5780638e73cf0014610b2d57806391d1485414610b4d57600080fd5b806370a082311161020e57806370a0823114610a27578063715018a614610a4757806372b44d7114610a5c57806373ef64fd14610a7c5780637cb6475914610aaf57600080fd5b80636352211e146109b2578063669ee234146109d2578063674c02aa146109f25780636b1a2b7f14610a1457600080fd5b8063279a669e116103505780633cf40df3116102d8578063499a15d41161029c578063499a15d4146109045780634e6bf2041461093c5780634f3db3461461095c5780635978c012146109715780635c975abb1461099157600080fd5b80633cf40df31461083e57806341f434341461085f57806342842e0e1461088157806344a0d68a1461089457806347705cbc146108b457600080fd5b80632f2ff15d1161031f5780632f2ff15d1461079e5780633511cd54146107be57806336568abe14610801578063396e8f53146108215780633ccfd60b1461083657600080fd5b8063279a669e146106f5578063282c51f3146107155780632a55205a146107495780632eb4a7ab1461078857600080fd5b806309849233116103de57806318160ddd116103a257806318160ddd146106415780631e0fbfa21461065e57806323b872dd1461069257806323c03085146106a5578063248a9ca3146106c557600080fd5b806309849233146105a05780630f4345e2146105b557806313faede6146105d55780631581b600146105f957806317dc10c41461062157600080fd5b8063025e332e11610425578063025e332e146104f157806304634d8d1461051357806306fdde0314610533578063081812fc14610555578063095ea7b31461058d57600080fd5b80623f332f1461045557806285bb6f14610480578063018d9b50146104b157806301ffc9a7146104d1575b600080fd5b34801561046157600080fd5b5061046a610eea565b604051610477919061338e565b60405180910390f35b34801561048c57600080fd5b50600d546104a190600160301b900460ff1681565b6040519015158152602001610477565b3480156104bd57600080fd5b506104a16104cc3660046133f7565b610f04565b3480156104dd57600080fd5b506104a16104ec366004613428565b610f21565b3480156104fd57600080fd5b5061051161050c3660046133f7565b610f4a565b005b34801561051f57600080fd5b5061051161052e366004613445565b610f5e565b34801561053f57600080fd5b50610548610f74565b60405161047791906134d8565b34801561056157600080fd5b506105756105703660046134eb565b611006565b6040516001600160a01b039091168152602001610477565b61051161059b366004613504565b61104a565b3480156105ac57600080fd5b506104a16110c8565b3480156105c157600080fd5b506105116105d03660046134eb565b6110de565b3480156105e157600080fd5b506105eb600c5481565b604051908152602001610477565b34801561060557600080fd5b5061057573ddf110763ebc75419a39150821c46a58ddd2d66781565b34801561062d57600080fd5b5061051161063c36600461353c565b6110ef565b34801561064d57600080fd5b5060045460035403600019016105eb565b34801561066a57600080fd5b506105eb7f3a2f235c9daaf33349d300aadff2f15078a89df81bcfdd45ba11c8f816bddc6f81565b6105116106a0366004613559565b611117565b3480156106b157600080fd5b506105116106c03660046133f7565b611142565b3480156106d157600080fd5b506105eb6106e03660046134eb565b6000908152600b602052604090206001015490565b34801561070157600080fd5b506105116107103660046136b0565b61116c565b34801561072157600080fd5b506105eb7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b34801561075557600080fd5b50610769610764366004613719565b611342565b604080516001600160a01b039093168352602083019190915201610477565b34801561079457600080fd5b506105eb600e5481565b3480156107aa57600080fd5b506105116107b936600461373b565b6113f0565b3480156107ca57600080fd5b506105eb6107d936600461373b565b6000918252600f602090815260408084206001600160a01b0393909316845291905290205490565b34801561080d57600080fd5b5061051161081c36600461373b565b61141a565b34801561082d57600080fd5b50610575611494565b6105116114ad565b34801561084a57600080fd5b50600d546104a190600160381b900460ff1681565b34801561086b57600080fd5b506105756daaeb6d7670e522a718067333cd4e81565b61051161088f366004613559565b61151e565b3480156108a057600080fd5b506105116108af3660046134eb565b611543565b3480156108c057600080fd5b506105eb6108cf3660046133f7565b600d5461ffff600160481b909104166000908152600f602090815260408083206001600160a01b039094168352929052205490565b34801561091057600080fd5b506105eb61091f36600461373b565b601060209081526000928352604080842090915290825290205481565b34801561094857600080fd5b50610511610957366004613767565b611550565b34801561096857600080fd5b506105eb6115f2565b34801561097d57600080fd5b5061051161098c366004613828565b611605565b34801561099d57600080fd5b50600d546104a1906301000000900460ff1681565b3480156109be57600080fd5b506105756109cd3660046134eb565b6116ba565b3480156109de57600080fd5b506105116109ed36600461353c565b6116c5565b3480156109fe57600080fd5b50600d546104a190640100000000900460ff1681565b610511610a2236600461385d565b6116d6565b348015610a3357600080fd5b506105eb610a423660046133f7565b611b79565b348015610a5357600080fd5b50610511611bc8565b348015610a6857600080fd5b50610511610a773660046133f7565b611bdc565b348015610a8857600080fd5b50600d54610a9c90610100900461ffff1681565b60405161ffff9091168152602001610477565b348015610abb57600080fd5b50610511610aca3660046134eb565b611bed565b348015610adb57600080fd5b50610511610aea3660046134eb565b611bfa565b348015610afb57600080fd5b50601154610575906001600160a01b031681565b348015610b1b57600080fd5b506002546001600160a01b0316610575565b348015610b3957600080fd5b50610511610b4836600461353c565b611c78565b348015610b5957600080fd5b506104a1610b6836600461373b565b611ca2565b348015610b7957600080fd5b50610548611ccd565b348015610b8e57600080fd5b50600d546104a19065010000000000900460ff1681565b610511610bb3366004613504565b611cdc565b348015610bc457600080fd5b506105eb600081565b348015610bd957600080fd5b50610511610be83660046138b8565b611d55565b348015610bf957600080fd5b50600d54610c0e90600160401b900460ff1681565b60405160ff9091168152602001610477565b348015610c2c57600080fd5b50610511610c3b3660046134eb565b611dd1565b348015610c4c57600080fd5b50610511610c5b3660046134eb565b611def565b610511610c6e36600461390c565b611e15565b348015610c7f57600080fd5b506104a1610c8e3660046133f7565b611e3b565b348015610c9f57600080fd5b50600d54610c0e9060ff1681565b348015610cb957600080fd5b50610511610cc836600461353c565b611efd565b348015610cd957600080fd5b50600d54610a9c90600160481b900461ffff1681565b348015610cfb57600080fd5b50610548610d0a3660046134eb565b611f23565b348015610d1b57600080fd5b506105eb610d2a3660046133f7565b600d5461ffff600160481b9091041660009081526010602090815260408083206001600160a01b039094168352929052205490565b348015610d6b57600080fd5b506105eb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b348015610d9f57600080fd5b50610511610dae36600461373b565b611fc5565b348015610dbf57600080fd5b506105eb61138881565b348015610dd557600080fd5b50610511610de43660046134eb565b611fea565b348015610df557600080fd5b50610511610e0436600461353c565b612018565b348015610e1557600080fd5b506104a1610e243660046139b2565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205460ff1690565b348015610e5e57600080fd5b50610511610e6d3660046133f7565b612041565b348015610e7e57600080fd5b506105eb610e8d36600461373b565b600f60209081526000928352604080842090915290825290205481565b348015610eb657600080fd5b50610511610ec536600461353c565b6120b7565b348015610ed657600080fd5b50610511610ee53660046133f7565b6120e1565b6060610eff610ef76121d9565b6001016121fd565b905090565b6000610f1b82610f126121d9565b60010190612211565b92915050565b6000610f2c82612233565b80610f3b5750610f3b82612268565b80610f1b5750610f1b82612289565b610f526122d7565b610f5b81612331565b50565b610f666122d7565b610f70828261235b565b5050565b606060058054610f83906139dc565b80601f0160208091040260200160405190810160405280929190818152602001828054610faf906139dc565b8015610ffc5780601f10610fd157610100808354040283529160200191610ffc565b820191906000526020600020905b815481529060010190602001808311610fdf57829003601f168201915b5050505050905090565b600061101182612458565b61102e576040516333d1c03960e21b815260040160405180910390fd5b506000908152600960205260409020546001600160a01b031690565b816110548161248d565b82826110608282612546565b600d54600160381b900460ff16156110b75760405162461bcd60e51b8152602060048201526015602482015274185c1c1c9bdd99481a5cc81c1c9bda1a589a5d1959605a1b60448201526064015b60405180910390fd5b6110c1858561257c565b5050505050565b60006110d26121d9565b6003015460ff16919050565b6110e66122d7565b610f5b8161261c565b6110f76122d7565b600d80549115156401000000000264ff0000000019909216919091179055565b826001600160a01b0381163314611131576111313361248d565b61113c848484612659565b50505050565b61114a6122d7565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6111967f3a2f235c9daaf33349d300aadff2f15078a89df81bcfdd45ba11c8f816bddc6f33611ca2565b6111e25760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f742061206169722064726f70706572000000000060448201526064016110ae565b6000805b82518110156112285782818151811061120157611201613a16565b6020026020010151826112149190613a42565b91508061122081613a55565b9150506111e6565b50806000106112795760405162461bcd60e51b815260206004820152601b60248201527f6e65656420746f206d696e74206174206c656173742031204e4654000000000060448201526064016110ae565b60045460035461138891839103600019016112949190613a42565b11156112db5760405162461bcd60e51b81526020600482015260166024820152751b585e08139195081b1a5b5a5d08195e18d95959195960521b60448201526064016110ae565b60005b82518110156110c1576113308585838181106112fc576112fc613a16565b905060200201602081019061131191906133f7565b84838151811061132357611323613a16565b60200260200101516127f3565b8061133a81613a55565b9150506112de565b60008281526001602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916113b75750604080518082019091526000546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906113d6906001600160601b031687613a6e565b6113e09190613a85565b91519350909150505b9250929050565b6000828152600b602052604090206001015461140b8161280d565b6114158383612817565b505050565b6001600160a01b038116331461148a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016110ae565b610f70828261289d565b600061149e6121d9565b546001600160a01b0316919050565b6114b56122d7565b60405160009073ddf110763ebc75419a39150821c46a58ddd2d6679047908381818185875af1925050503d806000811461150b576040519150601f19603f3d011682016040523d82523d6000602084013e611510565b606091505b5050905080610f5b57600080fd5b826001600160a01b0381163314611538576115383361248d565b61113c848484612904565b61154b6122d7565b600c55565b6115586122d7565b805182511461156657600080fd5b60005b825181101561113c5781818151811061158457611584613a16565b60200260200101516010600086815260200190815260200160002060008584815181106115b3576115b3613a16565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080806115ea90613a55565b915050611569565b60006115fc6121d9565b60040154905090565b61162f7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833611ca2565b6116745760405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba103090313ab93732b960511b60448201526064016110ae565b60005b8151811015610f7057600082828151811061169457611694613a16565b602002602001015190506116a78161291f565b50806116b281613a55565b915050611677565b6000610f1b8261292a565b6116cd6122d7565b610f5b81612999565b3233146117255760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163742e0060448201526064016110ae565b600d546301000000900460ff16156117785760405162461bcd60e51b81526020600482015260166024820152751d1a194818dbdb9d1c9858dd081a5cc81c185d5cd95960521b60448201526064016110ae565b600d5460ff168511156117d95760405162461bcd60e51b8152602060048201526024808201527f6d6178206d696e7420616d6f756e74207065722073657373696f6e20657863656044820152631959195960e21b60648201526084016110ae565b3485600c546117e89190613a6e565b111561182b5760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b60448201526064016110ae565b600d54600090640100000000900460ff1615156001036119dc57600d54600160401b900460ff16600003611929576040516bffffffffffffffffffffffff193360601b166020820152603481018690526000906054016040516020818303038152906040528051906020012090506118da85858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600e5491508490506129b7565b6119205760405162461bcd60e51b81526020600482015260176024820152761d5cd95c881a5cc81b9bdd08185b1b1bdddb1a5cdd1959604a1b60448201526064016110ae565b859150506119ea565b600d54600160401b900460ff166001036119d757600d54600160481b900461ffff16600090815260106020908152604080832033845290915281205490036119ad5760405162461bcd60e51b81526020600482015260176024820152761d5cd95c881a5cc81b9bdd08185b1b1bdddb1a5cdd1959604a1b60448201526064016110ae565b50600d54600160481b900461ffff1660009081526010602090815260408083203384529091529020545b6119ea565b50600d54610100900461ffff165b600d5465010000000000900460ff161515600103611ac057600d54600160481b900461ffff166000908152600f60209081526040808320338452909152902054611a349082613aa7565b861115611a835760405162461bcd60e51b815260206004820152601c60248201527f6d6178204e46542070657220616464726573732065786365656465640000000060448201526064016110ae565b600d54600160481b900461ffff166000908152600f6020908152604080832033845290915281208054889290611aba908490613a42565b90915550505b600d54600160301b900460ff161515600103611b675785600114611b005760405162461bcd60e51b815260206004820152600060248201526044016110ae565b611b09826116ba565b6001600160a01b0316336001600160a01b031614611b5e5760405162461bcd60e51b815260206004820152601260248201527113dddb995c881a5cc8191a5999995c995b9d60721b60448201526064016110ae565b611b678261291f565b611b7133876129cd565b505050505050565b60006001600160a01b038216611ba2576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526008602052604090205467ffffffffffffffff1690565b611bd06122d7565b611bda6000612a39565b565b611be46122d7565b610f5b81612a8b565b611bf56122d7565b600e55565b611c026122d7565b801580611c0f5750806001145b611c535760405162461bcd60e51b815260206004820152601560248201527420b63637bb903634b9ba103a3cb8329032b93937b960591b60448201526064016110ae565b600d805460ff909216600160401b0268ff000000000000000019909216919091179055565b611c806122d7565b600d8054911515650100000000000265ff000000000019909216919091179055565b6000918252600b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060068054610f83906139dc565b611d067f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633611ca2565b611d4b5760405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba10309036b4b73a32b960511b60448201526064016110ae565b610f7082826127f3565b81611d5f8161248d565b823383611d6d838383612ada565b600d54600160381b900460ff1615611dc75760405162461bcd60e51b815260206004820152601f60248201527f736574417070726f76616c466f72416c6c2069732070726f686962697465640060448201526064016110ae565b611b718686612b07565b611dd96122d7565b600d805460ff191660ff92909216919091179055565b611df76122d7565b600d805461ffff9092166101000262ffff0019909216919091179055565b836001600160a01b0381163314611e2f57611e2f3361248d565b6110c185858585612b73565b6000611e456121d9565b6003015460ff16611e5857506001919050565b611e6182610f04565b80610f1b5750611e6f6121d9565b546001600160a01b031663f8350ed083611e876121d9565b600401546040518363ffffffff1660e01b8152600401611ebc9291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015611ed9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b9190613aba565b611f056122d7565b600d805491151563010000000263ff00000019909216919091179055565b6060611f2e82612458565b506011546001600160a01b031615611fb15760115460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd90602401600060405180830381865afa158015611f89573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1b9190810190613ad7565b505060408051602081019091526000815290565b6000828152600b6020526040902060010154611fe08161280d565b611415838361289d565b611ff26122d7565b600d80546affff000000000000000000191660ff92909216600160481b02919091179055565b6120206122d7565b600d8054911515600160301b0266ff00000000000019909216919091179055565b6120496122d7565b6001600160a01b0381166120ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016110ae565b610f5b81612a39565b6120bf6122d7565b600d8054911515600160381b0267ff0000000000000019909216919091179055565b6120e96122d7565b610f5b81612bb7565b60035460008290036121175760405163b562e8dd60e01b815260040160405180910390fd5b6121246000848385612c06565b6001600160a01b03831660008181526008602090815260408083208054680100000000000000018802019055848352600790915281206001851460e11b4260a01b17831790558284019083908390600080516020613c4b8339815191528180a4600183015b8181146121af5780836000600080516020613c4b833981519152600080a4600101612189565b50816000036121d057604051622e076360e81b815260040160405180910390fd5b60035550505050565b7f7182bc540a919506f5dbc9f55afae7cdd4ca476499f0017cee40bdc99f34a61d90565b6060600061220a83612c9a565b9392505050565b6001600160a01b0381166000908152600183016020526040812054151561220a565b60006001600160e01b0319821663152a902d60e11b1480610f1b57506301ffc9a760e01b6001600160e01b0319831614610f1b565b60006001600160e01b03198216637965db0b60e01b1480610f1b5750610f1b825b60006301ffc9a760e01b6001600160e01b0319831614806122ba57506380ac58cd60e01b6001600160e01b03198316145b80610f1b5750506001600160e01b031916635b5e139f60e01b1490565b6002546001600160a01b03163314611bda5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016110ae565b8061233a6121d9565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6127106001600160601b03821611156123c95760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084016110ae565b6001600160a01b03821661241f5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016110ae565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b60008160011115801561246c575060035482105b8015610f1b575050600090815260076020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b15610f5b57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156124fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251e9190613aba565b610f5b57604051633b79c77360e21b81526001600160a01b03821660048201526024016110ae565b6001600160a01b03821615610f705761255f8282612cf6565b610f7057604051630a9934af60e31b815260040160405180910390fd5b6000612587826116ba565b9050336001600160a01b038216146125c0576125a38133610e24565b6125c0576040516367d9dca160e11b815260040160405180910390fd5b60008281526009602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b806126256121d9565b60040155604051819033907f8962277f6a1fe666523bc8356e92ca0332d6cbbc6ac21edbbcbb5ceaa258536a90600090a350565b60006126648261292a565b9050836001600160a01b0316816001600160a01b0316146126975760405162a1148160e81b815260040160405180910390fd5b600082815260096020526040902080546126c38187335b6001600160a01b039081169116811491141790565b6126ee576126d18633610e24565b6126ee57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661271557604051633a954ecd60e21b815260040160405180910390fd5b6127228686866001612c06565b801561272d57600082555b6001600160a01b038681166000908152600860205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260076020526040812091909155600160e11b841690036127bf576001840160008181526007602052604081205490036127bd5760035481146127bd5760008181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b0316600080516020613c4b83398151915260405160405180910390a4611b71565b610f70828260405180602001604052806000815250612d01565b610f5b8133612d67565b6128218282611ca2565b610f70576000828152600b602090815260408083206001600160a01b03851684529091529020805460ff191660011790556128593390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6128a78282611ca2565b15610f70576000828152600b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b61141583838360405180602001604052806000815250611e15565b610f5b816000612dc0565b60008180600111612980576003548110156129805760008181526007602052604081205490600160e01b8216900361297e575b8060000361220a57506000190160008181526007602052604090205461295d565b505b604051636f96cda160e11b815260040160405180910390fd5b806129a26121d9565b600301805460ff191691151591909117905550565b6000826129c48584612f07565b14949350505050565b60045460035461138891839103600019016129e89190613a42565b1115612a2f5760405162461bcd60e51b81526020600482015260166024820152751b585e08139195081b1a5b5a5d08195e18d95959195960521b60448201526064016110ae565b610f7082826120f2565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612aa081612a976121d9565b60010190612f54565b506040516001600160a01b0382169033907f3b01c97343869ca2757fcc37cdb8f71683b0a7aed858e3755f4529a1db85729290600090a350565b801561141557612aea8383612cf6565b61141557604051630a9934af60e31b815260040160405180910390fd5b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612b7e848484611117565b6001600160a01b0383163b1561113c57612b9a84848484612f69565b61113c576040516368d2bf6b60e11b815260040160405180910390fd5b612bcc81612bc36121d9565b60010190613055565b506040516001600160a01b0382169033907fbd0af1fe0a2c1c7bb340c17a284a291138979c8eeb797e176dbd1c415199af3c90600090a350565b83838383612c168484848461306a565b600d54600160381b900460ff161580612c3657506001600160a01b038816155b80612c4b57506001600160a01b03871661dead145b612c905760405162461bcd60e51b81526020600482015260166024820152751d1c985b9cd9995c881a5cc81c1c9bda1a589a5d195960521b60448201526064016110ae565b5050505050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015612cea57602002820191906000526020600020905b815481526020019060010190808311612cd6575b50505050509050919050565b600061220a83611e3b565b612d0b83836129cd565b6001600160a01b0383163b15611415576003548281035b612d356000868380600101945086612f69565b612d52576040516368d2bf6b60e11b815260040160405180910390fd5b818110612d225781600354146110c157600080fd5b612d718282611ca2565b610f7057612d7e8161306f565b612d89836020613081565b604051602001612d9a929190613b4e565b60408051601f198184030181529082905262461bcd60e51b82526110ae916004016134d8565b6000612dcb8361292a565b905080600080612de986600090815260096020526040902080549091565b915091508415612e2957612dfe8184336126ae565b612e2957612e0c8333610e24565b612e2957604051632ce44b5f60e11b815260040160405180910390fd5b612e37836000886001612c06565b8015612e4257600082555b6001600160a01b038316600081815260086020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260076020526040812091909155600160e11b85169003612ed057600186016000818152600760205260408120549003612ece576003548114612ece5760008181526007602052604090208590555b505b60405186906000906001600160a01b03861690600080516020613c4b833981519152908390a4505060048054600101905550505050565b600081815b8451811015612f4c57612f3882868381518110612f2b57612f2b613a16565b602002602001015161321d565b915080612f4481613a55565b915050612f0c565b509392505050565b600061220a836001600160a01b03841661324c565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612f9e903390899088908890600401613bc3565b6020604051808303816000875af1925050508015612fd9575060408051601f3d908101601f19168201909252612fd691810190613c00565b60015b613037573d808015613007576040519150601f19603f3d011682016040523d82523d6000602084013e61300c565b606091505b50805160000361302f576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b600061220a836001600160a01b03841661333f565b61113c565b6060610f1b6001600160a01b03831660145b60606000613090836002613a6e565b61309b906002613a42565b67ffffffffffffffff8111156130b3576130b36135da565b6040519080825280601f01601f1916602001820160405280156130dd576020820181803683370190505b509050600360fc1b816000815181106130f8576130f8613a16565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061312757613127613a16565b60200101906001600160f81b031916908160001a905350600061314b846002613a6e565b613156906001613a42565b90505b60018111156131ce576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061318a5761318a613a16565b1a60f81b8282815181106131a0576131a0613a16565b60200101906001600160f81b031916908160001a90535060049490941c936131c781613c1d565b9050613159565b50831561220a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016110ae565b600081831061323957600082815260208490526040902061220a565b600083815260208390526040902061220a565b60008181526001830160205260408120548015613335576000613270600183613aa7565b855490915060009061328490600190613aa7565b90508181146132e95760008660000182815481106132a4576132a4613a16565b90600052602060002001549050808760000184815481106132c7576132c7613a16565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806132fa576132fa613c34565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610f1b565b6000915050610f1b565b600081815260018301602052604081205461338657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f1b565b506000610f1b565b6020808252825182820181905260009190848201906040850190845b818110156133cf5783516001600160a01b0316835292840192918401916001016133aa565b50909695505050505050565b80356001600160a01b03811681146133f257600080fd5b919050565b60006020828403121561340957600080fd5b61220a826133db565b6001600160e01b031981168114610f5b57600080fd5b60006020828403121561343a57600080fd5b813561220a81613412565b6000806040838503121561345857600080fd5b613461836133db565b915060208301356001600160601b038116811461347d57600080fd5b809150509250929050565b60005b838110156134a357818101518382015260200161348b565b50506000910152565b600081518084526134c4816020860160208601613488565b601f01601f19169290920160200192915050565b60208152600061220a60208301846134ac565b6000602082840312156134fd57600080fd5b5035919050565b6000806040838503121561351757600080fd5b613520836133db565b946020939093013593505050565b8015158114610f5b57600080fd5b60006020828403121561354e57600080fd5b813561220a8161352e565b60008060006060848603121561356e57600080fd5b613577846133db565b9250613585602085016133db565b9150604084013590509250925092565b60008083601f8401126135a757600080fd5b50813567ffffffffffffffff8111156135bf57600080fd5b6020830191508360208260051b85010111156113e957600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613619576136196135da565b604052919050565b600067ffffffffffffffff82111561363b5761363b6135da565b5060051b60200190565b600082601f83011261365657600080fd5b8135602061366b61366683613621565b6135f0565b82815260059290921b8401810191818101908684111561368a57600080fd5b8286015b848110156136a5578035835291830191830161368e565b509695505050505050565b6000806000604084860312156136c557600080fd5b833567ffffffffffffffff808211156136dd57600080fd5b6136e987838801613595565b9095509350602086013591508082111561370257600080fd5b5061370f86828701613645565b9150509250925092565b6000806040838503121561372c57600080fd5b50508035926020909101359150565b6000806040838503121561374e57600080fd5b8235915061375e602084016133db565b90509250929050565b60008060006060848603121561377c57600080fd5b8335925060208085013567ffffffffffffffff8082111561379c57600080fd5b818701915087601f8301126137b057600080fd5b81356137be61366682613621565b81815260059190911b8301840190848101908a8311156137dd57600080fd5b938501935b82851015613802576137f3856133db565b825293850193908501906137e2565b96505050604087013592508083111561381a57600080fd5b505061370f86828701613645565b60006020828403121561383a57600080fd5b813567ffffffffffffffff81111561385157600080fd5b61304d84828501613645565b60008060008060006080868803121561387557600080fd5b8535945060208601359350604086013567ffffffffffffffff81111561389a57600080fd5b6138a688828901613595565b96999598509660600135949350505050565b600080604083850312156138cb57600080fd5b6138d4836133db565b9150602083013561347d8161352e565b600067ffffffffffffffff8211156138fe576138fe6135da565b50601f01601f191660200190565b6000806000806080858703121561392257600080fd5b61392b856133db565b9350613939602086016133db565b925060408501359150606085013567ffffffffffffffff81111561395c57600080fd5b8501601f8101871361396d57600080fd5b803561397b613666826138e4565b81815288602083850101111561399057600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080604083850312156139c557600080fd5b6139ce836133db565b915061375e602084016133db565b600181811c908216806139f057607f821691505b602082108103613a1057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610f1b57610f1b613a2c565b600060018201613a6757613a67613a2c565b5060010190565b8082028115828204841417610f1b57610f1b613a2c565b600082613aa257634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115610f1b57610f1b613a2c565b600060208284031215613acc57600080fd5b815161220a8161352e565b600060208284031215613ae957600080fd5b815167ffffffffffffffff811115613b0057600080fd5b8201601f81018413613b1157600080fd5b8051613b1f613666826138e4565b818152856020838501011115613b3457600080fd5b613b45826020830160208601613488565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613b86816017850160208801613488565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613bb7816028840160208801613488565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613bf6908301846134ac565b9695505050505050565b600060208284031215613c1257600080fd5b815161220a81613412565b600081613c2c57613c2c613a2c565b506000190190565b634e487b7160e01b600052603160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220203856e639cd28a21419666ba204b33d1d1204460ad5452dc42141996383ec3d64736f6c63430008110033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
Deployed Bytecode
0x6080604052600436106104505760003560e01c80636352211e1161023f578063a72193b611610139578063d5391393116100b6578063e985e9c51161007a578063e985e9c514610e09578063f2fde38b14610e52578063f48824db14610e72578063fcd1aac914610eaa578063ff76821214610eca57600080fd5b8063d539139314610d5f578063d547741f14610d93578063d5abeb0114610db3578063d728312a14610dc9578063e39e026914610de957600080fd5b8063bbb89744116100fd578063bbb8974414610c93578063bedb86fb14610cad578063c84c038714610ccd578063c87b56dd14610cef578063d04f32d214610d0f57600080fd5b8063a72193b614610bed578063a9e2acd514610c20578063b5f94d0614610c40578063b88d4fde14610c60578063babcc53914610c7357600080fd5b80637ee3b2ac116101c757806395d89b411161018b57806395d89b4114610b6d5780639659867e14610b8257806399f9889814610ba5578063a217fddf14610bb8578063a22cb46514610bcd57600080fd5b80637ee3b2ac14610acf578063877984cb14610aef5780638da5cb5b14610b0f5780638e73cf0014610b2d57806391d1485414610b4d57600080fd5b806370a082311161020e57806370a0823114610a27578063715018a614610a4757806372b44d7114610a5c57806373ef64fd14610a7c5780637cb6475914610aaf57600080fd5b80636352211e146109b2578063669ee234146109d2578063674c02aa146109f25780636b1a2b7f14610a1457600080fd5b8063279a669e116103505780633cf40df3116102d8578063499a15d41161029c578063499a15d4146109045780634e6bf2041461093c5780634f3db3461461095c5780635978c012146109715780635c975abb1461099157600080fd5b80633cf40df31461083e57806341f434341461085f57806342842e0e1461088157806344a0d68a1461089457806347705cbc146108b457600080fd5b80632f2ff15d1161031f5780632f2ff15d1461079e5780633511cd54146107be57806336568abe14610801578063396e8f53146108215780633ccfd60b1461083657600080fd5b8063279a669e146106f5578063282c51f3146107155780632a55205a146107495780632eb4a7ab1461078857600080fd5b806309849233116103de57806318160ddd116103a257806318160ddd146106415780631e0fbfa21461065e57806323b872dd1461069257806323c03085146106a5578063248a9ca3146106c557600080fd5b806309849233146105a05780630f4345e2146105b557806313faede6146105d55780631581b600146105f957806317dc10c41461062157600080fd5b8063025e332e11610425578063025e332e146104f157806304634d8d1461051357806306fdde0314610533578063081812fc14610555578063095ea7b31461058d57600080fd5b80623f332f1461045557806285bb6f14610480578063018d9b50146104b157806301ffc9a7146104d1575b600080fd5b34801561046157600080fd5b5061046a610eea565b604051610477919061338e565b60405180910390f35b34801561048c57600080fd5b50600d546104a190600160301b900460ff1681565b6040519015158152602001610477565b3480156104bd57600080fd5b506104a16104cc3660046133f7565b610f04565b3480156104dd57600080fd5b506104a16104ec366004613428565b610f21565b3480156104fd57600080fd5b5061051161050c3660046133f7565b610f4a565b005b34801561051f57600080fd5b5061051161052e366004613445565b610f5e565b34801561053f57600080fd5b50610548610f74565b60405161047791906134d8565b34801561056157600080fd5b506105756105703660046134eb565b611006565b6040516001600160a01b039091168152602001610477565b61051161059b366004613504565b61104a565b3480156105ac57600080fd5b506104a16110c8565b3480156105c157600080fd5b506105116105d03660046134eb565b6110de565b3480156105e157600080fd5b506105eb600c5481565b604051908152602001610477565b34801561060557600080fd5b5061057573ddf110763ebc75419a39150821c46a58ddd2d66781565b34801561062d57600080fd5b5061051161063c36600461353c565b6110ef565b34801561064d57600080fd5b5060045460035403600019016105eb565b34801561066a57600080fd5b506105eb7f3a2f235c9daaf33349d300aadff2f15078a89df81bcfdd45ba11c8f816bddc6f81565b6105116106a0366004613559565b611117565b3480156106b157600080fd5b506105116106c03660046133f7565b611142565b3480156106d157600080fd5b506105eb6106e03660046134eb565b6000908152600b602052604090206001015490565b34801561070157600080fd5b506105116107103660046136b0565b61116c565b34801561072157600080fd5b506105eb7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b34801561075557600080fd5b50610769610764366004613719565b611342565b604080516001600160a01b039093168352602083019190915201610477565b34801561079457600080fd5b506105eb600e5481565b3480156107aa57600080fd5b506105116107b936600461373b565b6113f0565b3480156107ca57600080fd5b506105eb6107d936600461373b565b6000918252600f602090815260408084206001600160a01b0393909316845291905290205490565b34801561080d57600080fd5b5061051161081c36600461373b565b61141a565b34801561082d57600080fd5b50610575611494565b6105116114ad565b34801561084a57600080fd5b50600d546104a190600160381b900460ff1681565b34801561086b57600080fd5b506105756daaeb6d7670e522a718067333cd4e81565b61051161088f366004613559565b61151e565b3480156108a057600080fd5b506105116108af3660046134eb565b611543565b3480156108c057600080fd5b506105eb6108cf3660046133f7565b600d5461ffff600160481b909104166000908152600f602090815260408083206001600160a01b039094168352929052205490565b34801561091057600080fd5b506105eb61091f36600461373b565b601060209081526000928352604080842090915290825290205481565b34801561094857600080fd5b50610511610957366004613767565b611550565b34801561096857600080fd5b506105eb6115f2565b34801561097d57600080fd5b5061051161098c366004613828565b611605565b34801561099d57600080fd5b50600d546104a1906301000000900460ff1681565b3480156109be57600080fd5b506105756109cd3660046134eb565b6116ba565b3480156109de57600080fd5b506105116109ed36600461353c565b6116c5565b3480156109fe57600080fd5b50600d546104a190640100000000900460ff1681565b610511610a2236600461385d565b6116d6565b348015610a3357600080fd5b506105eb610a423660046133f7565b611b79565b348015610a5357600080fd5b50610511611bc8565b348015610a6857600080fd5b50610511610a773660046133f7565b611bdc565b348015610a8857600080fd5b50600d54610a9c90610100900461ffff1681565b60405161ffff9091168152602001610477565b348015610abb57600080fd5b50610511610aca3660046134eb565b611bed565b348015610adb57600080fd5b50610511610aea3660046134eb565b611bfa565b348015610afb57600080fd5b50601154610575906001600160a01b031681565b348015610b1b57600080fd5b506002546001600160a01b0316610575565b348015610b3957600080fd5b50610511610b4836600461353c565b611c78565b348015610b5957600080fd5b506104a1610b6836600461373b565b611ca2565b348015610b7957600080fd5b50610548611ccd565b348015610b8e57600080fd5b50600d546104a19065010000000000900460ff1681565b610511610bb3366004613504565b611cdc565b348015610bc457600080fd5b506105eb600081565b348015610bd957600080fd5b50610511610be83660046138b8565b611d55565b348015610bf957600080fd5b50600d54610c0e90600160401b900460ff1681565b60405160ff9091168152602001610477565b348015610c2c57600080fd5b50610511610c3b3660046134eb565b611dd1565b348015610c4c57600080fd5b50610511610c5b3660046134eb565b611def565b610511610c6e36600461390c565b611e15565b348015610c7f57600080fd5b506104a1610c8e3660046133f7565b611e3b565b348015610c9f57600080fd5b50600d54610c0e9060ff1681565b348015610cb957600080fd5b50610511610cc836600461353c565b611efd565b348015610cd957600080fd5b50600d54610a9c90600160481b900461ffff1681565b348015610cfb57600080fd5b50610548610d0a3660046134eb565b611f23565b348015610d1b57600080fd5b506105eb610d2a3660046133f7565b600d5461ffff600160481b9091041660009081526010602090815260408083206001600160a01b039094168352929052205490565b348015610d6b57600080fd5b506105eb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b348015610d9f57600080fd5b50610511610dae36600461373b565b611fc5565b348015610dbf57600080fd5b506105eb61138881565b348015610dd557600080fd5b50610511610de43660046134eb565b611fea565b348015610df557600080fd5b50610511610e0436600461353c565b612018565b348015610e1557600080fd5b506104a1610e243660046139b2565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205460ff1690565b348015610e5e57600080fd5b50610511610e6d3660046133f7565b612041565b348015610e7e57600080fd5b506105eb610e8d36600461373b565b600f60209081526000928352604080842090915290825290205481565b348015610eb657600080fd5b50610511610ec536600461353c565b6120b7565b348015610ed657600080fd5b50610511610ee53660046133f7565b6120e1565b6060610eff610ef76121d9565b6001016121fd565b905090565b6000610f1b82610f126121d9565b60010190612211565b92915050565b6000610f2c82612233565b80610f3b5750610f3b82612268565b80610f1b5750610f1b82612289565b610f526122d7565b610f5b81612331565b50565b610f666122d7565b610f70828261235b565b5050565b606060058054610f83906139dc565b80601f0160208091040260200160405190810160405280929190818152602001828054610faf906139dc565b8015610ffc5780601f10610fd157610100808354040283529160200191610ffc565b820191906000526020600020905b815481529060010190602001808311610fdf57829003601f168201915b5050505050905090565b600061101182612458565b61102e576040516333d1c03960e21b815260040160405180910390fd5b506000908152600960205260409020546001600160a01b031690565b816110548161248d565b82826110608282612546565b600d54600160381b900460ff16156110b75760405162461bcd60e51b8152602060048201526015602482015274185c1c1c9bdd99481a5cc81c1c9bda1a589a5d1959605a1b60448201526064015b60405180910390fd5b6110c1858561257c565b5050505050565b60006110d26121d9565b6003015460ff16919050565b6110e66122d7565b610f5b8161261c565b6110f76122d7565b600d80549115156401000000000264ff0000000019909216919091179055565b826001600160a01b0381163314611131576111313361248d565b61113c848484612659565b50505050565b61114a6122d7565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6111967f3a2f235c9daaf33349d300aadff2f15078a89df81bcfdd45ba11c8f816bddc6f33611ca2565b6111e25760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f742061206169722064726f70706572000000000060448201526064016110ae565b6000805b82518110156112285782818151811061120157611201613a16565b6020026020010151826112149190613a42565b91508061122081613a55565b9150506111e6565b50806000106112795760405162461bcd60e51b815260206004820152601b60248201527f6e65656420746f206d696e74206174206c656173742031204e4654000000000060448201526064016110ae565b60045460035461138891839103600019016112949190613a42565b11156112db5760405162461bcd60e51b81526020600482015260166024820152751b585e08139195081b1a5b5a5d08195e18d95959195960521b60448201526064016110ae565b60005b82518110156110c1576113308585838181106112fc576112fc613a16565b905060200201602081019061131191906133f7565b84838151811061132357611323613a16565b60200260200101516127f3565b8061133a81613a55565b9150506112de565b60008281526001602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916113b75750604080518082019091526000546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906113d6906001600160601b031687613a6e565b6113e09190613a85565b91519350909150505b9250929050565b6000828152600b602052604090206001015461140b8161280d565b6114158383612817565b505050565b6001600160a01b038116331461148a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016110ae565b610f70828261289d565b600061149e6121d9565b546001600160a01b0316919050565b6114b56122d7565b60405160009073ddf110763ebc75419a39150821c46a58ddd2d6679047908381818185875af1925050503d806000811461150b576040519150601f19603f3d011682016040523d82523d6000602084013e611510565b606091505b5050905080610f5b57600080fd5b826001600160a01b0381163314611538576115383361248d565b61113c848484612904565b61154b6122d7565b600c55565b6115586122d7565b805182511461156657600080fd5b60005b825181101561113c5781818151811061158457611584613a16565b60200260200101516010600086815260200190815260200160002060008584815181106115b3576115b3613a16565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080806115ea90613a55565b915050611569565b60006115fc6121d9565b60040154905090565b61162f7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833611ca2565b6116745760405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba103090313ab93732b960511b60448201526064016110ae565b60005b8151811015610f7057600082828151811061169457611694613a16565b602002602001015190506116a78161291f565b50806116b281613a55565b915050611677565b6000610f1b8261292a565b6116cd6122d7565b610f5b81612999565b3233146117255760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163742e0060448201526064016110ae565b600d546301000000900460ff16156117785760405162461bcd60e51b81526020600482015260166024820152751d1a194818dbdb9d1c9858dd081a5cc81c185d5cd95960521b60448201526064016110ae565b600d5460ff168511156117d95760405162461bcd60e51b8152602060048201526024808201527f6d6178206d696e7420616d6f756e74207065722073657373696f6e20657863656044820152631959195960e21b60648201526084016110ae565b3485600c546117e89190613a6e565b111561182b5760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b60448201526064016110ae565b600d54600090640100000000900460ff1615156001036119dc57600d54600160401b900460ff16600003611929576040516bffffffffffffffffffffffff193360601b166020820152603481018690526000906054016040516020818303038152906040528051906020012090506118da85858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600e5491508490506129b7565b6119205760405162461bcd60e51b81526020600482015260176024820152761d5cd95c881a5cc81b9bdd08185b1b1bdddb1a5cdd1959604a1b60448201526064016110ae565b859150506119ea565b600d54600160401b900460ff166001036119d757600d54600160481b900461ffff16600090815260106020908152604080832033845290915281205490036119ad5760405162461bcd60e51b81526020600482015260176024820152761d5cd95c881a5cc81b9bdd08185b1b1bdddb1a5cdd1959604a1b60448201526064016110ae565b50600d54600160481b900461ffff1660009081526010602090815260408083203384529091529020545b6119ea565b50600d54610100900461ffff165b600d5465010000000000900460ff161515600103611ac057600d54600160481b900461ffff166000908152600f60209081526040808320338452909152902054611a349082613aa7565b861115611a835760405162461bcd60e51b815260206004820152601c60248201527f6d6178204e46542070657220616464726573732065786365656465640000000060448201526064016110ae565b600d54600160481b900461ffff166000908152600f6020908152604080832033845290915281208054889290611aba908490613a42565b90915550505b600d54600160301b900460ff161515600103611b675785600114611b005760405162461bcd60e51b815260206004820152600060248201526044016110ae565b611b09826116ba565b6001600160a01b0316336001600160a01b031614611b5e5760405162461bcd60e51b815260206004820152601260248201527113dddb995c881a5cc8191a5999995c995b9d60721b60448201526064016110ae565b611b678261291f565b611b7133876129cd565b505050505050565b60006001600160a01b038216611ba2576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526008602052604090205467ffffffffffffffff1690565b611bd06122d7565b611bda6000612a39565b565b611be46122d7565b610f5b81612a8b565b611bf56122d7565b600e55565b611c026122d7565b801580611c0f5750806001145b611c535760405162461bcd60e51b815260206004820152601560248201527420b63637bb903634b9ba103a3cb8329032b93937b960591b60448201526064016110ae565b600d805460ff909216600160401b0268ff000000000000000019909216919091179055565b611c806122d7565b600d8054911515650100000000000265ff000000000019909216919091179055565b6000918252600b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060068054610f83906139dc565b611d067f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633611ca2565b611d4b5760405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba10309036b4b73a32b960511b60448201526064016110ae565b610f7082826127f3565b81611d5f8161248d565b823383611d6d838383612ada565b600d54600160381b900460ff1615611dc75760405162461bcd60e51b815260206004820152601f60248201527f736574417070726f76616c466f72416c6c2069732070726f686962697465640060448201526064016110ae565b611b718686612b07565b611dd96122d7565b600d805460ff191660ff92909216919091179055565b611df76122d7565b600d805461ffff9092166101000262ffff0019909216919091179055565b836001600160a01b0381163314611e2f57611e2f3361248d565b6110c185858585612b73565b6000611e456121d9565b6003015460ff16611e5857506001919050565b611e6182610f04565b80610f1b5750611e6f6121d9565b546001600160a01b031663f8350ed083611e876121d9565b600401546040518363ffffffff1660e01b8152600401611ebc9291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015611ed9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b9190613aba565b611f056122d7565b600d805491151563010000000263ff00000019909216919091179055565b6060611f2e82612458565b506011546001600160a01b031615611fb15760115460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd90602401600060405180830381865afa158015611f89573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1b9190810190613ad7565b505060408051602081019091526000815290565b6000828152600b6020526040902060010154611fe08161280d565b611415838361289d565b611ff26122d7565b600d80546affff000000000000000000191660ff92909216600160481b02919091179055565b6120206122d7565b600d8054911515600160301b0266ff00000000000019909216919091179055565b6120496122d7565b6001600160a01b0381166120ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016110ae565b610f5b81612a39565b6120bf6122d7565b600d8054911515600160381b0267ff0000000000000019909216919091179055565b6120e96122d7565b610f5b81612bb7565b60035460008290036121175760405163b562e8dd60e01b815260040160405180910390fd5b6121246000848385612c06565b6001600160a01b03831660008181526008602090815260408083208054680100000000000000018802019055848352600790915281206001851460e11b4260a01b17831790558284019083908390600080516020613c4b8339815191528180a4600183015b8181146121af5780836000600080516020613c4b833981519152600080a4600101612189565b50816000036121d057604051622e076360e81b815260040160405180910390fd5b60035550505050565b7f7182bc540a919506f5dbc9f55afae7cdd4ca476499f0017cee40bdc99f34a61d90565b6060600061220a83612c9a565b9392505050565b6001600160a01b0381166000908152600183016020526040812054151561220a565b60006001600160e01b0319821663152a902d60e11b1480610f1b57506301ffc9a760e01b6001600160e01b0319831614610f1b565b60006001600160e01b03198216637965db0b60e01b1480610f1b5750610f1b825b60006301ffc9a760e01b6001600160e01b0319831614806122ba57506380ac58cd60e01b6001600160e01b03198316145b80610f1b5750506001600160e01b031916635b5e139f60e01b1490565b6002546001600160a01b03163314611bda5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016110ae565b8061233a6121d9565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6127106001600160601b03821611156123c95760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084016110ae565b6001600160a01b03821661241f5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016110ae565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b60008160011115801561246c575060035482105b8015610f1b575050600090815260076020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b15610f5b57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156124fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251e9190613aba565b610f5b57604051633b79c77360e21b81526001600160a01b03821660048201526024016110ae565b6001600160a01b03821615610f705761255f8282612cf6565b610f7057604051630a9934af60e31b815260040160405180910390fd5b6000612587826116ba565b9050336001600160a01b038216146125c0576125a38133610e24565b6125c0576040516367d9dca160e11b815260040160405180910390fd5b60008281526009602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b806126256121d9565b60040155604051819033907f8962277f6a1fe666523bc8356e92ca0332d6cbbc6ac21edbbcbb5ceaa258536a90600090a350565b60006126648261292a565b9050836001600160a01b0316816001600160a01b0316146126975760405162a1148160e81b815260040160405180910390fd5b600082815260096020526040902080546126c38187335b6001600160a01b039081169116811491141790565b6126ee576126d18633610e24565b6126ee57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661271557604051633a954ecd60e21b815260040160405180910390fd5b6127228686866001612c06565b801561272d57600082555b6001600160a01b038681166000908152600860205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260076020526040812091909155600160e11b841690036127bf576001840160008181526007602052604081205490036127bd5760035481146127bd5760008181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b0316600080516020613c4b83398151915260405160405180910390a4611b71565b610f70828260405180602001604052806000815250612d01565b610f5b8133612d67565b6128218282611ca2565b610f70576000828152600b602090815260408083206001600160a01b03851684529091529020805460ff191660011790556128593390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6128a78282611ca2565b15610f70576000828152600b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b61141583838360405180602001604052806000815250611e15565b610f5b816000612dc0565b60008180600111612980576003548110156129805760008181526007602052604081205490600160e01b8216900361297e575b8060000361220a57506000190160008181526007602052604090205461295d565b505b604051636f96cda160e11b815260040160405180910390fd5b806129a26121d9565b600301805460ff191691151591909117905550565b6000826129c48584612f07565b14949350505050565b60045460035461138891839103600019016129e89190613a42565b1115612a2f5760405162461bcd60e51b81526020600482015260166024820152751b585e08139195081b1a5b5a5d08195e18d95959195960521b60448201526064016110ae565b610f7082826120f2565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612aa081612a976121d9565b60010190612f54565b506040516001600160a01b0382169033907f3b01c97343869ca2757fcc37cdb8f71683b0a7aed858e3755f4529a1db85729290600090a350565b801561141557612aea8383612cf6565b61141557604051630a9934af60e31b815260040160405180910390fd5b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612b7e848484611117565b6001600160a01b0383163b1561113c57612b9a84848484612f69565b61113c576040516368d2bf6b60e11b815260040160405180910390fd5b612bcc81612bc36121d9565b60010190613055565b506040516001600160a01b0382169033907fbd0af1fe0a2c1c7bb340c17a284a291138979c8eeb797e176dbd1c415199af3c90600090a350565b83838383612c168484848461306a565b600d54600160381b900460ff161580612c3657506001600160a01b038816155b80612c4b57506001600160a01b03871661dead145b612c905760405162461bcd60e51b81526020600482015260166024820152751d1c985b9cd9995c881a5cc81c1c9bda1a589a5d195960521b60448201526064016110ae565b5050505050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015612cea57602002820191906000526020600020905b815481526020019060010190808311612cd6575b50505050509050919050565b600061220a83611e3b565b612d0b83836129cd565b6001600160a01b0383163b15611415576003548281035b612d356000868380600101945086612f69565b612d52576040516368d2bf6b60e11b815260040160405180910390fd5b818110612d225781600354146110c157600080fd5b612d718282611ca2565b610f7057612d7e8161306f565b612d89836020613081565b604051602001612d9a929190613b4e565b60408051601f198184030181529082905262461bcd60e51b82526110ae916004016134d8565b6000612dcb8361292a565b905080600080612de986600090815260096020526040902080549091565b915091508415612e2957612dfe8184336126ae565b612e2957612e0c8333610e24565b612e2957604051632ce44b5f60e11b815260040160405180910390fd5b612e37836000886001612c06565b8015612e4257600082555b6001600160a01b038316600081815260086020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260076020526040812091909155600160e11b85169003612ed057600186016000818152600760205260408120549003612ece576003548114612ece5760008181526007602052604090208590555b505b60405186906000906001600160a01b03861690600080516020613c4b833981519152908390a4505060048054600101905550505050565b600081815b8451811015612f4c57612f3882868381518110612f2b57612f2b613a16565b602002602001015161321d565b915080612f4481613a55565b915050612f0c565b509392505050565b600061220a836001600160a01b03841661324c565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612f9e903390899088908890600401613bc3565b6020604051808303816000875af1925050508015612fd9575060408051601f3d908101601f19168201909252612fd691810190613c00565b60015b613037573d808015613007576040519150601f19603f3d011682016040523d82523d6000602084013e61300c565b606091505b50805160000361302f576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b600061220a836001600160a01b03841661333f565b61113c565b6060610f1b6001600160a01b03831660145b60606000613090836002613a6e565b61309b906002613a42565b67ffffffffffffffff8111156130b3576130b36135da565b6040519080825280601f01601f1916602001820160405280156130dd576020820181803683370190505b509050600360fc1b816000815181106130f8576130f8613a16565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061312757613127613a16565b60200101906001600160f81b031916908160001a905350600061314b846002613a6e565b613156906001613a42565b90505b60018111156131ce576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061318a5761318a613a16565b1a60f81b8282815181106131a0576131a0613a16565b60200101906001600160f81b031916908160001a90535060049490941c936131c781613c1d565b9050613159565b50831561220a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016110ae565b600081831061323957600082815260208490526040902061220a565b600083815260208390526040902061220a565b60008181526001830160205260408120548015613335576000613270600183613aa7565b855490915060009061328490600190613aa7565b90508181146132e95760008660000182815481106132a4576132a4613a16565b90600052602060002001549050808760000184815481106132c7576132c7613a16565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806132fa576132fa613c34565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610f1b565b6000915050610f1b565b600081815260018301602052604081205461338657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f1b565b506000610f1b565b6020808252825182820181905260009190848201906040850190845b818110156133cf5783516001600160a01b0316835292840192918401916001016133aa565b50909695505050505050565b80356001600160a01b03811681146133f257600080fd5b919050565b60006020828403121561340957600080fd5b61220a826133db565b6001600160e01b031981168114610f5b57600080fd5b60006020828403121561343a57600080fd5b813561220a81613412565b6000806040838503121561345857600080fd5b613461836133db565b915060208301356001600160601b038116811461347d57600080fd5b809150509250929050565b60005b838110156134a357818101518382015260200161348b565b50506000910152565b600081518084526134c4816020860160208601613488565b601f01601f19169290920160200192915050565b60208152600061220a60208301846134ac565b6000602082840312156134fd57600080fd5b5035919050565b6000806040838503121561351757600080fd5b613520836133db565b946020939093013593505050565b8015158114610f5b57600080fd5b60006020828403121561354e57600080fd5b813561220a8161352e565b60008060006060848603121561356e57600080fd5b613577846133db565b9250613585602085016133db565b9150604084013590509250925092565b60008083601f8401126135a757600080fd5b50813567ffffffffffffffff8111156135bf57600080fd5b6020830191508360208260051b85010111156113e957600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613619576136196135da565b604052919050565b600067ffffffffffffffff82111561363b5761363b6135da565b5060051b60200190565b600082601f83011261365657600080fd5b8135602061366b61366683613621565b6135f0565b82815260059290921b8401810191818101908684111561368a57600080fd5b8286015b848110156136a5578035835291830191830161368e565b509695505050505050565b6000806000604084860312156136c557600080fd5b833567ffffffffffffffff808211156136dd57600080fd5b6136e987838801613595565b9095509350602086013591508082111561370257600080fd5b5061370f86828701613645565b9150509250925092565b6000806040838503121561372c57600080fd5b50508035926020909101359150565b6000806040838503121561374e57600080fd5b8235915061375e602084016133db565b90509250929050565b60008060006060848603121561377c57600080fd5b8335925060208085013567ffffffffffffffff8082111561379c57600080fd5b818701915087601f8301126137b057600080fd5b81356137be61366682613621565b81815260059190911b8301840190848101908a8311156137dd57600080fd5b938501935b82851015613802576137f3856133db565b825293850193908501906137e2565b96505050604087013592508083111561381a57600080fd5b505061370f86828701613645565b60006020828403121561383a57600080fd5b813567ffffffffffffffff81111561385157600080fd5b61304d84828501613645565b60008060008060006080868803121561387557600080fd5b8535945060208601359350604086013567ffffffffffffffff81111561389a57600080fd5b6138a688828901613595565b96999598509660600135949350505050565b600080604083850312156138cb57600080fd5b6138d4836133db565b9150602083013561347d8161352e565b600067ffffffffffffffff8211156138fe576138fe6135da565b50601f01601f191660200190565b6000806000806080858703121561392257600080fd5b61392b856133db565b9350613939602086016133db565b925060408501359150606085013567ffffffffffffffff81111561395c57600080fd5b8501601f8101871361396d57600080fd5b803561397b613666826138e4565b81815288602083850101111561399057600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080604083850312156139c557600080fd5b6139ce836133db565b915061375e602084016133db565b600181811c908216806139f057607f821691505b602082108103613a1057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610f1b57610f1b613a2c565b600060018201613a6757613a67613a2c565b5060010190565b8082028115828204841417610f1b57610f1b613a2c565b600082613aa257634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115610f1b57610f1b613a2c565b600060208284031215613acc57600080fd5b815161220a8161352e565b600060208284031215613ae957600080fd5b815167ffffffffffffffff811115613b0057600080fd5b8201601f81018413613b1157600080fd5b8051613b1f613666826138e4565b818152856020838501011115613b3457600080fd5b613b45826020830160208601613488565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613b86816017850160208801613488565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613bb7816028840160208801613488565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613bf6908301846134ac565b9695505050505050565b600060208284031215613c1257600080fd5b815161220a81613412565b600081613c2c57613c2c613a2c565b506000190190565b634e487b7160e01b600052603160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220203856e639cd28a21419666ba204b33d1d1204460ad5452dc42141996383ec3d64736f6c63430008110033
Loading...
Loading
Loading...
Loading
[ 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.