Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 15498589 | 758 days ago | IN | 0 ETH | 0.21669696 |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
CedarERC721Drop
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.7; // ========== External imports ========== import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/structs/BitMapsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; // ========== Internal imports ========== import "./interfaces/IThirdwebContract.sol"; // ========== Features ========== import "./interfaces/IPlatformFee.sol"; import "./interfaces/IPrimarySale.sol"; import "./interfaces/IOwnable.sol"; import "./openzeppelin-presets/metatx/ERC2771ContextUpgradeable.sol"; import "../generated/impl/BaseCedarERC721DropV3.sol"; import "./lib/FeeType.sol"; import "./lib/MerkleProof.sol"; import "../SignatureVerifier.sol"; import "../Agreement.sol"; import "../Greenlist.sol"; import "./errors/IErrors.sol"; import "./types/DataTypes.sol"; import "./lib/CedarDropERC721ClaimLogicV0.sol"; // ========== Cedar Features ========== contract CedarERC721Drop is Initializable, IThirdwebContract, IOwnable, IPrimarySale, ReentrancyGuardUpgradeable, ERC2771ContextUpgradeable, MulticallUpgradeable, AccessControlEnumerableUpgradeable, ERC721EnumerableUpgradeable, Agreement, Greenlist, IPlatformFee, BaseCedarERC721DropV3 { using BitMapsUpgradeable for BitMapsUpgradeable.BitMap; using StringsUpgradeable for uint256; using CedarDropERC721ClaimLogicV0 for DataTypes.ClaimData; /// @dev Emitted when the global max supply of tokens is updated. event MaxTotalSupplyUpdated(uint256 maxTotalSupply); /// @dev Emitted when the wallet claim count for an address is updated. event WalletClaimCountUpdated(address indexed wallet, uint256 count); /// @dev Emitted when the global max wallet claim count is updated. event MaxWalletClaimCountUpdated(uint256 count); /*/////////////////////////////////////////////////////////////// State variables //////////////////////////////////////////////////////////////*/ bytes32 private constant MODULE_TYPE = bytes32("DropERC721"); uint256 private constant VERSION = 2; /// @dev Only transfers to or from TRANSFER_ROLE holders are valid, when transfers are restricted. bytes32 private constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE"); /// @dev Only MINTER_ROLE holders can lazy mint NFTs. bytes32 private constant MINTER_ROLE = keccak256("MINTER_ROLE"); /// @dev Max bps in the thirdweb system. uint256 private constant MAX_BPS = 10_000; /// @dev Owner of the contract (purpose: OpenSea compatibility) address private _owner; /// @dev The (default) address that receives all royalty value. address private royaltyRecipient; /// @dev The (default) % of a sale to take as royalty (in basis points). uint16 private royaltyBps; /// @dev Contract level metadata. string public override(ICedarMetadataV0, IThirdwebContract) contractURI; /// @dev Largest tokenId of each batch of tokens with the same baseURI uint256[] public baseURIIndices; /// @dev The address that receives all platform fees from all sales. address private platformFeeRecipient; /// @dev The % of primary sales collected as platform fees. uint16 private platformFeeBps; DataTypes.ClaimData claimData; /*/////////////////////////////////////////////////////////////// Mappings //////////////////////////////////////////////////////////////*/ /** * @dev Mapping from 'Largest tokenId of a batch of tokens with the same baseURI' * to base URI for the respective batch of tokens. **/ mapping(uint256 => string) private baseURI; /// @dev Token ID => royalty recipient and bps for token mapping(uint256 => RoyaltyInfo) private royaltyInfoForToken; struct FeaturesInput { string userAgreement; address signatureVerifier; address greenlistManagerAddress; } /*/////////////////////////////////////////////////////////////// Constructor + initializer logic //////////////////////////////////////////////////////////////*/ constructor() {} /// @dev Initiliazes the contract, like a constructor. function initialize( address _defaultAdmin, string memory _name, string memory _symbol, string memory _contractURI, address[] memory _trustedForwarders, address _saleRecipient, address _royaltyRecipient, uint128 _royaltyBps, FeaturesInput memory featuresInput, uint128 _platformFeeBps, address _platformFeeRecipient ) external initializer { // Initialize inherited contracts, most base-like -> most derived. __ReentrancyGuard_init(); __ERC2771Context_init(_trustedForwarders); __ERC721_init(_name, _symbol); __Agreement_init(featuresInput.userAgreement, featuresInput.signatureVerifier); __Greenlist_init(featuresInput.greenlistManagerAddress); // Initialize this contract's state. royaltyRecipient = _royaltyRecipient; royaltyBps = uint16(_royaltyBps); claimData.primarySaleRecipient = _saleRecipient; contractURI = _contractURI; _owner = _defaultAdmin; claimData.platformFeeRecipient = _platformFeeRecipient; claimData.platformFeeBps = uint16(_platformFeeBps); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setupRole(MINTER_ROLE, _defaultAdmin); _setupRole(TRANSFER_ROLE, _defaultAdmin); _setupRole(TRANSFER_ROLE, address(0)); } /*/////////////////////////////////////////////////////////////// Generic contract logic //////////////////////////////////////////////////////////////*/ /// @dev Returns the type of the contract. function contractType() external pure override returns (bytes32) { return MODULE_TYPE; } /// @dev Returns the version of the contract. function contractVersion() external pure override returns (uint8) { return uint8(VERSION); } /** * @dev Returns the address of the current owner. */ function owner() public view override returns (address) { return hasRole(DEFAULT_ADMIN_ROLE, _owner) ? _owner : address(0); } /*/////////////////////////////////////////////////////////////// ERC 165 / 721 / 2981 logic //////////////////////////////////////////////////////////////*/ /// @dev Returns the URI for a given tokenId. function tokenURI(uint256 _tokenId) public view override(ERC721Upgradeable, ICedarNFTMetadataV1) returns (string memory) { for (uint256 i = 0; i < baseURIIndices.length; i += 1) { if (_tokenId < baseURIIndices[i]) { return string(abi.encodePacked(baseURI[baseURIIndices[i]], _tokenId.toString())); } } return ""; } /// @dev Returns the royalty recipient and amount, given a tokenId and sale price. function royaltyInfo(uint256 tokenId, uint256 salePrice) external view virtual override returns (address receiver, uint256 royaltyAmount) { (address recipient, uint256 bps) = getRoyaltyInfoForToken(tokenId); receiver = recipient; royaltyAmount = (salePrice * bps) / MAX_BPS; } /*/////////////////////////////////////////////////////////////// Minting logic //////////////////////////////////////////////////////////////*/ /** * @dev Lets an account with `MINTER_ROLE` lazy mint 'n' NFTs. * The URIs for each token is the provided `_baseURIForTokens` + `{tokenId}`. */ function lazyMint( uint256 _amount, string calldata _baseURIForTokens ) external override onlyRole(MINTER_ROLE) { uint256 startId = claimData.nextTokenIdToMint; uint256 baseURIIndex = startId + _amount; claimData.nextTokenIdToMint = baseURIIndex; baseURI[baseURIIndex] = _baseURIForTokens; baseURIIndices.push(baseURIIndex); emit TokensLazyMinted(startId, startId + _amount - 1, _baseURIForTokens); } /*/////////////////////////////////////////////////////////////// Claim logic //////////////////////////////////////////////////////////////*/ /// @dev Lets an account claim NFTs. function claim( address _receiver, uint256 _quantity, address _currency, uint256 _pricePerToken, bytes32[] calldata _proofs, uint256 _proofMaxQuantityPerTransaction ) external payable override nonReentrant { if(!(isTrustedForwarder(msg.sender) || _msgSender() == tx.origin)) revert Bot(); uint[] memory tokens = CedarDropERC721ClaimLogicV0.executeClaim( claimData, _receiver, _quantity, _currency, _pricePerToken, _proofs, _proofMaxQuantityPerTransaction, _msgSender() ); for (uint256 i = 0; i < tokens.length; i += 1) { _mint(_receiver, tokens[i]); } } /// @dev Lets a contract admin (account with `DEFAULT_ADMIN_ROLE`) set claim conditions. function setClaimConditions(ClaimCondition[] calldata _phases, bool _resetClaimEligibility) external override onlyRole(DEFAULT_ADMIN_ROLE) { CedarDropERC721ClaimLogicV0.setClaimConditions(claimData, _phases, _resetClaimEligibility); } /// @dev Checks whether a claimer meets the claim condition's allowlist criteria. function verifyClaimMerkleProof( uint256 _conditionId, address _claimer, uint256 _quantity, bytes32[] calldata _proofs, uint256 _proofMaxQuantityPerTransaction ) public view returns (bool validMerkleProof, uint256 merkleProofIndex) { return CedarDropERC721ClaimLogicV0.verifyClaimMerkleProof(claimData, _conditionId, _claimer, _quantity, _proofs, _proofMaxQuantityPerTransaction); } /// @dev Checks a request to claim NFTs against the active claim condition's criteria. function verifyClaim( uint256 _conditionId, address _claimer, uint256 _quantity, address _currency, uint256 _pricePerToken, bool verifyMaxQuantityPerTransaction ) public override view { CedarDropERC721ClaimLogicV0.verifyClaim(claimData, _conditionId, _claimer, _quantity, _currency, _pricePerToken, verifyMaxQuantityPerTransaction); } /*/////////////////////////////////////////////////////////////// Getter functions //////////////////////////////////////////////////////////////*/ /// @dev Returns the royalty recipient and bps for a particular token Id. function getRoyaltyInfoForToken(uint256 _tokenId) public view override returns (address, uint16) { RoyaltyInfo memory royaltyForToken = royaltyInfoForToken[_tokenId]; return royaltyForToken.recipient == address(0) ? (royaltyRecipient, uint16(royaltyBps)) : (royaltyForToken.recipient, uint16(royaltyForToken.bps)); } /// @dev Returns the default royalty recipient and bps. function getDefaultRoyaltyInfo() external view override returns (address, uint16) { return (royaltyRecipient, uint16(royaltyBps)); } /// @dev Returns the claim condition at the given uid. function getClaimConditionById(uint256 _conditionId) external view returns (ClaimCondition memory condition) { condition = claimData.claimCondition.phases[_conditionId]; } /// @dev Returns the amount of stored baseURIs function getBaseURICount() external view returns (uint256) { return baseURIIndices.length; } /// @dev Expose the current active claim condition including claim limits function getActiveClaimConditions() external view override returns (ClaimCondition memory condition, uint256 conditionId, uint256 walletMaxClaimCount, uint256 remainingSupply) { return CedarDropERC721ClaimLogicV0.getActiveClaimConditions(claimData); } /// @dev Expose the user specific limits related to the current active claim condition function getUserClaimConditions(address _claimer) external view override returns (uint256 conditionId, uint256 walletClaimedCount, uint256 lastClaimTimestamp, uint256 nextValidClaimTimestamp) { return CedarDropERC721ClaimLogicV0.getUserClaimConditions(claimData, _claimer); } /*/////////////////////////////////////////////////////////////// Setter functions //////////////////////////////////////////////////////////////*/ /// @dev Lets a contract admin set a claim count for a wallet. function setWalletClaimCount(address _claimer, uint256 _count) external onlyRole(DEFAULT_ADMIN_ROLE) { claimData.walletClaimCount[_claimer] = _count; emit WalletClaimCountUpdated(_claimer, _count); } /// @dev Lets a contract admin set a maximum number of NFTs that can be claimed by any wallet. function setMaxWalletClaimCount(uint256 _count) external onlyRole(DEFAULT_ADMIN_ROLE) { claimData.maxWalletClaimCount = _count; emit MaxWalletClaimCountUpdated(_count); } /// @dev Lets a contract admin set the global maximum supply for collection's NFTs. function setMaxTotalSupply(uint256 _maxTotalSupply) external onlyRole(DEFAULT_ADMIN_ROLE) { if(!(_maxTotalSupply < claimData.nextTokenIdToMint)) revert CrossedLimit(); claimData.maxTotalSupply = _maxTotalSupply; emit MaxTotalSupplyUpdated(_maxTotalSupply); } /// @dev Lets a contract admin set the recipient for all primary sales. function setPrimarySaleRecipient(address _saleRecipient) external override onlyRole(DEFAULT_ADMIN_ROLE) { claimData.primarySaleRecipient = _saleRecipient; emit PrimarySaleRecipientUpdated(_saleRecipient); } function primarySaleRecipient() external override view returns (address) { return claimData.primarySaleRecipient; } /// @dev Lets a contract admin update the default royalty recipient and bps. function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external override onlyRole(DEFAULT_ADMIN_ROLE) { if(!(_royaltyBps <= MAX_BPS)) revert MaxBps(); royaltyRecipient = _royaltyRecipient; royaltyBps = uint16(_royaltyBps); emit DefaultRoyalty(_royaltyRecipient, _royaltyBps); } /// @dev Lets a contract admin set the royalty recipient and bps for a particular token Id. function setRoyaltyInfoForToken( uint256 _tokenId, address _recipient, uint256 _bps ) external override onlyRole(DEFAULT_ADMIN_ROLE) { if(!(_bps <= MAX_BPS)) revert MaxBps(); royaltyInfoForToken[_tokenId] = RoyaltyInfo({recipient: _recipient, bps: _bps}); emit RoyaltyForToken(_tokenId, _recipient, _bps); } /// @dev Lets a contract admin set a new owner for the contract. The new owner must be a contract admin. function setOwner(address _newOwner) external override onlyRole(DEFAULT_ADMIN_ROLE) { if (!hasRole(DEFAULT_ADMIN_ROLE, _newOwner)) revert InvalidPermission(); address _prevOwner = _owner; _owner = _newOwner; emit OwnerUpdated(_prevOwner, _newOwner); } /// @dev Lets a contract admin set the URI for contract-level metadata. function setContractURI(string calldata _uri) override (ICedarMetadataV0, IThirdwebContract) external onlyRole(DEFAULT_ADMIN_ROLE) { contractURI = _uri; } /*/////////////////////////////////////////////////////////////// Miscellaneous //////////////////////////////////////////////////////////////*/ /// @dev Burns `tokenId`. See {ERC721-_burn}. function burn(uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length if(!(_isApprovedOrOwner(_msgSender(), tokenId))) revert InvalidPermission(); _burn(tokenId); } /// @dev See {ERC721-_beforeTokenTransfer}. function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override(ERC721EnumerableUpgradeable) { super._beforeTokenTransfer(from, to, tokenId); // if transfer is restricted on the contract, we still want to allow burning and minting if (!hasRole(TRANSFER_ROLE, address(0)) && from != address(0) && to != address(0)) { if(!(hasRole(TRANSFER_ROLE, from) || hasRole(TRANSFER_ROLE, to))) revert InvalidPermission(); } if (to != address(this)) { address caller = getCaller(); if (termsActivated) { require( termsAccepted[to], string( abi.encodePacked( "Receiver address has not accepted the collection's terms of use at ", ownerDomain ) ) ); } checkGreenlist(caller); } } /// @dev this function returns the address for the *direct* caller of this contract. function getCaller() internal view returns (address _caller) { assembly { _caller := caller() } } function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) { return ERC2771ContextUpgradeable._msgSender(); } function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) { return ERC2771ContextUpgradeable._msgData(); } // Agreement /// @notice activates the terms /// @dev this function activates the user terms function setTermsStatus(bool _status) external override virtual onlyRole(DEFAULT_ADMIN_ROLE) { _setTermsStatus(_status); } /// @notice switch on / off the greenlist /// @dev this function will allow only Aspen's asset proxy to transfer tokens function setGreenlistStatus(bool _status) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { _setGreenlistStatus(_status); } /// @notice stores terms accepted from a signed message /// @dev this function is for acceptors that have signed a message offchain to accept the terms. The function calls the verifier contract to valid the signature before storing acceptance. function storeTermsAccepted(address _acceptor, bytes calldata _signature) external override virtual onlyRole(DEFAULT_ADMIN_ROLE) { _storeTermsAccepted(_acceptor, _signature); } function setOwnerDomain(string calldata _ownerDomain) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { _setOwnerDomain(_ownerDomain); } /* ========== VIEWS ========== */ // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override( AccessControlEnumerableUpgradeable, ERC721EnumerableUpgradeable, BaseCedarERC721DropV3 ) returns (bool) { return ERC721EnumerableUpgradeable.supportsInterface(interfaceId); } // Concrete implementation semantic version - provided for completeness but not designed to be the point of dispatch function minorVersion() public pure override returns (uint256 minor, uint256 patch) { minor = 0; patch = 0; } function multicall(bytes[] calldata data) external override(IMulticallableV0, MulticallUpgradeable) returns (bytes[] memory results) { return MulticallUpgradeable(this).multicall(data); } /** * @dev Lets an account with `MINTER_ROLE` update base URI. */ function updateBaseURI(uint256 baseURIIndex, string calldata _baseURIForTokens) override external onlyRole(MINTER_ROLE) { baseURI[baseURIIndex] = _baseURIForTokens; emit BaseURIUpdated(baseURIIndex, _baseURIForTokens); } /** * @dev Gets the base URI indices */ function getBaseURIIndices() external override view returns(uint256[] memory) { return baseURIIndices; } /// @dev Returns the platform fee recipient and bps. function getPlatformFeeInfo() override external view returns (address, uint16) { return (claimData.platformFeeRecipient, uint16(claimData.platformFeeBps)); } /// @dev Lets a contract admin update the platform fee recipient and bps function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external override onlyRole(DEFAULT_ADMIN_ROLE) { require(_platformFeeBps <= MAX_BPS, "> MAX_BPS."); claimData.platformFeeBps = uint16(_platformFeeBps); claimData.platformFeeRecipient = _platformFeeRecipient; emit PlatformFeeInfoUpdated(_platformFeeRecipient, _platformFeeBps); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721Upgradeable.sol"; import "./IERC721EnumerableUpgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable { function __ERC721Enumerable_init() internal onlyInitializing { } function __ERC721Enumerable_init_unchained() internal onlyInitializing { } // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) { return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * 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, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721Upgradeable.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[46] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.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 IERC2981Upgradeable is IERC165Upgradeable { /** * @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 payed 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 (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal onlyInitializing { } function __AccessControlEnumerable_init_unchained() internal onlyInitializing { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/BitMaps.sol) pragma solidity ^0.8.0; /** * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential. * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor]. */ library BitMapsUpgradeable { struct BitMap { mapping(uint256 => uint256) _data; } /** * @dev Returns whether the bit at `index` is set. */ function get(BitMap storage bitmap, uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); return bitmap._data[bucket] & mask != 0; } /** * @dev Sets the bit at `index` to the boolean `value`. */ function setTo( BitMap storage bitmap, uint256 index, bool value ) internal { if (value) { set(bitmap, index); } else { unset(bitmap, index); } } /** * @dev Sets the bit at `index`. */ function set(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] |= mask; } /** * @dev Unsets the bit at `index`. */ function unset(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] &= ~mask; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol) pragma solidity ^0.8.0; import "./AddressUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Provides a function to batch together multiple calls in a single external call. * * _Available since v4.1._ */ abstract contract MulticallUpgradeable is Initializable { function __Multicall_init() internal onlyInitializing { } function __Multicall_init_unchained() internal onlyInitializing { } /** * @dev Receives and executes a batch of function calls on this contract. */ function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { results[i] = _functionDelegateCall(address(this), data[i]); } return results; } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; interface IThirdwebContract { /// @dev Returns the module type of the contract. function contractType() external pure returns (bytes32); /// @dev Returns the version of the contract. function contractVersion() external pure returns (uint8); /// @dev Returns the metadata URI of the contract. function contractURI() external view returns (string memory); /** * @dev Sets contract URI for the storefront-level metadata of the contract. * Only module admin can call this function. */ function setContractURI(string calldata _uri) external; }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IPlatformFee { /// @dev Returns the platform fee bps and recipient. function getPlatformFeeInfo() external view returns (address, uint16); /// @dev Lets a module admin update the fees on primary sales. function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external; /// @dev Emitted when fee on primary sales is updated. event PlatformFeeInfoUpdated(address platformFeeRecipient, uint256 platformFeeBps); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IPrimarySale { /// @dev The adress that receives all primary sales value. function primarySaleRecipient() external view returns (address); /// @dev Lets a module admin set the default recipient of all primary sales. function setPrimarySaleRecipient(address _saleRecipient) external; /// @dev Emitted when a new sale recipient is set. event PrimarySaleRecipientUpdated(address indexed recipient); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IOwnable { /// @dev Returns the owner of the contract. function owner() external view returns (address); /// @dev Lets a module admin set a new owner for the contract. The new owner must be a module admin. function setOwner(address _newOwner) external; /// @dev Emitted when a new Owner is set. event OwnerUpdated(address prevOwner, address newOwner); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (metatx/ERC2771Context.sol) pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable { mapping(address => bool) private _trustedForwarder; function __ERC2771Context_init(address[] memory trustedForwarder) internal onlyInitializing { __Context_init_unchained(); __ERC2771Context_init_unchained(trustedForwarder); } function __ERC2771Context_init_unchained(address[] memory trustedForwarder) internal onlyInitializing { for (uint256 i = 0; i < trustedForwarder.length; i++) { _trustedForwarder[trustedForwarder[i]] = true; } } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return _trustedForwarder[forwarder]; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } uint256[49] private __gap; }
// SPDX-License-Identifier: Apache-2.0 // Generated by impl.ts. Will be overwritten. // Filename: './BaseCedarERC721DropV3.sol' pragma solidity ^0.8.4; import "../../api/impl/ICedarERC721Drop.sol"; /// Inherit from this base to implement introspection abstract contract BaseCedarERC721DropV3 is ICedarERC721DropV3 { function supportedFeatures() override public pure returns (string[] memory features) { features = new string[](11); features[0] = "ICedarFeatures.sol:ICedarFeaturesV0"; features[1] = "ICedarVersioned.sol:ICedarVersionedV0"; features[2] = "IMulticallable.sol:IMulticallableV0"; features[3] = "agreement/ICedarAgreement.sol:ICedarAgreementV0"; features[4] = "issuance/ICedarNFTIssuance.sol:ICedarNFTIssuanceV1"; features[5] = "lazymint/ICedarNFTLazyMint.sol:ICedarNFTLazyMintV1"; features[6] = "standard/IERC721.sol:IERC721V0"; features[7] = "royalties/IRoyalty.sol:IRoyaltyV0"; features[8] = "baseURI/ICedarUpdateBaseURI.sol:ICedarUpdateBaseURIV0"; features[9] = "metadata/ICedarNFTMetadata.sol:ICedarNFTMetadataV1"; features[10] = "metadata/IContractMetadata.sol:ICedarMetadataV0"; } /// This needs to be public to be callable from initialize via delegatecall function minorVersion() virtual override public pure returns (uint256 minor, uint256 patch); function implementationVersion() override public pure returns (uint256 major, uint256 minor, uint256 patch) { (minor, patch) = minorVersion(); major = 3; } function supportsInterface(bytes4 interfaceID) virtual override public view returns (bool) { return (interfaceID == type(IERC165Upgradeable).interfaceId) || ((interfaceID == type(ICedarFeaturesV0).interfaceId) || ((interfaceID == type(ICedarVersionedV0).interfaceId) || ((interfaceID == type(IMulticallableV0).interfaceId) || ((interfaceID == type(ICedarAgreementV0).interfaceId) || ((interfaceID == type(ICedarNFTIssuanceV1).interfaceId) || ((interfaceID == type(ICedarNFTLazyMintV1).interfaceId) || ((interfaceID == type(IERC721V0).interfaceId) || ((interfaceID == type(IRoyaltyV0).interfaceId) || ((interfaceID == type(ICedarUpdateBaseURIV0).interfaceId) || ((interfaceID == type(ICedarNFTMetadataV1).interfaceId) || (interfaceID == type(ICedarMetadataV0).interfaceId))))))))))); } function isICedarFeaturesV0() override public pure returns (bool) { return true; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; library FeeType { uint256 internal constant PRIMARY_SALE = 0; uint256 internal constant MARKET_SALE = 1; uint256 internal constant SPLIT = 2; }
// SPDX-License-Identifier: MIT // Modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.3.0/contracts/utils/cryptography/MerkleProof.sol // Copied from https://github.com/ensdomains/governance/blob/master/contracts/MerkleProof.sol pragma solidity ^0.8.4; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * Source: https://github.com/ensdomains/governance/blob/master/contracts/MerkleProof.sol */ 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, uint256) { bytes32 computedHash = leaf; uint256 index = 0; for (uint256 i = 0; i < proof.length; i++) { index *= 2; bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); index += 1; } } // Check if the computed hash (root) is equal to the provided root return (computedHash == root, index); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @title Signature Verifier * @notice The contract used to verify offchain signatures against a message digest. * @author Monax Labs */ contract SignatureVerifier is EIP712, Ownable { /* ========== CONSTANTS ========== */ bytes32 public constant MESSSAGE_HASH = keccak256("AgreeTerms(string url,string message)"); /* ========== STATE VARIABLES ========== */ struct AgreeTerms { string url; string message; } AgreeTerms public terms; /* ========== CONSTRUCTOR ========== */ /// @dev The constructor sets the URL and message that is signed offchain by FIAT/FREE users. It is stored so that this contract can verify their signature for accepting terms. constructor( string memory _url, string memory _message, string memory _name ) EIP712(_name, "1.0.0") { require(bytes(_url).length != 0 && bytes(_message).length != 0, "Signature Verifier: invalid url and message"); terms.url = _url; terms.message = _message; } /// @notice verifies a signature /// @dev this function takes the signers address and the signature signed with their private key. ECDSA checks whether a hash of the message was signed by the user's private key. If yes, the _to address == ECDSA's returned address function verifySignature(address _to, bytes memory _signature) external view returns (bool) { if (_signature.length == 0) return false; bytes32 hash = _hashMessage(); address signer = ECDSA.recover(hash, _signature); return signer == _to; } /// @dev this function hashes the terms url and message function _hashMessage() private view returns (bytes32) { return _hashTypedDataV4( keccak256(abi.encode(MESSSAGE_HASH, keccak256(bytes(terms.url)), keccak256(bytes(terms.message)))) ); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.7; import "./SignatureVerifier.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./api/agreement/ICedarAgreement.sol"; abstract contract Agreement is Initializable, ICedarAgreementV0 { string public override userAgreement; mapping(address => bool) termsAccepted; bool public override termsActivated; SignatureVerifier public verifier; string public ownerDomain; event TermsActive(bool status); event AcceptTerms(string userAgreement, address user); function __Agreement_init(string memory _userAgreement, address _signatureVerifier) internal onlyInitializing { userAgreement = _userAgreement; verifier = SignatureVerifier(_signatureVerifier); } /// @notice activates the terms /// @dev this function activates the user terms function _setTermsStatus(bool _status) internal virtual { termsActivated = _status; emit TermsActive(_status); } /// @notice by signing this transaction, you are confirming that you have read and agreed to the terms of use at `ownerDomain` /// @dev this function is called by token receivers to accept the terms before token transfer. The contract stores their acceptance function acceptTerms() override external { require(termsActivated, "ERC721Cedar: terms not activated"); termsAccepted[msg.sender] = true; emit AcceptTerms(userAgreement, msg.sender); } /// @notice stores terms accepted from a signed message /// @dev this function is for acceptors that have signed a message offchain to accept the terms. The function calls the verifier contract to valid the signature before storing acceptance. function _storeTermsAccepted(address _acceptor, bytes calldata _signature) internal virtual { require(termsActivated, "ERC721Cedar: terms not activated"); require(verifier.verifySignature(_acceptor, _signature), "ERC721Cedar: signature cannot be verified"); termsAccepted[_acceptor] = true; emit AcceptTerms(userAgreement, _acceptor); } /// @notice checks whether an account signed the terms /// @dev this function calls the signature verifier to check whether the terms were accepted by an EOA. function checkSignature(address _account, bytes calldata _signature) external view returns (bool) { return verifier.verifySignature(_account, _signature); } /// @notice returns true / false for whether the account owner accepted terms /// @dev this function returns true / false for whether the account accepted the terms. function getAgreementStatus(address _address) external override view returns (bool sig) { return termsAccepted[_address]; } function _setOwnerDomain(string calldata _ownerDomain) internal virtual { ownerDomain = _ownerDomain; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Address.sol"; import "./GreenlistManager.sol"; contract Greenlist { using Address for address; bool greenlistStatus; GreenlistManager greenlistManager; event GreenlistStatus(bool _status); function __Greenlist_init(address _greenlistManagerAddress) internal { greenlistManager = GreenlistManager(_greenlistManagerAddress); } /// @notice switch on / off the greenlist /// @dev this function will allow only Aspen's asset proxy to transfer tokens function _setGreenlistStatus(bool _status) internal { greenlistStatus = _status; emit GreenlistStatus(_status); } /// @notice checks whether greenlist is activated /// @dev this function returns true / false for whether greenlist is on / off. function isGreenlistOn() public view returns (bool) { return greenlistStatus; } /// @dev this function checks whether the caller is a contract and if the operator is greenlisted function checkGreenlist(address _operator) internal view { if (Address.isContract(_operator) && isGreenlistOn()) { require(greenlistManager.isGreenlisted(_operator), "ERC721Cedar: operator is not greenlisted"); } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; error InvalidPermission(); error InvalidIndex(); error NothingToReveal(); error Bot(); error ST(); error CrossedLimit(); error InvalidPrice(); error InvalidQuantity(); error InvalidTime(); error InvalidProof(); error MaxBps();
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.7; import "../../api/issuance/IDropClaimCondition.sol"; interface DataTypes { struct ClaimData { /// @dev The set of all claim conditions, at any given moment. IDropClaimConditionV0.ClaimConditionList claimCondition; /// @dev The next token ID of the NFT that can be claimed. uint256 nextTokenIdToClaim; /// @dev Mapping from address => total number of NFTs a wallet has claimed. mapping(address => uint256) walletClaimCount; /// @dev The next token ID of the NFT to "lazy mint". uint256 nextTokenIdToMint; /// @dev Global max total supply of NFTs. uint256 maxTotalSupply; /// @dev The max number of NFTs a wallet can claim. uint256 maxWalletClaimCount; /// @dev The address that receives all primary sales value. address primarySaleRecipient; /// @dev The address that receives all platform fees from all sales. address platformFeeRecipient; /// @dev The % of primary sales collected as platform fees. uint16 platformFeeBps; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.7; import "../types/DataTypes.sol"; import "../errors/IErrors.sol"; import "../lib/CurrencyTransferLib.sol"; import "../lib/MerkleProof.sol"; library CedarDropERC721ClaimLogicV0 { using CedarDropERC721ClaimLogicV0 for DataTypes.ClaimData; using BitMapsUpgradeable for BitMapsUpgradeable.BitMap; struct InternalClaim { bool validMerkleProof; uint256 merkleProofIndex; bool toVerifyMaxQuantityPerTransaction; uint256 activeConditionId; uint256 tokenIdToClaim; } event TokensClaimed( uint256 indexed claimConditionIndex, address indexed claimer, address indexed receiver, uint256 startTokenId, uint256 quantityClaimed ); event ClaimConditionsUpdated(IDropClaimConditionV0.ClaimCondition[] claimConditions); function transferClaimedTokens( DataTypes.ClaimData storage claimData, uint256 _conditionId, uint256 _quantityBeingClaimed, address msgSender ) public returns (uint256[] memory tokens) { // Update the supply minted under mint condition. claimData.claimCondition.phases[_conditionId].supplyClaimed += _quantityBeingClaimed; // if transfer claimed tokens is called when `to != msg.sender`, it'd use msg.sender's limits. // behavior would be similar to `msg.sender` mint for itself, then transfer to `_to`. claimData.claimCondition.limitLastClaimTimestamp[_conditionId][msgSender] = block.timestamp; claimData.walletClaimCount[msgSender] += _quantityBeingClaimed; uint256 tokenIdToClaim = claimData.nextTokenIdToClaim; tokens = new uint256[](_quantityBeingClaimed); for (uint256 i = 0; i < _quantityBeingClaimed; i += 1) { tokens[i] = tokenIdToClaim; tokenIdToClaim += 1; } claimData.nextTokenIdToClaim = tokenIdToClaim; } function executeClaim( DataTypes.ClaimData storage claimData, address _receiver, uint256 _quantity, address _currency, uint256 _pricePerToken, bytes32[] calldata _proofs, uint256 _proofMaxQuantityPerTransaction, address msgSender ) public returns (uint256[] memory) { InternalClaim memory internalData; internalData.tokenIdToClaim = claimData.nextTokenIdToClaim; // Get the claim conditions. internalData.activeConditionId = getActiveClaimConditionId(claimData); /** * We make allowlist checks (i.e. verifyClaimMerkleProof) before verifying the claim's general * validity (i.e. verifyClaim) because we give precedence to the check of allow list quantity * restriction over the check of the general claim condition's quantityLimitPerTransaction * restriction. */ // Verify inclusion in allowlist. (internalData.validMerkleProof, internalData.merkleProofIndex) = verifyClaimMerkleProof( claimData, internalData.activeConditionId, msgSender, _quantity, _proofs, _proofMaxQuantityPerTransaction ); // Verify claim validity. If not valid, revert. // when there's allowlist present --> verifyClaimMerkleProof will verify the _proofMaxQuantityPerTransaction value with hashed leaf in the allowlist // when there's no allowlist, this check is true --> verifyClaim will check for _quantity being less/equal than the limit internalData.toVerifyMaxQuantityPerTransaction = _proofMaxQuantityPerTransaction == 0 || claimData.claimCondition.phases[internalData.activeConditionId].merkleRoot == bytes32(0); verifyClaim( claimData, internalData.activeConditionId, msgSender, _quantity, _currency, _pricePerToken, internalData.toVerifyMaxQuantityPerTransaction ); if (internalData.validMerkleProof && _proofMaxQuantityPerTransaction > 0) { /** * Mark the claimer's use of their position in the allowlist. A spot in an allowlist * can be used only once. */ claimData.claimCondition.limitMerkleProofClaim[internalData.activeConditionId].set( internalData.merkleProofIndex ); } // If there's a price, collect price. claimData.collectClaimPrice(_quantity, _currency, _pricePerToken, msgSender); // Mint the relevant NFTs to claimer. uint256[] memory tokens = transferClaimedTokens( claimData, internalData.activeConditionId, _quantity, msgSender ); emit TokensClaimed( internalData.activeConditionId, msgSender, _receiver, internalData.tokenIdToClaim, _quantity ); return tokens; } function verifyClaimMerkleProof( DataTypes.ClaimData storage claimData, uint256 _conditionId, address _claimer, uint256 _quantity, bytes32[] calldata _proofs, uint256 _proofMaxQuantityPerTransaction ) public view returns (bool validMerkleProof, uint256 merkleProofIndex) { IDropClaimConditionV0.ClaimCondition memory currentClaimPhase = claimData.claimCondition.phases[_conditionId]; if (currentClaimPhase.merkleRoot != bytes32(0)) { (validMerkleProof, merkleProofIndex) = MerkleProof.verify( _proofs, currentClaimPhase.merkleRoot, keccak256(abi.encodePacked(_claimer, _proofMaxQuantityPerTransaction)) ); if (!validMerkleProof) revert InvalidProof(); if (!(!claimData.claimCondition.limitMerkleProofClaim[_conditionId].get(merkleProofIndex))) revert InvalidProof(); if (!(_proofMaxQuantityPerTransaction == 0 || _quantity <= _proofMaxQuantityPerTransaction)) revert InvalidProof(); } } function getActiveClaimConditionId(DataTypes.ClaimData storage claimData) public view returns (uint256) { for ( uint256 i = claimData.claimCondition.currentStartId + claimData.claimCondition.count; i > claimData.claimCondition.currentStartId; i-- ) { if (block.timestamp >= claimData.claimCondition.phases[i - 1].startTimestamp) { return i - 1; } } revert("!CONDITION."); } function verifyClaim( DataTypes.ClaimData storage claimData, uint256 _conditionId, address _claimer, uint256 _quantity, address _currency, uint256 _pricePerToken, bool verifyMaxQuantityPerTransaction ) public view { IDropClaimConditionV0.ClaimCondition memory currentClaimPhase = claimData.claimCondition.phases[_conditionId]; if (!(_currency == currentClaimPhase.currency && _pricePerToken == currentClaimPhase.pricePerToken)) revert InvalidPrice(); // If we're checking for an allowlist quantity restriction, ignore the general quantity restriction. if ( !(_quantity > 0 && (!verifyMaxQuantityPerTransaction || _quantity <= currentClaimPhase.quantityLimitPerTransaction)) ) revert InvalidQuantity(); if (!(currentClaimPhase.supplyClaimed + _quantity <= currentClaimPhase.maxClaimableSupply)) revert CrossedLimit(); if (!(claimData.nextTokenIdToClaim + _quantity <= claimData.nextTokenIdToMint)) revert CrossedLimit(); if (!(claimData.maxTotalSupply == 0 || claimData.nextTokenIdToClaim + _quantity <= claimData.maxTotalSupply)) revert CrossedLimit(); if ( !(claimData.maxWalletClaimCount == 0 || claimData.walletClaimCount[_claimer] + _quantity <= claimData.maxWalletClaimCount) ) revert CrossedLimit(); (uint256 lastClaimTimestamp, uint256 nextValidClaimTimestamp) = getClaimTimestamp( claimData, _conditionId, _claimer ); if (!(lastClaimTimestamp == 0 || block.timestamp >= nextValidClaimTimestamp)) revert InvalidTime(); } /// @dev Returns the timestamp for when a claimer is eligible for claiming NFTs again. function getClaimTimestamp( DataTypes.ClaimData storage claimData, uint256 _conditionId, address _claimer ) public view returns (uint256 lastClaimTimestamp, uint256 nextValidClaimTimestamp) { lastClaimTimestamp = claimData.claimCondition.limitLastClaimTimestamp[_conditionId][_claimer]; unchecked { nextValidClaimTimestamp = lastClaimTimestamp + claimData.claimCondition.phases[_conditionId].waitTimeInSecondsBetweenClaims; if (nextValidClaimTimestamp < lastClaimTimestamp) { nextValidClaimTimestamp = type(uint256).max; } } } /// @dev Collects and distributes the primary sale value of NFTs being claimed. function collectClaimPrice( DataTypes.ClaimData storage claimData, uint256 _quantityToClaim, address _currency, uint256 _pricePerToken, address msgSender ) internal { if (_pricePerToken == 0) { return; } uint256 MAX_BPS = 10_000; uint256 totalPrice = _quantityToClaim * _pricePerToken; uint256 platformFees = (totalPrice * claimData.platformFeeBps) / MAX_BPS; if(_currency == CurrencyTransferLib.NATIVE_TOKEN && !(msg.value == totalPrice)) revert InvalidPrice(); CurrencyTransferLib.transferCurrency(_currency, msgSender, claimData.platformFeeRecipient, platformFees); CurrencyTransferLib.transferCurrency(_currency, msgSender, claimData.primarySaleRecipient, totalPrice - platformFees); } /// @dev Lets a contract admin (account with `DEFAULT_ADMIN_ROLE`) set claim conditions. function setClaimConditions( DataTypes.ClaimData storage claimData, IDropClaimConditionV0.ClaimCondition[] calldata _phases, bool _resetClaimEligibility ) public { uint256 existingStartIndex = claimData.claimCondition.currentStartId; uint256 existingPhaseCount = claimData.claimCondition.count; /** * `limitLastClaimTimestamp` and `limitMerkleProofClaim` are mappings that use a * claim condition's UID as a key. * * If `_resetClaimEligibility == true`, we assign completely new UIDs to the claim * conditions in `_phases`, effectively resetting the restrictions on claims expressed * by `limitLastClaimTimestamp` and `limitMerkleProofClaim`. */ uint256 newStartIndex = existingStartIndex; if (_resetClaimEligibility) { newStartIndex = existingStartIndex + existingPhaseCount; } claimData.claimCondition.count = _phases.length; claimData.claimCondition.currentStartId = newStartIndex; uint256 lastConditionStartTimestamp; for (uint256 i = 0; i < _phases.length; i++) { if (!(i == 0 || lastConditionStartTimestamp < _phases[i].startTimestamp)) revert ST(); uint256 supplyClaimedAlready = claimData.claimCondition.phases[newStartIndex + i].supplyClaimed; if (!(supplyClaimedAlready <= _phases[i].maxClaimableSupply)) revert CrossedLimit(); claimData.claimCondition.phases[newStartIndex + i] = _phases[i]; claimData.claimCondition.phases[newStartIndex + i].supplyClaimed = supplyClaimedAlready; lastConditionStartTimestamp = _phases[i].startTimestamp; } /** * Gas refunds (as much as possible) * * If `_resetClaimEligibility == true`, we assign completely new UIDs to the claim * conditions in `_phases`. So, we delete claim conditions with UID < `newStartIndex`. * * If `_resetClaimEligibility == false`, and there are more existing claim conditions * than in `_phases`, we delete the existing claim conditions that don't get replaced * by the conditions in `_phases`. */ if (_resetClaimEligibility) { for (uint256 i = existingStartIndex; i < newStartIndex; i++) { delete claimData.claimCondition.phases[i]; delete claimData.claimCondition.limitMerkleProofClaim[i]; } } else { if (existingPhaseCount > _phases.length) { for (uint256 i = _phases.length; i < existingPhaseCount; i++) { delete claimData.claimCondition.phases[newStartIndex + i]; delete claimData.claimCondition.limitMerkleProofClaim[newStartIndex + i]; } } } emit ClaimConditionsUpdated(_phases); } function getActiveClaimConditions(DataTypes.ClaimData storage claimData) public view returns ( IDropClaimConditionV0.ClaimCondition memory condition, uint256 conditionId, uint256 walletMaxClaimCount, uint256 remainingSupply ) { conditionId = getActiveClaimConditionId(claimData); condition = claimData.claimCondition.phases[conditionId]; walletMaxClaimCount = claimData.maxWalletClaimCount; remainingSupply = 0; // @todo } function getUserClaimConditions(DataTypes.ClaimData storage claimData, address _claimer) public view returns ( uint256 conditionId, uint256 walletClaimedCount, uint256 lastClaimTimestamp, uint256 nextValidClaimTimestamp ) { conditionId = getActiveClaimConditionId(claimData); (lastClaimTimestamp, nextValidClaimTimestamp) = getClaimTimestamp(claimData, conditionId, _claimer); walletClaimedCount = claimData.walletClaimCount[_claimer]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @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. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @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 (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * 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, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable 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. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // 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(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _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 onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @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 ) external; /** * @dev Transfers `tokenId` token 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; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// 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 IERC165Upgradeable { /** * @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 v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } 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, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).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 `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 ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.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. */ 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. */ 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`. */ 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. * * [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. */ 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. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol) 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. */ library EnumerableSetUpgradeable { // 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) { return _values(set._inner); } // 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; 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 on 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; assembly { result := store } return result; } }
// 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 IAccessControlUpgradeable { /** * @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: Apache 2.0 pragma solidity ^0.8.4; import "../ICedarFeatures.sol"; import "../IMulticallable.sol"; import "../ICedarVersioned.sol"; import "../issuance/ICedarNFTIssuance.sol"; import "../agreement/ICedarAgreement.sol"; import "../lazymint/ICedarNFTLazyMint.sol"; import "../standard/IERC721.sol"; import "../royalties/IRoyalty.sol"; import "../baseURI/ICedarUpdateBaseURI.sol"; import "../metadata/ICedarNFTMetadata.sol"; import "../metadata/IContractMetadata.sol"; // Each CedarERC721 contract should implement a maximal version of the interfaces it supports and should itself carry // the version major version suffix, in this case CedarERC721V0 interface ICedarERC721DropV0 is ICedarFeaturesV0, ICedarVersionedV0, ICedarNFTIssuanceV0, ICedarNFTLazyMintV0, IMulticallableV0, IERC721V0 { } interface ICedarERC721DropV1 is ICedarFeaturesV0, ICedarVersionedV0, IMulticallableV0, ICedarAgreementV0, ICedarNFTIssuanceV1, ICedarNFTLazyMintV0, IERC721V0, IRoyaltyV0 {} interface ICedarERC721DropV2 is ICedarFeaturesV0, ICedarVersionedV0, IMulticallableV0, ICedarAgreementV0, ICedarNFTIssuanceV1, ICedarNFTLazyMintV1, IERC721V0, IRoyaltyV0, ICedarUpdateBaseURIV0, ICedarNFTMetadataV0, ICedarMetadataV0 {} interface ICedarERC721DropV3 is ICedarFeaturesV0, ICedarVersionedV0, IMulticallableV0, ICedarAgreementV0, ICedarNFTIssuanceV1, ICedarNFTLazyMintV1, IERC721V0, IRoyaltyV0, ICedarUpdateBaseURIV0, ICedarNFTMetadataV1, ICedarMetadataV0 {}
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; interface ICedarFeaturesV0 is IERC165Upgradeable { // Marker interface to make an ERC165 clash less likely function isICedarFeaturesV0() external pure returns (bool); // List of features that contract supports and may be passed to featureVersion function supportedFeatures() external pure returns (string[] memory features); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; // See https://docs.openzeppelin.com/contracts/4.x/utilities#multicall interface IMulticallableV0 { function multicall(bytes[] calldata data) external returns (bytes[] memory results); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; interface ICedarMinorVersionedV0 { function minorVersion() external view returns (uint256 minor, uint256 patch); } interface ICedarImplementationVersionedV0 { // Concrete implementation semantic version - provided for completeness but not designed to be the point of dispatch function implementationVersion() external view returns ( uint256 major, uint256 minor, uint256 patch ); } interface ICedarVersionedV0 is ICedarImplementationVersionedV0, ICedarMinorVersionedV0, IERC165Upgradeable { }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; //import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "./IDropClaimCondition.sol"; /** * Thirdweb's 'Drop' contracts are distribution mechanisms for tokens. The * `DropERC721` contract is a distribution mechanism for ERC721 tokens. * * A minter wallet (i.e. holder of `MINTER_ROLE`) can (lazy)mint 'n' tokens * at once by providing a single base URI for all tokens being lazy minted. * The URI for each of the 'n' tokens lazy minted is the provided base URI + * `{tokenId}` of the respective token. (e.g. "ipsf://Qmece.../1"). * * A minter can choose to lazy mint 'delayed-reveal' tokens. More on 'delayed-reveal' * tokens in [this article](https://blog.thirdweb.com/delayed-reveal-nfts). * * A contract admin (i.e. holder of `DEFAULT_ADMIN_ROLE`) can create claim conditions * with non-overlapping time windows, and accounts can claim the tokens according to * restrictions defined in the claim condition that is active at the time of the transaction. */ interface ICedarNFTIssuanceV0 is IDropClaimConditionV0 { /// @dev Emitted when tokens are claimed. event TokensClaimed( uint256 indexed claimConditionIndex, address indexed claimer, address indexed receiver, uint256 startTokenId, uint256 quantityClaimed ); /// @dev Emitted when new claim conditions are set. event ClaimConditionsUpdated(ClaimCondition[] claimConditions); /** * @notice Lets a contract admin (account with `DEFAULT_ADMIN_ROLE`) set claim conditions. * * @param phases Claim conditions in ascending order by `startTimestamp`. * @param resetClaimEligibility Whether to reset `limitLastClaimTimestamp` and * `limitMerkleProofClaim` values when setting new * claim conditions. */ function setClaimConditions(ClaimCondition[] calldata phases, bool resetClaimEligibility) external; /** * @notice Lets an account claim a given quantity of NFTs. * * @param receiver The receiver of the NFTs to claim. * @param quantity The quantity of NFTs to claim. * @param currency The currency in which to pay for the claim. * @param pricePerToken The price per token to pay for the claim. * @param proofs The proof of the claimer's inclusion in the merkle root allowlist * of the claim conditions that apply. * @param proofMaxQuantityPerTransaction (Optional) The maximum number of NFTs an address included in an * allowlist can claim. */ function claim( address receiver, uint256 quantity, address currency, uint256 pricePerToken, bytes32[] calldata proofs, uint256 proofMaxQuantityPerTransaction ) external payable; } interface ICedarNFTIssuanceV1 is ICedarNFTIssuanceV0 { /// @dev Expose the current active claim condition including claim limits function getActiveClaimConditions() external view returns (ClaimCondition memory condition, uint256 conditionId, uint256 walletMaxClaimCount, uint256 remainingSupply); /// @dev Expose the user specific limits related to the current active claim condition function getUserClaimConditions(address _claimer) external view returns (uint256 conditionId, uint256 walletClaimedCount, uint256 lastClaimTimestamp, uint256 nextValidClaimTimestamp); /// @dev Checks a request to claim NFTs against the active claim condition's criteria. function verifyClaim( uint256 _conditionId, address _claimer, uint256 _quantity, address _currency, uint256 _pricePerToken, bool verifyMaxQuantityPerTransaction ) external view; }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; interface ICedarAgreementV0 { // Accept legal terms associated with transfer of this NFT function acceptTerms() external; function userAgreement() external view returns (string memory); function termsActivated() external view returns (bool); function setTermsStatus(bool _status) external; function getAgreementStatus(address _address) external view returns (bool sig); function storeTermsAccepted(address _acceptor, bytes calldata _signature) external; }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; interface ICedarNFTLazyMintV0 { /// @dev Emitted when tokens are lazy minted. event TokensLazyMinted(uint256 startTokenId, uint256 endTokenId, string baseURI, bytes encryptedBaseURI); /** * @notice Lets an account with `MINTER_ROLE` lazy mint 'n' NFTs. * The URIs for each token is the provided `_baseURIForTokens` + `{tokenId}`. * * @param amount The amount of NFTs to lazy mint. * @param baseURIForTokens The URI for the NFTs to lazy mint. If lazy minting * 'delayed-reveal' NFTs, the is a URI for NFTs in the * un-revealed state. * @param encryptedBaseURI If lazy minting 'delayed-reveal' NFTs, this is the * result of encrypting the URI of the NFTs in the revealed * state. */ function lazyMint( uint256 amount, string calldata baseURIForTokens, bytes calldata encryptedBaseURI ) external; } interface ICedarNFTLazyMintV1 { /// @dev Emitted when tokens are lazy minted. event TokensLazyMinted(uint256 startTokenId, uint256 endTokenId, string baseURI); /** * @notice Lets an account with `MINTER_ROLE` lazy mint 'n' NFTs. * The URIs for each token is the provided `_baseURIForTokens` + `{tokenId}`. * * @param amount The amount of NFTs to lazy mint. * @param baseURIForTokens The URI for the NFTs to lazy mint. If lazy minting * 'delayed-reveal' NFTs, the is a URI for NFTs in the * un-revealed state. */ function lazyMint( uint256 amount, string calldata baseURIForTokens ) external; }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; interface IERC721V0 is IERC721Upgradeable {}
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IRoyaltyV0 { struct RoyaltyInfo { address recipient; uint256 bps; } /// @dev Returns the royalty recipient and fee bps. function getDefaultRoyaltyInfo() external view returns (address, uint16); /// @dev Lets a module admin update the royalty bps and recipient. function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external; /// @dev Lets a module admin set the royalty recipient for a particular token Id. function setRoyaltyInfoForToken( uint256 tokenId, address recipient, uint256 bps ) external; /// @dev Returns the royalty recipient for a particular token Id. function getRoyaltyInfoForToken(uint256 tokenId) external view returns (address, uint16); /** * @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 payed in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); /// @dev Emitted when royalty info is updated. event DefaultRoyalty(address newRoyaltyRecipient, uint256 newRoyaltyBps); /// @dev Emitted when royalty recipient for tokenId is set event RoyaltyForToken(uint256 indexed tokenId, address royaltyRecipient, uint256 royaltyBps); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; interface ICedarUpdateBaseURIV0 { /// @dev Emitted when base URI is updated. event BaseURIUpdated(uint256 baseURIIndex, string baseURI); /** * @notice Lets a minter (account with `MINTER_ROLE`) update base URI */ function updateBaseURI( uint256 baseURIIndex, string calldata _baseURIForTokens ) external; /** * @dev Gets the base URI indices */ function getBaseURIIndices() external view returns(uint256[] memory); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface ICedarNFTMetadataV0 { /// @dev Returns the URI for a given tokenId. function tokenURI(uint256 _tokenId) external returns (string memory); } interface ICedarNFTMetadataV1 { /// @dev Returns the URI for a given tokenId. function tokenURI(uint256 _tokenId) view external returns (string memory); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface ICedarMetadataV0 { /// @dev Contract level metadata. function contractURI() external view returns (string memory); /// @dev Lets a contract admin set the URI for contract-level metadata. function setContractURI(string calldata _uri) external; }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/structs/BitMapsUpgradeable.sol"; /** * Thirdweb's 'Drop' contracts are distribution mechanisms for tokens. * * A contract admin (i.e. a holder of `DEFAULT_ADMIN_ROLE`) can set a series of claim conditions, * ordered by their respective `startTimestamp`. A claim condition defines criteria under which * accounts can mint tokens. Claim conditions can be overwritten or added to by the contract admin. * At any moment, there is only one active claim condition. */ interface IDropClaimConditionV0 { /** * @notice The criteria that make up a claim condition. * * @param startTimestamp The unix timestamp after which the claim condition applies. * The same claim condition applies until the `startTimestamp` * of the next claim condition. * * @param maxClaimableSupply The maximum total number of tokens that can be claimed under * the claim condition. * * @param supplyClaimed At any given point, the number of tokens that have been claimed * under the claim condition. * * @param quantityLimitPerTransaction The maximum number of tokens that can be claimed in a single * transaction. * * @param waitTimeInSecondsBetweenClaims The least number of seconds an account must wait after claiming * tokens, to be able to claim tokens again. * * @param merkleRoot The allowlist of addresses that can claim tokens under the claim * condition. * * @param pricePerToken The price required to pay per token claimed. * * @param currency The currency in which the `pricePerToken` must be paid. */ struct ClaimCondition { uint256 startTimestamp; uint256 maxClaimableSupply; uint256 supplyClaimed; uint256 quantityLimitPerTransaction; uint256 waitTimeInSecondsBetweenClaims; bytes32 merkleRoot; uint256 pricePerToken; address currency; } /** * @notice The set of all claim conditions, at any given moment. * Claim Phase ID = [currentStartId, currentStartId + length - 1]; * * @param currentStartId The uid for the first claim condition amongst the current set of * claim conditions. The uid for each next claim condition is one * more than the previous claim condition's uid. * * @param count The total number of phases / claim conditions in the list * of claim conditions. * * @param phases The claim conditions at a given uid. Claim conditions * are ordered in an ascending order by their `startTimestamp`. * * @param limitLastClaimTimestamp Map from an account and uid for a claim condition, to the last timestamp * at which the account claimed tokens under that claim condition. * * @param limitMerkleProofClaim Map from a claim condition uid to whether an address in an allowlist * has already claimed tokens i.e. used their place in the allowlist. */ struct ClaimConditionList { uint256 currentStartId; uint256 count; mapping(uint256 => ClaimCondition) phases; mapping(uint256 => mapping(address => uint256)) limitLastClaimTimestamp; mapping(uint256 => BitMapsUpgradeable.BitMap) limitMerkleProofClaim; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { 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 v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// 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.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; /** * @title Cedar Operator Manager * @notice The contract manages exchange operator contracts and enforces the greenlist. * @author Monax Labs */ contract GreenlistManager is OwnableUpgradeable, UUPSUpgradeable { /* ========== STATE VARIABLES ========== */ address public operator; function initialize() public initializer { __Ownable_init(); __UUPSUpgradeable_init(); } event OperatorAdded(address _address); event OperatorDeleted(address _address); function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} /// @notice add Aspen Operator address /// @dev this function adds Aspen's asset proxy contract address. function setAspenOperator(address _operator) external onlyOwner { operator = _operator; emit OperatorAdded(_operator); } /// @notice delete Aspen Operator /// @dev this function will delete the address if Aspen is not greenlisted. function deleteAspenOperator(address _address) external onlyOwner { delete operator; emit OperatorDeleted(_address); } /// @notice checks whether an operator is greenlisted /// @dev this function returns true / false for whether caller contract is greenlisted. function isGreenlisted(address _address) public view returns (bool) { return (operator == _address); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { 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); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate that the this implementation remains valid after an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; // Helper interfaces import { IWETH } from "../interfaces/IWETH.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; library CurrencyTransferLib { using SafeERC20Upgradeable for IERC20Upgradeable; /// @dev The address interpreted as native token of the chain. address public constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /// @dev Transfers a given amount of currency. function transferCurrency( address _currency, address _from, address _to, uint256 _amount ) internal { if (_amount == 0) { return; } if (_currency == NATIVE_TOKEN) { safeTransferNativeToken(_to, _amount); } else { safeTransferERC20(_currency, _from, _to, _amount); } } /// @dev Transfers a given amount of currency. (With native token wrapping) function transferCurrencyWithWrapper( address _currency, address _from, address _to, uint256 _amount, address _nativeTokenWrapper ) internal { if (_amount == 0) { return; } if (_currency == NATIVE_TOKEN) { if (_from == address(this)) { // withdraw from weth then transfer withdrawn native token to recipient IWETH(_nativeTokenWrapper).withdraw(_amount); safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper); } else if (_to == address(this)) { // store native currency in weth require(_amount == msg.value, "msg.value != amount"); IWETH(_nativeTokenWrapper).deposit{ value: _amount }(); } else { safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper); } } else { safeTransferERC20(_currency, _from, _to, _amount); } } /// @dev Transfer `amount` of ERC20 token from `from` to `to`. function safeTransferERC20( address _currency, address _from, address _to, uint256 _amount ) internal { if (_from == _to) { return; } if (_from == address(this)) { IERC20Upgradeable(_currency).safeTransfer(_to, _amount); } else { IERC20Upgradeable(_currency).safeTransferFrom(_from, _to, _amount); } } /// @dev Transfers `amount` of native token to `to`. function safeTransferNativeToken(address to, uint256 value) internal { // solhint-disable avoid-low-level-calls // slither-disable-next-line low-level-calls (bool success, ) = to.call{ value: value }(""); require(success, "native token transfer failed"); } /// @dev Transfers `amount` of native token to `to`. (With native token wrapping) function safeTransferNativeTokenWithWrapper( address to, uint256 value, address _nativeTokenWrapper ) internal { // solhint-disable avoid-low-level-calls // slither-disable-next-line low-level-calls (bool success, ) = to.call{ value: value }(""); if (!success) { IWETH(_nativeTokenWrapper).deposit{ value: value }(); IERC20Upgradeable(_nativeTokenWrapper).safeTransfer(to, value); } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; interface IWETH { function deposit() external payable; function withdraw(uint256 amount) external; function transfer(address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; import "../../../utils/AddressUpgradeable.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20Upgradeable { using AddressUpgradeable for address; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20Upgradeable token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20Upgradeable token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
{ "optimizer": { "enabled": true, "runs": 1 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": { "contracts/cedar/drop/lib/CedarDropERC721ClaimLogicV0.sol": { "CedarDropERC721ClaimLogicV0": "0x1023abe3d964ccb03b33d7b8c81dd943c4578d2a" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Bot","type":"error"},{"inputs":[],"name":"CrossedLimit","type":"error"},{"inputs":[],"name":"InvalidPermission","type":"error"},{"inputs":[],"name":"MaxBps","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"userAgreement","type":"string"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"AcceptTerms","type":"event"},{"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":false,"internalType":"uint256","name":"baseURIIndex","type":"uint256"},{"indexed":false,"internalType":"string","name":"baseURI","type":"string"}],"name":"BaseURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxClaimableSupply","type":"uint256"},{"internalType":"uint256","name":"supplyClaimed","type":"uint256"},{"internalType":"uint256","name":"quantityLimitPerTransaction","type":"uint256"},{"internalType":"uint256","name":"waitTimeInSecondsBetweenClaims","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"}],"indexed":false,"internalType":"struct IDropClaimConditionV0.ClaimCondition[]","name":"claimConditions","type":"tuple[]"}],"name":"ClaimConditionsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRoyaltyRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"newRoyaltyBps","type":"uint256"}],"name":"DefaultRoyalty","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"GreenlistStatus","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxTotalSupply","type":"uint256"}],"name":"MaxTotalSupplyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"count","type":"uint256"}],"name":"MaxWalletClaimCountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"prevOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"platformFeeRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"platformFeeBps","type":"uint256"}],"name":"PlatformFeeInfoUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"PrimarySaleRecipientUpdated","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":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"royaltyRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"royaltyBps","type":"uint256"}],"name":"RoyaltyForToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"TermsActive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"claimConditionIndex","type":"uint256"},{"indexed":true,"internalType":"address","name":"claimer","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantityClaimed","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"baseURI","type":"string"}],"name":"TokensLazyMinted","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"count","type":"uint256"}],"name":"WalletClaimCountUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptTerms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"baseURIIndices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"checkSignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"_currency","type":"address"},{"internalType":"uint256","name":"_pricePerToken","type":"uint256"},{"internalType":"bytes32[]","name":"_proofs","type":"bytes32[]"},{"internalType":"uint256","name":"_proofMaxQuantityPerTransaction","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"contractType","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getActiveClaimConditions","outputs":[{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxClaimableSupply","type":"uint256"},{"internalType":"uint256","name":"supplyClaimed","type":"uint256"},{"internalType":"uint256","name":"quantityLimitPerTransaction","type":"uint256"},{"internalType":"uint256","name":"waitTimeInSecondsBetweenClaims","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"}],"internalType":"struct IDropClaimConditionV0.ClaimCondition","name":"condition","type":"tuple"},{"internalType":"uint256","name":"conditionId","type":"uint256"},{"internalType":"uint256","name":"walletMaxClaimCount","type":"uint256"},{"internalType":"uint256","name":"remainingSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getAgreementStatus","outputs":[{"internalType":"bool","name":"sig","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBaseURICount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBaseURIIndices","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_conditionId","type":"uint256"}],"name":"getClaimConditionById","outputs":[{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxClaimableSupply","type":"uint256"},{"internalType":"uint256","name":"supplyClaimed","type":"uint256"},{"internalType":"uint256","name":"quantityLimitPerTransaction","type":"uint256"},{"internalType":"uint256","name":"waitTimeInSecondsBetweenClaims","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"}],"internalType":"struct IDropClaimConditionV0.ClaimCondition","name":"condition","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultRoyaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPlatformFeeInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"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":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getRoyaltyInfoForToken","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_claimer","type":"address"}],"name":"getUserClaimConditions","outputs":[{"internalType":"uint256","name":"conditionId","type":"uint256"},{"internalType":"uint256","name":"walletClaimedCount","type":"uint256"},{"internalType":"uint256","name":"lastClaimTimestamp","type":"uint256"},{"internalType":"uint256","name":"nextValidClaimTimestamp","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":"implementationVersion","outputs":[{"internalType":"uint256","name":"major","type":"uint256"},{"internalType":"uint256","name":"minor","type":"uint256"},{"internalType":"uint256","name":"patch","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_defaultAdmin","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_contractURI","type":"string"},{"internalType":"address[]","name":"_trustedForwarders","type":"address[]"},{"internalType":"address","name":"_saleRecipient","type":"address"},{"internalType":"address","name":"_royaltyRecipient","type":"address"},{"internalType":"uint128","name":"_royaltyBps","type":"uint128"},{"components":[{"internalType":"string","name":"userAgreement","type":"string"},{"internalType":"address","name":"signatureVerifier","type":"address"},{"internalType":"address","name":"greenlistManagerAddress","type":"address"}],"internalType":"struct CedarERC721Drop.FeaturesInput","name":"featuresInput","type":"tuple"},{"internalType":"uint128","name":"_platformFeeBps","type":"uint128"},{"internalType":"address","name":"_platformFeeRecipient","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isGreenlistOn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isICedarFeaturesV0","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"string","name":"_baseURIForTokens","type":"string"}],"name":"lazyMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minorVersion","outputs":[{"internalType":"uint256","name":"minor","type":"uint256"},{"internalType":"uint256","name":"patch","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerDomain","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"primarySaleRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","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":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxClaimableSupply","type":"uint256"},{"internalType":"uint256","name":"supplyClaimed","type":"uint256"},{"internalType":"uint256","name":"quantityLimitPerTransaction","type":"uint256"},{"internalType":"uint256","name":"waitTimeInSecondsBetweenClaims","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"}],"internalType":"struct IDropClaimConditionV0.ClaimCondition[]","name":"_phases","type":"tuple[]"},{"internalType":"bool","name":"_resetClaimEligibility","type":"bool"}],"name":"setClaimConditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyRecipient","type":"address"},{"internalType":"uint256","name":"_royaltyBps","type":"uint256"}],"name":"setDefaultRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setGreenlistStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxTotalSupply","type":"uint256"}],"name":"setMaxTotalSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"setMaxWalletClaimCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_ownerDomain","type":"string"}],"name":"setOwnerDomain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_platformFeeRecipient","type":"address"},{"internalType":"uint256","name":"_platformFeeBps","type":"uint256"}],"name":"setPlatformFeeInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_saleRecipient","type":"address"}],"name":"setPrimarySaleRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_bps","type":"uint256"}],"name":"setRoyaltyInfoForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setTermsStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_claimer","type":"address"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"setWalletClaimCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_acceptor","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"storeTermsAccepted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supportedFeatures","outputs":[{"internalType":"string[]","name":"features","type":"string[]"}],"stateMutability":"pure","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":[],"name":"termsActivated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"baseURIIndex","type":"uint256"},{"internalType":"string","name":"_baseURIForTokens","type":"string"}],"name":"updateBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"userAgreement","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifier","outputs":[{"internalType":"contract SignatureVerifier","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_conditionId","type":"uint256"},{"internalType":"address","name":"_claimer","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"_currency","type":"address"},{"internalType":"uint256","name":"_pricePerToken","type":"uint256"},{"internalType":"bool","name":"verifyMaxQuantityPerTransaction","type":"bool"}],"name":"verifyClaim","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_conditionId","type":"uint256"},{"internalType":"address","name":"_claimer","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"bytes32[]","name":"_proofs","type":"bytes32[]"},{"internalType":"uint256","name":"_proofMaxQuantityPerTransaction","type":"uint256"}],"name":"verifyClaimMerkleProof","outputs":[{"internalType":"bool","name":"validMerkleProof","type":"bool"},{"internalType":"uint256","name":"merkleProofIndex","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506157d180620000216000396000f3fe6080604052600436106103415760003560e01c806301ffc9a71461034657806306bfcec61461037b57806306fdde03146103a8578063079fe40e146103ca578063081812fc146103f2578063095ea7b31461041257806313af40351461043457806318160ddd14610454578063191b9515146104745780631e7ac4881461049657806323b872dd146104b6578063248a9ca3146104d657806329a66747146104f65780632a55205a1461051b5780632b4be9b4146105495780632b7ac3f3146105695780632dfa6a651461058f5780632f2ff15d146105c95780632f745c59146105e957806336568abe1461060957806338ac3a74146106295780633a42a074146106495780633ea33f29146106625780633f3e4c111461068257806342842e0e146106a257806342966c68146106c257806347158264146106e25780634cc157df146107025780634f6ccce7146107445780635086795714610764578063572b6c05146107845780635be7551f146107a4578063600dd5ea146107bf5780636352211e146107df57806363b45e2d146107ff5780636f4f2837146108155780636f8934f41461083557806370a082311461086257806373b9332b146108825780637436f3dc146108975780637470bf2b146108b85780637627f6c4146108cc5780637a5a8e7e146108ee578063815af90814610901578063817234fa146109165780638312aa1b146109365780638da5cb5b146109765780639010d07c1461098b57806391d14854146109ab578063938e3d7b146109cb57806395d89b41146109eb5780639bcf7a1514610a00578063a0a8e46014610a20578063a217fddf14610a3c578063a22cb46514610a51578063ac9650d814610a71578063af3be89014610a9e578063afb8291614610ad5578063b24f2d3914610af5578063b88d4fde14610b21578063c87b56dd14610b41578063ca15c87314610b61578063cb2ef6f714610b81578063d45573f614610ba1578063d547741f14610bcd578063d860483f14610bed578063dc3cf5fe14610c0d578063dd76644514610c22578063e23b816414610c42578063e8a3d48514610c62578063e985e9c514610c77578063f0fe08b514610c97578063fcd3d74714610cb7578063fec3802314610cd7575b600080fd5b34801561035257600080fd5b5061036661036136600461488e565b610cf7565b60405190151581526020015b60405180910390f35b34801561038757600080fd5b50600360008060408051938452602084019290925290820152606001610372565b3480156103b457600080fd5b506103bd610d08565b6040516103729190614f7a565b3480156103d657600080fd5b506101d7546001600160a01b03165b6040516103729190614d4d565b3480156103fe57600080fd5b506103e561040d36600461482e565b610d9b565b34801561041e57600080fd5b5061043261042d3660046144c9565b610e29565b005b34801561044057600080fd5b5061043261044f3660046141f2565b610f4c565b34801561046057600080fd5b50610193545b604051908152602001610372565b34801561048057600080fd5b50610489610feb565b6040516103729190614f36565b3480156104a257600080fd5b506104326104b13660046144c9565b611043565b3480156104c257600080fd5b506104326104d1366004614248565b6110f4565b3480156104e257600080fd5b506104666104f136600461482e565b61112c565b34801561050257600080fd5b5061050b611141565b6040516103729493929190615159565b34801561052757600080fd5b5061053b61053636600461486c565b6111e3565b604051610372929190614dcc565b34801561055557600080fd5b50610432610564366004614336565b611220565b34801561057557600080fd5b506101c5546103e59061010090046001600160a01b031681565b34801561059b57600080fd5b506103666105aa3660046141f2565b6001600160a01b031660009081526101c4602052604090205460ff1690565b3480156105d557600080fd5b506104326105e4366004614847565b61123f565b3480156105f557600080fd5b506104666106043660046144c9565b61125e565b34801561061557600080fd5b50610432610624366004614847565b6112f5565b34801561063557600080fd5b506104326106443660046147c6565b611383565b34801561065557600080fd5b506101c75460ff16610366565b34801561066e57600080fd5b5061043261067d3660046144c9565b61139a565b34801561068e57600080fd5b5061043261069d36600461482e565b611403565b3480156106ae57600080fd5b506104326106bd366004614248565b611472565b3480156106ce57600080fd5b506104326106dd36600461482e565b61148d565b3480156106ee57600080fd5b506104326106fd366004614a9d565b6114c1565b34801561070e57600080fd5b5061072261071d36600461482e565b6115a1565b604080516001600160a01b03909316835261ffff909116602083015201610372565b34801561075057600080fd5b5061046661075f36600461482e565b61160e565b34801561077057600080fd5b5061043261077f36600461482e565b6116a3565b34801561079057600080fd5b5061036661079f3660046141f2565b6116e7565b3480156107b057600080fd5b506101c5546103669060ff1681565b3480156107cb57600080fd5b506104326107da3660046144c9565b611705565b3480156107eb57600080fd5b506103e56107fa36600461482e565b611792565b34801561080b57600080fd5b506101cb54610466565b34801561082157600080fd5b506104326108303660046141f2565b61180a565b34801561084157600080fd5b5061085561085036600461482e565b611864565b604051610372919061514a565b34801561086e57600080fd5b5061046661087d3660046141f2565b6118e4565b34801561088e57600080fd5b506103bd61196c565b3480156108a357600080fd5b50604080516000808252602082015201610372565b3480156108c457600080fd5b506001610366565b3480156108d857600080fd5b506108e16119fb565b6040516103729190614ee1565b6104326108fc3660046144f5565b611ca8565b34801561090d57600080fd5b50610432611e38565b34801561092257600080fd5b50610432610931366004614a9d565b611ea1565b34801561094257600080fd5b506109566109513660046141f2565b611f18565b604080519485526020850193909352918301526060820152608001610372565b34801561098257600080fd5b506103e5611fc3565b34801561099757600080fd5b506103e56109a636600461486c565b611ffb565b3480156109b757600080fd5b506103666109c6366004614847565b61201b565b3480156109d757600080fd5b506104326109e63660046148c8565b612046565b3480156109f757600080fd5b506103bd612061565b348015610a0c57600080fd5b50610432610a1b36600461499e565b612071565b348015610a2c57600080fd5b5060405160028152602001610372565b348015610a4857600080fd5b50610466600081565b348015610a5d57600080fd5b50610432610a6c366004614308565b61212c565b348015610a7d57600080fd5b50610a91610a8c366004614579565b61213e565b6040516103729190614e7f565b348015610aaa57600080fd5b50610abe610ab9366004614a2c565b6121bc565b604080519215158352602083019190915201610372565b348015610ae157600080fd5b50610432610af03660046149c5565b612262565b348015610b0157600080fd5b506101c9546001600160a01b03811690600160a01b900461ffff16610722565b348015610b2d57600080fd5b50610432610b3c366004614289565b612302565b348015610b4d57600080fd5b506103bd610b5c36600461482e565b61233b565b348015610b6d57600080fd5b50610466610b7c36600461482e565b6123fc565b348015610b8d57600080fd5b506944726f7045524337323160b01b610466565b348015610bad57600080fd5b506101d8546001600160a01b03811690600160a01b900461ffff16610722565b348015610bd957600080fd5b50610432610be8366004614847565b612414565b348015610bf957600080fd5b50610466610c0836600461482e565b612433565b348015610c1957600080fd5b506103bd612455565b348015610c2e57600080fd5b50610432610c3d3660046148c8565b612463565b348015610c4e57600080fd5b50610432610c5d3660046146aa565b61247b565b348015610c6e57600080fd5b506103bd6124fe565b348015610c8357600080fd5b50610366610c9236600461420f565b61250c565b348015610ca357600080fd5b50610432610cb236600461438a565b61253b565b348015610cc357600080fd5b50610432610cd23660046147c6565b612758565b348015610ce357600080fd5b50610366610cf2366004614336565b61276f565b6000610d0282612802565b92915050565b606061015f8054610d1890615455565b80601f0160208091040260200160405190810160405280929190818152602001828054610d4490615455565b8015610d915780601f10610d6657610100808354040283529160200191610d91565b820191906000526020600020905b815481529060010190602001808311610d7457829003601f168201915b5050505050905090565b6000610da682612827565b610e0c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b50600090815261016360205260409020546001600160a01b031690565b6000610e3482611792565b9050806001600160a01b0316836001600160a01b03161415610ea25760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610e03565b806001600160a01b0316610eb4612845565b6001600160a01b03161480610ed05750610ed081610c92612845565b610f3d5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608401610e03565b610f47838361284f565b505050565b6000610f5f81610f5a612845565b6128be565b610f6a60008361201b565b610f8757604051634345326f60e11b815260040160405180910390fd5b6101c880546001600160a01b038481166001600160a01b031983168117909355604080519190921680825260208201939093527f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7691015b60405180910390a1505050565b60606101cb805480602002602001604051908101604052809291908181526020018280548015610d9157602002820191906000526020600020905b815481526020019060010190808311611026575050505050905090565b600061105181610f5a612845565b6127108211156110905760405162461bcd60e51b815260206004820152600a6024820152691f1026a0ac2fa128299760b11b6044820152606401610e03565b6101d880546001600160b01b031916600160a01b61ffff8516026001600160a01b031916176001600160a01b0385161790556040517fe2497bd806ec41a6e0dd992c29a72efc0ef8fec9092d1978fd4a1e00b2f1830490610fde9085908590614dcc565b6111056110ff612845565b82612922565b6111215760405162461bcd60e51b8152600401610e03906150ae565b610f478383836129e4565b600090815260fb602052604090206001015490565b611149613e77565b60405163a4910ae160e01b81526101cd600482015260009081908190731023abe3d964ccb03b33d7b8c81dd943c4578d2a9063a4910ae1906024016101606040518083038186803b15801561119d57600080fd5b505af41580156111b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d591906148fd565b935093509350935090919293565b6000806000806111f2866115a1565b90945084925061ffff16905061271061120b82876153dc565b61121591906153c8565b925050509250929050565b600061122e81610f5a612845565b611239848484612b7c565b50505050565b6112488261112c565b61125481610f5a612845565b610f478383612ccc565b6000611269836118e4565b82106112cb5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e03565b506001600160a01b0391909116600090815261019160209081526040808320938352929052205490565b6112fd612845565b6001600160a01b0316816001600160a01b0316146113755760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e03565b61137f8282612cef565b5050565b600061139181610f5a612845565b61137f82612d12565b60006113a881610f5a612845565b6001600160a01b03831660008181526101d3602052604090819020849055517f8973b95d42472e89416ea69404f8038c041db700af9ec294e7b4cd4e1ff2801c906113f69085815260200190565b60405180910390a2505050565b600061141181610f5a612845565b6101d454821061143457604051638844d0c960e01b815260040160405180910390fd5b6101d58290556040518281527ff2672935fc79f5237559e2e2999dbe743bf65430894ac2b37666890e7c69e1af906020015b60405180910390a15050565b610f4783838360405180602001604052806000815250612302565b6114986110ff612845565b6114b557604051634345326f60e11b815260040160405180910390fd5b6114be81612d5b565b50565b60008051602061570d8339815191526114dc81610f5a612845565b6101d45460006114ec86836153b0565b6101d481905560008181526101d96020526040902090915061150f908686613ec8565b506101cb8054600181810183556000929092527fe8bbfecd380c4167d6a1f763a233ec73e73f534b1970c4e1683f437ec23c1f44018290557f4e6c698792b8dfb7c94c60c7e9e91f82932832d5e1ec0870ed42cf674e6af44590839061157589836153b0565b61157f91906153fb565b878760405161159194939291906152ed565b60405180910390a1505050505050565b60008181526101da60209081526040808320815180830190925280546001600160a01b0316808352600190910154928201929092528291156115e95780516020820151611604565b6101c9546001600160a01b03811690600160a01b900461ffff165b9250925050915091565b600061161a6101935490565b821061167d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e03565b610193828154811061169157611691615501565b90600052602060002001549050919050565b60006116b181610f5a612845565b6101d68290556040518281527ff9d383c69b6255cbd431ca23734f43bdf15e694c7494956c917498469bcbce7390602001611466565b6001600160a01b031660009081526065602052604090205460ff1690565b600061171381610f5a612845565b61271082111561173657604051637d190eed60e01b815260040160405180910390fd5b6101c9805461ffff8416600160a01b026001600160b01b03199091166001600160a01b038616171790556040517f90d7ec04bcb8978719414f82e52e4cb651db41d0e6f8cea6118c2191e6183adb90610fde9085908590614dcc565b600081815261016160205260408120546001600160a01b031680610d025760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610e03565b600061181881610f5a612845565b6101d780546001600160a01b0319166001600160a01b0384169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a25050565b61186c613e77565b5060009081526101cf6020908152604091829020825161010081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c08201526007909101546001600160a01b031660e082015290565b60006001600160a01b03821661194f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610e03565b506001600160a01b03166000908152610162602052604090205490565b6101c6805461197a90615455565b80601f01602080910402602001604051908101604052809291908181526020018280546119a690615455565b80156119f35780601f106119c8576101008083540402835291602001916119f3565b820191906000526020600020905b8154815290600101906020018083116119d657829003601f168201915b505050505081565b60408051600b8082526101808201909252606091816020015b6060815260200190600190039081611a145790505090506040518060600160405280602381526020016156ea6023913981600081518110611a5757611a57615501565b602002602001018190525060405180606001604052806025815260200161562f6025913981600181518110611a8e57611a8e615501565b602002602001018190525060405180606001604052806023815260200161560c6023913981600281518110611ac557611ac5615501565b60200260200101819052506040518060600160405280602f8152602001615587602f913981600381518110611afc57611afc615501565b60200260200101819052506040518060600160405280603281526020016156546032913981600481518110611b3357611b33615501565b60200260200101819052506040518060600160405280603281526020016156b86032913981600581518110611b6a57611b6a615501565b60200260200101819052506040518060400160405280601e81526020017f7374616e646172642f494552433732312e736f6c3a494552433732315630000081525081600681518110611bbe57611bbe615501565b60200260200101819052506040518060600160405280602181526020016155eb6021913981600781518110611bf557611bf5615501565b60200260200101819052506040518060600160405280603581526020016155b66035913981600881518110611c2c57611c2c615501565b60200260200101819052506040518060600160405280603281526020016156866032913981600981518110611c6357611c63615501565b60200260200101819052506040518060600160405280602f815260200161574d602f913981600a81518110611c9a57611c9a615501565b602002602001018190525090565b60026001541415611cfb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e03565b6002600155611d09336116e7565b80611d23575032611d18612845565b6001600160a01b0316145b611d4057604051633d5552d360e21b815260040160405180910390fd5b6000731023abe3d964ccb03b33d7b8c81dd943c4578d2a63a10f3ed76101cd8a8a8a8a8a8a8a611d6e612845565b6040518a63ffffffff1660e01b8152600401611d9299989796959493929190615186565b60006040518083038186803b158015611daa57600080fd5b505af4158015611dbe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611de6919081019061472f565b905060005b8151811015611e2957611e1789838381518110611e0a57611e0a615501565b6020026020010151612df2565b611e226001826153b0565b9050611deb565b50506001805550505050505050565b6101c55460ff16611e5b5760405162461bcd60e51b8152600401610e0390615079565b3360008181526101c4602052604090819020805460ff191660011790555160008051602061577c83398151915291611e97916101c39190614f8d565b60405180910390a1565b60008051602061570d833981519152611ebc81610f5a612845565b60008481526101d960205260409020611ed6908484613ec8565b507f29a79348b587fdb8c1e68f2bdc84a2edf777093f8db626cb838e7ace52c2cf29848484604051611f0a939291906152d3565b60405180910390a150505050565b6040516326040b6560e11b81526101cd60048201526001600160a01b0382166024820152600090819081908190731023abe3d964ccb03b33d7b8c81dd943c4578d2a90634c0816ca9060440160806040518083038186803b158015611f7c57600080fd5b505af4158015611f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb49190614acf565b93509350935093509193509193565b6101c854600090611fde9082906001600160a01b031661201b565b611fe85750600090565b6101c8546001600160a01b03165b905090565b600082815261012d602052604081206120149083612f20565b9392505050565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600061205481610f5a612845565b6112396101ca8484613ec8565b60606101608054610d1890615455565b600061207f81610f5a612845565b6127108211156120a257604051637d190eed60e01b815260040160405180910390fd5b6040805180820182526001600160a01b038581168252602080830186815260008981526101da90925290849020925183546001600160a01b0319169216919091178255516001909101555184907f7365cf4122f072a3365c20d54eff9b38d73c096c28e1892ec8f5b0e403a0f12d9061211e9086908690614dcc565b60405180910390a250505050565b61137f612137612845565b8383612f2c565b604051631592ca1b60e31b8152606090309063ac9650d8906121669086908690600401614de5565b600060405180830381600087803b15801561218057600080fd5b505af1158015612194573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261201491908101906145ba565b600080731023abe3d964ccb03b33d7b8c81dd943c4578d2a6381dd4bed6101cd8a8a8a8a8a8a6040518863ffffffff1660e01b8152600401612204979695949392919061528b565b604080518083038186803b15801561221b57600080fd5b505af415801561222f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122539190614800565b91509150965096945050505050565b604051639f41a5b960e01b81526101cd6004820152602481018790526001600160a01b038087166044830152606482018690528416608482015260a4810183905281151560c4820152731023abe3d964ccb03b33d7b8c81dd943c4578d2a90639f41a5b99060e40160006040518083038186803b1580156122e257600080fd5b505af41580156122f6573d6000803e3d6000fd5b50505050505050505050565b61231361230d612845565b83612922565b61232f5760405162461bcd60e51b8152600401610e03906150ae565b61123984848484612ff8565b606060005b6101cb548110156123e6576101cb818154811061235f5761235f615501565b90600052602060002001548310156123d4576101d960006101cb838154811061238a5761238a615501565b906000526020600020015481526020019081526020016000206123ac8461302b565b6040516020016123bd929190614c55565b604051602081830303815290604052915050919050565b6123df6001826153b0565b9050612340565b5050604080516020810190915260008152919050565b600081815261012d60205260408120610d0290613128565b61241d8261112c565b61242981610f5a612845565b610f478383612cef565b6101cb818154811061244457600080fd5b600091825260209091200154905081565b6101c3805461197a90615455565b600061247181610f5a612845565b610f478383613132565b600061248981610f5a612845565b604051632d58f47f60e21b8152731023abe3d964ccb03b33d7b8c81dd943c4578d2a9063b563d1fc906124c8906101cd908890889088906004016151e4565b60006040518083038186803b1580156124e057600080fd5b505af41580156124f4573d6000803e3d6000fd5b5050505050505050565b6101ca805461197a90615455565b6001600160a01b0391821660009081526101646020908152604080832093909416825291909152205460ff1690565b600054610100900460ff166125565760005460ff161561255e565b61255e61313f565b6125c15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e03565b600054610100900460ff161580156125e3576000805461ffff19166101011790555b6125eb613150565b6125f488613181565b6125fe8b8b6131b9565b612610846000015185602001516131ea565b61264184604001516101c780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6101c980546001600160a01b038881166001600160b01b031990921691909117600160a01b61ffff891602179091556101d780546001600160a01b031916918916919091179055885161269c906101ca9060208c0190613f4c565b506101c880546001600160a01b0319166001600160a01b038e8116919091179091556101d880549184166001600160b01b031990921691909117600160a01b61ffff8616021790556126ef60008d613250565b61270760008051602061570d8339815191528d613250565b61271f6000805160206155678339815191528d613250565b6127386000805160206155678339815191526000613250565b801561274a576000805461ff00191690555b505050505050505050505050565b600061276681610f5a612845565b61137f8261325a565b6101c55460405163258c1ef560e01b815260009161010090046001600160a01b03169063258c1ef5906127aa90879087908790600401614d9e565b60206040518083038186803b1580156127c257600080fd5b505afa1580156127d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fa91906147e3565b949350505050565b60006001600160e01b0319821663780e9d6360e01b1480610d025750610d028261329c565b600090815261016160205260409020546001600160a01b0316151590565b6000611ff66132dc565b60008181526101636020526040902080546001600160a01b0319166001600160a01b038416908117909155819061288582611792565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6128c8828261201b565b61137f576128e0816001600160a01b031660146132fe565b6128eb8360206132fe565b6040516020016128fc929190614cde565b60408051601f198184030181529082905262461bcd60e51b8252610e0391600401614f7a565b600061292d82612827565b61298e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e03565b600061299983611792565b9050806001600160a01b0316846001600160a01b031614806129d45750836001600160a01b03166129c984610d9b565b6001600160a01b0316145b806127fa57506127fa818561250c565b826001600160a01b03166129f782611792565b6001600160a01b031614612a5b5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610e03565b6001600160a01b038216612abd5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e03565b612ac8838383613499565b612ad360008261284f565b6001600160a01b038316600090815261016260205260408120805460019290612afd9084906153fb565b90915550506001600160a01b038216600090815261016260205260408120805460019290612b2c9084906153b0565b90915550506000818152610161602052604080822080546001600160a01b0319166001600160a01b03868116918217909255915184939187169160008051602061572d83398151915291a4505050565b6101c55460ff16612b9f5760405162461bcd60e51b8152600401610e0390615079565b6101c55460405163258c1ef560e01b81526101009091046001600160a01b03169063258c1ef590612bd890869086908690600401614d9e565b60206040518083038186803b158015612bf057600080fd5b505afa158015612c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2891906147e3565b612c865760405162461bcd60e51b815260206004820152602960248201527f45524337323143656461723a207369676e61747572652063616e6e6f74206265604482015268081d995c9a599a595960ba1b6064820152608401610e03565b6001600160a01b03831660009081526101c4602052604090819020805460ff191660011790555160008051602061577c83398151915290610fde906101c3908690614f8d565b612cd682826135c8565b600082815261012d60205260409020610f47908261364f565b612cf98282613664565b600082815261012d60205260409020610f4790826136e9565b6101c5805460ff19168215159081179091556040519081527f973f129f1e2d7aa595b1461d5e88f9a15d2178a3209f60d73e7cf018c8e21ab6906020015b60405180910390a150565b6000612d6682611792565b9050612d7481600084613499565b612d7f60008361284f565b6001600160a01b038116600090815261016260205260408120805460019290612da99084906153fb565b90915550506000828152610161602052604080822080546001600160a01b0319169055518391906001600160a01b0384169060008051602061572d833981519152908390a45050565b6001600160a01b038216612e485760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e03565b612e5181612827565b15612e9d5760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610e03565b612ea960008383613499565b6001600160a01b038216600090815261016260205260408120805460019290612ed39084906153b0565b90915550506000818152610161602052604080822080546001600160a01b0319166001600160a01b038616908117909155905183929060008051602061572d833981519152908290a45050565b600061201483836136fe565b816001600160a01b0316836001600160a01b03161415612f8a5760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610e03565b6001600160a01b0383811660008181526101646020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6130038484846129e4565b61300f84848484613728565b6112395760405162461bcd60e51b8152600401610e0390615027565b60608161304f5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613079578061306381615490565b91506130729050600a836153c8565b9150613053565b6000816001600160401b0381111561309357613093615517565b6040519080825280601f01601f1916602001820160405280156130bd576020820181803683370190505b5090505b84156127fa576130d26001836153fb565b91506130df600a866154ab565b6130ea9060306153b0565b60f81b8183815181106130ff576130ff615501565b60200101906001600160f81b031916908160001a905350613121600a866153c8565b94506130c1565b6000610d02825490565b610f476101c68383613ec8565b600061314a30613843565b15905090565b600054610100900460ff166131775760405162461bcd60e51b8152600401610e03906150ff565b61317f613852565b565b600054610100900460ff166131a85760405162461bcd60e51b8152600401610e03906150ff565b6131b061387f565b6114be816138a6565b600054610100900460ff166131e05760405162461bcd60e51b8152600401610e03906150ff565b61137f8282613935565b600054610100900460ff166132115760405162461bcd60e51b8152600401610e03906150ff565b8151613225906101c3906020850190613f4c565b506101c580546001600160a01b0390921661010002610100600160a81b031990921691909117905550565b61137f8282612ccc565b6101c7805460ff19168215159081179091556040519081527fae23cc2173a8e9a060899b7376c4c8a44c9c9ff7d61c02ee68b3ff63cf2b730790602001612d50565b60006001600160e01b031982166380ac58cd60e01b14806132cd57506001600160e01b03198216635b5e139f60e01b145b80610d025750610d0282613985565b60006132e7336116e7565b156132f9575060131936013560601c90565b503390565b6060600061330d8360026153dc565b6133189060026153b0565b6001600160401b0381111561332f5761332f615517565b6040519080825280601f01601f191660200182016040528015613359576020820181803683370190505b509050600360fc1b8160008151811061337457613374615501565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106133a3576133a3615501565b60200101906001600160f81b031916908160001a90535060006133c78460026153dc565b6133d29060016153b0565b90505b600181111561344a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061340657613406615501565b1a60f81b82828151811061341c5761341c615501565b60200101906001600160f81b031916908160001a90535060049490941c936134438161543e565b90506133d5565b5083156120145760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e03565b6134a48383836139aa565b6134bd600080516020615567833981519152600061201b565b1580156134d257506001600160a01b03831615155b80156134e657506001600160a01b03821615155b1561353e576135036000805160206155678339815191528461201b565b8061352157506135216000805160206155678339815191528361201b565b61353e57604051634345326f60e11b815260040160405180910390fd5b6001600160a01b0382163014610f47576101c554339060ff16156135bf576001600160a01b03831660009081526101c4602090815260409182902054915160ff90921691613590916101c69101614c7a565b604051602081830303815290604052906135bd5760405162461bcd60e51b8152600401610e039190614f7a565b505b61123981613a64565b6135d2828261201b565b61137f57600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561360b612845565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000612014836001600160a01b038416613b63565b61366e828261201b565b1561137f57600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff191690556136a5612845565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000612014836001600160a01b038416613bb2565b600082600001828154811061371557613715615501565b9060005260206000200154905092915050565b600061373c846001600160a01b0316613843565b1561383857836001600160a01b031663150b7a02613758612845565b8786866040518563ffffffff1660e01b815260040161377a9493929190614d61565b602060405180830381600087803b15801561379457600080fd5b505af19250505080156137c4575060408051601f3d908101601f191682019092526137c1918101906148ab565b60015b61381e573d8080156137f2576040519150601f19603f3d011682016040523d82523d6000602084013e6137f7565b606091505b5080516138165760405162461bcd60e51b8152600401610e0390615027565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127fa565b506001949350505050565b6001600160a01b03163b151590565b600054610100900460ff166138795760405162461bcd60e51b8152600401610e03906150ff565b60018055565b600054610100900460ff1661317f5760405162461bcd60e51b8152600401610e03906150ff565b600054610100900460ff166138cd5760405162461bcd60e51b8152600401610e03906150ff565b60005b815181101561137f576001606560008484815181106138f1576138f1615501565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061392d81615490565b9150506138d0565b600054610100900460ff1661395c5760405162461bcd60e51b8152600401610e03906150ff565b81516139709061015f906020850190613f4c565b508051610f4790610160906020840190613f4c565b60006001600160e01b03198216635a05180f60e01b1480610d025750610d0282613ca5565b6001600160a01b038316613a0757613a02816101938054600083815261019460205260408120829055600182018355919091527ffc8af01f449989052b52093a58fc9f42d0b11f0c6dd5dca0463dab62346ccc680155565b613a2a565b816001600160a01b0316836001600160a01b031614613a2a57613a2a8382613cda565b6001600160a01b038216613a4157610f4781613d7c565b826001600160a01b0316826001600160a01b031614610f4757610f478282613e31565b613a6d81613843565b8015613a7c57506101c75460ff165b156114be576101c75460405163240a823f60e01b81526101009091046001600160a01b03169063240a823f90613ab6908490600401614d4d565b60206040518083038186803b158015613ace57600080fd5b505afa158015613ae2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b0691906147e3565b6114be5760405162461bcd60e51b815260206004820152602860248201527f45524337323143656461723a206f70657261746f72206973206e6f7420677265604482015267195b9b1a5cdd195960c21b6064820152608401610e03565b6000818152600183016020526040812054613baa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d02565b506000610d02565b60008181526001830160205260408120548015613c9b576000613bd66001836153fb565b8554909150600090613bea906001906153fb565b9050818114613c4f576000866000018281548110613c0a57613c0a615501565b9060005260206000200154905080876000018481548110613c2d57613c2d615501565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613c6057613c606154eb565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610d02565b6000915050610d02565b60006001600160e01b03198216637965db0b60e01b1480610d0257506301ffc9a760e01b6001600160e01b0319831614610d02565b60006001613ce7846118e4565b613cf191906153fb565b60008381526101926020526040902054909150808214613d47576001600160a01b038416600090815261019160209081526040808320858452825280832054848452818420819055835261019290915290208190555b506000918252610192602090815260408084208490556001600160a01b03909416835261019181528383209183525290812055565b61019354600090613d8f906001906153fb565b600083815261019460205260408120546101938054939450909284908110613db957613db9615501565b90600052602060002001549050806101938381548110613ddb57613ddb615501565b60009182526020808320909101929092558281526101949091526040808220849055858252812055610193805480613e1557613e156154eb565b6001900381819060005260206000200160009055905550505050565b6000613e3c836118e4565b6001600160a01b0390931660009081526101916020908152604080832086845282528083208590559382526101929052919091209190915550565b6040518061010001604052806000815260200160008152602001600081526020016000815260200160008152602001600080191681526020016000815260200160006001600160a01b031681525090565b828054613ed490615455565b90600052602060002090601f016020900481019282613ef65760008555613f3c565b82601f10613f0f5782800160ff19823516178555613f3c565b82800160010185558215613f3c579182015b82811115613f3c578235825591602001919060010190613f21565b50613f48929150613fc0565b5090565b828054613f5890615455565b90600052602060002090601f016020900481019282613f7a5760008555613f3c565b82601f10613f9357805160ff1916838001178555613f3c565b82800160010185558215613f3c579182015b82811115613f3c578251825591602001919060010190613fa5565b5b80821115613f485760008155600101613fc1565b6000613fe8613fe384615389565b615336565b9050828152838383011115613ffc57600080fd5b828260208301376000602084830101529392505050565b803561401e8161552d565b919050565b805161401e8161552d565b600082601f83011261403f57600080fd5b8135602061404f613fe383615366565b80838252828201915082860187848660051b890101111561406f57600080fd5b60005b858110156140975781356140858161552d565b84529284019290840190600101614072565b5090979650505050505050565b60008083601f8401126140b657600080fd5b5081356001600160401b038111156140cd57600080fd5b6020830191508360208260051b85010111156140e857600080fd5b9250929050565b60008083601f84011261410157600080fd5b5081356001600160401b0381111561411857600080fd5b6020830191508360208285010111156140e857600080fd5b600082601f83011261414157600080fd5b61201483833560208501613fd5565b60006060828403121561416257600080fd5b604051606081016001600160401b03808211838310171561418557614185615517565b81604052829350843591508082111561419d57600080fd5b506141aa85828601614130565b82525060208301356141bb8161552d565b602082015260408301356141ce8161552d565b6040919091015292915050565b80356001600160801b038116811461401e57600080fd5b60006020828403121561420457600080fd5b81356120148161552d565b6000806040838503121561422257600080fd5b823561422d8161552d565b9150602083013561423d8161552d565b809150509250929050565b60008060006060848603121561425d57600080fd5b83356142688161552d565b925060208401356142788161552d565b929592945050506040919091013590565b6000806000806080858703121561429f57600080fd5b84356142aa8161552d565b935060208501356142ba8161552d565b92506040850135915060608501356001600160401b038111156142dc57600080fd5b8501601f810187136142ed57600080fd5b6142fc87823560208401613fd5565b91505092959194509250565b6000806040838503121561431b57600080fd5b82356143268161552d565b9150602083013561423d81615542565b60008060006040848603121561434b57600080fd5b83356143568161552d565b925060208401356001600160401b0381111561437157600080fd5b61437d868287016140ef565b9497909650939450505050565b60008060008060008060008060008060006101608c8e0312156143ac57600080fd5b6143b58c614013565b9a506001600160401b0360208d01358110156143d057600080fd5b6143e08e60208f01358f01614130565b9a508060408e013511156143f357600080fd5b6144038e60408f01358f01614130565b99508060608e0135111561441657600080fd5b6144268e60608f01358f01614130565b98508060808e0135111561443957600080fd5b6144498e60808f01358f0161402e565b975061445760a08e01614013565b965061446560c08e01614013565b955061447360e08e016141db565b9450806101008e0135111561448757600080fd5b506144998d6101008e01358e01614150565b92506144a86101208d016141db565b91506144b76101408d01614013565b90509295989b509295989b9093969950565b600080604083850312156144dc57600080fd5b82356144e78161552d565b946020939093013593505050565b600080600080600080600060c0888a03121561451057600080fd5b873561451b8161552d565b96506020880135955060408801356145328161552d565b94506060880135935060808801356001600160401b0381111561455457600080fd5b6145608a828b016140a4565b989b979a5095989497959660a090950135949350505050565b6000806020838503121561458c57600080fd5b82356001600160401b038111156145a257600080fd5b6145ae858286016140a4565b90969095509350505050565b600060208083850312156145cd57600080fd5b82516001600160401b03808211156145e457600080fd5b818501915085601f8301126145f857600080fd5b8151614606613fe382615366565b80828252858201915085850189878560051b880101111561462657600080fd5b60005b8481101561469b5781518681111561464057600080fd5b8701603f81018c1361465157600080fd5b888101516040614663613fe383615389565b8281528e8284860101111561467757600080fd5b614686838d8301848701615412565b87525050509287019290870190600101614629565b50909998505050505050505050565b6000806000604084860312156146bf57600080fd5b83356001600160401b03808211156146d657600080fd5b818601915086601f8301126146ea57600080fd5b8135818111156146f957600080fd5b8760208260081b850101111561470e57600080fd5b6020928301955093505084013561472481615542565b809150509250925092565b6000602080838503121561474257600080fd5b82516001600160401b0381111561475857600080fd5b8301601f8101851361476957600080fd5b8051614777613fe382615366565b80828252848201915084840188868560051b870101111561479757600080fd5b600094505b838510156147ba57805183526001949094019391850191850161479c565b50979650505050505050565b6000602082840312156147d857600080fd5b813561201481615542565b6000602082840312156147f557600080fd5b815161201481615542565b6000806040838503121561481357600080fd5b825161481e81615542565b6020939093015192949293505050565b60006020828403121561484057600080fd5b5035919050565b6000806040838503121561485a57600080fd5b82359150602083013561423d8161552d565b6000806040838503121561487f57600080fd5b50508035926020909101359150565b6000602082840312156148a057600080fd5b813561201481615550565b6000602082840312156148bd57600080fd5b815161201481615550565b600080602083850312156148db57600080fd5b82356001600160401b038111156148f157600080fd5b6145ae858286016140ef565b60008060008084860361016081121561491557600080fd5b6101008082121561492557600080fd5b61492d61530d565b9150865182526020870151602083015260408701516040830152606087015160608301526080870151608083015260a087015160a083015260c087015160c083015261497b60e08801614023565b60e083015286015161012087015161014090970151919890975090945092505050565b6000806000606084860312156149b357600080fd5b8335925060208401356142788161552d565b60008060008060008060c087890312156149de57600080fd5b8635955060208701356149f08161552d565b9450604087013593506060870135614a078161552d565b92506080870135915060a0870135614a1e81615542565b809150509295509295509295565b60008060008060008060a08789031215614a4557600080fd5b863595506020870135614a578161552d565b94506040870135935060608701356001600160401b03811115614a7957600080fd5b614a8589828a016140a4565b979a9699509497949695608090950135949350505050565b600080600060408486031215614ab257600080fd5b8335925060208401356001600160401b0381111561437157600080fd5b60008060008060808587031215614ae557600080fd5b505082516020840151604085015160609095015191969095509092509050565b81835260006001600160fb1b03831115614b1e57600080fd5b8260051b8083602087013760009401602001938452509192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452614b7c816020860160208601615412565b601f01601f19169290920160200192915050565b60008154614b9d81615455565b60018281168015614bb55760018114614bc657614bf5565b60ff19841687528287019450614bf5565b8560005260208060002060005b85811015614bec5781548a820152908401908201614bd3565b50505082870194505b5050505092915050565b805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260018060a01b0360e08201511660e08301525050565b6000614c618285614b90565b8351614c71818360208801615412565b01949350505050565b7f5265636569766572206164647265737320686173206e6f74206163636570746581527f642074686520636f6c6c656374696f6e2773207465726d73206f662075736520602082015262030ba160ed1b604082015260006120146043830184614b90565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351614d10816017850160208801615412565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614d41816028840160208801615412565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614d9490830184614b64565b9695505050505050565b6001600160a01b0384168152604060208201819052600090614dc39083018486614b3b565b95945050505050565b6001600160a01b03929092168252602082015260400190565b60208082528181018390526000906040600585901b8401810190840186845b87811015614e7257868403603f190183528135368a9003601e19018112614e2a57600080fd5b890180356001600160401b03811115614e4257600080fd5b8036038b1315614e5157600080fd5b614e5e8682898501614b3b565b955050509184019190840190600101614e04565b5091979650505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614ed457603f19888603018452614ec2858351614b64565b94509285019290850190600101614ea6565b5092979650505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614ed457603f19888603018452614f24858351614b64565b94509285019290850190600101614f08565b6020808252825182820181905260009190848201906040850190845b81811015614f6e57835183529284019291840191600101614f52565b50909695505050505050565b6020815260006120146020830184614b64565b604081526000808454614f9f81615455565b8060408601526060600180841660008114614fc15760018114614fd557615006565b60ff19851688840152608088019550615006565b8960005260208060002060005b86811015614ffd5781548b8201870152908401908201614fe2565b8a018501975050505b505050506001600160a01b0394909416602093909301929092525092915050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f45524337323143656461723a207465726d73206e6f7420616374697661746564604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6101008101610d028284614bff565b61016081016151688287614bff565b84610100830152836101208301528261014083015295945050505050565b60006101008b835260018060a01b03808c1660208501528a6040850152808a1660608501528860808501528160a08501526151c4828501888a614b05565b92508560c085015280851660e085015250509a9950505050505050505050565b848152606060208083018290528282018590526000919060809081850188855b8981101561527657813583528382013584840152604080830135908401528582013586840152848201358584015260a0808301359084015260c0808301359084015260e0808301356152558161552d565b6001600160a01b031690840152610100928301929190910190600101615204565b505086151560408701529350614dc392505050565b87815286602082015260018060a01b038616604082015284606082015260c0608082015260006152bf60c083018587614b05565b90508260a083015298975050505050505050565b838152604060208201526000614dc3604083018486614b3b565b848152836020820152606060408201526000614d94606083018486614b3b565b60405161010081016001600160401b038111828210171561533057615330615517565b60405290565b604051601f8201601f191681016001600160401b038111828210171561535e5761535e615517565b604052919050565b60006001600160401b0382111561537f5761537f615517565b5060051b60200190565b60006001600160401b038211156153a2576153a2615517565b50601f01601f191660200190565b600082198211156153c3576153c36154bf565b500190565b6000826153d7576153d76154d5565b500490565b60008160001904831182151516156153f6576153f66154bf565b500290565b60008282101561540d5761540d6154bf565b500390565b60005b8381101561542d578181015183820152602001615415565b838111156112395750506000910152565b60008161544d5761544d6154bf565b506000190190565b600181811c9082168061546957607f821691505b6020821081141561548a57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156154a4576154a46154bf565b5060010190565b6000826154ba576154ba6154d5565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146114be57600080fd5b80151581146114be57600080fd5b6001600160e01b0319811681146114be57600080fdfe8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c61677265656d656e742f49436564617241677265656d656e742e736f6c3a49436564617241677265656d656e745630626173655552492f494365646172557064617465426173655552492e736f6c3a494365646172557064617465426173655552495630726f79616c746965732f49526f79616c74792e736f6c3a49526f79616c74795630494d756c746963616c6c61626c652e736f6c3a494d756c746963616c6c61626c65563049436564617256657273696f6e65642e736f6c3a49436564617256657273696f6e6564563069737375616e63652f4943656461724e465449737375616e63652e736f6c3a4943656461724e465449737375616e636556316d657461646174612f4943656461724e46544d657461646174612e736f6c3a4943656461724e46544d6574616461746156316c617a796d696e742f4943656461724e46544c617a794d696e742e736f6c3a4943656461724e46544c617a794d696e74563149436564617246656174757265732e736f6c3a494365646172466561747572657356309f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6d657461646174612f49436f6e74726163744d657461646174612e736f6c3a4943656461724d657461646174615630e6f8b8b4dcb99c0bcda0ec9d87d5425c99ef716797a0343009884d11d3fe857da26469706673582212201d1f9bab4a2f26cdd97e4da81822b253e34d54fa4e972fb0960b7fce6b5f2f3264736f6c63430008070033
Deployed Bytecode
0x6080604052600436106103415760003560e01c806301ffc9a71461034657806306bfcec61461037b57806306fdde03146103a8578063079fe40e146103ca578063081812fc146103f2578063095ea7b31461041257806313af40351461043457806318160ddd14610454578063191b9515146104745780631e7ac4881461049657806323b872dd146104b6578063248a9ca3146104d657806329a66747146104f65780632a55205a1461051b5780632b4be9b4146105495780632b7ac3f3146105695780632dfa6a651461058f5780632f2ff15d146105c95780632f745c59146105e957806336568abe1461060957806338ac3a74146106295780633a42a074146106495780633ea33f29146106625780633f3e4c111461068257806342842e0e146106a257806342966c68146106c257806347158264146106e25780634cc157df146107025780634f6ccce7146107445780635086795714610764578063572b6c05146107845780635be7551f146107a4578063600dd5ea146107bf5780636352211e146107df57806363b45e2d146107ff5780636f4f2837146108155780636f8934f41461083557806370a082311461086257806373b9332b146108825780637436f3dc146108975780637470bf2b146108b85780637627f6c4146108cc5780637a5a8e7e146108ee578063815af90814610901578063817234fa146109165780638312aa1b146109365780638da5cb5b146109765780639010d07c1461098b57806391d14854146109ab578063938e3d7b146109cb57806395d89b41146109eb5780639bcf7a1514610a00578063a0a8e46014610a20578063a217fddf14610a3c578063a22cb46514610a51578063ac9650d814610a71578063af3be89014610a9e578063afb8291614610ad5578063b24f2d3914610af5578063b88d4fde14610b21578063c87b56dd14610b41578063ca15c87314610b61578063cb2ef6f714610b81578063d45573f614610ba1578063d547741f14610bcd578063d860483f14610bed578063dc3cf5fe14610c0d578063dd76644514610c22578063e23b816414610c42578063e8a3d48514610c62578063e985e9c514610c77578063f0fe08b514610c97578063fcd3d74714610cb7578063fec3802314610cd7575b600080fd5b34801561035257600080fd5b5061036661036136600461488e565b610cf7565b60405190151581526020015b60405180910390f35b34801561038757600080fd5b50600360008060408051938452602084019290925290820152606001610372565b3480156103b457600080fd5b506103bd610d08565b6040516103729190614f7a565b3480156103d657600080fd5b506101d7546001600160a01b03165b6040516103729190614d4d565b3480156103fe57600080fd5b506103e561040d36600461482e565b610d9b565b34801561041e57600080fd5b5061043261042d3660046144c9565b610e29565b005b34801561044057600080fd5b5061043261044f3660046141f2565b610f4c565b34801561046057600080fd5b50610193545b604051908152602001610372565b34801561048057600080fd5b50610489610feb565b6040516103729190614f36565b3480156104a257600080fd5b506104326104b13660046144c9565b611043565b3480156104c257600080fd5b506104326104d1366004614248565b6110f4565b3480156104e257600080fd5b506104666104f136600461482e565b61112c565b34801561050257600080fd5b5061050b611141565b6040516103729493929190615159565b34801561052757600080fd5b5061053b61053636600461486c565b6111e3565b604051610372929190614dcc565b34801561055557600080fd5b50610432610564366004614336565b611220565b34801561057557600080fd5b506101c5546103e59061010090046001600160a01b031681565b34801561059b57600080fd5b506103666105aa3660046141f2565b6001600160a01b031660009081526101c4602052604090205460ff1690565b3480156105d557600080fd5b506104326105e4366004614847565b61123f565b3480156105f557600080fd5b506104666106043660046144c9565b61125e565b34801561061557600080fd5b50610432610624366004614847565b6112f5565b34801561063557600080fd5b506104326106443660046147c6565b611383565b34801561065557600080fd5b506101c75460ff16610366565b34801561066e57600080fd5b5061043261067d3660046144c9565b61139a565b34801561068e57600080fd5b5061043261069d36600461482e565b611403565b3480156106ae57600080fd5b506104326106bd366004614248565b611472565b3480156106ce57600080fd5b506104326106dd36600461482e565b61148d565b3480156106ee57600080fd5b506104326106fd366004614a9d565b6114c1565b34801561070e57600080fd5b5061072261071d36600461482e565b6115a1565b604080516001600160a01b03909316835261ffff909116602083015201610372565b34801561075057600080fd5b5061046661075f36600461482e565b61160e565b34801561077057600080fd5b5061043261077f36600461482e565b6116a3565b34801561079057600080fd5b5061036661079f3660046141f2565b6116e7565b3480156107b057600080fd5b506101c5546103669060ff1681565b3480156107cb57600080fd5b506104326107da3660046144c9565b611705565b3480156107eb57600080fd5b506103e56107fa36600461482e565b611792565b34801561080b57600080fd5b506101cb54610466565b34801561082157600080fd5b506104326108303660046141f2565b61180a565b34801561084157600080fd5b5061085561085036600461482e565b611864565b604051610372919061514a565b34801561086e57600080fd5b5061046661087d3660046141f2565b6118e4565b34801561088e57600080fd5b506103bd61196c565b3480156108a357600080fd5b50604080516000808252602082015201610372565b3480156108c457600080fd5b506001610366565b3480156108d857600080fd5b506108e16119fb565b6040516103729190614ee1565b6104326108fc3660046144f5565b611ca8565b34801561090d57600080fd5b50610432611e38565b34801561092257600080fd5b50610432610931366004614a9d565b611ea1565b34801561094257600080fd5b506109566109513660046141f2565b611f18565b604080519485526020850193909352918301526060820152608001610372565b34801561098257600080fd5b506103e5611fc3565b34801561099757600080fd5b506103e56109a636600461486c565b611ffb565b3480156109b757600080fd5b506103666109c6366004614847565b61201b565b3480156109d757600080fd5b506104326109e63660046148c8565b612046565b3480156109f757600080fd5b506103bd612061565b348015610a0c57600080fd5b50610432610a1b36600461499e565b612071565b348015610a2c57600080fd5b5060405160028152602001610372565b348015610a4857600080fd5b50610466600081565b348015610a5d57600080fd5b50610432610a6c366004614308565b61212c565b348015610a7d57600080fd5b50610a91610a8c366004614579565b61213e565b6040516103729190614e7f565b348015610aaa57600080fd5b50610abe610ab9366004614a2c565b6121bc565b604080519215158352602083019190915201610372565b348015610ae157600080fd5b50610432610af03660046149c5565b612262565b348015610b0157600080fd5b506101c9546001600160a01b03811690600160a01b900461ffff16610722565b348015610b2d57600080fd5b50610432610b3c366004614289565b612302565b348015610b4d57600080fd5b506103bd610b5c36600461482e565b61233b565b348015610b6d57600080fd5b50610466610b7c36600461482e565b6123fc565b348015610b8d57600080fd5b506944726f7045524337323160b01b610466565b348015610bad57600080fd5b506101d8546001600160a01b03811690600160a01b900461ffff16610722565b348015610bd957600080fd5b50610432610be8366004614847565b612414565b348015610bf957600080fd5b50610466610c0836600461482e565b612433565b348015610c1957600080fd5b506103bd612455565b348015610c2e57600080fd5b50610432610c3d3660046148c8565b612463565b348015610c4e57600080fd5b50610432610c5d3660046146aa565b61247b565b348015610c6e57600080fd5b506103bd6124fe565b348015610c8357600080fd5b50610366610c9236600461420f565b61250c565b348015610ca357600080fd5b50610432610cb236600461438a565b61253b565b348015610cc357600080fd5b50610432610cd23660046147c6565b612758565b348015610ce357600080fd5b50610366610cf2366004614336565b61276f565b6000610d0282612802565b92915050565b606061015f8054610d1890615455565b80601f0160208091040260200160405190810160405280929190818152602001828054610d4490615455565b8015610d915780601f10610d6657610100808354040283529160200191610d91565b820191906000526020600020905b815481529060010190602001808311610d7457829003601f168201915b5050505050905090565b6000610da682612827565b610e0c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b50600090815261016360205260409020546001600160a01b031690565b6000610e3482611792565b9050806001600160a01b0316836001600160a01b03161415610ea25760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610e03565b806001600160a01b0316610eb4612845565b6001600160a01b03161480610ed05750610ed081610c92612845565b610f3d5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608401610e03565b610f47838361284f565b505050565b6000610f5f81610f5a612845565b6128be565b610f6a60008361201b565b610f8757604051634345326f60e11b815260040160405180910390fd5b6101c880546001600160a01b038481166001600160a01b031983168117909355604080519190921680825260208201939093527f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7691015b60405180910390a1505050565b60606101cb805480602002602001604051908101604052809291908181526020018280548015610d9157602002820191906000526020600020905b815481526020019060010190808311611026575050505050905090565b600061105181610f5a612845565b6127108211156110905760405162461bcd60e51b815260206004820152600a6024820152691f1026a0ac2fa128299760b11b6044820152606401610e03565b6101d880546001600160b01b031916600160a01b61ffff8516026001600160a01b031916176001600160a01b0385161790556040517fe2497bd806ec41a6e0dd992c29a72efc0ef8fec9092d1978fd4a1e00b2f1830490610fde9085908590614dcc565b6111056110ff612845565b82612922565b6111215760405162461bcd60e51b8152600401610e03906150ae565b610f478383836129e4565b600090815260fb602052604090206001015490565b611149613e77565b60405163a4910ae160e01b81526101cd600482015260009081908190731023abe3d964ccb03b33d7b8c81dd943c4578d2a9063a4910ae1906024016101606040518083038186803b15801561119d57600080fd5b505af41580156111b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d591906148fd565b935093509350935090919293565b6000806000806111f2866115a1565b90945084925061ffff16905061271061120b82876153dc565b61121591906153c8565b925050509250929050565b600061122e81610f5a612845565b611239848484612b7c565b50505050565b6112488261112c565b61125481610f5a612845565b610f478383612ccc565b6000611269836118e4565b82106112cb5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e03565b506001600160a01b0391909116600090815261019160209081526040808320938352929052205490565b6112fd612845565b6001600160a01b0316816001600160a01b0316146113755760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e03565b61137f8282612cef565b5050565b600061139181610f5a612845565b61137f82612d12565b60006113a881610f5a612845565b6001600160a01b03831660008181526101d3602052604090819020849055517f8973b95d42472e89416ea69404f8038c041db700af9ec294e7b4cd4e1ff2801c906113f69085815260200190565b60405180910390a2505050565b600061141181610f5a612845565b6101d454821061143457604051638844d0c960e01b815260040160405180910390fd5b6101d58290556040518281527ff2672935fc79f5237559e2e2999dbe743bf65430894ac2b37666890e7c69e1af906020015b60405180910390a15050565b610f4783838360405180602001604052806000815250612302565b6114986110ff612845565b6114b557604051634345326f60e11b815260040160405180910390fd5b6114be81612d5b565b50565b60008051602061570d8339815191526114dc81610f5a612845565b6101d45460006114ec86836153b0565b6101d481905560008181526101d96020526040902090915061150f908686613ec8565b506101cb8054600181810183556000929092527fe8bbfecd380c4167d6a1f763a233ec73e73f534b1970c4e1683f437ec23c1f44018290557f4e6c698792b8dfb7c94c60c7e9e91f82932832d5e1ec0870ed42cf674e6af44590839061157589836153b0565b61157f91906153fb565b878760405161159194939291906152ed565b60405180910390a1505050505050565b60008181526101da60209081526040808320815180830190925280546001600160a01b0316808352600190910154928201929092528291156115e95780516020820151611604565b6101c9546001600160a01b03811690600160a01b900461ffff165b9250925050915091565b600061161a6101935490565b821061167d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e03565b610193828154811061169157611691615501565b90600052602060002001549050919050565b60006116b181610f5a612845565b6101d68290556040518281527ff9d383c69b6255cbd431ca23734f43bdf15e694c7494956c917498469bcbce7390602001611466565b6001600160a01b031660009081526065602052604090205460ff1690565b600061171381610f5a612845565b61271082111561173657604051637d190eed60e01b815260040160405180910390fd5b6101c9805461ffff8416600160a01b026001600160b01b03199091166001600160a01b038616171790556040517f90d7ec04bcb8978719414f82e52e4cb651db41d0e6f8cea6118c2191e6183adb90610fde9085908590614dcc565b600081815261016160205260408120546001600160a01b031680610d025760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610e03565b600061181881610f5a612845565b6101d780546001600160a01b0319166001600160a01b0384169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a25050565b61186c613e77565b5060009081526101cf6020908152604091829020825161010081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c08201526007909101546001600160a01b031660e082015290565b60006001600160a01b03821661194f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610e03565b506001600160a01b03166000908152610162602052604090205490565b6101c6805461197a90615455565b80601f01602080910402602001604051908101604052809291908181526020018280546119a690615455565b80156119f35780601f106119c8576101008083540402835291602001916119f3565b820191906000526020600020905b8154815290600101906020018083116119d657829003601f168201915b505050505081565b60408051600b8082526101808201909252606091816020015b6060815260200190600190039081611a145790505090506040518060600160405280602381526020016156ea6023913981600081518110611a5757611a57615501565b602002602001018190525060405180606001604052806025815260200161562f6025913981600181518110611a8e57611a8e615501565b602002602001018190525060405180606001604052806023815260200161560c6023913981600281518110611ac557611ac5615501565b60200260200101819052506040518060600160405280602f8152602001615587602f913981600381518110611afc57611afc615501565b60200260200101819052506040518060600160405280603281526020016156546032913981600481518110611b3357611b33615501565b60200260200101819052506040518060600160405280603281526020016156b86032913981600581518110611b6a57611b6a615501565b60200260200101819052506040518060400160405280601e81526020017f7374616e646172642f494552433732312e736f6c3a494552433732315630000081525081600681518110611bbe57611bbe615501565b60200260200101819052506040518060600160405280602181526020016155eb6021913981600781518110611bf557611bf5615501565b60200260200101819052506040518060600160405280603581526020016155b66035913981600881518110611c2c57611c2c615501565b60200260200101819052506040518060600160405280603281526020016156866032913981600981518110611c6357611c63615501565b60200260200101819052506040518060600160405280602f815260200161574d602f913981600a81518110611c9a57611c9a615501565b602002602001018190525090565b60026001541415611cfb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e03565b6002600155611d09336116e7565b80611d23575032611d18612845565b6001600160a01b0316145b611d4057604051633d5552d360e21b815260040160405180910390fd5b6000731023abe3d964ccb03b33d7b8c81dd943c4578d2a63a10f3ed76101cd8a8a8a8a8a8a8a611d6e612845565b6040518a63ffffffff1660e01b8152600401611d9299989796959493929190615186565b60006040518083038186803b158015611daa57600080fd5b505af4158015611dbe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611de6919081019061472f565b905060005b8151811015611e2957611e1789838381518110611e0a57611e0a615501565b6020026020010151612df2565b611e226001826153b0565b9050611deb565b50506001805550505050505050565b6101c55460ff16611e5b5760405162461bcd60e51b8152600401610e0390615079565b3360008181526101c4602052604090819020805460ff191660011790555160008051602061577c83398151915291611e97916101c39190614f8d565b60405180910390a1565b60008051602061570d833981519152611ebc81610f5a612845565b60008481526101d960205260409020611ed6908484613ec8565b507f29a79348b587fdb8c1e68f2bdc84a2edf777093f8db626cb838e7ace52c2cf29848484604051611f0a939291906152d3565b60405180910390a150505050565b6040516326040b6560e11b81526101cd60048201526001600160a01b0382166024820152600090819081908190731023abe3d964ccb03b33d7b8c81dd943c4578d2a90634c0816ca9060440160806040518083038186803b158015611f7c57600080fd5b505af4158015611f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb49190614acf565b93509350935093509193509193565b6101c854600090611fde9082906001600160a01b031661201b565b611fe85750600090565b6101c8546001600160a01b03165b905090565b600082815261012d602052604081206120149083612f20565b9392505050565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600061205481610f5a612845565b6112396101ca8484613ec8565b60606101608054610d1890615455565b600061207f81610f5a612845565b6127108211156120a257604051637d190eed60e01b815260040160405180910390fd5b6040805180820182526001600160a01b038581168252602080830186815260008981526101da90925290849020925183546001600160a01b0319169216919091178255516001909101555184907f7365cf4122f072a3365c20d54eff9b38d73c096c28e1892ec8f5b0e403a0f12d9061211e9086908690614dcc565b60405180910390a250505050565b61137f612137612845565b8383612f2c565b604051631592ca1b60e31b8152606090309063ac9650d8906121669086908690600401614de5565b600060405180830381600087803b15801561218057600080fd5b505af1158015612194573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261201491908101906145ba565b600080731023abe3d964ccb03b33d7b8c81dd943c4578d2a6381dd4bed6101cd8a8a8a8a8a8a6040518863ffffffff1660e01b8152600401612204979695949392919061528b565b604080518083038186803b15801561221b57600080fd5b505af415801561222f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122539190614800565b91509150965096945050505050565b604051639f41a5b960e01b81526101cd6004820152602481018790526001600160a01b038087166044830152606482018690528416608482015260a4810183905281151560c4820152731023abe3d964ccb03b33d7b8c81dd943c4578d2a90639f41a5b99060e40160006040518083038186803b1580156122e257600080fd5b505af41580156122f6573d6000803e3d6000fd5b50505050505050505050565b61231361230d612845565b83612922565b61232f5760405162461bcd60e51b8152600401610e03906150ae565b61123984848484612ff8565b606060005b6101cb548110156123e6576101cb818154811061235f5761235f615501565b90600052602060002001548310156123d4576101d960006101cb838154811061238a5761238a615501565b906000526020600020015481526020019081526020016000206123ac8461302b565b6040516020016123bd929190614c55565b604051602081830303815290604052915050919050565b6123df6001826153b0565b9050612340565b5050604080516020810190915260008152919050565b600081815261012d60205260408120610d0290613128565b61241d8261112c565b61242981610f5a612845565b610f478383612cef565b6101cb818154811061244457600080fd5b600091825260209091200154905081565b6101c3805461197a90615455565b600061247181610f5a612845565b610f478383613132565b600061248981610f5a612845565b604051632d58f47f60e21b8152731023abe3d964ccb03b33d7b8c81dd943c4578d2a9063b563d1fc906124c8906101cd908890889088906004016151e4565b60006040518083038186803b1580156124e057600080fd5b505af41580156124f4573d6000803e3d6000fd5b5050505050505050565b6101ca805461197a90615455565b6001600160a01b0391821660009081526101646020908152604080832093909416825291909152205460ff1690565b600054610100900460ff166125565760005460ff161561255e565b61255e61313f565b6125c15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e03565b600054610100900460ff161580156125e3576000805461ffff19166101011790555b6125eb613150565b6125f488613181565b6125fe8b8b6131b9565b612610846000015185602001516131ea565b61264184604001516101c780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6101c980546001600160a01b038881166001600160b01b031990921691909117600160a01b61ffff891602179091556101d780546001600160a01b031916918916919091179055885161269c906101ca9060208c0190613f4c565b506101c880546001600160a01b0319166001600160a01b038e8116919091179091556101d880549184166001600160b01b031990921691909117600160a01b61ffff8616021790556126ef60008d613250565b61270760008051602061570d8339815191528d613250565b61271f6000805160206155678339815191528d613250565b6127386000805160206155678339815191526000613250565b801561274a576000805461ff00191690555b505050505050505050505050565b600061276681610f5a612845565b61137f8261325a565b6101c55460405163258c1ef560e01b815260009161010090046001600160a01b03169063258c1ef5906127aa90879087908790600401614d9e565b60206040518083038186803b1580156127c257600080fd5b505afa1580156127d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fa91906147e3565b949350505050565b60006001600160e01b0319821663780e9d6360e01b1480610d025750610d028261329c565b600090815261016160205260409020546001600160a01b0316151590565b6000611ff66132dc565b60008181526101636020526040902080546001600160a01b0319166001600160a01b038416908117909155819061288582611792565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6128c8828261201b565b61137f576128e0816001600160a01b031660146132fe565b6128eb8360206132fe565b6040516020016128fc929190614cde565b60408051601f198184030181529082905262461bcd60e51b8252610e0391600401614f7a565b600061292d82612827565b61298e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e03565b600061299983611792565b9050806001600160a01b0316846001600160a01b031614806129d45750836001600160a01b03166129c984610d9b565b6001600160a01b0316145b806127fa57506127fa818561250c565b826001600160a01b03166129f782611792565b6001600160a01b031614612a5b5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610e03565b6001600160a01b038216612abd5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e03565b612ac8838383613499565b612ad360008261284f565b6001600160a01b038316600090815261016260205260408120805460019290612afd9084906153fb565b90915550506001600160a01b038216600090815261016260205260408120805460019290612b2c9084906153b0565b90915550506000818152610161602052604080822080546001600160a01b0319166001600160a01b03868116918217909255915184939187169160008051602061572d83398151915291a4505050565b6101c55460ff16612b9f5760405162461bcd60e51b8152600401610e0390615079565b6101c55460405163258c1ef560e01b81526101009091046001600160a01b03169063258c1ef590612bd890869086908690600401614d9e565b60206040518083038186803b158015612bf057600080fd5b505afa158015612c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2891906147e3565b612c865760405162461bcd60e51b815260206004820152602960248201527f45524337323143656461723a207369676e61747572652063616e6e6f74206265604482015268081d995c9a599a595960ba1b6064820152608401610e03565b6001600160a01b03831660009081526101c4602052604090819020805460ff191660011790555160008051602061577c83398151915290610fde906101c3908690614f8d565b612cd682826135c8565b600082815261012d60205260409020610f47908261364f565b612cf98282613664565b600082815261012d60205260409020610f4790826136e9565b6101c5805460ff19168215159081179091556040519081527f973f129f1e2d7aa595b1461d5e88f9a15d2178a3209f60d73e7cf018c8e21ab6906020015b60405180910390a150565b6000612d6682611792565b9050612d7481600084613499565b612d7f60008361284f565b6001600160a01b038116600090815261016260205260408120805460019290612da99084906153fb565b90915550506000828152610161602052604080822080546001600160a01b0319169055518391906001600160a01b0384169060008051602061572d833981519152908390a45050565b6001600160a01b038216612e485760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e03565b612e5181612827565b15612e9d5760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610e03565b612ea960008383613499565b6001600160a01b038216600090815261016260205260408120805460019290612ed39084906153b0565b90915550506000818152610161602052604080822080546001600160a01b0319166001600160a01b038616908117909155905183929060008051602061572d833981519152908290a45050565b600061201483836136fe565b816001600160a01b0316836001600160a01b03161415612f8a5760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610e03565b6001600160a01b0383811660008181526101646020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6130038484846129e4565b61300f84848484613728565b6112395760405162461bcd60e51b8152600401610e0390615027565b60608161304f5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613079578061306381615490565b91506130729050600a836153c8565b9150613053565b6000816001600160401b0381111561309357613093615517565b6040519080825280601f01601f1916602001820160405280156130bd576020820181803683370190505b5090505b84156127fa576130d26001836153fb565b91506130df600a866154ab565b6130ea9060306153b0565b60f81b8183815181106130ff576130ff615501565b60200101906001600160f81b031916908160001a905350613121600a866153c8565b94506130c1565b6000610d02825490565b610f476101c68383613ec8565b600061314a30613843565b15905090565b600054610100900460ff166131775760405162461bcd60e51b8152600401610e03906150ff565b61317f613852565b565b600054610100900460ff166131a85760405162461bcd60e51b8152600401610e03906150ff565b6131b061387f565b6114be816138a6565b600054610100900460ff166131e05760405162461bcd60e51b8152600401610e03906150ff565b61137f8282613935565b600054610100900460ff166132115760405162461bcd60e51b8152600401610e03906150ff565b8151613225906101c3906020850190613f4c565b506101c580546001600160a01b0390921661010002610100600160a81b031990921691909117905550565b61137f8282612ccc565b6101c7805460ff19168215159081179091556040519081527fae23cc2173a8e9a060899b7376c4c8a44c9c9ff7d61c02ee68b3ff63cf2b730790602001612d50565b60006001600160e01b031982166380ac58cd60e01b14806132cd57506001600160e01b03198216635b5e139f60e01b145b80610d025750610d0282613985565b60006132e7336116e7565b156132f9575060131936013560601c90565b503390565b6060600061330d8360026153dc565b6133189060026153b0565b6001600160401b0381111561332f5761332f615517565b6040519080825280601f01601f191660200182016040528015613359576020820181803683370190505b509050600360fc1b8160008151811061337457613374615501565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106133a3576133a3615501565b60200101906001600160f81b031916908160001a90535060006133c78460026153dc565b6133d29060016153b0565b90505b600181111561344a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061340657613406615501565b1a60f81b82828151811061341c5761341c615501565b60200101906001600160f81b031916908160001a90535060049490941c936134438161543e565b90506133d5565b5083156120145760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e03565b6134a48383836139aa565b6134bd600080516020615567833981519152600061201b565b1580156134d257506001600160a01b03831615155b80156134e657506001600160a01b03821615155b1561353e576135036000805160206155678339815191528461201b565b8061352157506135216000805160206155678339815191528361201b565b61353e57604051634345326f60e11b815260040160405180910390fd5b6001600160a01b0382163014610f47576101c554339060ff16156135bf576001600160a01b03831660009081526101c4602090815260409182902054915160ff90921691613590916101c69101614c7a565b604051602081830303815290604052906135bd5760405162461bcd60e51b8152600401610e039190614f7a565b505b61123981613a64565b6135d2828261201b565b61137f57600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561360b612845565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000612014836001600160a01b038416613b63565b61366e828261201b565b1561137f57600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff191690556136a5612845565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000612014836001600160a01b038416613bb2565b600082600001828154811061371557613715615501565b9060005260206000200154905092915050565b600061373c846001600160a01b0316613843565b1561383857836001600160a01b031663150b7a02613758612845565b8786866040518563ffffffff1660e01b815260040161377a9493929190614d61565b602060405180830381600087803b15801561379457600080fd5b505af19250505080156137c4575060408051601f3d908101601f191682019092526137c1918101906148ab565b60015b61381e573d8080156137f2576040519150601f19603f3d011682016040523d82523d6000602084013e6137f7565b606091505b5080516138165760405162461bcd60e51b8152600401610e0390615027565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127fa565b506001949350505050565b6001600160a01b03163b151590565b600054610100900460ff166138795760405162461bcd60e51b8152600401610e03906150ff565b60018055565b600054610100900460ff1661317f5760405162461bcd60e51b8152600401610e03906150ff565b600054610100900460ff166138cd5760405162461bcd60e51b8152600401610e03906150ff565b60005b815181101561137f576001606560008484815181106138f1576138f1615501565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061392d81615490565b9150506138d0565b600054610100900460ff1661395c5760405162461bcd60e51b8152600401610e03906150ff565b81516139709061015f906020850190613f4c565b508051610f4790610160906020840190613f4c565b60006001600160e01b03198216635a05180f60e01b1480610d025750610d0282613ca5565b6001600160a01b038316613a0757613a02816101938054600083815261019460205260408120829055600182018355919091527ffc8af01f449989052b52093a58fc9f42d0b11f0c6dd5dca0463dab62346ccc680155565b613a2a565b816001600160a01b0316836001600160a01b031614613a2a57613a2a8382613cda565b6001600160a01b038216613a4157610f4781613d7c565b826001600160a01b0316826001600160a01b031614610f4757610f478282613e31565b613a6d81613843565b8015613a7c57506101c75460ff165b156114be576101c75460405163240a823f60e01b81526101009091046001600160a01b03169063240a823f90613ab6908490600401614d4d565b60206040518083038186803b158015613ace57600080fd5b505afa158015613ae2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b0691906147e3565b6114be5760405162461bcd60e51b815260206004820152602860248201527f45524337323143656461723a206f70657261746f72206973206e6f7420677265604482015267195b9b1a5cdd195960c21b6064820152608401610e03565b6000818152600183016020526040812054613baa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d02565b506000610d02565b60008181526001830160205260408120548015613c9b576000613bd66001836153fb565b8554909150600090613bea906001906153fb565b9050818114613c4f576000866000018281548110613c0a57613c0a615501565b9060005260206000200154905080876000018481548110613c2d57613c2d615501565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613c6057613c606154eb565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610d02565b6000915050610d02565b60006001600160e01b03198216637965db0b60e01b1480610d0257506301ffc9a760e01b6001600160e01b0319831614610d02565b60006001613ce7846118e4565b613cf191906153fb565b60008381526101926020526040902054909150808214613d47576001600160a01b038416600090815261019160209081526040808320858452825280832054848452818420819055835261019290915290208190555b506000918252610192602090815260408084208490556001600160a01b03909416835261019181528383209183525290812055565b61019354600090613d8f906001906153fb565b600083815261019460205260408120546101938054939450909284908110613db957613db9615501565b90600052602060002001549050806101938381548110613ddb57613ddb615501565b60009182526020808320909101929092558281526101949091526040808220849055858252812055610193805480613e1557613e156154eb565b6001900381819060005260206000200160009055905550505050565b6000613e3c836118e4565b6001600160a01b0390931660009081526101916020908152604080832086845282528083208590559382526101929052919091209190915550565b6040518061010001604052806000815260200160008152602001600081526020016000815260200160008152602001600080191681526020016000815260200160006001600160a01b031681525090565b828054613ed490615455565b90600052602060002090601f016020900481019282613ef65760008555613f3c565b82601f10613f0f5782800160ff19823516178555613f3c565b82800160010185558215613f3c579182015b82811115613f3c578235825591602001919060010190613f21565b50613f48929150613fc0565b5090565b828054613f5890615455565b90600052602060002090601f016020900481019282613f7a5760008555613f3c565b82601f10613f9357805160ff1916838001178555613f3c565b82800160010185558215613f3c579182015b82811115613f3c578251825591602001919060010190613fa5565b5b80821115613f485760008155600101613fc1565b6000613fe8613fe384615389565b615336565b9050828152838383011115613ffc57600080fd5b828260208301376000602084830101529392505050565b803561401e8161552d565b919050565b805161401e8161552d565b600082601f83011261403f57600080fd5b8135602061404f613fe383615366565b80838252828201915082860187848660051b890101111561406f57600080fd5b60005b858110156140975781356140858161552d565b84529284019290840190600101614072565b5090979650505050505050565b60008083601f8401126140b657600080fd5b5081356001600160401b038111156140cd57600080fd5b6020830191508360208260051b85010111156140e857600080fd5b9250929050565b60008083601f84011261410157600080fd5b5081356001600160401b0381111561411857600080fd5b6020830191508360208285010111156140e857600080fd5b600082601f83011261414157600080fd5b61201483833560208501613fd5565b60006060828403121561416257600080fd5b604051606081016001600160401b03808211838310171561418557614185615517565b81604052829350843591508082111561419d57600080fd5b506141aa85828601614130565b82525060208301356141bb8161552d565b602082015260408301356141ce8161552d565b6040919091015292915050565b80356001600160801b038116811461401e57600080fd5b60006020828403121561420457600080fd5b81356120148161552d565b6000806040838503121561422257600080fd5b823561422d8161552d565b9150602083013561423d8161552d565b809150509250929050565b60008060006060848603121561425d57600080fd5b83356142688161552d565b925060208401356142788161552d565b929592945050506040919091013590565b6000806000806080858703121561429f57600080fd5b84356142aa8161552d565b935060208501356142ba8161552d565b92506040850135915060608501356001600160401b038111156142dc57600080fd5b8501601f810187136142ed57600080fd5b6142fc87823560208401613fd5565b91505092959194509250565b6000806040838503121561431b57600080fd5b82356143268161552d565b9150602083013561423d81615542565b60008060006040848603121561434b57600080fd5b83356143568161552d565b925060208401356001600160401b0381111561437157600080fd5b61437d868287016140ef565b9497909650939450505050565b60008060008060008060008060008060006101608c8e0312156143ac57600080fd5b6143b58c614013565b9a506001600160401b0360208d01358110156143d057600080fd5b6143e08e60208f01358f01614130565b9a508060408e013511156143f357600080fd5b6144038e60408f01358f01614130565b99508060608e0135111561441657600080fd5b6144268e60608f01358f01614130565b98508060808e0135111561443957600080fd5b6144498e60808f01358f0161402e565b975061445760a08e01614013565b965061446560c08e01614013565b955061447360e08e016141db565b9450806101008e0135111561448757600080fd5b506144998d6101008e01358e01614150565b92506144a86101208d016141db565b91506144b76101408d01614013565b90509295989b509295989b9093969950565b600080604083850312156144dc57600080fd5b82356144e78161552d565b946020939093013593505050565b600080600080600080600060c0888a03121561451057600080fd5b873561451b8161552d565b96506020880135955060408801356145328161552d565b94506060880135935060808801356001600160401b0381111561455457600080fd5b6145608a828b016140a4565b989b979a5095989497959660a090950135949350505050565b6000806020838503121561458c57600080fd5b82356001600160401b038111156145a257600080fd5b6145ae858286016140a4565b90969095509350505050565b600060208083850312156145cd57600080fd5b82516001600160401b03808211156145e457600080fd5b818501915085601f8301126145f857600080fd5b8151614606613fe382615366565b80828252858201915085850189878560051b880101111561462657600080fd5b60005b8481101561469b5781518681111561464057600080fd5b8701603f81018c1361465157600080fd5b888101516040614663613fe383615389565b8281528e8284860101111561467757600080fd5b614686838d8301848701615412565b87525050509287019290870190600101614629565b50909998505050505050505050565b6000806000604084860312156146bf57600080fd5b83356001600160401b03808211156146d657600080fd5b818601915086601f8301126146ea57600080fd5b8135818111156146f957600080fd5b8760208260081b850101111561470e57600080fd5b6020928301955093505084013561472481615542565b809150509250925092565b6000602080838503121561474257600080fd5b82516001600160401b0381111561475857600080fd5b8301601f8101851361476957600080fd5b8051614777613fe382615366565b80828252848201915084840188868560051b870101111561479757600080fd5b600094505b838510156147ba57805183526001949094019391850191850161479c565b50979650505050505050565b6000602082840312156147d857600080fd5b813561201481615542565b6000602082840312156147f557600080fd5b815161201481615542565b6000806040838503121561481357600080fd5b825161481e81615542565b6020939093015192949293505050565b60006020828403121561484057600080fd5b5035919050565b6000806040838503121561485a57600080fd5b82359150602083013561423d8161552d565b6000806040838503121561487f57600080fd5b50508035926020909101359150565b6000602082840312156148a057600080fd5b813561201481615550565b6000602082840312156148bd57600080fd5b815161201481615550565b600080602083850312156148db57600080fd5b82356001600160401b038111156148f157600080fd5b6145ae858286016140ef565b60008060008084860361016081121561491557600080fd5b6101008082121561492557600080fd5b61492d61530d565b9150865182526020870151602083015260408701516040830152606087015160608301526080870151608083015260a087015160a083015260c087015160c083015261497b60e08801614023565b60e083015286015161012087015161014090970151919890975090945092505050565b6000806000606084860312156149b357600080fd5b8335925060208401356142788161552d565b60008060008060008060c087890312156149de57600080fd5b8635955060208701356149f08161552d565b9450604087013593506060870135614a078161552d565b92506080870135915060a0870135614a1e81615542565b809150509295509295509295565b60008060008060008060a08789031215614a4557600080fd5b863595506020870135614a578161552d565b94506040870135935060608701356001600160401b03811115614a7957600080fd5b614a8589828a016140a4565b979a9699509497949695608090950135949350505050565b600080600060408486031215614ab257600080fd5b8335925060208401356001600160401b0381111561437157600080fd5b60008060008060808587031215614ae557600080fd5b505082516020840151604085015160609095015191969095509092509050565b81835260006001600160fb1b03831115614b1e57600080fd5b8260051b8083602087013760009401602001938452509192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452614b7c816020860160208601615412565b601f01601f19169290920160200192915050565b60008154614b9d81615455565b60018281168015614bb55760018114614bc657614bf5565b60ff19841687528287019450614bf5565b8560005260208060002060005b85811015614bec5781548a820152908401908201614bd3565b50505082870194505b5050505092915050565b805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260018060a01b0360e08201511660e08301525050565b6000614c618285614b90565b8351614c71818360208801615412565b01949350505050565b7f5265636569766572206164647265737320686173206e6f74206163636570746581527f642074686520636f6c6c656374696f6e2773207465726d73206f662075736520602082015262030ba160ed1b604082015260006120146043830184614b90565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351614d10816017850160208801615412565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614d41816028840160208801615412565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614d9490830184614b64565b9695505050505050565b6001600160a01b0384168152604060208201819052600090614dc39083018486614b3b565b95945050505050565b6001600160a01b03929092168252602082015260400190565b60208082528181018390526000906040600585901b8401810190840186845b87811015614e7257868403603f190183528135368a9003601e19018112614e2a57600080fd5b890180356001600160401b03811115614e4257600080fd5b8036038b1315614e5157600080fd5b614e5e8682898501614b3b565b955050509184019190840190600101614e04565b5091979650505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614ed457603f19888603018452614ec2858351614b64565b94509285019290850190600101614ea6565b5092979650505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614ed457603f19888603018452614f24858351614b64565b94509285019290850190600101614f08565b6020808252825182820181905260009190848201906040850190845b81811015614f6e57835183529284019291840191600101614f52565b50909695505050505050565b6020815260006120146020830184614b64565b604081526000808454614f9f81615455565b8060408601526060600180841660008114614fc15760018114614fd557615006565b60ff19851688840152608088019550615006565b8960005260208060002060005b86811015614ffd5781548b8201870152908401908201614fe2565b8a018501975050505b505050506001600160a01b0394909416602093909301929092525092915050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f45524337323143656461723a207465726d73206e6f7420616374697661746564604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6101008101610d028284614bff565b61016081016151688287614bff565b84610100830152836101208301528261014083015295945050505050565b60006101008b835260018060a01b03808c1660208501528a6040850152808a1660608501528860808501528160a08501526151c4828501888a614b05565b92508560c085015280851660e085015250509a9950505050505050505050565b848152606060208083018290528282018590526000919060809081850188855b8981101561527657813583528382013584840152604080830135908401528582013586840152848201358584015260a0808301359084015260c0808301359084015260e0808301356152558161552d565b6001600160a01b031690840152610100928301929190910190600101615204565b505086151560408701529350614dc392505050565b87815286602082015260018060a01b038616604082015284606082015260c0608082015260006152bf60c083018587614b05565b90508260a083015298975050505050505050565b838152604060208201526000614dc3604083018486614b3b565b848152836020820152606060408201526000614d94606083018486614b3b565b60405161010081016001600160401b038111828210171561533057615330615517565b60405290565b604051601f8201601f191681016001600160401b038111828210171561535e5761535e615517565b604052919050565b60006001600160401b0382111561537f5761537f615517565b5060051b60200190565b60006001600160401b038211156153a2576153a2615517565b50601f01601f191660200190565b600082198211156153c3576153c36154bf565b500190565b6000826153d7576153d76154d5565b500490565b60008160001904831182151516156153f6576153f66154bf565b500290565b60008282101561540d5761540d6154bf565b500390565b60005b8381101561542d578181015183820152602001615415565b838111156112395750506000910152565b60008161544d5761544d6154bf565b506000190190565b600181811c9082168061546957607f821691505b6020821081141561548a57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156154a4576154a46154bf565b5060010190565b6000826154ba576154ba6154d5565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146114be57600080fd5b80151581146114be57600080fd5b6001600160e01b0319811681146114be57600080fdfe8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c61677265656d656e742f49436564617241677265656d656e742e736f6c3a49436564617241677265656d656e745630626173655552492f494365646172557064617465426173655552492e736f6c3a494365646172557064617465426173655552495630726f79616c746965732f49526f79616c74792e736f6c3a49526f79616c74795630494d756c746963616c6c61626c652e736f6c3a494d756c746963616c6c61626c65563049436564617256657273696f6e65642e736f6c3a49436564617256657273696f6e6564563069737375616e63652f4943656461724e465449737375616e63652e736f6c3a4943656461724e465449737375616e636556316d657461646174612f4943656461724e46544d657461646174612e736f6c3a4943656461724e46544d6574616461746156316c617a796d696e742f4943656461724e46544c617a794d696e742e736f6c3a4943656461724e46544c617a794d696e74563149436564617246656174757265732e736f6c3a494365646172466561747572657356309f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6d657461646174612f49436f6e74726163744d657461646174612e736f6c3a4943656461724d657461646174615630e6f8b8b4dcb99c0bcda0ec9d87d5425c99ef716797a0343009884d11d3fe857da26469706673582212201d1f9bab4a2f26cdd97e4da81822b253e34d54fa4e972fb0960b7fce6b5f2f3264736f6c63430008070033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.