Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ERC721ATieredSalesCollection
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "../../../common/WithdrawExtension.sol"; import "../../../common/meta-transactions/ERC2771ContextOwnable.sol"; import "../../ERC721/extensions/ERC721RoyaltyExtension.sol"; import "../extensions/ERC721ACollectionMetadataExtension.sol"; import "../extensions/ERC721APrefixedMetadataExtension.sol"; import "../extensions/ERC721AMinterExtension.sol"; import "../extensions/ERC721AOwnerMintExtension.sol"; import "../extensions/ERC721ATieringExtension.sol"; import "../extensions/ERC721ARoleBasedMintExtension.sol"; import "../extensions/ERC721ARoleBasedLockableExtension.sol"; contract ERC721ATieredSalesCollection is Ownable, ERC165Storage, WithdrawExtension, ERC721ACollectionMetadataExtension, ERC721APrefixedMetadataExtension, ERC721AOwnerMintExtension, ERC721ATieringExtension, ERC721ARoleBasedMintExtension, ERC721ARoleBasedLockableExtension, ERC721RoyaltyExtension, ERC2771ContextOwnable { struct Config { string name; string symbol; string contractURI; string placeholderURI; string tokenURIPrefix; uint256 maxSupply; Tier[] tiers; address defaultRoyaltyAddress; uint16 defaultRoyaltyBps; address proceedsRecipient; address trustedForwarder; } constructor(Config memory config) ERC721A(config.name, config.symbol) { initialize(config, msg.sender); } function initialize(Config memory config, address deployer) public initializer { _setupRole(DEFAULT_ADMIN_ROLE, deployer); _transferOwnership(deployer); __WithdrawExtension_init(config.proceedsRecipient, WithdrawMode.ANYONE); __ERC721ACollectionMetadataExtension_init( config.name, config.symbol, config.contractURI ); __ERC721APrefixedMetadataExtension_init( config.placeholderURI, config.tokenURIPrefix ); __ERC721AMinterExtension_init(config.maxSupply); __ERC721AOwnerMintExtension_init(); __ERC721ARoleBasedMintExtension_init(deployer); __ERC721ARoleBasedLockableExtension_init(); __ERC721ATieringExtension_init(config.tiers); __ERC721RoyaltyExtension_init( config.defaultRoyaltyAddress, config.defaultRoyaltyBps ); __ERC2771ContextOwnable_init(config.trustedForwarder); } function _msgSender() internal view virtual override(ERC2771ContextOwnable, Context) returns (address sender) { return ERC2771ContextOwnable._msgSender(); } function _msgData() internal view virtual override(ERC2771ContextOwnable, Context) returns (bytes calldata) { return ERC2771ContextOwnable._msgData(); } function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override(ERC721A, ERC721ALockableExtension) { ERC721ALockableExtension._beforeTokenTransfers( from, to, startTokenId, quantity ); } /* PUBLIC */ function supportsInterface(bytes4 interfaceId) public view virtual override( ERC165Storage, ERC721ACollectionMetadataExtension, ERC721APrefixedMetadataExtension, ERC721AOwnerMintExtension, ERC721ARoleBasedMintExtension, ERC721RoyaltyExtension, ERC721ARoleBasedLockableExtension ) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } function name() public view override(ERC721A, ERC721ACollectionMetadataExtension) returns (string memory) { return ERC721ACollectionMetadataExtension.name(); } function symbol() public view override(ERC721A, ERC721ACollectionMetadataExtension) returns (string memory) { return ERC721ACollectionMetadataExtension.symbol(); } function tokenURI(uint256 _tokenId) public view virtual override(ERC721A, ERC721APrefixedMetadataExtension) returns (string memory) { return ERC721APrefixedMetadataExtension.tokenURI(_tokenId); } function setMaxSupply(uint256 newValue) public virtual override(ERC721AMinterExtension, ERC721ATieringExtension) onlyOwner { ERC721ATieringExtension.setMaxSupply(newValue); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * Simple EIP2981 reference override implementation */ interface IEIP2981RoyaltyOverride is IERC165 { event TokenRoyaltyRemoved(uint256 tokenId); event TokenRoyaltySet(uint256 tokenId, address recipient, uint16 bps); event DefaultRoyaltySet(address recipient, uint16 bps); struct TokenRoyalty { address recipient; uint16 bps; } struct TokenRoyaltyConfig { uint256 tokenId; address recipient; uint16 bps; } /** * @dev Set per token royalties. Passing a recipient of address(0) will delete any existing configuration */ function setTokenRoyalties(TokenRoyaltyConfig[] calldata royalties) external; /** * @dev Get the number of token specific overrides. Used to enumerate over all configurations */ function getTokenRoyaltiesCount() external view returns(uint256); /** * @dev Get a token royalty configuration by index. Use in conjunction with getTokenRoyaltiesCount to get all per token configurations */ function getTokenRoyaltyByIndex(uint256 index) external view returns(TokenRoyaltyConfig memory); /** * @dev Set a default royalty configuration. Will be used if no token specific configuration is set */ function setDefaultRoyalty(TokenRoyalty calldata royalty) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "./IRoyaltyOverride.sol"; import "../specs/IEIP2981.sol"; /** * Simple EIP2981 reference override implementation */ abstract contract EIP2981RoyaltyOverrideCore is IEIP2981, IEIP2981RoyaltyOverride, ERC165 { using EnumerableSet for EnumerableSet.UintSet; TokenRoyalty public defaultRoyalty; mapping(uint256 => TokenRoyalty) private _tokenRoyalties; EnumerableSet.UintSet private _tokensWithRoyalties; function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IEIP2981).interfaceId || interfaceId == type(IEIP2981RoyaltyOverride).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Sets token royalties. When you override this in the implementation contract * ensure that you access restrict it to the contract owner or admin */ function _setTokenRoyalties(TokenRoyaltyConfig[] memory royaltyConfigs) internal { for (uint i = 0; i < royaltyConfigs.length; i++) { TokenRoyaltyConfig memory royaltyConfig = royaltyConfigs[i]; require(royaltyConfig.bps < 10000, "Invalid bps"); if (royaltyConfig.recipient == address(0)) { delete _tokenRoyalties[royaltyConfig.tokenId]; _tokensWithRoyalties.remove(royaltyConfig.tokenId); emit TokenRoyaltyRemoved(royaltyConfig.tokenId); } else { _tokenRoyalties[royaltyConfig.tokenId] = TokenRoyalty(royaltyConfig.recipient, royaltyConfig.bps); _tokensWithRoyalties.add(royaltyConfig.tokenId); emit TokenRoyaltySet(royaltyConfig.tokenId, royaltyConfig.recipient, royaltyConfig.bps); } } } /** * @dev Sets default royalty. When you override this in the implementation contract * ensure that you access restrict it to the contract owner or admin */ function _setDefaultRoyalty(TokenRoyalty memory royalty) internal { require(royalty.bps < 10000, "Invalid bps"); defaultRoyalty = TokenRoyalty(royalty.recipient, royalty.bps); emit DefaultRoyaltySet(royalty.recipient, royalty.bps); } /** * @dev See {IEIP2981RoyaltyOverride-getTokenRoyaltiesCount}. */ function getTokenRoyaltiesCount() external override view returns(uint256) { return _tokensWithRoyalties.length(); } /** * @dev See {IEIP2981RoyaltyOverride-getTokenRoyaltyByIndex}. */ function getTokenRoyaltyByIndex(uint256 index) external override view returns(TokenRoyaltyConfig memory) { uint256 tokenId = _tokensWithRoyalties.at(index); TokenRoyalty memory royalty = _tokenRoyalties[tokenId]; return TokenRoyaltyConfig(tokenId, royalty.recipient, royalty.bps); } /** * @dev See {IEIP2981RoyaltyOverride-royaltyInfo}. */ function royaltyInfo(uint256 tokenId, uint256 value) public override view returns (address, uint256) { if (_tokenRoyalties[tokenId].recipient != address(0)) { return (_tokenRoyalties[tokenId].recipient, value*_tokenRoyalties[tokenId].bps/10000); } if (defaultRoyalty.recipient != address(0) && defaultRoyalty.bps != 0) { return (defaultRoyalty.recipient, value*defaultRoyalty.bps/10000); } return (address(0), 0); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * EIP-2981 */ interface IEIP2981 { /** * bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a * * => 0x2a55205a = 0x2a55205a */ function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address, uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ 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()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // 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 (last updated v4.6.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/Address.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. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * 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 prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = _setInitializedVersion(1); if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { bool isTopLevelCall = _setInitializedVersion(version); if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(version); } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { _setInitializedVersion(type(uint8).max); } function _setInitializedVersion(uint8 version) private returns (bool) { // 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, and for the lowest level // of initializers, because in other contexts the contract may have been reentered. if (_initializing) { require( version == 1 && !Address.isContract(address(this)), "Initializable: contract is already initialized" ); return false; } else { require(_initialized < version, "Initializable: contract is already initialized"); _initialized = version; return true; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @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 ReentrancyGuard { // 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; constructor() { _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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.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 ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings 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. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual 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 overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.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 = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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 = ERC721.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(ERC721.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(ERC721.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 IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.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 {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must 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 Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (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 IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated 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 // 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 v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// 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 (last updated v4.6.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @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. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = _efficientHash(computedHash, proofElement); } else { // Hash(current element of the proof + current computed hash) computedHash = _efficientHash(proofElement, computedHash); } } return computedHash; } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Storage.sol) pragma solidity ^0.8.0; import "./ERC165.sol"; /** * @dev Storage based implementation of the {IERC165} interface. * * Contracts may inherit from this and call {_registerInterface} to declare * their support of an interface. */ abstract contract ERC165Storage is ERC165 { /** * @dev Mapping of interface ids to whether or not it's supported. */ mapping(bytes4 => bool) private _supportedInterfaces; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return super.supportsInterface(interfaceId) || _supportedInterfaces[interfaceId]; } /** * @dev Registers the contract as an implementer of the interface defined by * `interfaceId`. Support of the actual ERC165 interface is automatic and * registering its interface id is not required. * * See {IERC165-supportsInterface}. * * Requirements: * * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`). */ function _registerInterface(bytes4 interfaceId) internal virtual { require(interfaceId != 0xffffffff, "ERC165: invalid interface id"); _supportedInterfaces[interfaceId] = true; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// 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 BitMaps { 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.6.0) (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 EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { 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: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "./ERC721CollectionMetadataExtension.sol"; interface IERC721AutoIdMinterExtension { function setMaxSupply(uint256 newValue) external; function freezeMaxSupply() external; function totalSupply() external view returns (uint256); } /** * @dev Extension to add minting capability with an auto incremented ID for each token and a maximum supply setting. */ abstract contract ERC721AutoIdMinterExtension is IERC721AutoIdMinterExtension, ERC721CollectionMetadataExtension { using SafeMath for uint256; uint256 public maxSupply; bool public maxSupplyFrozen; uint256 internal _currentTokenId = 0; function __ERC721AutoIdMinterExtension_init(uint256 _maxSupply) internal onlyInitializing { __ERC721AutoIdMinterExtension_init_unchained(_maxSupply); } function __ERC721AutoIdMinterExtension_init_unchained(uint256 _maxSupply) internal onlyInitializing { maxSupply = _maxSupply; _registerInterface(type(IERC721AutoIdMinterExtension).interfaceId); _registerInterface(type(IERC721).interfaceId); } /* ADMIN */ function setMaxSupply(uint256 newValue) public virtual override onlyOwner { require(!maxSupplyFrozen, "FROZEN"); require(newValue >= totalSupply(), "LOWER_THAN_SUPPLY"); maxSupply = newValue; } function freezeMaxSupply() external onlyOwner { maxSupplyFrozen = true; } /* PUBLIC */ function totalSupply() public view returns (uint256) { return _currentTokenId; } /* INTERNAL */ function _mintTo(address to, uint256 count) internal { require(totalSupply() + count <= maxSupply, "EXCEEDS_SUPPLY"); for (uint256 i = 0; i < count; i++) { uint256 newTokenId = _currentTokenId; _safeMint(to, newTokenId); _incrementTokenId(); } } /** * Increments the value of _currentTokenId */ function _incrementTokenId() internal { _currentTokenId++; } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; interface IERC721CollectionMetadataExtension { function setContractURI(string memory newValue) external; function contractURI() external view returns (string memory); } /** * @dev Extension to allow configuring contract-level collection metadata URI. */ abstract contract ERC721CollectionMetadataExtension is Initializable, Ownable, ERC165Storage, ERC721 { string private _name; string private _symbol; string private _contractURI; function __ERC721CollectionMetadataExtension_init( string memory name_, string memory symbol_, string memory contractURI_ ) internal onlyInitializing { __ERC721CollectionMetadataExtension_init_unchained( name_, symbol_, contractURI_ ); } function __ERC721CollectionMetadataExtension_init_unchained( string memory name_, string memory symbol_, string memory contractURI_ ) internal onlyInitializing { _name = name_; _symbol = symbol_; _contractURI = contractURI_; _registerInterface( type(IERC721CollectionMetadataExtension).interfaceId ); _registerInterface(type(IERC721).interfaceId); _registerInterface(type(IERC721Metadata).interfaceId); } /* ADMIN */ function setContractURI(string memory newValue) external onlyOwner { _contractURI = newValue; } /* PUBLIC */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Storage, ERC721) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function contractURI() public view returns (string memory) { return _contractURI; } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "./ERC721AutoIdMinterExtension.sol"; interface IERC721OwnerMintExtension { function mintByOwner(address to, uint256 count) external; } /** * @dev Extension to allow owner to mint directly without paying. */ abstract contract ERC721OwnerMintExtension is IERC721OwnerMintExtension, Initializable, Ownable, ERC165Storage, ERC721AutoIdMinterExtension { function __ERC721OwnerMintExtension_init() internal onlyInitializing { __ERC721OwnerMintExtension_init_unchained(); } function __ERC721OwnerMintExtension_init_unchained() internal onlyInitializing { _registerInterface(type(IERC721OwnerMintExtension).interfaceId); } /* ADMIN */ function mintByOwner(address to, uint256 count) external onlyOwner { _mintTo(to, count); } /* PUBLIC */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Storage, ERC721CollectionMetadataExtension) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "./ERC721CollectionMetadataExtension.sol"; interface IERC721PrefixedMetadataExtension { function setPlaceholderURI(string memory newValue) external; function setTokenURIPrefix(string memory newValue) external; function setTokenURISuffix(string memory newValue) external; function placeholderURI() external view returns (string memory); function tokenURIPrefix() external view returns (string memory); function tokenURISuffix() external view returns (string memory); function tokenURI(uint256 _tokenId) external view returns (string memory); function freezeTokenURI() external; } /** * @dev Extension to allow configuring tokens metadata URI. * In this extension tokens will have a shared token URI prefix, * therefore on tokenURI() token's ID will be appended to the base URI. * It also allows configuring a fallback "placeholder" URI when prefix is not set yet. */ abstract contract ERC721PrefixedMetadataExtension is IERC721PrefixedMetadataExtension, Initializable, Ownable, ERC165Storage, ERC721 { string internal _placeholderURI; string internal _tokenURIPrefix; string internal _tokenURISuffix; bool public tokenURIFrozen; function __ERC721PrefixedMetadataExtension_init( string memory placeholderURI_, string memory tokenURIPrefix_ ) internal onlyInitializing { __ERC721PrefixedMetadataExtension_init_unchained( placeholderURI_, tokenURIPrefix_ ); } function __ERC721PrefixedMetadataExtension_init_unchained( string memory placeholderURI_, string memory tokenURIPrefix_ ) internal onlyInitializing { _placeholderURI = placeholderURI_; _tokenURIPrefix = tokenURIPrefix_; _tokenURISuffix = ".json"; _registerInterface(type(IERC721PrefixedMetadataExtension).interfaceId); _registerInterface(type(IERC721Metadata).interfaceId); } /* ADMIN */ function setPlaceholderURI(string memory newValue) external onlyOwner { _placeholderURI = newValue; } function setTokenURIPrefix(string memory newValue) external onlyOwner { require(!tokenURIFrozen, "FROZEN"); _tokenURIPrefix = newValue; } function setTokenURISuffix(string memory newValue) external onlyOwner { require(!tokenURIFrozen, "FROZEN"); _tokenURISuffix = newValue; } function freezeTokenURI() external onlyOwner { tokenURIFrozen = true; } /* PUBLIC */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Storage, ERC721) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } function placeholderURI() public view returns (string memory) { return _placeholderURI; } function tokenURIPrefix() public view returns (string memory) { return _tokenURIPrefix; } function tokenURISuffix() public view returns (string memory) { return _tokenURISuffix; } function tokenURI(uint256 _tokenId) public view virtual override(ERC721, IERC721PrefixedMetadataExtension) returns (string memory) { return bytes(_tokenURIPrefix).length > 0 ? string( abi.encodePacked( _tokenURIPrefix, Strings.toString(_tokenId), _tokenURISuffix ) ) : _placeholderURI; } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "./ERC721AutoIdMinterExtension.sol"; interface IERC721RoleBasedMintExtension { function mintByRole(address to, uint256 count) external; } /** * @dev Extension to allow holders of a OpenZepplin-based role to mint directly. */ abstract contract ERC721RoleBasedMintExtension is IERC721RoleBasedMintExtension, Initializable, ERC165Storage, ERC721AutoIdMinterExtension, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); function __ERC721RoleBasedMintExtension_init(address minter) internal onlyInitializing { __ERC721RoleBasedMintExtension_init_unchained(minter); } function __ERC721RoleBasedMintExtension_init_unchained(address minter) internal onlyInitializing { _registerInterface(type(IERC721RoleBasedMintExtension).interfaceId); _setupRole(MINTER_ROLE, minter); } /* ADMIN */ function mintByRole(address to, uint256 count) external { require(hasRole(MINTER_ROLE, _msgSender()), "NOT_MINTER_ROLE"); _mintTo(to, count); } /* PUBLIC */ function supportsInterface(bytes4 interfaceId) public view virtual override( ERC165Storage, AccessControl, ERC721CollectionMetadataExtension ) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@manifoldxyz/royalty-registry-solidity/contracts/overrides/IRoyaltyOverride.sol"; import "@manifoldxyz/royalty-registry-solidity/contracts/overrides/RoyaltyOverrideCore.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "../../../misc/rarible/IRoyalties.sol"; import "../../../misc/rarible/LibPart.sol"; import "../../../misc/rarible/LibRoyaltiesV2.sol"; interface IERC721RoyaltyExtension { function setTokenRoyalties( IEIP2981RoyaltyOverride.TokenRoyaltyConfig[] calldata royaltyConfigs ) external; function setDefaultRoyalty( IEIP2981RoyaltyOverride.TokenRoyalty calldata royalty ) external; function getRaribleV2Royalties(uint256 id) external view returns (LibPart.Part[] memory result); } /** * @dev Extension to signal configured royalty to famous marketplaces as well as ERC2981. * * This extension currently supports Standard ERC2981, Rarible. * Note that OpenSea is supported via Flair metadata feature. */ abstract contract ERC721RoyaltyExtension is IERC721RoyaltyExtension, IRoyalties, Initializable, Ownable, ERC165Storage, EIP2981RoyaltyOverrideCore { function __ERC721RoyaltyExtension_init( address defaultRoyaltyReceiver, uint16 defaultRoyaltyBps ) internal onlyInitializing { __ERC721RoyaltyExtension_init_unchained( defaultRoyaltyReceiver, defaultRoyaltyBps ); } function __ERC721RoyaltyExtension_init_unchained( address defaultRoyaltyReceiver, uint16 defaultRoyaltyBps ) internal onlyInitializing { _registerInterface(type(IERC721RoyaltyExtension).interfaceId); _registerInterface(type(IEIP2981).interfaceId); _registerInterface(type(IEIP2981RoyaltyOverride).interfaceId); _registerInterface(LibRoyaltiesV2._INTERFACE_ID_ROYALTIES); TokenRoyalty memory royalty = TokenRoyalty( defaultRoyaltyReceiver, defaultRoyaltyBps ); _setDefaultRoyalty(royalty); } function setTokenRoyalties(TokenRoyaltyConfig[] calldata royaltyConfigs) external override(IEIP2981RoyaltyOverride, IERC721RoyaltyExtension) onlyOwner { _setTokenRoyalties(royaltyConfigs); } function setDefaultRoyalty(TokenRoyalty calldata royalty) external override(IEIP2981RoyaltyOverride, IERC721RoyaltyExtension) onlyOwner { _setDefaultRoyalty(royalty); } function getRaribleV2Royalties(uint256 id) external view override(IRoyalties, IERC721RoyaltyExtension) returns (LibPart.Part[] memory result) { result = new LibPart.Part[](1); result[0].account = payable(defaultRoyalty.recipient); result[0].value = defaultRoyalty.bps; id; // avoid unused param warning } /* PUBLIC */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Storage, EIP2981RoyaltyOverrideCore) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./ERC721AutoIdMinterExtension.sol"; interface IERC721TieringExtension { struct Tier { uint256 start; uint256 end; address currency; uint256 price; uint256 maxPerWallet; bytes32 merkleRoot; uint256 reserved; uint256 maxAllocation; } function onTierAllowlist( uint256 tierId, address minter, uint256 maxAllowance, bytes32[] calldata proof ) external view returns (bool); function eligibleForTier( uint256 tierId, address minter, uint256 maxAllowance, bytes32[] calldata proof ) external view returns (uint256); function mintByTier( uint256 tierId, uint256 count, uint256 maxAllowance, bytes32[] calldata proof ) external payable; } /** * @dev Extension to allow multiple tiers for minting, * you can configure, different minting window, price, currency, max per wallet, and allowlist per tier. */ abstract contract ERC721TieringExtension is IERC721TieringExtension, Initializable, Ownable, ERC721AutoIdMinterExtension, ReentrancyGuard { mapping(uint256 => Tier) public tiers; uint256 public totalReserved; mapping(uint256 => uint256) public tierMints; mapping(uint256 => mapping(address => uint256)) internal walletMinted; uint256 internal reservedMints; function __ERC721TieringExtension_init(Tier[] memory _tiers) internal onlyInitializing { __ERC721TieringExtension_init_unchained(_tiers); } function __ERC721TieringExtension_init_unchained(Tier[] memory _tiers) internal onlyInitializing { _registerInterface(type(IERC721TieringExtension).interfaceId); for (uint256 i = 0; i < _tiers.length; i++) { tiers[i] = _tiers[i]; totalReserved += _tiers[i].reserved; } } /* ADMIN */ function configureTiering(uint256 tierId, Tier calldata tier) public onlyOwner { require(tier.maxAllocation >= tierMints[tierId], "LOWER_THAN_MINTED"); if (tiers[tierId].reserved > 0) { require(tier.reserved >= tierMints[tierId], "LOW_RESERVE_AMOUNT"); } if (tierMints[tierId] > 0) { require( tier.maxPerWallet >= tiers[tierId].maxPerWallet, "LOW_MAX_PER_WALLET" ); } totalReserved -= tiers[tierId].reserved; tiers[tierId] = tier; totalReserved += tier.reserved; require(totalReserved <= maxSupply, "MAX_SUPPLY_EXCEEDED"); } function configureTiering( uint256[] calldata _tierIds, Tier[] calldata _tiers ) public onlyOwner { for (uint256 i = 0; i < _tierIds.length; i++) { configureTiering(_tierIds[i], _tiers[i]); } } /* PUBLIC */ function setMaxSupply(uint256 newValue) public virtual override(ERC721AutoIdMinterExtension) onlyOwner { ERC721AutoIdMinterExtension.setMaxSupply(newValue); require( newValue - totalSupply() >= totalReserved - reservedMints, "LOWER_THAN_RESERVED" ); } function onTierAllowlist( uint256 tierId, address minter, uint256 maxAllowance, bytes32[] calldata proof ) public view returns (bool) { return MerkleProof.verify( proof, tiers[tierId].merkleRoot, _generateMerkleLeaf(minter, maxAllowance) ); } function eligibleForTier( uint256 tierId, address minter, uint256 maxAllowance, bytes32[] calldata proof ) public view returns (uint256 maxMintable) { require(tiers[tierId].maxPerWallet > 0, "NOT_EXISTS"); require(block.timestamp >= tiers[tierId].start, "NOT_STARTED"); require(block.timestamp <= tiers[tierId].end, "ALREADY_ENDED"); maxMintable = tiers[tierId].maxPerWallet - walletMinted[tierId][minter]; if (tiers[tierId].merkleRoot != bytes32(0)) { require( walletMinted[tierId][minter] < maxAllowance, "MAXED_ALLOWANCE" ); require( onTierAllowlist(tierId, minter, maxAllowance, proof), "NOT_ALLOWLISTED" ); uint256 remainingAllowance = maxAllowance - walletMinted[tierId][minter]; if (maxMintable > remainingAllowance) { maxMintable = remainingAllowance; } } } function mintByTier( uint256 tierId, uint256 count, uint256 maxAllowance, bytes32[] calldata proof ) external payable nonReentrant { address minter = _msgSender(); uint256 maxMintable = eligibleForTier( tierId, minter, maxAllowance, proof ); require(count <= maxMintable, "EXCEEDS_MAX"); require(count <= remainingForTier(tierId), "EXCEEDS_ALLOCATION"); require( count + tierMints[tierId] <= tiers[tierId].maxAllocation, "EXCEEDS_ALLOCATION" ); if (tiers[tierId].currency == address(0)) { require( tiers[tierId].price * count <= msg.value, "INSUFFICIENT_AMOUNT" ); } else { IERC20(tiers[tierId].currency).transferFrom( minter, address(this), tiers[tierId].price * count ); } walletMinted[tierId][minter] += count; tierMints[tierId] += count; if (tiers[tierId].reserved > 0) { reservedMints += count; } _mintTo(minter, count); } function remainingForTier(uint256 tierId) public view returns (uint256 tierRemaining) { // Substract all the remaining reserved spots from the total remaining supply... tierRemaining = (maxSupply - totalSupply()) - (totalReserved - reservedMints); // If this tier has reserved spots, add remaining spots back to result... if (tiers[tierId].reserved > 0) { tierRemaining += (tiers[tierId].reserved - tierMints[tierId]); } } /* PRIVATE */ function _generateMerkleLeaf(address account, uint256 maxAllowance) private pure returns (bytes32) { return keccak256(abi.encodePacked(account, maxAllowance)); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "erc721a/contracts/ERC721A.sol"; import {IERC721CollectionMetadataExtension} from "../../ERC721/extensions/ERC721CollectionMetadataExtension.sol"; /** * @dev Extension to allow configuring contract-level collection metadata URI. */ abstract contract ERC721ACollectionMetadataExtension is IERC721CollectionMetadataExtension, Initializable, Ownable, ERC165Storage, ERC721A { string private _name; string private _symbol; string private _contractURI; function __ERC721ACollectionMetadataExtension_init( string memory name_, string memory symbol_, string memory contractURI_ ) internal onlyInitializing { __ERC721ACollectionMetadataExtension_init_unchained( name_, symbol_, contractURI_ ); } function __ERC721ACollectionMetadataExtension_init_unchained( string memory name_, string memory symbol_, string memory contractURI_ ) internal onlyInitializing { _name = name_; _symbol = symbol_; _contractURI = contractURI_; _registerInterface( type(IERC721CollectionMetadataExtension).interfaceId ); _registerInterface(type(IERC721).interfaceId); _registerInterface(type(IERC721A).interfaceId); _registerInterface(type(IERC721Metadata).interfaceId); } /* ADMIN */ function setContractURI(string memory newValue) external onlyOwner { _contractURI = newValue; } /* PUBLIC */ function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Storage, ERC721A) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } function contractURI() public view returns (string memory) { return _contractURI; } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "@openzeppelin/contracts/utils/structs/BitMaps.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./ERC721AMinterExtension.sol"; interface IERC721ALockableExtension { function locked(uint256 tokenId) external view returns (bool); function lock(uint256 tokenId) external; function lock(uint256[] calldata tokenIds) external; function unlock(uint256 tokenId) external; function unlock(uint256[] calldata tokenIds) external; } /** * @dev Extension to allow locking NFTs, for use-cases like staking, without leaving holders wallet. */ abstract contract ERC721ALockableExtension is IERC721ALockableExtension, Initializable, ERC165Storage, ERC721AMinterExtension, ReentrancyGuard { using BitMaps for BitMaps.BitMap; BitMaps.BitMap internal lockedTokens; function __ERC721ALockableExtension_init() internal onlyInitializing { __ERC721ALockableExtension_init_unchained(); } function __ERC721ALockableExtension_init_unchained() internal onlyInitializing { _registerInterface(type(IERC721ALockableExtension).interfaceId); } // PUBLIC function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Storage, ERC721ACollectionMetadataExtension) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } /** * At this moment staking is only possible from a certain address (usually a smart contract). * * This is because in almost all cases you want another contract to perform custom logic on lock and unlock operations, * without allowing users to directly unlock their tokens and sell them, for example. */ function _lock(uint256 tokenId) internal virtual { require(!lockedTokens.get(tokenId), "LOCKED"); lockedTokens.set(tokenId); } function _unlock(uint256 tokenId) internal virtual { require(lockedTokens.get(tokenId), "NOT_LOCKED"); lockedTokens.unset(tokenId); } /** * Returns if a token is locked or not. */ function locked(uint256 tokenId) public view virtual returns (bool) { return lockedTokens.get(tokenId); } function filterUnlocked(uint256[] calldata ticketTokenIds) public view returns (uint256[] memory) { uint256[] memory unlocked = new uint256[](ticketTokenIds.length); for (uint256 i = 0; i < ticketTokenIds.length; i++) { if (!locked(ticketTokenIds[i])) { unlocked[i] = ticketTokenIds[i]; } } return unlocked; } function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override(ERC721A) { require( // We are not checking the quantity because it is only used during mint where users cannot stake/unstake. !lockedTokens.get(startTokenId), "LOCKED" ); super._beforeTokenTransfers(from, to, startTokenId, quantity); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "erc721a/contracts/ERC721A.sol"; import {IERC721AutoIdMinterExtension} from "../../ERC721/extensions/ERC721AutoIdMinterExtension.sol"; import "./ERC721ACollectionMetadataExtension.sol"; /** * @dev Extension to add minting capability with an auto incremented ID for each token and a maximum supply setting. */ abstract contract ERC721AMinterExtension is ERC721ACollectionMetadataExtension { using SafeMath for uint256; uint256 public maxSupply; bool public maxSupplyFrozen; function __ERC721AMinterExtension_init(uint256 _maxSupply) internal onlyInitializing { __ERC721AMinterExtension_init_unchained(_maxSupply); } function __ERC721AMinterExtension_init_unchained(uint256 _maxSupply) internal onlyInitializing { maxSupply = _maxSupply; _registerInterface(type(IERC721AutoIdMinterExtension).interfaceId); _registerInterface(type(IERC721).interfaceId); _registerInterface(type(IERC721A).interfaceId); } /* ADMIN */ function setMaxSupply(uint256 newValue) public virtual onlyOwner { require(!maxSupplyFrozen, "BASE_URI_FROZEN"); require(newValue >= totalSupply(), "LOWER_THAN_SUPPLY"); maxSupply = newValue; } function freezeMaxSupply() external onlyOwner { maxSupplyFrozen = true; } /* INTERNAL */ function _mintTo(address to, uint256 count) internal { require(totalSupply() + count <= maxSupply, "EXCEEDS_SUPPLY"); _safeMint(to, count); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "./ERC721AMinterExtension.sol"; import {IERC721OwnerMintExtension} from "../../ERC721/extensions/ERC721OwnerMintExtension.sol"; /** * @dev Extension to allow owner to mint directly without paying. */ abstract contract ERC721AOwnerMintExtension is IERC721OwnerMintExtension, Initializable, Ownable, ERC165Storage, ERC721AMinterExtension { function __ERC721AOwnerMintExtension_init() internal onlyInitializing { __ERC721AOwnerMintExtension_init_unchained(); } function __ERC721AOwnerMintExtension_init_unchained() internal onlyInitializing { _registerInterface(type(IERC721OwnerMintExtension).interfaceId); } /* ADMIN */ function mintByOwner(address to, uint256 count) external onlyOwner { _mintTo(to, count); } /* PUBLIC */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Storage, ERC721ACollectionMetadataExtension) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "erc721a/contracts/ERC721A.sol"; import {IERC721PrefixedMetadataExtension} from "../../ERC721/extensions/ERC721PrefixedMetadataExtension.sol"; /** * @dev Extension to allow configuring tokens metadata URI. * In this extension tokens will have a shared token URI prefix, * therefore on tokenURI() token's ID will be appended to the base URI. * It also allows configuring a fallback "placeholder" URI when prefix is not set yet. */ abstract contract ERC721APrefixedMetadataExtension is IERC721PrefixedMetadataExtension, Initializable, Ownable, ERC165Storage, ERC721A { string internal _placeholderURI; string internal _tokenURIPrefix; string internal _tokenURISuffix; bool public tokenURIFrozen; function __ERC721APrefixedMetadataExtension_init( string memory placeholderURI_, string memory tokenURIPrefix_ ) internal onlyInitializing { __ERC721APrefixedMetadataExtension_init_unchained( placeholderURI_, tokenURIPrefix_ ); } function __ERC721APrefixedMetadataExtension_init_unchained( string memory placeholderURI_, string memory tokenURIPrefix_ ) internal onlyInitializing { _placeholderURI = placeholderURI_; _tokenURIPrefix = tokenURIPrefix_; _tokenURISuffix = ".json"; _registerInterface(type(IERC721PrefixedMetadataExtension).interfaceId); _registerInterface(type(IERC721Metadata).interfaceId); } /* ADMIN */ function setPlaceholderURI(string memory newValue) external onlyOwner { _placeholderURI = newValue; } function setTokenURIPrefix(string memory newValue) external onlyOwner { require(!tokenURIFrozen, "FROZEN"); _tokenURIPrefix = newValue; } function setTokenURISuffix(string memory newValue) external onlyOwner { require(!tokenURIFrozen, "FROZEN"); _tokenURISuffix = newValue; } function freezeTokenURI() external onlyOwner { tokenURIFrozen = true; } /* PUBLIC */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Storage, ERC721A) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } function placeholderURI() public view returns (string memory) { return _placeholderURI; } function tokenURIPrefix() public view returns (string memory) { return _tokenURIPrefix; } function tokenURISuffix() public view returns (string memory) { return _tokenURISuffix; } function tokenURI(uint256 _tokenId) public view virtual override(ERC721A, IERC721PrefixedMetadataExtension) returns (string memory) { return bytes(_tokenURIPrefix).length > 0 ? string( abi.encodePacked( _tokenURIPrefix, Strings.toString(_tokenId), _tokenURISuffix ) ) : _placeholderURI; } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "@openzeppelin/contracts/utils/structs/BitMaps.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./ERC721ALockableExtension.sol"; interface IERC721ARoleBasedLockableExtension { function hasRoleBasedLockableExtension() external view returns (bool); } /** * @dev Extension to allow locking NFTs, for use-cases like staking, without leaving holders wallet, using roles. */ abstract contract ERC721ARoleBasedLockableExtension is IERC721ARoleBasedLockableExtension, ERC721ALockableExtension, AccessControl { using BitMaps for BitMaps.BitMap; bytes32 public constant LOCKER_ROLE = keccak256("LOCKER_ROLE"); function __ERC721ARoleBasedLockableExtension_init() internal onlyInitializing { __ERC721ARoleBasedLockableExtension_init_unchained(); } function __ERC721ARoleBasedLockableExtension_init_unchained() internal onlyInitializing { _registerInterface( type(IERC721ARoleBasedLockableExtension).interfaceId ); } // ADMIN /** * Locks token(s) to effectively lock them, while keeping in the same wallet. * This mechanism prevents them from being transferred, yet still will show correct owner. */ function lock(uint256 tokenId) public virtual nonReentrant { require(hasRole(LOCKER_ROLE, msg.sender), "NOT_LOCKER_ROLE"); _lock(tokenId); } function lock(uint256[] calldata tokenIds) public virtual nonReentrant { require(hasRole(LOCKER_ROLE, msg.sender), "STAKABLE_NOT_LOCKER_ROLE"); for (uint256 i = 0; i < tokenIds.length; i++) { _lock(tokenIds[i]); } } /** * Unlocks locked token(s) to be able to transfer. */ function unlock(uint256 tokenId) public virtual nonReentrant { require(hasRole(LOCKER_ROLE, msg.sender), "NOT_LOCKER_ROLE"); _unlock(tokenId); } function unlock(uint256[] calldata tokenIds) public virtual nonReentrant { require(hasRole(LOCKER_ROLE, msg.sender), "STAKABLE_NOT_LOCKER_ROLE"); for (uint256 i = 0; i < tokenIds.length; i++) { _unlock(tokenIds[i]); } } // PUBLIC function hasRoleBasedLockableExtension() public view virtual returns (bool) { return true; } function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControl, ERC721ALockableExtension) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "./ERC721AMinterExtension.sol"; import {IERC721RoleBasedMintExtension} from "../../ERC721/extensions/ERC721RoleBasedMintExtension.sol"; /** * @dev Extension to allow holders of a OpenZepplin-based role to mint directly. */ abstract contract ERC721ARoleBasedMintExtension is IERC721RoleBasedMintExtension, ERC165Storage, ERC721AMinterExtension, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); function __ERC721ARoleBasedMintExtension_init(address minter) internal onlyInitializing { __ERC721ARoleBasedMintExtension_init_unchained(minter); } function __ERC721ARoleBasedMintExtension_init_unchained(address minter) internal onlyInitializing { _registerInterface(type(IERC721RoleBasedMintExtension).interfaceId); _setupRole(MINTER_ROLE, minter); } /* ADMIN */ function mintByRole(address to, uint256 count) external { require(hasRole(MINTER_ROLE, _msgSender()), "NOT_MINTER_ROLE"); _mintTo(to, count); } /* PUBLIC */ function supportsInterface(bytes4 interfaceId) public view virtual override( ERC165Storage, AccessControl, ERC721ACollectionMetadataExtension ) returns (bool) { return ERC165Storage.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./ERC721AMinterExtension.sol"; import {IERC721TieringExtension} from "../../ERC721/extensions/ERC721TieringExtension.sol"; /** * @dev Extension to allow multiple tiers for minting, * you can configure, different minting window, price, currency, max per wallet, and allowlist per tier. */ abstract contract ERC721ATieringExtension is IERC721TieringExtension, Initializable, Ownable, ERC721AMinterExtension, ReentrancyGuard { mapping(uint256 => Tier) public tiers; uint256 public totalReserved; mapping(uint256 => uint256) public tierMints; mapping(uint256 => mapping(address => uint256)) internal walletMinted; uint256 internal reservedMints; function __ERC721ATieringExtension_init(Tier[] memory _tiers) internal onlyInitializing { __ERC721ATieringExtension_init_unchained(_tiers); } function __ERC721ATieringExtension_init_unchained(Tier[] memory _tiers) internal onlyInitializing { _registerInterface(type(IERC721TieringExtension).interfaceId); for (uint256 i = 0; i < _tiers.length; i++) { tiers[i] = _tiers[i]; totalReserved += _tiers[i].reserved; } } /* ADMIN */ function configureTiering(uint256 tierId, Tier calldata tier) public onlyOwner { require(tier.maxAllocation >= tierMints[tierId], "LOWER_THAN_MINTED"); if (tiers[tierId].reserved > 0) { require(tier.reserved >= tierMints[tierId], "LOW_RESERVE_AMOUNT"); } if (tierMints[tierId] > 0) { require( tier.maxPerWallet >= tiers[tierId].maxPerWallet, "LOW_MAX_PER_WALLET" ); } totalReserved -= tiers[tierId].reserved; tiers[tierId] = tier; totalReserved += tier.reserved; require(totalReserved <= maxSupply, "MAX_SUPPLY_EXCEEDED"); } function configureTiering( uint256[] calldata _tierIds, Tier[] calldata _tiers ) public onlyOwner { for (uint256 i = 0; i < _tierIds.length; i++) { configureTiering(_tierIds[i], _tiers[i]); } } /* PUBLIC */ function setMaxSupply(uint256 newValue) public virtual override(ERC721AMinterExtension) onlyOwner { ERC721AMinterExtension.setMaxSupply(newValue); require( newValue - totalSupply() >= totalReserved - reservedMints, "LOWER_THAN_RESERVED" ); } function onTierAllowlist( uint256 tierId, address minter, uint256 maxAllowance, bytes32[] calldata proof ) public view returns (bool) { return MerkleProof.verify( proof, tiers[tierId].merkleRoot, _generateMerkleLeaf(minter, maxAllowance) ); } function eligibleForTier( uint256 tierId, address minter, uint256 maxAllowance, bytes32[] calldata proof ) public view returns (uint256 maxMintable) { require(tiers[tierId].maxPerWallet > 0, "NOT_EXISTS"); require(block.timestamp >= tiers[tierId].start, "NOT_STARTED"); require(block.timestamp <= tiers[tierId].end, "ALREADY_ENDED"); maxMintable = tiers[tierId].maxPerWallet - walletMinted[tierId][minter]; if (tiers[tierId].merkleRoot != bytes32(0)) { require( walletMinted[tierId][minter] < maxAllowance, "MAXED_ALLOWANCE" ); require( onTierAllowlist(tierId, minter, maxAllowance, proof), "NOT_ALLOWLISTED" ); uint256 remainingAllowance = maxAllowance - walletMinted[tierId][minter]; if (maxMintable > remainingAllowance) { maxMintable = remainingAllowance; } } } function mintByTier( uint256 tierId, uint256 count, uint256 maxAllowance, bytes32[] calldata proof ) external payable nonReentrant { address minter = _msgSender(); uint256 maxMintable = eligibleForTier( tierId, minter, maxAllowance, proof ); require(count <= maxMintable, "EXCEEDS_MAX"); require(count <= remainingForTier(tierId), "EXCEEDS_ALLOCATION"); require( count + tierMints[tierId] <= tiers[tierId].maxAllocation, "EXCEEDS_ALLOCATION" ); if (tiers[tierId].currency == address(0)) { require( tiers[tierId].price * count <= msg.value, "INSUFFICIENT_AMOUNT" ); } else { IERC20(tiers[tierId].currency).transferFrom( minter, address(this), tiers[tierId].price * count ); } walletMinted[tierId][minter] += count; tierMints[tierId] += count; if (tiers[tierId].reserved > 0) { reservedMints += count; } _mintTo(minter, count); } function remainingForTier(uint256 tierId) public view returns (uint256 tierRemaining) { // Substract all the remaining reserved spots from the total remaining supply... tierRemaining = (maxSupply - totalSupply()) - (totalReserved - reservedMints); // If this tier has reserved spots, add remaining spots back to result... if (tiers[tierId].reserved > 0) { tierRemaining += (tiers[tierId].reserved - tierMints[tierId]); } } /* PRIVATE */ function _generateMerkleLeaf(address account, uint256 maxAllowance) private pure returns (bytes32) { return keccak256(abi.encodePacked(account, maxAllowance)); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; enum WithdrawMode { OWNER, RECIPIENT, ANYONE, NOBODY } interface IWithdrawExtension { function setWithdrawRecipient(address _withdrawRecipient) external; function lockWithdrawRecipient() external; function revokeWithdrawPower() external; function setWithdrawMode(WithdrawMode _withdrawMode) external; function lockWithdrawMode() external; function withdraw( address[] calldata claimTokens, uint256[] calldata amounts ) external; } abstract contract WithdrawExtension is IWithdrawExtension, Initializable, Ownable, ERC165Storage { using Address for address; using Address for address payable; event WithdrawPowerRevoked(); event Withdrawn(address[] claimTokens, uint256[] amounts); address public withdrawRecipient; bool public withdrawRecipientLocked; bool public withdrawPowerRevoked; WithdrawMode public withdrawMode; bool public withdrawModeLocked; /* INTERNAL */ function __WithdrawExtension_init( address _withdrawRecipient, WithdrawMode _withdrawMode ) internal onlyInitializing { __WithdrawExtension_init_unchained(_withdrawRecipient, _withdrawMode); } function __WithdrawExtension_init_unchained( address _withdrawRecipient, WithdrawMode _withdrawMode ) internal onlyInitializing { _registerInterface(type(IWithdrawExtension).interfaceId); withdrawRecipient = _withdrawRecipient; withdrawMode = _withdrawMode; } /* ADMIN */ function setWithdrawRecipient(address _withdrawRecipient) external onlyOwner { require(!withdrawRecipientLocked, "LOCKED"); withdrawRecipient = _withdrawRecipient; } function lockWithdrawRecipient() external onlyOwner { require(!withdrawRecipientLocked, "LOCKED"); withdrawRecipientLocked = true; } function setWithdrawMode(WithdrawMode _withdrawMode) external onlyOwner { require(!withdrawModeLocked, "LOCKED"); withdrawMode = _withdrawMode; } function lockWithdrawMode() external onlyOwner { require(!withdrawModeLocked, "OCKED"); withdrawModeLocked = true; } /* PUBLIC */ function withdraw( address[] calldata claimTokens, uint256[] calldata amounts ) external { /** * We are using msg.sender for smaller attack surface when evaluating * the sender of the function call. If in future we want to handle "withdraw" * functionality via meta transactions, we should consider using `_msgSender` */ _assertWithdrawAccess(msg.sender); require(withdrawRecipient != address(0), "WITHDRAW/NO_RECIPIENT"); require(!withdrawPowerRevoked, "WITHDRAW/EMERGENCY_POWER_REVOKED"); for (uint256 i = 0; i < claimTokens.length; i++) { if (claimTokens[i] == address(0)) { payable(withdrawRecipient).sendValue(amounts[i]); } else { IERC20(claimTokens[i]).transfer(withdrawRecipient, amounts[i]); } } emit Withdrawn(claimTokens, amounts); } function revokeWithdrawPower() external onlyOwner { withdrawPowerRevoked = true; emit WithdrawPowerRevoked(); } /* INTERNAL */ function _assertWithdrawAccess(address account) internal view { if (withdrawMode == WithdrawMode.NOBODY) { revert("WITHDRAW/LOCKED"); } else if (withdrawMode == WithdrawMode.ANYONE) { return; } else if (withdrawMode == WithdrawMode.RECIPIENT) { require(withdrawRecipient == account, "WITHDRAW/ONLY_RECIPIENT"); } else if (withdrawMode == WithdrawMode.OWNER) { require(owner() == account, "WITHDRAW/ONLY_OWNER"); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771ContextOwnable is Initializable, Context, Ownable { address public _trustedForwarder; function __ERC2771ContextOwnable_init(address trustedForwarder) internal onlyInitializing { __ERC2771ContextOwnable_init_unchained(trustedForwarder); } function __ERC2771ContextOwnable_init_unchained(address trustedForwarder) internal onlyInitializing { _trustedForwarder = trustedForwarder; } function setTrustedForwarder(address trustedForwarder) public onlyOwner { _trustedForwarder = trustedForwarder; } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return forwarder == _trustedForwarder; } 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(); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; pragma abicoder v2; import "./LibPart.sol"; interface IRoyalties { function getRaribleV2Royalties(uint256 id) external view returns (LibPart.Part[] memory); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; library LibPart { bytes32 public constant TYPE_HASH = keccak256("Part(address account,uint96 value)"); struct Part { address payable account; uint96 value; } function hash(Part memory part) internal pure returns (bytes32) { return keccak256(abi.encode(TYPE_HASH, part.account, part.value)); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; library LibRoyaltiesV2 { /* * bytes4(keccak256('getRaribleV2Royalties(uint256)')) == 0xcad96cca */ bytes4 constant _INTERFACE_ID_ROYALTIES = 0xcad96cca; }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.1.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev ERC721 token receiver interface. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, * including the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at `_startTokenId()` * (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Mask of an entry in packed address data. uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with `_mintERC2309`. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to `_mintERC2309` // is required to cause an overflow, which is unrealistic. uint256 private constant MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The tokenId of the next token to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See `_packedOwnershipOf` implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see `_totalMinted`. */ function totalSupply() public view override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to `_startTokenId()` unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view returns (uint256) { return _burnCounter; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes of the XOR of // all function selectors in the interface. See: https://eips.ethereum.org/EIPS/eip-165 // e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)` return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> BITPOS_NUMBER_MINTED) & BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> BITPOS_NUMBER_BURNED) & BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & BITMASK_AUX_COMPLEMENT) | (auxCasted << BITPOS_AUX); _packedAddressData[owner] = packed; } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & BITMASK_BURNED == 0) { // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. // // We can directly compare the packed value. // If the address is zero, packed is zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP); ownership.burned = packed & BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> BITPOS_EXTRA_DATA); } /** * Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, BITMASK_ADDRESS) // `owner | (block.timestamp << BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @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) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << BITPOS_NEXT_INITIALIZED`. result := shl(BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSenderERC721A()) revert ApproveToCaller(); _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), 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-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 { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & BITMASK_BURNED == 0; // and not burned. } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 tokenId = startTokenId; uint256 end = startTokenId + quantity; do { emit Transfer(address(0), to, tokenId++); } while (tokenId < end); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { mapping(uint256 => address) storage tokenApprovalsPtr = _tokenApprovals; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId]`. assembly { // Compute the slot. mstore(0x00, tokenId) mstore(0x20, tokenApprovalsPtr.slot) approvedAddressSlot := keccak256(0x00, 0x40) // Load the slot's value from storage. approvedAddress := sload(approvedAddressSlot) } } /** * @dev Returns whether the `approvedAddress` is equals to `from` or `msgSender`. */ function _isOwnerOrApproved( address approvedAddress, address from, address msgSender ) private pure returns (bool result) { assembly { // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. from := and(from, BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, BITMASK_ADDRESS) // `msgSender == from || msgSender == approvedAddress`. result := or(eq(msgSender, from), eq(msgSender, approvedAddress)) } } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isOwnerOrApproved(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isOwnerOrApproved(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (BITMASK_BURNED | BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << BITPOS_EXTRA_DATA; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. * This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. * This includes minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function _toString(uint256 value) internal pure returns (string memory ptr) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), // but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged. // We will need 1 32-byte word to store the length, // and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128. ptr := add(mload(0x40), 128) // Update the free memory pointer to allocate. mstore(0x40, ptr) // Cache the end of the memory to calculate the length later. let end := ptr // We write the string from the rightmost digit to the leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // Costs a bit more than early returning for the zero case, // but cheaper in terms of deployment and overall runtime costs. for { // Initialize and perform the first pass without check. let temp := value // Move the pointer 1 byte leftwards to point to an empty character slot. ptr := sub(ptr, 1) // Write the character to the pointer. 48 is the ASCII index of '0'. mstore8(ptr, add(48, mod(temp, 10))) temp := div(temp, 10) } temp { // Keep dividing `temp` until zero. temp := div(temp, 10) } { // Body of the for loop. ptr := sub(ptr, 1) mstore8(ptr, add(48, mod(temp, 10))) } let length := sub(end, ptr) // Move the pointer 32 bytes leftwards to make room for the length. ptr := sub(ptr, 32) // Store the length. mstore(ptr, length) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.1.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of an ERC721A compliant contract. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * The caller cannot approve to their own address. */ error ApproveToCaller(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set through `_extraData`. uint24 extraData; } /** * @dev Returns the total amount of tokens stored by the contract. * * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens. */ function totalSupply() external view returns (uint256); // ============================== // IERC165 // ============================== /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================== // IERC721 // ============================== /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must 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 Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================== // IERC721Metadata // ============================== /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================== // IERC2309 // ============================== /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` (inclusive) is transferred from `from` to `to`, * as defined in the ERC2309 standard. See `_mintERC2309` for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 6 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"contractURI","type":"string"},{"internalType":"string","name":"placeholderURI","type":"string"},{"internalType":"string","name":"tokenURIPrefix","type":"string"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"components":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"reserved","type":"uint256"},{"internalType":"uint256","name":"maxAllocation","type":"uint256"}],"internalType":"struct IERC721TieringExtension.Tier[]","name":"tiers","type":"tuple[]"},{"internalType":"address","name":"defaultRoyaltyAddress","type":"address"},{"internalType":"uint16","name":"defaultRoyaltyBps","type":"uint16"},{"internalType":"address","name":"proceedsRecipient","type":"address"},{"internalType":"address","name":"trustedForwarder","type":"address"}],"internalType":"struct ERC721ATieredSalesCollection.Config","name":"config","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint16","name":"bps","type":"uint16"}],"name":"DefaultRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenRoyaltyRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint16","name":"bps","type":"uint16"}],"name":"TokenRoyaltySet","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":[],"name":"WithdrawPowerRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"claimTokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCKER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_trustedForwarder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tierId","type":"uint256"},{"components":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"reserved","type":"uint256"},{"internalType":"uint256","name":"maxAllocation","type":"uint256"}],"internalType":"struct IERC721TieringExtension.Tier","name":"tier","type":"tuple"}],"name":"configureTiering","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tierIds","type":"uint256[]"},{"components":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"reserved","type":"uint256"},{"internalType":"uint256","name":"maxAllocation","type":"uint256"}],"internalType":"struct IERC721TieringExtension.Tier[]","name":"_tiers","type":"tuple[]"}],"name":"configureTiering","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultRoyalty","outputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint16","name":"bps","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tierId","type":"uint256"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"maxAllowance","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"eligibleForTier","outputs":[{"internalType":"uint256","name":"maxMintable","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ticketTokenIds","type":"uint256[]"}],"name":"filterUnlocked","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freezeTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getRaribleV2Royalties","outputs":[{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"result","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenRoyaltiesCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getTokenRoyaltyByIndex","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint16","name":"bps","type":"uint16"}],"internalType":"struct IEIP2981RoyaltyOverride.TokenRoyaltyConfig","name":"","type":"tuple"}],"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":"hasRoleBasedLockableExtension","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"contractURI","type":"string"},{"internalType":"string","name":"placeholderURI","type":"string"},{"internalType":"string","name":"tokenURIPrefix","type":"string"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"components":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"reserved","type":"uint256"},{"internalType":"uint256","name":"maxAllocation","type":"uint256"}],"internalType":"struct IERC721TieringExtension.Tier[]","name":"tiers","type":"tuple[]"},{"internalType":"address","name":"defaultRoyaltyAddress","type":"address"},{"internalType":"uint16","name":"defaultRoyaltyBps","type":"uint16"},{"internalType":"address","name":"proceedsRecipient","type":"address"},{"internalType":"address","name":"trustedForwarder","type":"address"}],"internalType":"struct ERC721ATieredSalesCollection.Config","name":"config","type":"tuple"},{"internalType":"address","name":"deployer","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":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockWithdrawMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockWithdrawRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"count","type":"uint256"}],"name":"mintByOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"count","type":"uint256"}],"name":"mintByRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tierId","type":"uint256"},{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"uint256","name":"maxAllowance","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintByTier","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tierId","type":"uint256"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"maxAllowance","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"onTierAllowlist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"placeholderURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tierId","type":"uint256"}],"name":"remainingForTier","outputs":[{"internalType":"uint256","name":"tierRemaining","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeWithdrawPower","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"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":[{"internalType":"string","name":"newValue","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint16","name":"bps","type":"uint16"}],"internalType":"struct IEIP2981RoyaltyOverride.TokenRoyalty","name":"royalty","type":"tuple"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newValue","type":"string"}],"name":"setPlaceholderURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint16","name":"bps","type":"uint16"}],"internalType":"struct IEIP2981RoyaltyOverride.TokenRoyaltyConfig[]","name":"royaltyConfigs","type":"tuple[]"}],"name":"setTokenRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newValue","type":"string"}],"name":"setTokenURIPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newValue","type":"string"}],"name":"setTokenURISuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"trustedForwarder","type":"address"}],"name":"setTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum WithdrawMode","name":"_withdrawMode","type":"uint8"}],"name":"setWithdrawMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_withdrawRecipient","type":"address"}],"name":"setWithdrawRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tierMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tiers","outputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"reserved","type":"uint256"},{"internalType":"uint256","name":"maxAllocation","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":"tokenURIFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURISuffix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReserved","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"claimTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawMode","outputs":[{"internalType":"enum WithdrawMode","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawModeLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawPowerRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawRecipientLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162006cd938038062006cd9833981016040819052620000349162000fc0565b805160208201516200004f620000496200009a565b620000b6565b81516200006490600590602085019062000cc9565b5080516200007a90600690602084019062000cc9565b5060006003555050600160145562000093813362000111565b50620012aa565b6000620000b16200024d60201b62002d4b1760201c565b905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60006200011f600162000286565b9050801562000138576000805461ff0019166101001790555b6200014560008362000338565b6200015082620000b6565b6101208301516200016390600262000348565b8251602084015160408501516200017c9291906200037e565b6200019683606001518460800151620003b560201b60201c565b60a0830151620001a690620003eb565b620001b062000423565b620001bb8262000459565b620001c56200048e565b60c0830151620001d590620004c2565b620001f08360e00151846101000151620004f760201b60201c565b61014083015162000201906200052d565b801562000248576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6020546000906001600160a01b031633141562000271575060131936013560601c90565b620000b16200056260201b62002d6d1760201c565b60008054610100900460ff1615620002ef578160ff166001148015620002bf5750620002bd306200056660201b62002d711760201c565b155b620002e75760405162461bcd60e51b8152600401620002de9062001159565b60405180910390fd5b506000919050565b60005460ff808416911610620003195760405162461bcd60e51b8152600401620002de9062001159565b506000805460ff191660ff92909216919091179055600190565b919050565b62000344828262000575565b5050565b600054610100900460ff16620003725760405162461bcd60e51b8152600401620002de90620011a7565b6200034482826200061b565b600054610100900460ff16620003a85760405162461bcd60e51b8152600401620002de90620011a7565b62000248838383620006a7565b600054610100900460ff16620003df5760405162461bcd60e51b8152600401620002de90620011a7565b6200034482826200075b565b600054610100900460ff16620004155760405162461bcd60e51b8152600401620002de90620011a7565b620004208162000804565b50565b600054610100900460ff166200044d5760405162461bcd60e51b8152600401620002de90620011a7565b6200045762000869565b565b600054610100900460ff16620004835760405162461bcd60e51b8152600401620002de90620011a7565b6200042081620008a5565b600054610100900460ff16620004b85760405162461bcd60e51b8152600401620002de90620011a7565b620004576200090d565b600054610100900460ff16620004ec5760405162461bcd60e51b8152600401620002de90620011a7565b620004208162000949565b600054610100900460ff16620005215760405162461bcd60e51b8152600401620002de90620011a7565b62000344828262000a76565b600054610100900460ff16620005575760405162461bcd60e51b8152600401620002de90620011a7565b620004208162000b13565b3390565b6001600160a01b03163b151590565b6000828152601b602090815260408083206001600160a01b038516845290915290205460ff1662000344576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620005d76200009a565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600054610100900460ff16620006455760405162461bcd60e51b8152600401620002de90620011a7565b6200065763ac2ba33360e01b62000b5f565b600280546001600160a01b0384166001600160a01b0319821681178355839291600162ff000160a01b03191617600160b01b8360038111156200069e576200069e620011f2565b02179055505050565b600054610100900460ff16620006d15760405162461bcd60e51b8152600401620002de90620011a7565b8251620006e690600b90602086019062000cc9565b508151620006fc90600c90602085019062000cc9565b5080516200071290600d90602084019062000cc9565b5062000725633d96f4ff60e11b62000b5f565b620007376380ac58cd60e01b62000b5f565b6200074963184371e560e31b62000b5f565b62000248635b5e139f60e01b62000b5f565b600054610100900460ff16620007855760405162461bcd60e51b8152600401620002de90620011a7565b81516200079a90600e90602085019062000cc9565b508051620007b090600f90602084019062000cc9565b5060408051808201909152600580825264173539b7b760d91b6020909201918252620007df9160109162000cc9565b50620007f2631f2f406b60e01b62000b5f565b62000344635b5e139f60e01b62000b5f565b600054610100900460ff166200082e5760405162461bcd60e51b8152600401620002de90620011a7565b6012819055620008456330f487b560e11b62000b5f565b620008576380ac58cd60e01b62000b5f565b6200042063184371e560e31b62000b5f565b600054610100900460ff16620008935760405162461bcd60e51b8152600401620002de90620011a7565b62000457631aa1577160e11b62000b5f565b600054610100900460ff16620008cf5760405162461bcd60e51b8152600401620002de90620011a7565b620008e1631a056e7160e01b62000b5f565b620004207f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68262000338565b600054610100900460ff16620009375760405162461bcd60e51b8152600401620002de90620011a7565b6200045763714ad8e760e01b62000b5f565b600054610100900460ff16620009735760405162461bcd60e51b8152600401620002de90620011a7565b620009856308b4902960e41b62000b5f565b60005b81518110156200034457818181518110620009a757620009a762001208565b602090810291909101810151600083815260158352604090819020825181559282015160018401558101516002830180546001600160a01b0319166001600160a01b03909216919091179055606081015160038301556080810151600483015560a0810151600583015560c0810151600683015560e00151600790910155815182908290811062000a3c5762000a3c62001208565b602002602001015160c001516016600082825462000a5b919062001234565b9091555081905062000a6d816200124f565b91505062000988565b600054610100900460ff1662000aa05760405162461bcd60e51b8152600401620002de90620011a7565b62000ab2633a47bf5160e11b62000b5f565b62000ac463152a902d60e11b62000b5f565b62000ad663c69dbd8f60e01b62000b5f565b62000ae863656cb66560e11b62000b5f565b604080518082019091526001600160a01b038316815261ffff82166020820152620002488162000be3565b600054610100900460ff1662000b3d5760405162461bcd60e51b8152600401620002de90620011a7565b602080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160e01b0319808216141562000bbb5760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e74657266616365206964000000006044820152606401620002de565b6001600160e01b0319166000908152600160208190526040909120805460ff19169091179055565b612710816020015161ffff161062000c2c5760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642062707360a81b6044820152606401620002de565b60408051808201825282516001600160a01b03168082526020808501805161ffff1691909301819052601c8054600160a01b9092026001600160b01b03199092169092171790558251905191517f2c5ea6e4103e78cb101e796fb2dace540362fc542cbff5145eaa24af7dd8fe419262000cbe92916001600160a01b0392909216825261ffff16602082015260400190565b60405180910390a150565b82805462000cd7906200126d565b90600052602060002090601f01602090048101928262000cfb576000855562000d46565b82601f1062000d1657805160ff191683800117855562000d46565b8280016001018555821562000d46579182015b8281111562000d4657825182559160200191906001019062000d29565b5062000d5492915062000d58565b5090565b5b8082111562000d54576000815560010162000d59565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b038111828210171562000dab5762000dab62000d6f565b60405290565b60405161016081016001600160401b038111828210171562000dab5762000dab62000d6f565b604051601f8201601f191681016001600160401b038111828210171562000e025762000e0262000d6f565b604052919050565b600082601f83011262000e1c57600080fd5b81516001600160401b0381111562000e385762000e3862000d6f565b602062000e4e601f8301601f1916820162000dd7565b828152858284870101111562000e6357600080fd5b60005b8381101562000e8357858101830151828201840152820162000e66565b8381111562000e955760008385840101525b5095945050505050565b80516001600160a01b03811681146200033357600080fd5b600082601f83011262000ec957600080fd5b815160206001600160401b0382111562000ee75762000ee762000d6f565b62000ef7818360051b0162000dd7565b82815260089290921b8401810191818101908684111562000f1757600080fd5b8286015b8481101562000fa257610100818903121562000f375760008081fd5b62000f4162000d85565b815181528482015185820152604062000f5c81840162000e9f565b90820152606082810151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201528352918301916101000162000f1b565b509695505050505050565b805161ffff811681146200033357600080fd5b60006020828403121562000fd357600080fd5b81516001600160401b038082111562000feb57600080fd5b9083019061016082860312156200100157600080fd5b6200100b62000db1565b8251828111156200101b57600080fd5b620010298782860162000e0a565b8252506020830151828111156200103f57600080fd5b6200104d8782860162000e0a565b6020830152506040830151828111156200106657600080fd5b620010748782860162000e0a565b6040830152506060830151828111156200108d57600080fd5b6200109b8782860162000e0a565b606083015250608083015182811115620010b457600080fd5b620010c28782860162000e0a565b60808301525060a083015160a082015260c083015182811115620010e557600080fd5b620010f38782860162000eb7565b60c0830152506200110760e0840162000e9f565b60e082015261010091506200111e82840162000fad565b8282015261012091506200113482840162000e9f565b8282015261014091506200114a82840162000e9f565b91810191909152949350505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156200124a576200124a6200121e565b500190565b60006000198214156200126657620012666200121e565b5060010190565b600181811c908216806200128257607f821691505b60208210811415620012a457634e487b7160e01b600052602260045260246000fd5b50919050565b615a1f80620012ba6000396000f3fe6080604052600436106103785760003560e01c806301ffc9a71461037d578063039af9eb146103b25780630653aca51461046357806306fdde03146104b2578063081812fc146104d4578063095ea7b31461050c578063167446071461052e57806318160ddd146105435780631a056e711461056657806320f1bb301461058657806323b872dd146105a6578063248a9ca3146105c65780632a55205a146105e65780632bb684ad146106145780632c233067146106415780632d00b587146106615780632f2ff15d1461068f5780633542aee2146106af5780633574a2dd146106cf57806336568abe146106ef57806342842e0e1461070f57806349561cb91461072f5780635136dcc71461075057806353367f081461077057806356c022bb1461079d578063572b6c05146107bd5780635897f878146107dd5780635d36598f146107fd5780635ea2c91b1461081d5780636057e0ec146108305780636198e339146108515780636352211e1461087157806368c7d37c146108915780636ef03047146108b15780636f8b44b0146108d157806370a08231146108f1578063714ad8e714610911578063715018a6146109255780637313cba91461093a5780637885fdc71461094f5780637e9803421461098a578063837fe1401461099f578063859610c6146109b45780638da5cb5b146109d457806391d14854146109e9578063938e3d7b14610a0957806395d89b4114610a2957806399e0dd7c14610a3e578063a217fddf14610a5e578063a22cb46514610a73578063a9852bfb14610a93578063af121f5414610ab3578063b45a3c0e14610ad4578063b88d4fde14610af4578063ba4695fd14610b14578063bd2c18f714610b29578063c0ac998314610b49578063c0bb38ff14610b5e578063c29de63014610b7e578063c71b0e1c14610b98578063c723955a14610bae578063c87b56dd14610bc3578063cad96cca14610be3578063d539139314610c10578063d547741f14610c32578063d5abeb0114610c52578063d8b436fd14610c68578063da74222814610c88578063da82b22714610ca8578063dbbc853b14610cbd578063dcbe353f14610cd2578063dd46706414610cf2578063de6d6d9614610d12578063e8a3d48514610d32578063e985e9c514610d47578063ef60ceaf14610d90578063f2fde38b14610db0578063f362136714610dd0578063f384702f14610df2575b600080fd5b34801561038957600080fd5b5061039d610398366004614884565b610e0c565b60405190151581526020015b60405180910390f35b3480156103be57600080fd5b5061041a6103cd3660046148a1565b60156020526000908152604090208054600182015460028301546003840154600485015460058601546006870154600790970154959694956001600160a01b039094169492939192909188565b6040805198895260208901979097526001600160a01b03909516958701959095526060860192909252608085015260a084015260c083019190915260e0820152610100016103a9565b34801561046f57600080fd5b5061048361047e3660046148a1565b610e1d565b60408051825181526020808401516001600160a01b0316908201529181015161ffff16908201526060016103a9565b3480156104be57600080fd5b506104c7610ea2565b6040516103a99190614912565b3480156104e057600080fd5b506104f46104ef3660046148a1565b610eb1565b6040516001600160a01b0390911681526020016103a9565b34801561051857600080fd5b5061052c610527366004614945565b610ef5565b005b34801561053a57600080fd5b5061052c610f95565b34801561054f57600080fd5b50600454600354035b6040519081526020016103a9565b34801561057257600080fd5b5061052c610581366004614945565b610fec565b34801561059257600080fd5b5061052c6105a1366004614971565b611052565b3480156105b257600080fd5b5061052c6105c13660046149ab565b61126f565b3480156105d257600080fd5b506105586105e13660046148a1565b6113fb565b3480156105f257600080fd5b506106066106013660046149ec565b611410565b6040516103a9929190614a0e565b34801561062057600080fd5b5061063461062f366004614a6b565b6114d5565b6040516103a99190614aac565b34801561064d57600080fd5b5061052c61065c366004614af0565b61159f565b34801561066d57600080fd5b5060025461068290600160b01b900460ff1681565b6040516103a99190614b27565b34801561069b57600080fd5b5061052c6106aa366004614b4f565b611635565b3480156106bb57600080fd5b5061052c6106ca366004614945565b611656565b3480156106db57600080fd5b5061052c6106ea366004614c88565b611695565b3480156106fb57600080fd5b5061052c61070a366004614b4f565b6116e7565b34801561071b57600080fd5b5061052c61072a3660046149ab565b611771565b34801561073b57600080fd5b5060025461039d90600160b81b900460ff1681565b34801561075c57600080fd5b5061052c61076b366004614cbc565b61178c565b34801561077c57600080fd5b5061055861078b3660046148a1565b60176020526000908152604090205481565b3480156107a957600080fd5b506020546104f4906001600160a01b031681565b3480156107c957600080fd5b5061039d6107d8366004614d30565b611826565b3480156107e957600080fd5b506105586107f83660046148a1565b61183a565b34801561080957600080fd5b5061052c610818366004614a6b565b6118bb565b61052c61082b366004614d4d565b61195f565b34801561083c57600080fd5b5060025461039d90600160a01b900460ff1681565b34801561085d57600080fd5b5061052c61086c3660046148a1565b611c3b565b34801561087d57600080fd5b506104f461088c3660046148a1565b611ca8565b34801561089d57600080fd5b5061039d6108ac366004614dad565b611cb3565b3480156108bd57600080fd5b5061052c6108cc366004614ef5565b611d55565b3480156108dd57600080fd5b5061052c6108ec3660046148a1565b611e64565b3480156108fd57600080fd5b5061055861090c366004614d30565b611eaf565b34801561091d57600080fd5b50600161039d565b34801561093157600080fd5b5061052c611efd565b34801561094657600080fd5b506104c7611f48565b34801561095b57600080fd5b50601c5461097c906001600160a01b03811690600160a01b900461ffff1682565b6040516103a9929190615080565b34801561099657600080fd5b50610558611fda565b3480156109ab57600080fd5b5061052c611fe6565b3480156109c057600080fd5b5061052c6109cf366004614a6b565b612064565b3480156109e057600080fd5b506104f46120fe565b3480156109f557600080fd5b5061039d610a04366004614b4f565b612113565b348015610a1557600080fd5b5061052c610a24366004614c88565b61213e565b348015610a3557600080fd5b506104c7612190565b348015610a4a57600080fd5b5061052c610a59366004614c88565b61219a565b348015610a6a57600080fd5b50610558600081565b348015610a7f57600080fd5b5061052c610a8e3660046150ab565b61220f565b348015610a9f57600080fd5b5061052c610aae366004614c88565b6122a5565b348015610abf57600080fd5b5060025461039d90600160a81b900460ff1681565b348015610ae057600080fd5b5061039d610aef3660046148a1565b61231a565b348015610b0057600080fd5b5061052c610b0f3660046150d9565b612327565b348015610b2057600080fd5b5061052c612371565b348015610b3557600080fd5b50610558610b44366004614dad565b6123bf565b348015610b5557600080fd5b506104c76125f0565b348015610b6a57600080fd5b5061052c610b79366004614d30565b6125ff565b348015610b8a57600080fd5b5060115461039d9060ff1681565b348015610ba457600080fd5b5061055860165481565b348015610bba57600080fd5b5061052c61268a565b348015610bcf57600080fd5b506104c7610bde3660046148a1565b612720565b348015610bef57600080fd5b50610c03610bfe3660046148a1565b61272b565b6040516103a99190615158565b348015610c1c57600080fd5b5061055860008051602061598a83398151915281565b348015610c3e57600080fd5b5061052c610c4d366004614b4f565b6127e6565b348015610c5e57600080fd5b5061055860125481565b348015610c7457600080fd5b5061052c610c833660046151b9565b612802565b348015610c9457600080fd5b5061052c610ca3366004614d30565b61289f565b348015610cb457600080fd5b5061052c612900565b348015610cc957600080fd5b506104c761297d565b348015610cde57600080fd5b506002546104f4906001600160a01b031681565b348015610cfe57600080fd5b5061052c610d0d3660046148a1565b61298c565b348015610d1e57600080fd5b5061052c610d2d366004615252565b6129f1565b348015610d3e57600080fd5b506104c7612c39565b348015610d5357600080fd5b5061039d610d623660046152bd565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205460ff1690565b348015610d9c57600080fd5b5061052c610dab3660046152eb565b612c48565b348015610dbc57600080fd5b5061052c610dcb366004614d30565b612c9e565b348015610ddc57600080fd5b506105586000805160206159ca83398151915281565b348015610dfe57600080fd5b5060135461039d9060ff1681565b6000610e1782612d80565b92915050565b6040805160608101825260008082526020820181905291810182905290610e45601e84612dbc565b6000818152601d60209081526040918290208251808401845290546001600160a01b03808216835261ffff600160a01b90920482168385019081528551606081018752968752925116928501929092525116908201529392505050565b6060610eac612dcf565b905090565b6000610ebc82612dde565b610ed9576040516333d1c03960e21b815260040160405180910390fd5b506000908152600960205260409020546001600160a01b031690565b6000610f0082611ca8565b9050336001600160a01b03821614610f3957610f1c8133610d62565b610f39576040516367d9dca160e11b815260040160405180910390fd5b60008281526009602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610f9d612e06565b6001600160a01b0316610fae6120fe565b6001600160a01b031614610fdd5760405162461bcd60e51b8152600401610fd490615303565b60405180910390fd5b6013805460ff19166001179055565b61100660008051602061598a833981519152610a04612e06565b6110445760405162461bcd60e51b815260206004820152600f60248201526e4e4f545f4d494e5445525f524f4c4560881b6044820152606401610fd4565b61104e8282612e10565b5050565b61105a612e06565b6001600160a01b031661106b6120fe565b6001600160a01b0316146110915760405162461bcd60e51b8152600401610fd490615303565b60008281526017602052604090205460e082013510156110e75760405162461bcd60e51b81526020600482015260116024820152701313d5d15497d512105397d35253951151607a1b6044820152606401610fd4565b600082815260156020526040902060060154156111555760008281526017602052604090205460c082013510156111555760405162461bcd60e51b81526020600482015260126024820152711313d5d7d49154d154959157d05353d5539560721b6044820152606401610fd4565b600082815260176020526040902054156111c357600082815260156020526040902060040154608082013510156111c35760405162461bcd60e51b81526020600482015260126024820152711313d5d7d3505617d4115497d5d05313115560721b6044820152606401610fd4565b60008281526015602052604081206006015460168054919290916111e890849061534e565b9091555050600082815260156020526040902081906112078282615365565b9050508060c001356016600082825461122091906153d6565b9091555050601254601654111561104e5760405162461bcd60e51b815260206004820152601360248201527213505617d4d55414131657d15610d151511151606a1b6044820152606401610fd4565b600061127a82612e74565b9050836001600160a01b0316816001600160a01b0316146112ad5760405162a1148160e81b815260040160405180910390fd5b60008281526009602052604090208054338082146001600160a01b038816909114176112fa576112dd8633610d62565b6112fa57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661132157604051633a954ecd60e21b815260040160405180910390fd5b61132e8686866001612ed5565b801561133957600082555b6001600160a01b0386811660009081526008602052604080822080546000190190559187168152208054600101905561137685600160e11b612ee1565b600085815260076020526040902055600160e11b83166113c457600184016000818152600760205260409020546113c25760035481146113c25760008181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b03166000805160206159aa83398151915260405160405180910390a4505050505050565b6000908152601b602052604090206001015490565b6000828152601d602052604081205481906001600160a01b031615611475576000848152601d60205260409020546001600160a01b038116906127109061146290600160a01b900461ffff16866153ee565b61146c9190615423565b915091506114ce565b601c546001600160a01b03161580159061149b5750601c54600160a01b900461ffff1615155b156114c757601c546001600160a01b038116906127109061146290600160a01b900461ffff16866153ee565b5060009050805b9250929050565b60606000826001600160401b038111156114f1576114f1614b7f565b60405190808252806020026020018201604052801561151a578160200160208202803683370190505b50905060005b838110156115975761154985858381811061153d5761153d615437565b9050602002013561231a565b6115855784848281811061155f5761155f615437565b9050602002013582828151811061157857611578615437565b6020026020010181815250505b8061158f8161544d565b915050611520565b509392505050565b6115a7612e06565b6001600160a01b03166115b86120fe565b6001600160a01b0316146115de5760405162461bcd60e51b8152600401610fd490615303565b600254600160b81b900460ff16156116085760405162461bcd60e51b8152600401610fd490615468565b6002805482919060ff60b01b1916600160b01b83600381111561162d5761162d614b11565b021790555050565b61163e826113fb565b61164781612ef6565b6116518383612f07565b505050565b61165e612e06565b6001600160a01b031661166f6120fe565b6001600160a01b0316146110445760405162461bcd60e51b8152600401610fd490615303565b61169d612e06565b6001600160a01b03166116ae6120fe565b6001600160a01b0316146116d45760405162461bcd60e51b8152600401610fd490615303565b805161104e90600e9060208401906147d5565b6116ef612e06565b6001600160a01b0316816001600160a01b0316146117675760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610fd4565b61104e8282612f8e565b61165183838360405180602001604052806000815250612327565b611794612e06565b6001600160a01b03166117a56120fe565b6001600160a01b0316146117cb5760405162461bcd60e51b8152600401610fd490615303565b61104e8282808060200260200160405190810160405280939291908181526020016000905b8282101561181c5761180d60608302860136819003810190615488565b815260200190600101906117f0565b5050505050613013565b6020546001600160a01b0391821691161490565b600060195460165461184c919061534e565b60045460035403601254611860919061534e565b61186a919061534e565b600083815260156020526040902060060154909150156118b6576000828152601760209081526040808320546015909252909120600601546118ac919061534e565b610e1790826153d6565b919050565b600260145414156118de5760405162461bcd60e51b8152600401610fd4906154ee565b60026014556118fb6000805160206159ca83398151915233612113565b6119175760405162461bcd60e51b8152600401610fd490615525565b60005b818110156119555761194383838381811061193757611937615437565b905060200201356131ba565b8061194d8161544d565b91505061191a565b5050600160145550565b600260145414156119825760405162461bcd60e51b8152600401610fd4906154ee565b60026014556000611991612e06565b905060006119a287838787876123bf565b9050808611156119e25760405162461bcd60e51b815260206004820152600b60248201526a08ab0868a8a88a6be9a82b60ab1b6044820152606401610fd4565b6119eb8761183a565b861115611a0a5760405162461bcd60e51b8152600401610fd490615557565b600087815260156020908152604080832060070154601790925290912054611a3290886153d6565b1115611a505760405162461bcd60e51b8152600401610fd490615557565b6000878152601560205260409020600201546001600160a01b0316611ad7576000878152601560205260409020600301543490611a8e9088906153ee565b1115611ad25760405162461bcd60e51b8152602060048201526013602482015272125394d551919250d251539517d05353d55395606a1b6044820152606401610fd4565b611b9a565b600087815260156020526040902060028101546003909101546001600160a01b03909116906323b872dd9084903090611b11908b906153ee565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b158015611b6057600080fd5b505af1158015611b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b989190615583565b505b60008781526018602090815260408083206001600160a01b038616845290915281208054889290611bcc9084906153d6565b909155505060008781526017602052604081208054889290611bef9084906153d6565b909155505060008781526015602052604090206006015415611c23578560196000828254611c1d91906153d6565b90915550505b611c2d8287612e10565b505060016014555050505050565b60026014541415611c5e5760405162461bcd60e51b8152600401610fd4906154ee565b6002601455611c7b6000805160206159ca83398151915233612113565b611c975760405162461bcd60e51b8152600401610fd4906155a0565b611ca0816131ba565b506001601455565b6000610e1782612e74565b6000611d4983838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508b8152601560205260409020600501549250611d449150899050886040516001600160601b0319606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b613221565b90505b95945050505050565b6000611d616001613237565b90508015611d79576000805461ff0019166101001790555b611d846000836132c6565b611d8d826132d0565b611d9d836101200151600261332b565b611db483600001518460200151856040015161335c565b611dc68360600151846080015161338e565b611dd38360a001516133bf565b611ddb6133ef565b611de48261341e565b611dec61344e565b611df98360c0015161347d565b611e0c8360e001518461010001516134ad565b611e1a8361014001516134de565b8015611651576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b611e6c612e06565b6001600160a01b0316611e7d6120fe565b6001600160a01b031614611ea35760405162461bcd60e51b8152600401610fd490615303565b611eac8161350e565b50565b60006001600160a01b038216611ed8576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600860205260409020546001600160401b031690565b611f05612e06565b6001600160a01b0316611f166120fe565b6001600160a01b031614611f3c5760405162461bcd60e51b8152600401610fd490615303565b611f4660006132d0565b565b6060600e8054611f57906155c9565b80601f0160208091040260200160405190810160405280929190818152602001828054611f83906155c9565b8015611fd05780601f10611fa557610100808354040283529160200191611fd0565b820191906000526020600020905b815481529060010190602001808311611fb357829003601f168201915b5050505050905090565b6000610eac601e6135bb565b611fee612e06565b6001600160a01b0316611fff6120fe565b6001600160a01b0316146120255760405162461bcd60e51b8152600401610fd490615303565b600254600160a01b900460ff161561204f5760405162461bcd60e51b8152600401610fd490615468565b6002805460ff60a01b1916600160a01b179055565b600260145414156120875760405162461bcd60e51b8152600401610fd4906154ee565b60026014556120a46000805160206159ca83398151915233612113565b6120c05760405162461bcd60e51b8152600401610fd490615525565b60005b81811015611955576120ec8383838181106120e0576120e0615437565b905060200201356135c5565b806120f68161544d565b9150506120c3565b6000546201000090046001600160a01b031690565b6000918252601b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b612146612e06565b6001600160a01b03166121576120fe565b6001600160a01b03161461217d5760405162461bcd60e51b8152600401610fd490615303565b805161104e90600d9060208401906147d5565b6060610eac61360f565b6121a2612e06565b6001600160a01b03166121b36120fe565b6001600160a01b0316146121d95760405162461bcd60e51b8152600401610fd490615303565b60115460ff16156121fc5760405162461bcd60e51b8152600401610fd4906155fe565b805161104e90600f9060208401906147d5565b6001600160a01b0382163314156122395760405163b06307db60e01b815260040160405180910390fd5b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6122ad612e06565b6001600160a01b03166122be6120fe565b6001600160a01b0316146122e45760405162461bcd60e51b8152600401610fd490615303565b60115460ff16156123075760405162461bcd60e51b8152600401610fd4906155fe565b805161104e9060109060208401906147d5565b6000610e17601a8361361e565b61233284848461126f565b6001600160a01b0383163b1561236b5761234e84848484613642565b61236b576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b612379612e06565b6001600160a01b031661238a6120fe565b6001600160a01b0316146123b05760405162461bcd60e51b8152600401610fd490615303565b6011805460ff19166001179055565b60008581526015602052604081206004015461240a5760405162461bcd60e51b815260206004820152600a6024820152694e4f545f45584953545360b01b6044820152606401610fd4565b6000868152601560205260409020544210156124565760405162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b6044820152606401610fd4565b6000868152601560205260409020600101544211156124a75760405162461bcd60e51b815260206004820152600d60248201526c1053149150511657d153911151609a1b6044820152606401610fd4565b60008681526018602090815260408083206001600160a01b03891684528252808320548984526015909252909120600401546124e3919061534e565b60008781526015602052604090206005015490915015611d4c5760008681526018602090815260408083206001600160a01b038916845290915290205484116125605760405162461bcd60e51b815260206004820152600f60248201526e4d415845445f414c4c4f57414e434560881b6044820152606401610fd4565b61256d8686868686611cb3565b6125ab5760405162461bcd60e51b815260206004820152600f60248201526e1393d517d0531313d5d31254d51151608a1b6044820152606401610fd4565b60008681526018602090815260408083206001600160a01b03891684529091528120546125d8908661534e565b9050808211156125e6578091505b5095945050505050565b6060600f8054611f57906155c9565b612607612e06565b6001600160a01b03166126186120fe565b6001600160a01b03161461263e5760405162461bcd60e51b8152600401610fd490615303565b600254600160a01b900460ff16156126685760405162461bcd60e51b8152600401610fd490615468565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b612692612e06565b6001600160a01b03166126a36120fe565b6001600160a01b0316146126c95760405162461bcd60e51b8152600401610fd490615303565b600254600160b81b900460ff161561270b5760405162461bcd60e51b815260206004820152600560248201526413d0d2d15160da1b6044820152606401610fd4565b6002805460ff60b81b1916600160b81b179055565b6060610e178261373a565b604080516001808252818301909252606091816020015b6040805180820190915260008082526020820152815260200190600190039081612742575050601c5481519192506001600160a01b031690829060009061278b5761278b615437565b60209081029190910101516001600160a01b03919091169052601c548151600160a01b90910461ffff169082906000906127c7576127c7615437565b6020908102919091018101516001600160601b03909216910152919050565b6127ef826113fb565b6127f881612ef6565b6116518383612f8e565b61280a612e06565b6001600160a01b031661281b6120fe565b6001600160a01b0316146128415760405162461bcd60e51b8152600401610fd490615303565b60005b838110156128985761288685858381811061286157612861615437565b9050602002013584848481811061287a5761287a615437565b90506101000201611052565b806128908161544d565b915050612844565b5050505050565b6128a7612e06565b6001600160a01b03166128b86120fe565b6001600160a01b0316146128de5760405162461bcd60e51b8152600401610fd490615303565b602080546001600160a01b0319166001600160a01b0392909216919091179055565b612908612e06565b6001600160a01b03166129196120fe565b6001600160a01b03161461293f5760405162461bcd60e51b8152600401610fd490615303565b6002805460ff60a81b1916600160a81b1790556040517fa24423a69b45c25c0479663125e48b482e71d85eae416f589545243bafaf3c9590600090a1565b606060108054611f57906155c9565b600260145414156129af5760405162461bcd60e51b8152600401610fd4906154ee565b60026014556129cc6000805160206159ca83398151915233612113565b6129e85760405162461bcd60e51b8152600401610fd4906155a0565b611ca0816135c5565b6129fa33613816565b6002546001600160a01b0316612a4a5760405162461bcd60e51b815260206004820152601560248201527415d2551211149055cbd393d7d49150d25412515395605a1b6044820152606401610fd4565b600254600160a81b900460ff1615612aa45760405162461bcd60e51b815260206004820181905260248201527f57495448445241572f454d455247454e43595f504f5745525f5245564f4b45446044820152606401610fd4565b60005b83811015612bf5576000858583818110612ac357612ac3615437565b9050602002016020810190612ad89190614d30565b6001600160a01b03161415612b1c57612b17838383818110612afc57612afc615437565b6002546001600160a01b03169260209091020135905061399f565b612be3565b848482818110612b2e57612b2e615437565b9050602002016020810190612b439190614d30565b6002546001600160a01b039182169163a9059cbb9116858585818110612b6b57612b6b615437565b905060200201356040518363ffffffff1660e01b8152600401612b8f929190614a0e565b602060405180830381600087803b158015612ba957600080fd5b505af1158015612bbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be19190615583565b505b80612bed8161544d565b915050612aa7565b507fd40c399a83caf67d15628b821aa7c7bd940e563c57a047e2bd3b8c602bcaf5a584848484604051612c2b949392919061561e565b60405180910390a150505050565b6060600d8054611f57906155c9565b612c50612e06565b6001600160a01b0316612c616120fe565b6001600160a01b031614612c875760405162461bcd60e51b8152600401610fd490615303565b611eac612c99368390038301836156a2565b613ab5565b612ca6612e06565b6001600160a01b0316612cb76120fe565b6001600160a01b031614612cdd5760405162461bcd60e51b8152600401610fd490615303565b6001600160a01b038116612d425760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610fd4565b611eac816132d0565b6000612d5633611826565b15612d68575060131936013560601c90565b503390565b3390565b6001600160a01b03163b151590565b60006301ffc9a760e01b6001600160e01b031983161480610e175750506001600160e01b03191660009081526001602052604090205460ff1690565b6000612dc88383613b60565b9392505050565b6060600b8054611f57906155c9565b600060035482108015610e17575050600090815260076020526040902054600160e01b161590565b6000610eac612d4b565b60125481612e216004546003540390565b612e2b91906153d6565b1115612e6a5760405162461bcd60e51b815260206004820152600e60248201526d455843454544535f535550504c5960901b6044820152606401610fd4565b61104e8282613b8a565b600081600354811015612ebc57600081815260076020526040902054600160e01b8116612eba575b80612dc8575060001901600081815260076020526040902054612e9c565b505b604051636f96cda160e11b815260040160405180910390fd5b61236b84848484613ba4565b4260a01b176001600160a01b03919091161790565b611eac81612f02612e06565b613bd1565b612f118282612113565b61104e576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612f4a612e06565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612f988282612113565b1561104e576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff19169055612fcf612e06565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60005b815181101561104e57600082828151811061303357613033615437565b60200260200101519050612710816040015161ffff16106130665760405162461bcd60e51b8152600401610fd4906156fe565b60208101516001600160a01b03166130df5780516000908152601d6020526040902080546001600160b01b031916905580516130a490601e90613c35565b5080516040519081527fa2870857763bd9ae76c957f869f16b31c18dd3bb4c7b4d3a4496dc5c57c657f99060200160405180910390a16131a7565b6040805180820182526020808401516001600160a01b0390811683528484015161ffff90811683850190815286516000908152601d90945294909220925183549451909216600160a01b026001600160b01b0319909416911617919091179055805161314d90601e90613c41565b50805160208083015160408085015181519485526001600160a01b039092169284019290925261ffff1682820152517f389b70fb0887f01e83784eb1c4c589f740eca53b00ed0f45e41db5d079719abb9181900360600190a15b50806131b28161544d565b915050613016565b6131c5601a8261361e565b6131fe5760405162461bcd60e51b815260206004820152600a6024820152691393d517d313d0d2d15160b21b6044820152606401610fd4565b600881901c6000908152601a602052604090208054600160ff84161b1916905550565b60008261322e8584613c4d565b14949350505050565b60008054610100900460ff1615613285578160ff166001148015613261575061325f30612d71565b155b61327d5760405162461bcd60e51b8152600401610fd490615723565b506000919050565b60005460ff8084169116106132ac5760405162461bcd60e51b8152600401610fd490615723565b506000805460ff191660ff92909216919091179055600190565b61104e8282612f07565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054610100900460ff166133525760405162461bcd60e51b8152600401610fd490615771565b61104e8282613cb9565b600054610100900460ff166133835760405162461bcd60e51b8152600401610fd490615771565b611651838383613d3d565b600054610100900460ff166133b55760405162461bcd60e51b8152600401610fd490615771565b61104e8282613de0565b600054610100900460ff166133e65760405162461bcd60e51b8152600401610fd490615771565b611eac81613e7c565b600054610100900460ff166134165760405162461bcd60e51b8152600401610fd490615771565b611f46613ed8565b600054610100900460ff166134455760405162461bcd60e51b8152600401610fd490615771565b611eac81613f0f565b600054610100900460ff166134755760405162461bcd60e51b8152600401610fd490615771565b611f46613f5e565b600054610100900460ff166134a45760405162461bcd60e51b8152600401610fd490615771565b611eac81613f95565b600054610100900460ff166134d45760405162461bcd60e51b8152600401610fd490615771565b61104e82826140b1565b600054610100900460ff166135055760405162461bcd60e51b8152600401610fd490615771565b611eac81614141565b613516612e06565b6001600160a01b03166135276120fe565b6001600160a01b03161461354d5760405162461bcd60e51b8152600401610fd490615303565b61355681614168565b601954601654613566919061534e565b60045460035403613577908361534e565b1015611eac5760405162461bcd60e51b81526020600482015260136024820152721313d5d15497d512105397d49154d154959151606a1b6044820152606401610fd4565b6000610e17825490565b6135d0601a8261361e565b156135ed5760405162461bcd60e51b8152600401610fd490615468565b600881901c6000908152601a602052604090208054600160ff84161b17905550565b6060600c8054611f57906155c9565b600881901c600090815260208390526040902054600160ff83161b16151592915050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906136779033908990889088906004016157bc565b602060405180830381600087803b15801561369157600080fd5b505af19250505080156136c1575060408051601f3d908101601f191682019092526136be918101906157ef565b60015b61371c573d8080156136ef576040519150601f19603f3d011682016040523d82523d6000602084013e6136f4565b606091505b508051613714576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60606000600f805461374b906155c9565b9050116137e257600e805461375f906155c9565b80601f016020809104026020016040519081016040528092919081815260200182805461378b906155c9565b80156137d85780601f106137ad576101008083540402835291602001916137d8565b820191906000526020600020905b8154815290600101906020018083116137bb57829003601f168201915b5050505050610e17565b600f6137ed8361423b565b6010604051602001613801939291906158a6565b60405160208183030381529060405292915050565b6003600254600160b01b900460ff16600381111561383657613836614b11565b14156138765760405162461bcd60e51b815260206004820152600f60248201526e15d2551211149055cbd313d0d2d151608a1b6044820152606401610fd4565b60028054600160b01b900460ff16600381111561389557613895614b11565b141561389e5750565b6001600254600160b01b900460ff1660038111156138be576138be614b11565b141561391b576002546001600160a01b03828116911614611eac5760405162461bcd60e51b815260206004820152601760248201527615d2551211149055cbd3d3931657d49150d25412515395604a1b6044820152606401610fd4565b6000600254600160b01b900460ff16600381111561393b5761393b614b11565b1415611eac57806001600160a01b03166139536120fe565b6001600160a01b031614611eac5760405162461bcd60e51b81526020600482015260136024820152722ba4aa24222920ab97a7a7262cafa7aba722a960691b6044820152606401610fd4565b804710156139ef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610fd4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613a3c576040519150601f19603f3d011682016040523d82523d6000602084013e613a41565b606091505b50509050806116515760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610fd4565b612710816020015161ffff1610613ade5760405162461bcd60e51b8152600401610fd4906156fe565b60408051808201825282516001600160a01b03168082526020808501805161ffff1691909301819052601c80546001600160b01b031916909217600160a01b9091021790558251905191517f2c5ea6e4103e78cb101e796fb2dace540362fc542cbff5145eaa24af7dd8fe4192613b559291615080565b60405180910390a150565b6000826000018281548110613b7757613b77615437565b9060005260206000200154905092915050565b61104e828260405180602001604052806000815250614338565b613baf601a8361361e565b15613bcc5760405162461bcd60e51b8152600401610fd490615468565b61236b565b613bdb8282612113565b61104e57613bf3816001600160a01b0316601461439e565b613bfe83602061439e565b604051602001613c0f9291906158d9565b60408051601f198184030181529082905262461bcd60e51b8252610fd491600401614912565b6000612dc88383614539565b6000612dc8838361462c565b600081815b8451811015611597576000858281518110613c6f57613c6f615437565b60200260200101519050808311613c955760008381526020829052604090209250613ca6565b600081815260208490526040902092505b5080613cb18161544d565b915050613c52565b600054610100900460ff16613ce05760405162461bcd60e51b8152600401610fd490615771565b613cf063ac2ba33360e01b61467b565b600280546001600160a01b0384166001600160a01b0319821681178355839291600162ff000160a01b03191617600160b01b836003811115613d3457613d34614b11565b02179055505050565b600054610100900460ff16613d645760405162461bcd60e51b8152600401610fd490615771565b8251613d7790600b9060208601906147d5565b508151613d8b90600c9060208501906147d5565b508051613d9f90600d9060208401906147d5565b50613db0633d96f4ff60e11b61467b565b613dc06380ac58cd60e01b61467b565b613dd063184371e560e31b61467b565b611651635b5e139f60e01b61467b565b600054610100900460ff16613e075760405162461bcd60e51b8152600401610fd490615771565b8151613e1a90600e9060208501906147d5565b508051613e2e90600f9060208401906147d5565b5060408051808201909152600580825264173539b7b760d91b6020909201918252613e5b916010916147d5565b50613e6c631f2f406b60e01b61467b565b61104e635b5e139f60e01b61467b565b600054610100900460ff16613ea35760405162461bcd60e51b8152600401610fd490615771565b6012819055613eb86330f487b560e11b61467b565b613ec86380ac58cd60e01b61467b565b611eac63184371e560e31b61467b565b600054610100900460ff16613eff5760405162461bcd60e51b8152600401610fd490615771565b611f46631aa1577160e11b61467b565b600054610100900460ff16613f365760405162461bcd60e51b8152600401610fd490615771565b613f46631a056e7160e01b61467b565b611eac60008051602061598a833981519152826132c6565b600054610100900460ff16613f855760405162461bcd60e51b8152600401610fd490615771565b611f4663714ad8e760e01b61467b565b600054610100900460ff16613fbc5760405162461bcd60e51b8152600401610fd490615771565b613fcc6308b4902960e41b61467b565b60005b815181101561104e57818181518110613fea57613fea615437565b602090810291909101810151600083815260158352604090819020825181559282015160018401558101516002830180546001600160a01b0319166001600160a01b03909216919091179055606081015160038301556080810151600483015560a0810151600583015560c0810151600683015560e00151600790910155815182908290811061407c5761407c615437565b602002602001015160c001516016600082825461409991906153d6565b909155508190506140a98161544d565b915050613fcf565b600054610100900460ff166140d85760405162461bcd60e51b8152600401610fd490615771565b6140e8633a47bf5160e11b61467b565b6140f863152a902d60e11b61467b565b61410863c69dbd8f60e01b61467b565b61411863656cb66560e11b61467b565b604080518082019091526001600160a01b038316815261ffff8216602082015261165181613ab5565b600054610100900460ff166128de5760405162461bcd60e51b8152600401610fd490615771565b614170612e06565b6001600160a01b03166141816120fe565b6001600160a01b0316146141a75760405162461bcd60e51b8152600401610fd490615303565b60135460ff16156141ec5760405162461bcd60e51b815260206004820152600f60248201526e2120a9a2afaaa924afa32927ad22a760891b6044820152606401610fd4565b600454600354038110156142365760405162461bcd60e51b81526020600482015260116024820152704c4f5745525f5448414e5f535550504c5960781b6044820152606401610fd4565b601255565b60608161425f5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561428957806142738161544d565b91506142829050600a83615423565b9150614263565b6000816001600160401b038111156142a3576142a3614b7f565b6040519080825280601f01601f1916602001820160405280156142cd576020820181803683370190505b5090505b8415613732576142e260018361534e565b91506142ef600a86615948565b6142fa9060306153d6565b60f81b81838151811061430f5761430f615437565b60200101906001600160f81b031916908160001a905350614331600a86615423565b94506142d1565b61434283836146fc565b6001600160a01b0383163b15611651576003548281035b61436c6000868380600101945086613642565b614389576040516368d2bf6b60e11b815260040160405180910390fd5b81811061435957816003541461289857600080fd5b606060006143ad8360026153ee565b6143b89060026153d6565b6001600160401b038111156143cf576143cf614b7f565b6040519080825280601f01601f1916602001820160405280156143f9576020820181803683370190505b509050600360fc1b8160008151811061441457614414615437565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061444357614443615437565b60200101906001600160f81b031916908160001a90535060006144678460026153ee565b6144729060016153d6565b90505b60018111156144ea576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106144a6576144a6615437565b1a60f81b8282815181106144bc576144bc615437565b60200101906001600160f81b031916908160001a90535060049490941c936144e38161595c565b9050614475565b508315612dc85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610fd4565b6000818152600183016020526040812054801561462257600061455d60018361534e565b85549091506000906145719060019061534e565b90508181146145d657600086600001828154811061459157614591615437565b90600052602060002001549050808760000184815481106145b4576145b4615437565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806145e7576145e7615973565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610e17565b6000915050610e17565b600081815260018301602052604081205461467357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610e17565b506000610e17565b6001600160e01b031980821614156146d45760405162461bcd60e51b815260206004820152601c60248201527b115490cc4d8d4e881a5b9d985b1a59081a5b9d195c999858d9481a5960221b6044820152606401610fd4565b6001600160e01b0319166000908152600160208190526040909120805460ff19169091179055565b6003546001600160a01b03831661472557604051622e076360e81b815260040160405180910390fd5b816147435760405163b562e8dd60e01b815260040160405180910390fd5b6147506000848385612ed5565b6001600160a01b038316600090815260086020526040902080546001600160401b018402019055614787836001841460e11b612ee1565b600082815260076020526040902055808281015b6040516001830192906001600160a01b038716906000906000805160206159aa833981519152908290a480821061479b5760035550505050565b8280546147e1906155c9565b90600052602060002090601f0160209004810192826148035760008555614849565b82601f1061481c57805160ff1916838001178555614849565b82800160010185558215614849579182015b8281111561484957825182559160200191906001019061482e565b50614855929150614859565b5090565b5b80821115614855576000815560010161485a565b6001600160e01b031981168114611eac57600080fd5b60006020828403121561489657600080fd5b8135612dc88161486e565b6000602082840312156148b357600080fd5b5035919050565b60005b838110156148d55781810151838201526020016148bd565b8381111561236b5750506000910152565b600081518084526148fe8160208601602086016148ba565b601f01601f19169290920160200192915050565b602081526000612dc860208301846148e6565b6001600160a01b0381168114611eac57600080fd5b80356118b681614925565b6000806040838503121561495857600080fd5b823561496381614925565b946020939093013593505050565b60008082840361012081121561498657600080fd5b83359250610100601f198201121561499d57600080fd5b506020830190509250929050565b6000806000606084860312156149c057600080fd5b83356149cb81614925565b925060208401356149db81614925565b929592945050506040919091013590565b600080604083850312156149ff57600080fd5b50508035926020909101359150565b6001600160a01b03929092168252602082015260400190565b60008083601f840112614a3957600080fd5b5081356001600160401b03811115614a5057600080fd5b6020830191508360208260051b85010111156114ce57600080fd5b60008060208385031215614a7e57600080fd5b82356001600160401b03811115614a9457600080fd5b614aa085828601614a27565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015614ae457835183529284019291840191600101614ac8565b50909695505050505050565b600060208284031215614b0257600080fd5b813560048110612dc857600080fd5b634e487b7160e01b600052602160045260246000fd5b6020810160048310614b4957634e487b7160e01b600052602160045260246000fd5b91905290565b60008060408385031215614b6257600080fd5b823591506020830135614b7481614925565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715614bb857614bb8614b7f565b60405290565b60405161016081016001600160401b0381118282101715614bb857614bb8614b7f565b604051601f8201601f191681016001600160401b0381118282101715614c0957614c09614b7f565b604052919050565b60006001600160401b03831115614c2a57614c2a614b7f565b614c3d601f8401601f1916602001614be1565b9050828152838383011115614c5157600080fd5b828260208301376000602084830101529392505050565b600082601f830112614c7957600080fd5b612dc883833560208501614c11565b600060208284031215614c9a57600080fd5b81356001600160401b03811115614cb057600080fd5b61373284828501614c68565b60008060208385031215614ccf57600080fd5b82356001600160401b0380821115614ce657600080fd5b818501915085601f830112614cfa57600080fd5b813581811115614d0957600080fd5b866020606083028501011115614d1e57600080fd5b60209290920196919550909350505050565b600060208284031215614d4257600080fd5b8135612dc881614925565b600080600080600060808688031215614d6557600080fd5b85359450602086013593506040860135925060608601356001600160401b03811115614d9057600080fd5b614d9c88828901614a27565b969995985093965092949392505050565b600080600080600060808688031215614dc557600080fd5b853594506020860135614dd781614925565b93506040860135925060608601356001600160401b03811115614d9057600080fd5b600082601f830112614e0a57600080fd5b813560206001600160401b03821115614e2557614e25614b7f565b614e33818360051b01614be1565b82815260089290921b84018101918181019086841115614e5257600080fd5b8286015b84811015614ed8576101008189031215614e705760008081fd5b614e78614b95565b813581528482013585820152604080830135614e9381614925565b90820152606082810135908201526080808301359082015260a0808301359082015260c0808301359082015260e0808301359082015283529183019161010001614e56565b509695505050505050565b803561ffff811681146118b657600080fd5b60008060408385031215614f0857600080fd5b82356001600160401b0380821115614f1f57600080fd5b908401906101608287031215614f3457600080fd5b614f3c614bbe565b823582811115614f4b57600080fd5b614f5788828601614c68565b825250602083013582811115614f6c57600080fd5b614f7888828601614c68565b602083015250604083013582811115614f9057600080fd5b614f9c88828601614c68565b604083015250606083013582811115614fb457600080fd5b614fc088828601614c68565b606083015250608083013582811115614fd857600080fd5b614fe488828601614c68565b60808301525060a083013560a082015260c08301358281111561500657600080fd5b61501288828601614df9565b60c08301525061502460e0840161493a565b60e08201526101009150615039828401614ee3565b82820152610120915061504d82840161493a565b82820152610140915061506182840161493a565b828201528094505050506150776020840161493a565b90509250929050565b6001600160a01b0392909216825261ffff16602082015260400190565b8015158114611eac57600080fd5b600080604083850312156150be57600080fd5b82356150c981614925565b91506020830135614b748161509d565b600080600080608085870312156150ef57600080fd5b84356150fa81614925565b9350602085013561510a81614925565b92506040850135915060608501356001600160401b0381111561512c57600080fd5b8501601f8101871361513d57600080fd5b61514c87823560208401614c11565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b828110156151ac57815180516001600160a01b031685528601516001600160601b0316868501529284019290850190600101615175565b5091979650505050505050565b600080600080604085870312156151cf57600080fd5b84356001600160401b03808211156151e657600080fd5b6151f288838901614a27565b9096509450602087013591508082111561520b57600080fd5b818701915087601f83011261521f57600080fd5b81358181111561522e57600080fd5b8860208260081b850101111561524357600080fd5b95989497505060200194505050565b6000806000806040858703121561526857600080fd5b84356001600160401b038082111561527f57600080fd5b61528b88838901614a27565b909650945060208701359150808211156152a457600080fd5b506152b187828801614a27565b95989497509550505050565b600080604083850312156152d057600080fd5b82356152db81614925565b91506020830135614b7481614925565b6000604082840312156152fd57600080fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561536057615360615338565b500390565b813581556020820135600182015560028101604083013561538581614925565b81546001600160a01b0319166001600160a01b0391909116179055606082013560038201556080820135600482015560a0820135600582015560c0820135600682015560e090910135600790910155565b600082198211156153e9576153e9615338565b500190565b600081600019048311821515161561540857615408615338565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826154325761543261540d565b500490565b634e487b7160e01b600052603260045260246000fd5b600060001982141561546157615461615338565b5060010190565b6020808252600690820152651313d0d2d15160d21b604082015260600190565b60006060828403121561549a57600080fd5b604051606081016001600160401b03811182821017156154bc576154bc614b7f565b6040528235815260208301356154d181614925565b60208201526154e260408401614ee3565b60408201529392505050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601890820152775354414b41424c455f4e4f545f4c4f434b45525f524f4c4560401b604082015260600190565b60208082526012908201527122ac21a2a2a229afa0a62627a1a0aa24a7a760711b604082015260600190565b60006020828403121561559557600080fd5b8151612dc88161509d565b6020808252600f908201526e4e4f545f4c4f434b45525f524f4c4560881b604082015260600190565b600181811c908216806155dd57607f821691505b602082108114156152fd57634e487b7160e01b600052602260045260246000fd5b602080825260069082015265232927ad22a760d11b604082015260600190565b6040808252810184905260008560608301825b8781101561566157823561564481614925565b6001600160a01b0316825260209283019290910190600101615631565b5083810360208501528481526001600160fb1b0385111561568157600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b6000604082840312156156b457600080fd5b604080519081016001600160401b03811182821017156156d6576156d6614b7f565b60405282356156e481614925565b81526156f260208401614ee3565b60208201529392505050565b6020808252600b908201526a496e76616c69642062707360a81b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611d49908301846148e6565b60006020828403121561580157600080fd5b8151612dc88161486e565b8054600090600181811c908083168061582657607f831692505b602080841082141561584857634e487b7160e01b600052602260045260246000fd5b81801561585c576001811461586d5761589a565b60ff1986168952848901965061589a565b60008881526020902060005b868110156158925781548b820152908501908301615879565b505084890196505b50505050505092915050565b60006158b2828661580c565b84516158c28183602089016148ba565b6158ce8183018661580c565b979650505050505050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b81526000835161590b8160178501602088016148ba565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161593c8160288401602088016148ba565b01602801949350505050565b6000826159575761595761540d565b500690565b60008161596b5761596b615338565b506000190190565b634e487b7160e01b600052603160045260246000fdfe9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efaf9a8bb3cbd6b84fbccefa71ff73e26e798553c6914585a84886212a46a90279a26469706673582212203a0c7c47beb0ace6eaf47d7138ea85c0bb7c800ad330f615aec6bd5b04a3233164736f6c634300080900330000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a436f6c6c656374696f6e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003434f4c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012697066733a2f2f636f6e747261637455524900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015697066733a2f2f706c616365686f6c64657255524900000000000000000000000000000000000000000000000000000000000000000000000000000000000016697066733a2f2f746f6b656e5552495072656669782f000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103785760003560e01c806301ffc9a71461037d578063039af9eb146103b25780630653aca51461046357806306fdde03146104b2578063081812fc146104d4578063095ea7b31461050c578063167446071461052e57806318160ddd146105435780631a056e711461056657806320f1bb301461058657806323b872dd146105a6578063248a9ca3146105c65780632a55205a146105e65780632bb684ad146106145780632c233067146106415780632d00b587146106615780632f2ff15d1461068f5780633542aee2146106af5780633574a2dd146106cf57806336568abe146106ef57806342842e0e1461070f57806349561cb91461072f5780635136dcc71461075057806353367f081461077057806356c022bb1461079d578063572b6c05146107bd5780635897f878146107dd5780635d36598f146107fd5780635ea2c91b1461081d5780636057e0ec146108305780636198e339146108515780636352211e1461087157806368c7d37c146108915780636ef03047146108b15780636f8b44b0146108d157806370a08231146108f1578063714ad8e714610911578063715018a6146109255780637313cba91461093a5780637885fdc71461094f5780637e9803421461098a578063837fe1401461099f578063859610c6146109b45780638da5cb5b146109d457806391d14854146109e9578063938e3d7b14610a0957806395d89b4114610a2957806399e0dd7c14610a3e578063a217fddf14610a5e578063a22cb46514610a73578063a9852bfb14610a93578063af121f5414610ab3578063b45a3c0e14610ad4578063b88d4fde14610af4578063ba4695fd14610b14578063bd2c18f714610b29578063c0ac998314610b49578063c0bb38ff14610b5e578063c29de63014610b7e578063c71b0e1c14610b98578063c723955a14610bae578063c87b56dd14610bc3578063cad96cca14610be3578063d539139314610c10578063d547741f14610c32578063d5abeb0114610c52578063d8b436fd14610c68578063da74222814610c88578063da82b22714610ca8578063dbbc853b14610cbd578063dcbe353f14610cd2578063dd46706414610cf2578063de6d6d9614610d12578063e8a3d48514610d32578063e985e9c514610d47578063ef60ceaf14610d90578063f2fde38b14610db0578063f362136714610dd0578063f384702f14610df2575b600080fd5b34801561038957600080fd5b5061039d610398366004614884565b610e0c565b60405190151581526020015b60405180910390f35b3480156103be57600080fd5b5061041a6103cd3660046148a1565b60156020526000908152604090208054600182015460028301546003840154600485015460058601546006870154600790970154959694956001600160a01b039094169492939192909188565b6040805198895260208901979097526001600160a01b03909516958701959095526060860192909252608085015260a084015260c083019190915260e0820152610100016103a9565b34801561046f57600080fd5b5061048361047e3660046148a1565b610e1d565b60408051825181526020808401516001600160a01b0316908201529181015161ffff16908201526060016103a9565b3480156104be57600080fd5b506104c7610ea2565b6040516103a99190614912565b3480156104e057600080fd5b506104f46104ef3660046148a1565b610eb1565b6040516001600160a01b0390911681526020016103a9565b34801561051857600080fd5b5061052c610527366004614945565b610ef5565b005b34801561053a57600080fd5b5061052c610f95565b34801561054f57600080fd5b50600454600354035b6040519081526020016103a9565b34801561057257600080fd5b5061052c610581366004614945565b610fec565b34801561059257600080fd5b5061052c6105a1366004614971565b611052565b3480156105b257600080fd5b5061052c6105c13660046149ab565b61126f565b3480156105d257600080fd5b506105586105e13660046148a1565b6113fb565b3480156105f257600080fd5b506106066106013660046149ec565b611410565b6040516103a9929190614a0e565b34801561062057600080fd5b5061063461062f366004614a6b565b6114d5565b6040516103a99190614aac565b34801561064d57600080fd5b5061052c61065c366004614af0565b61159f565b34801561066d57600080fd5b5060025461068290600160b01b900460ff1681565b6040516103a99190614b27565b34801561069b57600080fd5b5061052c6106aa366004614b4f565b611635565b3480156106bb57600080fd5b5061052c6106ca366004614945565b611656565b3480156106db57600080fd5b5061052c6106ea366004614c88565b611695565b3480156106fb57600080fd5b5061052c61070a366004614b4f565b6116e7565b34801561071b57600080fd5b5061052c61072a3660046149ab565b611771565b34801561073b57600080fd5b5060025461039d90600160b81b900460ff1681565b34801561075c57600080fd5b5061052c61076b366004614cbc565b61178c565b34801561077c57600080fd5b5061055861078b3660046148a1565b60176020526000908152604090205481565b3480156107a957600080fd5b506020546104f4906001600160a01b031681565b3480156107c957600080fd5b5061039d6107d8366004614d30565b611826565b3480156107e957600080fd5b506105586107f83660046148a1565b61183a565b34801561080957600080fd5b5061052c610818366004614a6b565b6118bb565b61052c61082b366004614d4d565b61195f565b34801561083c57600080fd5b5060025461039d90600160a01b900460ff1681565b34801561085d57600080fd5b5061052c61086c3660046148a1565b611c3b565b34801561087d57600080fd5b506104f461088c3660046148a1565b611ca8565b34801561089d57600080fd5b5061039d6108ac366004614dad565b611cb3565b3480156108bd57600080fd5b5061052c6108cc366004614ef5565b611d55565b3480156108dd57600080fd5b5061052c6108ec3660046148a1565b611e64565b3480156108fd57600080fd5b5061055861090c366004614d30565b611eaf565b34801561091d57600080fd5b50600161039d565b34801561093157600080fd5b5061052c611efd565b34801561094657600080fd5b506104c7611f48565b34801561095b57600080fd5b50601c5461097c906001600160a01b03811690600160a01b900461ffff1682565b6040516103a9929190615080565b34801561099657600080fd5b50610558611fda565b3480156109ab57600080fd5b5061052c611fe6565b3480156109c057600080fd5b5061052c6109cf366004614a6b565b612064565b3480156109e057600080fd5b506104f46120fe565b3480156109f557600080fd5b5061039d610a04366004614b4f565b612113565b348015610a1557600080fd5b5061052c610a24366004614c88565b61213e565b348015610a3557600080fd5b506104c7612190565b348015610a4a57600080fd5b5061052c610a59366004614c88565b61219a565b348015610a6a57600080fd5b50610558600081565b348015610a7f57600080fd5b5061052c610a8e3660046150ab565b61220f565b348015610a9f57600080fd5b5061052c610aae366004614c88565b6122a5565b348015610abf57600080fd5b5060025461039d90600160a81b900460ff1681565b348015610ae057600080fd5b5061039d610aef3660046148a1565b61231a565b348015610b0057600080fd5b5061052c610b0f3660046150d9565b612327565b348015610b2057600080fd5b5061052c612371565b348015610b3557600080fd5b50610558610b44366004614dad565b6123bf565b348015610b5557600080fd5b506104c76125f0565b348015610b6a57600080fd5b5061052c610b79366004614d30565b6125ff565b348015610b8a57600080fd5b5060115461039d9060ff1681565b348015610ba457600080fd5b5061055860165481565b348015610bba57600080fd5b5061052c61268a565b348015610bcf57600080fd5b506104c7610bde3660046148a1565b612720565b348015610bef57600080fd5b50610c03610bfe3660046148a1565b61272b565b6040516103a99190615158565b348015610c1c57600080fd5b5061055860008051602061598a83398151915281565b348015610c3e57600080fd5b5061052c610c4d366004614b4f565b6127e6565b348015610c5e57600080fd5b5061055860125481565b348015610c7457600080fd5b5061052c610c833660046151b9565b612802565b348015610c9457600080fd5b5061052c610ca3366004614d30565b61289f565b348015610cb457600080fd5b5061052c612900565b348015610cc957600080fd5b506104c761297d565b348015610cde57600080fd5b506002546104f4906001600160a01b031681565b348015610cfe57600080fd5b5061052c610d0d3660046148a1565b61298c565b348015610d1e57600080fd5b5061052c610d2d366004615252565b6129f1565b348015610d3e57600080fd5b506104c7612c39565b348015610d5357600080fd5b5061039d610d623660046152bd565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205460ff1690565b348015610d9c57600080fd5b5061052c610dab3660046152eb565b612c48565b348015610dbc57600080fd5b5061052c610dcb366004614d30565b612c9e565b348015610ddc57600080fd5b506105586000805160206159ca83398151915281565b348015610dfe57600080fd5b5060135461039d9060ff1681565b6000610e1782612d80565b92915050565b6040805160608101825260008082526020820181905291810182905290610e45601e84612dbc565b6000818152601d60209081526040918290208251808401845290546001600160a01b03808216835261ffff600160a01b90920482168385019081528551606081018752968752925116928501929092525116908201529392505050565b6060610eac612dcf565b905090565b6000610ebc82612dde565b610ed9576040516333d1c03960e21b815260040160405180910390fd5b506000908152600960205260409020546001600160a01b031690565b6000610f0082611ca8565b9050336001600160a01b03821614610f3957610f1c8133610d62565b610f39576040516367d9dca160e11b815260040160405180910390fd5b60008281526009602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610f9d612e06565b6001600160a01b0316610fae6120fe565b6001600160a01b031614610fdd5760405162461bcd60e51b8152600401610fd490615303565b60405180910390fd5b6013805460ff19166001179055565b61100660008051602061598a833981519152610a04612e06565b6110445760405162461bcd60e51b815260206004820152600f60248201526e4e4f545f4d494e5445525f524f4c4560881b6044820152606401610fd4565b61104e8282612e10565b5050565b61105a612e06565b6001600160a01b031661106b6120fe565b6001600160a01b0316146110915760405162461bcd60e51b8152600401610fd490615303565b60008281526017602052604090205460e082013510156110e75760405162461bcd60e51b81526020600482015260116024820152701313d5d15497d512105397d35253951151607a1b6044820152606401610fd4565b600082815260156020526040902060060154156111555760008281526017602052604090205460c082013510156111555760405162461bcd60e51b81526020600482015260126024820152711313d5d7d49154d154959157d05353d5539560721b6044820152606401610fd4565b600082815260176020526040902054156111c357600082815260156020526040902060040154608082013510156111c35760405162461bcd60e51b81526020600482015260126024820152711313d5d7d3505617d4115497d5d05313115560721b6044820152606401610fd4565b60008281526015602052604081206006015460168054919290916111e890849061534e565b9091555050600082815260156020526040902081906112078282615365565b9050508060c001356016600082825461122091906153d6565b9091555050601254601654111561104e5760405162461bcd60e51b815260206004820152601360248201527213505617d4d55414131657d15610d151511151606a1b6044820152606401610fd4565b600061127a82612e74565b9050836001600160a01b0316816001600160a01b0316146112ad5760405162a1148160e81b815260040160405180910390fd5b60008281526009602052604090208054338082146001600160a01b038816909114176112fa576112dd8633610d62565b6112fa57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661132157604051633a954ecd60e21b815260040160405180910390fd5b61132e8686866001612ed5565b801561133957600082555b6001600160a01b0386811660009081526008602052604080822080546000190190559187168152208054600101905561137685600160e11b612ee1565b600085815260076020526040902055600160e11b83166113c457600184016000818152600760205260409020546113c25760035481146113c25760008181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b03166000805160206159aa83398151915260405160405180910390a4505050505050565b6000908152601b602052604090206001015490565b6000828152601d602052604081205481906001600160a01b031615611475576000848152601d60205260409020546001600160a01b038116906127109061146290600160a01b900461ffff16866153ee565b61146c9190615423565b915091506114ce565b601c546001600160a01b03161580159061149b5750601c54600160a01b900461ffff1615155b156114c757601c546001600160a01b038116906127109061146290600160a01b900461ffff16866153ee565b5060009050805b9250929050565b60606000826001600160401b038111156114f1576114f1614b7f565b60405190808252806020026020018201604052801561151a578160200160208202803683370190505b50905060005b838110156115975761154985858381811061153d5761153d615437565b9050602002013561231a565b6115855784848281811061155f5761155f615437565b9050602002013582828151811061157857611578615437565b6020026020010181815250505b8061158f8161544d565b915050611520565b509392505050565b6115a7612e06565b6001600160a01b03166115b86120fe565b6001600160a01b0316146115de5760405162461bcd60e51b8152600401610fd490615303565b600254600160b81b900460ff16156116085760405162461bcd60e51b8152600401610fd490615468565b6002805482919060ff60b01b1916600160b01b83600381111561162d5761162d614b11565b021790555050565b61163e826113fb565b61164781612ef6565b6116518383612f07565b505050565b61165e612e06565b6001600160a01b031661166f6120fe565b6001600160a01b0316146110445760405162461bcd60e51b8152600401610fd490615303565b61169d612e06565b6001600160a01b03166116ae6120fe565b6001600160a01b0316146116d45760405162461bcd60e51b8152600401610fd490615303565b805161104e90600e9060208401906147d5565b6116ef612e06565b6001600160a01b0316816001600160a01b0316146117675760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610fd4565b61104e8282612f8e565b61165183838360405180602001604052806000815250612327565b611794612e06565b6001600160a01b03166117a56120fe565b6001600160a01b0316146117cb5760405162461bcd60e51b8152600401610fd490615303565b61104e8282808060200260200160405190810160405280939291908181526020016000905b8282101561181c5761180d60608302860136819003810190615488565b815260200190600101906117f0565b5050505050613013565b6020546001600160a01b0391821691161490565b600060195460165461184c919061534e565b60045460035403601254611860919061534e565b61186a919061534e565b600083815260156020526040902060060154909150156118b6576000828152601760209081526040808320546015909252909120600601546118ac919061534e565b610e1790826153d6565b919050565b600260145414156118de5760405162461bcd60e51b8152600401610fd4906154ee565b60026014556118fb6000805160206159ca83398151915233612113565b6119175760405162461bcd60e51b8152600401610fd490615525565b60005b818110156119555761194383838381811061193757611937615437565b905060200201356131ba565b8061194d8161544d565b91505061191a565b5050600160145550565b600260145414156119825760405162461bcd60e51b8152600401610fd4906154ee565b60026014556000611991612e06565b905060006119a287838787876123bf565b9050808611156119e25760405162461bcd60e51b815260206004820152600b60248201526a08ab0868a8a88a6be9a82b60ab1b6044820152606401610fd4565b6119eb8761183a565b861115611a0a5760405162461bcd60e51b8152600401610fd490615557565b600087815260156020908152604080832060070154601790925290912054611a3290886153d6565b1115611a505760405162461bcd60e51b8152600401610fd490615557565b6000878152601560205260409020600201546001600160a01b0316611ad7576000878152601560205260409020600301543490611a8e9088906153ee565b1115611ad25760405162461bcd60e51b8152602060048201526013602482015272125394d551919250d251539517d05353d55395606a1b6044820152606401610fd4565b611b9a565b600087815260156020526040902060028101546003909101546001600160a01b03909116906323b872dd9084903090611b11908b906153ee565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b158015611b6057600080fd5b505af1158015611b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b989190615583565b505b60008781526018602090815260408083206001600160a01b038616845290915281208054889290611bcc9084906153d6565b909155505060008781526017602052604081208054889290611bef9084906153d6565b909155505060008781526015602052604090206006015415611c23578560196000828254611c1d91906153d6565b90915550505b611c2d8287612e10565b505060016014555050505050565b60026014541415611c5e5760405162461bcd60e51b8152600401610fd4906154ee565b6002601455611c7b6000805160206159ca83398151915233612113565b611c975760405162461bcd60e51b8152600401610fd4906155a0565b611ca0816131ba565b506001601455565b6000610e1782612e74565b6000611d4983838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508b8152601560205260409020600501549250611d449150899050886040516001600160601b0319606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b613221565b90505b95945050505050565b6000611d616001613237565b90508015611d79576000805461ff0019166101001790555b611d846000836132c6565b611d8d826132d0565b611d9d836101200151600261332b565b611db483600001518460200151856040015161335c565b611dc68360600151846080015161338e565b611dd38360a001516133bf565b611ddb6133ef565b611de48261341e565b611dec61344e565b611df98360c0015161347d565b611e0c8360e001518461010001516134ad565b611e1a8361014001516134de565b8015611651576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b611e6c612e06565b6001600160a01b0316611e7d6120fe565b6001600160a01b031614611ea35760405162461bcd60e51b8152600401610fd490615303565b611eac8161350e565b50565b60006001600160a01b038216611ed8576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600860205260409020546001600160401b031690565b611f05612e06565b6001600160a01b0316611f166120fe565b6001600160a01b031614611f3c5760405162461bcd60e51b8152600401610fd490615303565b611f4660006132d0565b565b6060600e8054611f57906155c9565b80601f0160208091040260200160405190810160405280929190818152602001828054611f83906155c9565b8015611fd05780601f10611fa557610100808354040283529160200191611fd0565b820191906000526020600020905b815481529060010190602001808311611fb357829003601f168201915b5050505050905090565b6000610eac601e6135bb565b611fee612e06565b6001600160a01b0316611fff6120fe565b6001600160a01b0316146120255760405162461bcd60e51b8152600401610fd490615303565b600254600160a01b900460ff161561204f5760405162461bcd60e51b8152600401610fd490615468565b6002805460ff60a01b1916600160a01b179055565b600260145414156120875760405162461bcd60e51b8152600401610fd4906154ee565b60026014556120a46000805160206159ca83398151915233612113565b6120c05760405162461bcd60e51b8152600401610fd490615525565b60005b81811015611955576120ec8383838181106120e0576120e0615437565b905060200201356135c5565b806120f68161544d565b9150506120c3565b6000546201000090046001600160a01b031690565b6000918252601b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b612146612e06565b6001600160a01b03166121576120fe565b6001600160a01b03161461217d5760405162461bcd60e51b8152600401610fd490615303565b805161104e90600d9060208401906147d5565b6060610eac61360f565b6121a2612e06565b6001600160a01b03166121b36120fe565b6001600160a01b0316146121d95760405162461bcd60e51b8152600401610fd490615303565b60115460ff16156121fc5760405162461bcd60e51b8152600401610fd4906155fe565b805161104e90600f9060208401906147d5565b6001600160a01b0382163314156122395760405163b06307db60e01b815260040160405180910390fd5b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6122ad612e06565b6001600160a01b03166122be6120fe565b6001600160a01b0316146122e45760405162461bcd60e51b8152600401610fd490615303565b60115460ff16156123075760405162461bcd60e51b8152600401610fd4906155fe565b805161104e9060109060208401906147d5565b6000610e17601a8361361e565b61233284848461126f565b6001600160a01b0383163b1561236b5761234e84848484613642565b61236b576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b612379612e06565b6001600160a01b031661238a6120fe565b6001600160a01b0316146123b05760405162461bcd60e51b8152600401610fd490615303565b6011805460ff19166001179055565b60008581526015602052604081206004015461240a5760405162461bcd60e51b815260206004820152600a6024820152694e4f545f45584953545360b01b6044820152606401610fd4565b6000868152601560205260409020544210156124565760405162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b6044820152606401610fd4565b6000868152601560205260409020600101544211156124a75760405162461bcd60e51b815260206004820152600d60248201526c1053149150511657d153911151609a1b6044820152606401610fd4565b60008681526018602090815260408083206001600160a01b03891684528252808320548984526015909252909120600401546124e3919061534e565b60008781526015602052604090206005015490915015611d4c5760008681526018602090815260408083206001600160a01b038916845290915290205484116125605760405162461bcd60e51b815260206004820152600f60248201526e4d415845445f414c4c4f57414e434560881b6044820152606401610fd4565b61256d8686868686611cb3565b6125ab5760405162461bcd60e51b815260206004820152600f60248201526e1393d517d0531313d5d31254d51151608a1b6044820152606401610fd4565b60008681526018602090815260408083206001600160a01b03891684529091528120546125d8908661534e565b9050808211156125e6578091505b5095945050505050565b6060600f8054611f57906155c9565b612607612e06565b6001600160a01b03166126186120fe565b6001600160a01b03161461263e5760405162461bcd60e51b8152600401610fd490615303565b600254600160a01b900460ff16156126685760405162461bcd60e51b8152600401610fd490615468565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b612692612e06565b6001600160a01b03166126a36120fe565b6001600160a01b0316146126c95760405162461bcd60e51b8152600401610fd490615303565b600254600160b81b900460ff161561270b5760405162461bcd60e51b815260206004820152600560248201526413d0d2d15160da1b6044820152606401610fd4565b6002805460ff60b81b1916600160b81b179055565b6060610e178261373a565b604080516001808252818301909252606091816020015b6040805180820190915260008082526020820152815260200190600190039081612742575050601c5481519192506001600160a01b031690829060009061278b5761278b615437565b60209081029190910101516001600160a01b03919091169052601c548151600160a01b90910461ffff169082906000906127c7576127c7615437565b6020908102919091018101516001600160601b03909216910152919050565b6127ef826113fb565b6127f881612ef6565b6116518383612f8e565b61280a612e06565b6001600160a01b031661281b6120fe565b6001600160a01b0316146128415760405162461bcd60e51b8152600401610fd490615303565b60005b838110156128985761288685858381811061286157612861615437565b9050602002013584848481811061287a5761287a615437565b90506101000201611052565b806128908161544d565b915050612844565b5050505050565b6128a7612e06565b6001600160a01b03166128b86120fe565b6001600160a01b0316146128de5760405162461bcd60e51b8152600401610fd490615303565b602080546001600160a01b0319166001600160a01b0392909216919091179055565b612908612e06565b6001600160a01b03166129196120fe565b6001600160a01b03161461293f5760405162461bcd60e51b8152600401610fd490615303565b6002805460ff60a81b1916600160a81b1790556040517fa24423a69b45c25c0479663125e48b482e71d85eae416f589545243bafaf3c9590600090a1565b606060108054611f57906155c9565b600260145414156129af5760405162461bcd60e51b8152600401610fd4906154ee565b60026014556129cc6000805160206159ca83398151915233612113565b6129e85760405162461bcd60e51b8152600401610fd4906155a0565b611ca0816135c5565b6129fa33613816565b6002546001600160a01b0316612a4a5760405162461bcd60e51b815260206004820152601560248201527415d2551211149055cbd393d7d49150d25412515395605a1b6044820152606401610fd4565b600254600160a81b900460ff1615612aa45760405162461bcd60e51b815260206004820181905260248201527f57495448445241572f454d455247454e43595f504f5745525f5245564f4b45446044820152606401610fd4565b60005b83811015612bf5576000858583818110612ac357612ac3615437565b9050602002016020810190612ad89190614d30565b6001600160a01b03161415612b1c57612b17838383818110612afc57612afc615437565b6002546001600160a01b03169260209091020135905061399f565b612be3565b848482818110612b2e57612b2e615437565b9050602002016020810190612b439190614d30565b6002546001600160a01b039182169163a9059cbb9116858585818110612b6b57612b6b615437565b905060200201356040518363ffffffff1660e01b8152600401612b8f929190614a0e565b602060405180830381600087803b158015612ba957600080fd5b505af1158015612bbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be19190615583565b505b80612bed8161544d565b915050612aa7565b507fd40c399a83caf67d15628b821aa7c7bd940e563c57a047e2bd3b8c602bcaf5a584848484604051612c2b949392919061561e565b60405180910390a150505050565b6060600d8054611f57906155c9565b612c50612e06565b6001600160a01b0316612c616120fe565b6001600160a01b031614612c875760405162461bcd60e51b8152600401610fd490615303565b611eac612c99368390038301836156a2565b613ab5565b612ca6612e06565b6001600160a01b0316612cb76120fe565b6001600160a01b031614612cdd5760405162461bcd60e51b8152600401610fd490615303565b6001600160a01b038116612d425760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610fd4565b611eac816132d0565b6000612d5633611826565b15612d68575060131936013560601c90565b503390565b3390565b6001600160a01b03163b151590565b60006301ffc9a760e01b6001600160e01b031983161480610e175750506001600160e01b03191660009081526001602052604090205460ff1690565b6000612dc88383613b60565b9392505050565b6060600b8054611f57906155c9565b600060035482108015610e17575050600090815260076020526040902054600160e01b161590565b6000610eac612d4b565b60125481612e216004546003540390565b612e2b91906153d6565b1115612e6a5760405162461bcd60e51b815260206004820152600e60248201526d455843454544535f535550504c5960901b6044820152606401610fd4565b61104e8282613b8a565b600081600354811015612ebc57600081815260076020526040902054600160e01b8116612eba575b80612dc8575060001901600081815260076020526040902054612e9c565b505b604051636f96cda160e11b815260040160405180910390fd5b61236b84848484613ba4565b4260a01b176001600160a01b03919091161790565b611eac81612f02612e06565b613bd1565b612f118282612113565b61104e576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612f4a612e06565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612f988282612113565b1561104e576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff19169055612fcf612e06565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60005b815181101561104e57600082828151811061303357613033615437565b60200260200101519050612710816040015161ffff16106130665760405162461bcd60e51b8152600401610fd4906156fe565b60208101516001600160a01b03166130df5780516000908152601d6020526040902080546001600160b01b031916905580516130a490601e90613c35565b5080516040519081527fa2870857763bd9ae76c957f869f16b31c18dd3bb4c7b4d3a4496dc5c57c657f99060200160405180910390a16131a7565b6040805180820182526020808401516001600160a01b0390811683528484015161ffff90811683850190815286516000908152601d90945294909220925183549451909216600160a01b026001600160b01b0319909416911617919091179055805161314d90601e90613c41565b50805160208083015160408085015181519485526001600160a01b039092169284019290925261ffff1682820152517f389b70fb0887f01e83784eb1c4c589f740eca53b00ed0f45e41db5d079719abb9181900360600190a15b50806131b28161544d565b915050613016565b6131c5601a8261361e565b6131fe5760405162461bcd60e51b815260206004820152600a6024820152691393d517d313d0d2d15160b21b6044820152606401610fd4565b600881901c6000908152601a602052604090208054600160ff84161b1916905550565b60008261322e8584613c4d565b14949350505050565b60008054610100900460ff1615613285578160ff166001148015613261575061325f30612d71565b155b61327d5760405162461bcd60e51b8152600401610fd490615723565b506000919050565b60005460ff8084169116106132ac5760405162461bcd60e51b8152600401610fd490615723565b506000805460ff191660ff92909216919091179055600190565b61104e8282612f07565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054610100900460ff166133525760405162461bcd60e51b8152600401610fd490615771565b61104e8282613cb9565b600054610100900460ff166133835760405162461bcd60e51b8152600401610fd490615771565b611651838383613d3d565b600054610100900460ff166133b55760405162461bcd60e51b8152600401610fd490615771565b61104e8282613de0565b600054610100900460ff166133e65760405162461bcd60e51b8152600401610fd490615771565b611eac81613e7c565b600054610100900460ff166134165760405162461bcd60e51b8152600401610fd490615771565b611f46613ed8565b600054610100900460ff166134455760405162461bcd60e51b8152600401610fd490615771565b611eac81613f0f565b600054610100900460ff166134755760405162461bcd60e51b8152600401610fd490615771565b611f46613f5e565b600054610100900460ff166134a45760405162461bcd60e51b8152600401610fd490615771565b611eac81613f95565b600054610100900460ff166134d45760405162461bcd60e51b8152600401610fd490615771565b61104e82826140b1565b600054610100900460ff166135055760405162461bcd60e51b8152600401610fd490615771565b611eac81614141565b613516612e06565b6001600160a01b03166135276120fe565b6001600160a01b03161461354d5760405162461bcd60e51b8152600401610fd490615303565b61355681614168565b601954601654613566919061534e565b60045460035403613577908361534e565b1015611eac5760405162461bcd60e51b81526020600482015260136024820152721313d5d15497d512105397d49154d154959151606a1b6044820152606401610fd4565b6000610e17825490565b6135d0601a8261361e565b156135ed5760405162461bcd60e51b8152600401610fd490615468565b600881901c6000908152601a602052604090208054600160ff84161b17905550565b6060600c8054611f57906155c9565b600881901c600090815260208390526040902054600160ff83161b16151592915050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906136779033908990889088906004016157bc565b602060405180830381600087803b15801561369157600080fd5b505af19250505080156136c1575060408051601f3d908101601f191682019092526136be918101906157ef565b60015b61371c573d8080156136ef576040519150601f19603f3d011682016040523d82523d6000602084013e6136f4565b606091505b508051613714576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60606000600f805461374b906155c9565b9050116137e257600e805461375f906155c9565b80601f016020809104026020016040519081016040528092919081815260200182805461378b906155c9565b80156137d85780601f106137ad576101008083540402835291602001916137d8565b820191906000526020600020905b8154815290600101906020018083116137bb57829003601f168201915b5050505050610e17565b600f6137ed8361423b565b6010604051602001613801939291906158a6565b60405160208183030381529060405292915050565b6003600254600160b01b900460ff16600381111561383657613836614b11565b14156138765760405162461bcd60e51b815260206004820152600f60248201526e15d2551211149055cbd313d0d2d151608a1b6044820152606401610fd4565b60028054600160b01b900460ff16600381111561389557613895614b11565b141561389e5750565b6001600254600160b01b900460ff1660038111156138be576138be614b11565b141561391b576002546001600160a01b03828116911614611eac5760405162461bcd60e51b815260206004820152601760248201527615d2551211149055cbd3d3931657d49150d25412515395604a1b6044820152606401610fd4565b6000600254600160b01b900460ff16600381111561393b5761393b614b11565b1415611eac57806001600160a01b03166139536120fe565b6001600160a01b031614611eac5760405162461bcd60e51b81526020600482015260136024820152722ba4aa24222920ab97a7a7262cafa7aba722a960691b6044820152606401610fd4565b804710156139ef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610fd4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613a3c576040519150601f19603f3d011682016040523d82523d6000602084013e613a41565b606091505b50509050806116515760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610fd4565b612710816020015161ffff1610613ade5760405162461bcd60e51b8152600401610fd4906156fe565b60408051808201825282516001600160a01b03168082526020808501805161ffff1691909301819052601c80546001600160b01b031916909217600160a01b9091021790558251905191517f2c5ea6e4103e78cb101e796fb2dace540362fc542cbff5145eaa24af7dd8fe4192613b559291615080565b60405180910390a150565b6000826000018281548110613b7757613b77615437565b9060005260206000200154905092915050565b61104e828260405180602001604052806000815250614338565b613baf601a8361361e565b15613bcc5760405162461bcd60e51b8152600401610fd490615468565b61236b565b613bdb8282612113565b61104e57613bf3816001600160a01b0316601461439e565b613bfe83602061439e565b604051602001613c0f9291906158d9565b60408051601f198184030181529082905262461bcd60e51b8252610fd491600401614912565b6000612dc88383614539565b6000612dc8838361462c565b600081815b8451811015611597576000858281518110613c6f57613c6f615437565b60200260200101519050808311613c955760008381526020829052604090209250613ca6565b600081815260208490526040902092505b5080613cb18161544d565b915050613c52565b600054610100900460ff16613ce05760405162461bcd60e51b8152600401610fd490615771565b613cf063ac2ba33360e01b61467b565b600280546001600160a01b0384166001600160a01b0319821681178355839291600162ff000160a01b03191617600160b01b836003811115613d3457613d34614b11565b02179055505050565b600054610100900460ff16613d645760405162461bcd60e51b8152600401610fd490615771565b8251613d7790600b9060208601906147d5565b508151613d8b90600c9060208501906147d5565b508051613d9f90600d9060208401906147d5565b50613db0633d96f4ff60e11b61467b565b613dc06380ac58cd60e01b61467b565b613dd063184371e560e31b61467b565b611651635b5e139f60e01b61467b565b600054610100900460ff16613e075760405162461bcd60e51b8152600401610fd490615771565b8151613e1a90600e9060208501906147d5565b508051613e2e90600f9060208401906147d5565b5060408051808201909152600580825264173539b7b760d91b6020909201918252613e5b916010916147d5565b50613e6c631f2f406b60e01b61467b565b61104e635b5e139f60e01b61467b565b600054610100900460ff16613ea35760405162461bcd60e51b8152600401610fd490615771565b6012819055613eb86330f487b560e11b61467b565b613ec86380ac58cd60e01b61467b565b611eac63184371e560e31b61467b565b600054610100900460ff16613eff5760405162461bcd60e51b8152600401610fd490615771565b611f46631aa1577160e11b61467b565b600054610100900460ff16613f365760405162461bcd60e51b8152600401610fd490615771565b613f46631a056e7160e01b61467b565b611eac60008051602061598a833981519152826132c6565b600054610100900460ff16613f855760405162461bcd60e51b8152600401610fd490615771565b611f4663714ad8e760e01b61467b565b600054610100900460ff16613fbc5760405162461bcd60e51b8152600401610fd490615771565b613fcc6308b4902960e41b61467b565b60005b815181101561104e57818181518110613fea57613fea615437565b602090810291909101810151600083815260158352604090819020825181559282015160018401558101516002830180546001600160a01b0319166001600160a01b03909216919091179055606081015160038301556080810151600483015560a0810151600583015560c0810151600683015560e00151600790910155815182908290811061407c5761407c615437565b602002602001015160c001516016600082825461409991906153d6565b909155508190506140a98161544d565b915050613fcf565b600054610100900460ff166140d85760405162461bcd60e51b8152600401610fd490615771565b6140e8633a47bf5160e11b61467b565b6140f863152a902d60e11b61467b565b61410863c69dbd8f60e01b61467b565b61411863656cb66560e11b61467b565b604080518082019091526001600160a01b038316815261ffff8216602082015261165181613ab5565b600054610100900460ff166128de5760405162461bcd60e51b8152600401610fd490615771565b614170612e06565b6001600160a01b03166141816120fe565b6001600160a01b0316146141a75760405162461bcd60e51b8152600401610fd490615303565b60135460ff16156141ec5760405162461bcd60e51b815260206004820152600f60248201526e2120a9a2afaaa924afa32927ad22a760891b6044820152606401610fd4565b600454600354038110156142365760405162461bcd60e51b81526020600482015260116024820152704c4f5745525f5448414e5f535550504c5960781b6044820152606401610fd4565b601255565b60608161425f5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561428957806142738161544d565b91506142829050600a83615423565b9150614263565b6000816001600160401b038111156142a3576142a3614b7f565b6040519080825280601f01601f1916602001820160405280156142cd576020820181803683370190505b5090505b8415613732576142e260018361534e565b91506142ef600a86615948565b6142fa9060306153d6565b60f81b81838151811061430f5761430f615437565b60200101906001600160f81b031916908160001a905350614331600a86615423565b94506142d1565b61434283836146fc565b6001600160a01b0383163b15611651576003548281035b61436c6000868380600101945086613642565b614389576040516368d2bf6b60e11b815260040160405180910390fd5b81811061435957816003541461289857600080fd5b606060006143ad8360026153ee565b6143b89060026153d6565b6001600160401b038111156143cf576143cf614b7f565b6040519080825280601f01601f1916602001820160405280156143f9576020820181803683370190505b509050600360fc1b8160008151811061441457614414615437565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061444357614443615437565b60200101906001600160f81b031916908160001a90535060006144678460026153ee565b6144729060016153d6565b90505b60018111156144ea576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106144a6576144a6615437565b1a60f81b8282815181106144bc576144bc615437565b60200101906001600160f81b031916908160001a90535060049490941c936144e38161595c565b9050614475565b508315612dc85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610fd4565b6000818152600183016020526040812054801561462257600061455d60018361534e565b85549091506000906145719060019061534e565b90508181146145d657600086600001828154811061459157614591615437565b90600052602060002001549050808760000184815481106145b4576145b4615437565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806145e7576145e7615973565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610e17565b6000915050610e17565b600081815260018301602052604081205461467357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610e17565b506000610e17565b6001600160e01b031980821614156146d45760405162461bcd60e51b815260206004820152601c60248201527b115490cc4d8d4e881a5b9d985b1a59081a5b9d195c999858d9481a5960221b6044820152606401610fd4565b6001600160e01b0319166000908152600160208190526040909120805460ff19169091179055565b6003546001600160a01b03831661472557604051622e076360e81b815260040160405180910390fd5b816147435760405163b562e8dd60e01b815260040160405180910390fd5b6147506000848385612ed5565b6001600160a01b038316600090815260086020526040902080546001600160401b018402019055614787836001841460e11b612ee1565b600082815260076020526040902055808281015b6040516001830192906001600160a01b038716906000906000805160206159aa833981519152908290a480821061479b5760035550505050565b8280546147e1906155c9565b90600052602060002090601f0160209004810192826148035760008555614849565b82601f1061481c57805160ff1916838001178555614849565b82800160010185558215614849579182015b8281111561484957825182559160200191906001019061482e565b50614855929150614859565b5090565b5b80821115614855576000815560010161485a565b6001600160e01b031981168114611eac57600080fd5b60006020828403121561489657600080fd5b8135612dc88161486e565b6000602082840312156148b357600080fd5b5035919050565b60005b838110156148d55781810151838201526020016148bd565b8381111561236b5750506000910152565b600081518084526148fe8160208601602086016148ba565b601f01601f19169290920160200192915050565b602081526000612dc860208301846148e6565b6001600160a01b0381168114611eac57600080fd5b80356118b681614925565b6000806040838503121561495857600080fd5b823561496381614925565b946020939093013593505050565b60008082840361012081121561498657600080fd5b83359250610100601f198201121561499d57600080fd5b506020830190509250929050565b6000806000606084860312156149c057600080fd5b83356149cb81614925565b925060208401356149db81614925565b929592945050506040919091013590565b600080604083850312156149ff57600080fd5b50508035926020909101359150565b6001600160a01b03929092168252602082015260400190565b60008083601f840112614a3957600080fd5b5081356001600160401b03811115614a5057600080fd5b6020830191508360208260051b85010111156114ce57600080fd5b60008060208385031215614a7e57600080fd5b82356001600160401b03811115614a9457600080fd5b614aa085828601614a27565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015614ae457835183529284019291840191600101614ac8565b50909695505050505050565b600060208284031215614b0257600080fd5b813560048110612dc857600080fd5b634e487b7160e01b600052602160045260246000fd5b6020810160048310614b4957634e487b7160e01b600052602160045260246000fd5b91905290565b60008060408385031215614b6257600080fd5b823591506020830135614b7481614925565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715614bb857614bb8614b7f565b60405290565b60405161016081016001600160401b0381118282101715614bb857614bb8614b7f565b604051601f8201601f191681016001600160401b0381118282101715614c0957614c09614b7f565b604052919050565b60006001600160401b03831115614c2a57614c2a614b7f565b614c3d601f8401601f1916602001614be1565b9050828152838383011115614c5157600080fd5b828260208301376000602084830101529392505050565b600082601f830112614c7957600080fd5b612dc883833560208501614c11565b600060208284031215614c9a57600080fd5b81356001600160401b03811115614cb057600080fd5b61373284828501614c68565b60008060208385031215614ccf57600080fd5b82356001600160401b0380821115614ce657600080fd5b818501915085601f830112614cfa57600080fd5b813581811115614d0957600080fd5b866020606083028501011115614d1e57600080fd5b60209290920196919550909350505050565b600060208284031215614d4257600080fd5b8135612dc881614925565b600080600080600060808688031215614d6557600080fd5b85359450602086013593506040860135925060608601356001600160401b03811115614d9057600080fd5b614d9c88828901614a27565b969995985093965092949392505050565b600080600080600060808688031215614dc557600080fd5b853594506020860135614dd781614925565b93506040860135925060608601356001600160401b03811115614d9057600080fd5b600082601f830112614e0a57600080fd5b813560206001600160401b03821115614e2557614e25614b7f565b614e33818360051b01614be1565b82815260089290921b84018101918181019086841115614e5257600080fd5b8286015b84811015614ed8576101008189031215614e705760008081fd5b614e78614b95565b813581528482013585820152604080830135614e9381614925565b90820152606082810135908201526080808301359082015260a0808301359082015260c0808301359082015260e0808301359082015283529183019161010001614e56565b509695505050505050565b803561ffff811681146118b657600080fd5b60008060408385031215614f0857600080fd5b82356001600160401b0380821115614f1f57600080fd5b908401906101608287031215614f3457600080fd5b614f3c614bbe565b823582811115614f4b57600080fd5b614f5788828601614c68565b825250602083013582811115614f6c57600080fd5b614f7888828601614c68565b602083015250604083013582811115614f9057600080fd5b614f9c88828601614c68565b604083015250606083013582811115614fb457600080fd5b614fc088828601614c68565b606083015250608083013582811115614fd857600080fd5b614fe488828601614c68565b60808301525060a083013560a082015260c08301358281111561500657600080fd5b61501288828601614df9565b60c08301525061502460e0840161493a565b60e08201526101009150615039828401614ee3565b82820152610120915061504d82840161493a565b82820152610140915061506182840161493a565b828201528094505050506150776020840161493a565b90509250929050565b6001600160a01b0392909216825261ffff16602082015260400190565b8015158114611eac57600080fd5b600080604083850312156150be57600080fd5b82356150c981614925565b91506020830135614b748161509d565b600080600080608085870312156150ef57600080fd5b84356150fa81614925565b9350602085013561510a81614925565b92506040850135915060608501356001600160401b0381111561512c57600080fd5b8501601f8101871361513d57600080fd5b61514c87823560208401614c11565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b828110156151ac57815180516001600160a01b031685528601516001600160601b0316868501529284019290850190600101615175565b5091979650505050505050565b600080600080604085870312156151cf57600080fd5b84356001600160401b03808211156151e657600080fd5b6151f288838901614a27565b9096509450602087013591508082111561520b57600080fd5b818701915087601f83011261521f57600080fd5b81358181111561522e57600080fd5b8860208260081b850101111561524357600080fd5b95989497505060200194505050565b6000806000806040858703121561526857600080fd5b84356001600160401b038082111561527f57600080fd5b61528b88838901614a27565b909650945060208701359150808211156152a457600080fd5b506152b187828801614a27565b95989497509550505050565b600080604083850312156152d057600080fd5b82356152db81614925565b91506020830135614b7481614925565b6000604082840312156152fd57600080fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561536057615360615338565b500390565b813581556020820135600182015560028101604083013561538581614925565b81546001600160a01b0319166001600160a01b0391909116179055606082013560038201556080820135600482015560a0820135600582015560c0820135600682015560e090910135600790910155565b600082198211156153e9576153e9615338565b500190565b600081600019048311821515161561540857615408615338565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826154325761543261540d565b500490565b634e487b7160e01b600052603260045260246000fd5b600060001982141561546157615461615338565b5060010190565b6020808252600690820152651313d0d2d15160d21b604082015260600190565b60006060828403121561549a57600080fd5b604051606081016001600160401b03811182821017156154bc576154bc614b7f565b6040528235815260208301356154d181614925565b60208201526154e260408401614ee3565b60408201529392505050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601890820152775354414b41424c455f4e4f545f4c4f434b45525f524f4c4560401b604082015260600190565b60208082526012908201527122ac21a2a2a229afa0a62627a1a0aa24a7a760711b604082015260600190565b60006020828403121561559557600080fd5b8151612dc88161509d565b6020808252600f908201526e4e4f545f4c4f434b45525f524f4c4560881b604082015260600190565b600181811c908216806155dd57607f821691505b602082108114156152fd57634e487b7160e01b600052602260045260246000fd5b602080825260069082015265232927ad22a760d11b604082015260600190565b6040808252810184905260008560608301825b8781101561566157823561564481614925565b6001600160a01b0316825260209283019290910190600101615631565b5083810360208501528481526001600160fb1b0385111561568157600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b6000604082840312156156b457600080fd5b604080519081016001600160401b03811182821017156156d6576156d6614b7f565b60405282356156e481614925565b81526156f260208401614ee3565b60208201529392505050565b6020808252600b908201526a496e76616c69642062707360a81b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611d49908301846148e6565b60006020828403121561580157600080fd5b8151612dc88161486e565b8054600090600181811c908083168061582657607f831692505b602080841082141561584857634e487b7160e01b600052602260045260246000fd5b81801561585c576001811461586d5761589a565b60ff1986168952848901965061589a565b60008881526020902060005b868110156158925781548b820152908501908301615879565b505084890196505b50505050505092915050565b60006158b2828661580c565b84516158c28183602089016148ba565b6158ce8183018661580c565b979650505050505050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b81526000835161590b8160178501602088016148ba565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161593c8160288401602088016148ba565b01602801949350505050565b6000826159575761595761540d565b500690565b60008161596b5761596b615338565b506000190190565b634e487b7160e01b600052603160045260246000fdfe9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efaf9a8bb3cbd6b84fbccefa71ff73e26e798553c6914585a84886212a46a90279a26469706673582212203a0c7c47beb0ace6eaf47d7138ea85c0bb7c800ad330f615aec6bd5b04a3233164736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a436f6c6c656374696f6e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003434f4c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012697066733a2f2f636f6e747261637455524900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015697066733a2f2f706c616365686f6c64657255524900000000000000000000000000000000000000000000000000000000000000000000000000000000000016697066733a2f2f746f6b656e5552495072656669782f000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : config (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
-----Encoded View---------------
23 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [3] : 00000000000000000000000000000000000000000000000000000000000001e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000260
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 00000000000000000000000000000000000000000000000000000000000002a0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [12] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [13] : 436f6c6c656374696f6e00000000000000000000000000000000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [15] : 434f4c0000000000000000000000000000000000000000000000000000000000
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [17] : 697066733a2f2f636f6e74726163745552490000000000000000000000000000
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000015
Arg [19] : 697066733a2f2f706c616365686f6c6465725552490000000000000000000000
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000016
Arg [21] : 697066733a2f2f746f6b656e5552495072656669782f00000000000000000000
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.