Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Public Mint | 13790988 | 1151 days ago | IN | 0.72 ETH | 0.00463364 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
13790988 | 1151 days ago | 0.72 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
PropertyNFT
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; import "./VRFConsumerBaseUpgradeable.sol"; import "./libraries/RandomLib.sol"; contract PropertyNFT is AccessControlEnumerableUpgradeable, PausableUpgradeable, OwnableUpgradeable, ERC721EnumerableUpgradeable, VRFConsumerBaseUpgradable { using SafeMathUpgradeable for uint256; using StringsUpgradeable for uint256; using ECDSAUpgradeable for bytes32; using RandomLib for RandomLib.Random; struct Whitelist { uint8 tier; uint8 cap; } // Max Supply uint256 public constant MAX_SUPPLY = 6000; uint256 public constant RESERVED = 200; // Mint Prices uint256 public constant LAUNCH_PRICE = 0.09 ether; uint256[] public PRIVATE_SALE_PRICES; uint256 public constant PARTNER_SALE_PRICE = 0.08 ether; // Wallet Restrictions uint8 public constant MAX_QUANTITY = 8; // maximum number of mint per transaction uint8 public constant WALLET_LIMIT_PUBLIC = 16; // to change mapping(address => bool) public whitelistedPartners; // Sales Timings uint256 public PRIVATE_SALE_START; uint256 public PUBLIC_SALE_START; // Treasury Address address payable public TREASURY; // Metadata string public baseTokenURI; string public notRevealedURI; bool public revealed; // Chainlink bytes32 internal keyHash; uint256 internal fee; // PRIVATE VARIABLES mapping(address => uint8) private publicSaleMintedAmount; // number of NFT minted for each wallet during public sale mapping(address => uint8) private privateSaleMintedAmount; mapping(bytes => bool) private _nonceUsed; // nonce was used to mint already address private signerAddress; uint32[] private available; RandomLib.Random internal random; // Reserve Storage uint256[50] private ______gap; // ---------------------- MODIFIERS --------------------------- /// @dev Only EOA modifier modifier onlyEOA() { require(msg.sender == tx.origin, "PropertyNFT: Only EOA"); _; } // ---------------------- INITIALIZER ------------------------- function __PropertyNFT_init( string memory _notRevealedUri, address _owner, address _treasury, uint256 _privateSaleStart, uint256 _publicSaleStart, address _vrfCoordinator, address _link, bytes32 _keyHash, uint256 _fee, address _signerAddress ) public initializer { __AccessControlEnumerable_init(); __Ownable_init(); __Pausable_init(); __ERC721_init_unchained("PropertyNFT", "PP"); __ERC721Enumerable_init(); __VRFConsumableBase_init(_vrfCoordinator, _link); _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); grantRole(DEFAULT_ADMIN_ROLE, _treasury); notRevealedURI = _notRevealedUri; TREASURY = payable(_treasury); PRIVATE_SALE_START = _privateSaleStart; PUBLIC_SALE_START = _publicSaleStart; PRIVATE_SALE_PRICES = [0.08 ether, 0.0725 ether, 0.065 ether]; keyHash = _keyHash; fee = _fee; signerAddress = _signerAddress; transferOwnership(_owner); } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require( _exists(tokenId), "ERC721Metadata: URI query for nonexistent token" ); string memory currentBaseURI = _baseURI(); if (!revealed) { return notRevealedURI; } else { return bytes(currentBaseURI).length > 0 ? string( abi.encodePacked(currentBaseURI, tokenId.toString()) ) : ""; } } // -------------------------- PUBLIC FUNCTIONS ---------------------------- /// @dev Presale Mint function presaleMint( uint8 _mintAmount, uint8 tier, bytes memory nonce, bytes memory signature ) public payable onlyEOA whenNotPaused { require(isPresaleOpen(), "PropertyNFT: Presale Mint not open!"); require(!_nonceUsed[nonce], "PropertyNFT: Nonce was used"); require( isSignedBySigner( msg.sender, nonce, signature, signerAddress, _mintAmount, tier ), "PropertyNFT: Invalid signature" ); require(tier > 0, "PropertyNFT: Whitelist Tier < 1."); require(tier <= 3, "PropertyNFT: Whitelist Tier > 3."); require( privateSaleMintedAmount[msg.sender] + _mintAmount <= tier, "PropertyNFT: Presale Limit Exceeded!" ); require( msg.value == PRIVATE_SALE_PRICES[tier - 1] * _mintAmount, "PropertyNFT: Insufficient ETH!" ); require( totalSupply() + _mintAmount <= MAX_SUPPLY, "PropertyNFT: Maximum Supply Reached!" ); (bool success, ) = TREASURY.call{value: msg.value}(""); // forward amount to treasury wallet require(success, "PropertyNFT: Unable to forward message to treasury!"); for (uint256 i = 0; i < _mintAmount; i++) { privateSaleMintedAmount[msg.sender]++; _mintRandom(msg.sender); } } /// @dev partner Mint function partnerMint(bytes memory nonce, bytes memory signature) public payable onlyEOA whenNotPaused { require(isPresaleOpen(), "PropertyNFT: Presale Mint not open!"); require(!_nonceUsed[nonce], "PropertyNFT: Nonce was used"); require( isSignedBySigner(msg.sender, nonce, signature, signerAddress, 0, 0), "PropertyNFT: Invalid signature" ); require( whitelistedPartners[msg.sender] == false, "PropertyNFT: You have already minted!" ); require( msg.value == PARTNER_SALE_PRICE, "PropertyNFT: Insufficient ETH!" ); require( totalSupply() + 1 <= MAX_SUPPLY, "PropertyNFT: Maximum Supply Reached!" ); (bool success, ) = TREASURY.call{value: msg.value}(""); // forward amount to treasury wallet require(success, "PropertyNFT: Unable to forward message to treasury!"); // Update whitelisted partner mint whitelistedPartners[msg.sender] = true; _mintRandom(msg.sender); } /// @dev Public sale function publicMint(uint8 _mintAmount) public payable onlyEOA whenNotPaused { require( (isPublicSaleOpen()), "PropertyNFT: Public sale has not started!" ); require( publicSaleMintedAmount[msg.sender] + _mintAmount <= WALLET_LIMIT_PUBLIC, "PropertyNFT: Maximum amount of mints exceeded!" ); require( _mintAmount <= MAX_QUANTITY, "PropertyNFT: Maximum mint amount per transaction exceeded!" ); require( totalSupply() + _mintAmount <= MAX_SUPPLY - RESERVED, "PropertyNFT: Maximum Supply Reached!" ); require( msg.value == LAUNCH_PRICE * _mintAmount, "PropertyNFT: Insufficient ETH!" ); (bool success, ) = TREASURY.call{value: msg.value}(""); // forward amount to treasury wallet require(success, "PropertyNFT: Unable to forward message to treasury!"); publicSaleMintedAmount[msg.sender] += _mintAmount; for (uint256 i; i < _mintAmount; i++) { _mintRandom(msg.sender); } } // ----------------- VIEW FUNCTIONS ------------------------ /// @dev Returns mint count during private sale function privateSaleMintCount(address user) public view returns (uint256) { return privateSaleMintedAmount[user]; } function walletOfOwner(address _owner) public view returns (uint256[] memory) { uint256 ownerTokenCount = balanceOf(_owner); uint256[] memory tokenIds = new uint256[](ownerTokenCount); for (uint256 i; i < ownerTokenCount; i++) { tokenIds[i] = tokenOfOwnerByIndex(_owner, i); } return tokenIds; } /// @dev Check if Presale is Open function isPresaleOpen() public view returns (bool) { return block.timestamp >= PRIVATE_SALE_START && block.timestamp < PUBLIC_SALE_START; } /// @dev Check if Public Sale is Open function isPublicSaleOpen() public view returns (bool) { return block.timestamp >= PUBLIC_SALE_START; } /// @dev Get Whitelist Price function getWhitelistPrice(uint8 tier) public view returns (uint256) { return PRIVATE_SALE_PRICES[tier - 1]; } // ------------------ PURE FUNCTIONS ------------------------ /// @dev Parse Bytes postal code form into array function parsePostalCode(bytes memory postalCode) public pure returns (uint8[4] memory) { return [ uint8(postalCode[0]), uint8(postalCode[1]), uint8(postalCode[2]), uint8(postalCode[3]) ]; } /// @dev Parse token id into bytes form function getPostalCode(uint32 tokenId) public pure returns (bytes memory) { return abi.encodePacked(tokenId); } // ------------------ INTERNAL FUNCTIONS ------------------------ /// @dev Sets baseURI function _setBaseURI(string memory _baseTokenURI) internal virtual { baseTokenURI = _baseTokenURI; } /// @dev Gets baseToken URI function _baseURI() internal view override returns (string memory) { return baseTokenURI; } /// @dev Initialize Randomness using chainlink function initializeRandomness() public onlyRole(DEFAULT_ADMIN_ROLE) returns (bytes32 requestId) { require( LINK.balanceOf(address(this)) >= fee, "Not enough LINK - fill contract with faucet" ); return requestRandomness(keyHash, fee); } /// @dev Callback function for Chainlink VRF function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override { RandomLib.setInitialRandom(random, randomness); } function _mintRandom(address user) internal { require( available.length > 0, "PropertyNFT: No more available Propertys" ); uint256 randN = RandomLib.nextRandom(random); uint256 postalCode = available[randN % available.length]; _removeFromAvailable(randN % available.length); _mint(user, postalCode); } // ------------------------ ADMIN FUNCTIONS ---------------------------- /// @dev Set Available mints function pushAvailable(uint32[] memory _available) external onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i; i < _available.length; i++) { available.push(_available[i]); } } /// @dev Reserve some NFTS function airdrop(address[] memory addressList) public onlyRole(DEFAULT_ADMIN_ROLE) { for (uint256 i; i < addressList.length; i++) { _mintRandom(addressList[i]); } } /// @dev Pauses all token transfers. function pause() public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _pause(); } /// @dev Unpauses all token transfers. function unpause() public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _unpause(); } function updateBaseURI(string memory _newBaseURI) public onlyRole(DEFAULT_ADMIN_ROLE) { _reveal(); _setBaseURI(_newBaseURI); } /// @dev Emergency Function to withdraw ETH from this contract function withdrawToTreasury() public onlyRole(DEFAULT_ADMIN_ROLE) { (bool success, ) = TREASURY.call{value: address(this).balance}(""); require(success); } /// @dev Updates presale Start Time function updatePresaleStart(uint256 _startTime) external onlyRole(DEFAULT_ADMIN_ROLE) { PRIVATE_SALE_START = _startTime; } /// @dev Emergency Function to withdraw ETH from this contract function updatePublicSaleStart(uint256 _startTime) external onlyRole(DEFAULT_ADMIN_ROLE) { PUBLIC_SALE_START = _startTime; } // -------------------------- INTERNAL FUNCTIONS ----------------------------- function _reveal() internal { revealed = true; } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override(ERC721EnumerableUpgradeable) whenNotPaused { super._beforeTokenTransfer(from, to, tokenId); } // ------------------------- PRIVATE FUNCTIONS ------------------------------ /// @dev Checks if the the signature is signed by a valid signer function isSignedBySigner( address sender, bytes memory nonce, bytes memory signature, address _signerAddress, uint256 mintAmount, uint256 tier ) private pure returns (bool) { bytes32 hash = keccak256( abi.encodePacked(sender, nonce, mintAmount, tier) ); return _signerAddress == hash.recover(signature); } function supportsInterface(bytes4 interfaceId) public view virtual override( AccessControlEnumerableUpgradeable, ERC721EnumerableUpgradeable ) returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } function _removeFromAvailable(uint256 index) private { require(index < available.length); available[index] = available[available.length - 1]; available.pop(); } function getAvailable() public view onlyRole(DEFAULT_ADMIN_ROLE) returns (uint32[] memory) { return available; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface LinkTokenInterface { function allowance( address owner, address spender ) external view returns ( uint256 remaining ); function approve( address spender, uint256 value ) external returns ( bool success ); function balanceOf( address owner ) external view returns ( uint256 balance ); function decimals() external view returns ( uint8 decimalPlaces ); function decreaseApproval( address spender, uint256 addedValue ) external returns ( bool success ); function increaseApproval( address spender, uint256 subtractedValue ) external; function name() external view returns ( string memory tokenName ); function symbol() external view returns ( string memory tokenSymbol ); function totalSupply() external view returns ( uint256 totalTokensIssued ); function transfer( address to, uint256 value ) external returns ( bool success ); function transferAndCall( address to, uint256 value, bytes calldata data ) external returns ( bool success ); function transferFrom( address from, address to, uint256 value ) external returns ( bool success ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); __AccessControlEnumerable_init_unchained(); } function __AccessControlEnumerable_init_unchained() internal initializer { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {grantRole} to track enumerable memberships */ function grantRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { super.grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {revokeRole} to track enumerable memberships */ function revokeRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { super.revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {renounceRole} to track enumerable memberships */ function renounceRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { super.renounceRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {_setupRole} to track enumerable memberships */ function _setupRole(bytes32 role, address account) internal virtual override { super._setupRole(role, account); _roleMembers[role].add(account); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view 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 granted `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}. * ==== */ 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); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal initializer { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal initializer { _setOwner(_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 { _setOwner(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"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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 a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal initializer { __Context_init_unchained(); __Pausable_init_unchained(); } function __Pausable_init_unchained() internal initializer { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal initializer { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); 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); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} uint256[44] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC721Upgradeable.sol"; import "./IERC721EnumerableUpgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable { function __ERC721Enumerable_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC721Enumerable_init_unchained(); } function __ERC721Enumerable_init_unchained() internal initializer { } // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) { return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721Upgradeable.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } uint256[46] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT 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 CountersUpgradeable { 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 pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal initializer { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal initializer { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT 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 no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMathUpgradeable { /** * @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 substraction 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 pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; abstract contract VRFConsumerBaseUpgradable { uint256 private constant USER_SEED_PLACEHOLDER = 0; LinkTokenInterface internal LINK; address private vrfCoordinator; mapping(bytes32 => uint256) private nonces; // Reserve Storage uint256[50] private ______gap; // replaced constructor with initializer <-- function __VRFConsumableBase_init(address _vrfCoordinator, address _link) public { vrfCoordinator = _vrfCoordinator; LINK = LinkTokenInterface(_link); } function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual; function requestRandomness(bytes32 _keyHash, uint256 _fee) internal returns (bytes32 requestId) { LINK.transferAndCall( vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER) ); uint256 vRFSeed = makeVRFInputSeed( _keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash] ); nonces[_keyHash] = nonces[_keyHash] + 1; return makeRequestId(_keyHash, vRFSeed); } function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external { require( msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill" ); fulfillRandomness(requestId, randomness); } function makeVRFInputSeed( bytes32 _keyHash, uint256 _userSeed, address _requester, uint256 _nonce ) internal pure returns (uint256) { return uint256( keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)) ); } function makeRequestId(bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library RandomLib { struct Random { uint256 lastRandom; uint256 initialRandom; } function nextRandom(Random storage g) internal returns (uint256) { unchecked { g.lastRandom = uint256( keccak256( abi.encode( keccak256( abi.encodePacked( msg.sender, tx.origin, gasleft(), g.lastRandom, g.initialRandom, block.timestamp, block.number, blockhash(block.number), blockhash(block.number - 100) ) ) ) ) ); } return g.lastRandom; } /// @dev set by the randomness from chainlink function setInitialRandom(Random storage g, uint256 initialRandom) internal { g.initialRandom = initialRandom; } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LAUNCH_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_QUANTITY","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PARTNER_SALE_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"PRIVATE_SALE_PRICES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRIVATE_SALE_START","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUBLIC_SALE_START","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESERVED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WALLET_LIMIT_PUBLIC","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_notRevealedUri","type":"string"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_privateSaleStart","type":"uint256"},{"internalType":"uint256","name":"_publicSaleStart","type":"uint256"},{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"address","name":"_link","type":"address"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"address","name":"_signerAddress","type":"address"}],"name":"__PropertyNFT_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"address","name":"_link","type":"address"}],"name":"__VRFConsumableBase_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addressList","type":"address[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailable","outputs":[{"internalType":"uint32[]","name":"","type":"uint32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"tokenId","type":"uint32"}],"name":"getPostalCode","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"tier","type":"uint8"}],"name":"getWhitelistPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initializeRandomness","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPresaleOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPublicSaleOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"notRevealedURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"postalCode","type":"bytes"}],"name":"parsePostalCode","outputs":[{"internalType":"uint8[4]","name":"","type":"uint8[4]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"partnerMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_mintAmount","type":"uint8"},{"internalType":"uint8","name":"tier","type":"uint8"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"presaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"privateSaleMintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_mintAmount","type":"uint8"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_available","type":"uint32[]"}],"name":"pushAvailable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"updateBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"updatePresaleStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"updatePublicSaleStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedPartners","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawToTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506150cc806100206000396000f3fe6080604052600436106103ce5760003560e01c8063729ad39e116101fd578063a217fddf11610118578063d547741f116100ab578063e985e9c51161007a578063e985e9c514610b33578063eb4f847b14610b7d578063ed1088a414610b92578063f2fde38b14610bb2578063f9cc060514610bd257600080fd5b8063d547741f14610ac9578063d547cfb714610ae9578063e41ee46a14610afe578063e821f77214610b1357600080fd5b8063b88d4fde116100e7578063b88d4fde14610a54578063c87b56dd14610a74578063ca15c87314610a94578063d2e2a4ff14610ab457600080fd5b8063a217fddf146109ee578063a22cb46514610a03578063a4a482cb14610a23578063aa592f2514610a3f57600080fd5b80639010d07c1161019057806394985ddd1161015f57806394985ddd1461097b57806395d89b411461099b5780639616a05f146109b05780639b11503e146109d757600080fd5b80639010d07c146108fb57806391d148541461091b578063931688cb1461093b57806393ce660d1461095b57600080fd5b8063857b3f03116101cc578063857b3f0314610870578063858e83b5146108aa5780638967112c146108bd5780638da5cb5b146108dd57600080fd5b8063729ad39e1461080f5780637620de2f1461082f5780637e80c186146108465780638456cb591461085b57600080fd5b806332cb6b0c116102ed5780634f6ccce7116102805780636c10efc31161024f5780636c10efc31461077d57806370a08231146107c5578063715018a6146107e557806372250380146107fa57600080fd5b80634f6ccce71461070a578063518302271461072a5780635c975abb146107455780636352211e1461075d57600080fd5b8063419c2d73116102bc578063419c2d731461065f57806342842e0e14610690578063438b6300146106b0578063472e7eb4146106dd57600080fd5b806332cb6b0c146105f457806336568abe1461060a5780633a74f0321461062a5780633f4ba83a1461064a57600080fd5b80631a6949e31161036557806326e8a9291161033457806326e8a929146105735780632d2c5565146105935780632f2ff15d146105b45780632f745c59146105d457600080fd5b80631a6949e3146104f7578063233a51671461051057806323b872dd14610523578063248a9ca31461054357600080fd5b8063081812fc116103a1578063081812fc14610476578063095ea7b3146104ae57806317781950146104ce57806318160ddd146104e157600080fd5b80630149d825146103d357806301ffc9a7146103f55780630214aef01461042a57806306fdde0314610454575b600080fd5b3480156103df57600080fd5b506103f36103ee366004614445565b610bf4565b005b34801561040157600080fd5b50610415610410366004614513565b610daa565b60405190151581526020015b60405180910390f35b34801561043657600080fd5b5061044667011c37937e08000081565b604051908152602001610421565b34801561046057600080fd5b50610469610df0565b6040516104219190614588565b34801561048257600080fd5b5061049661049136600461459b565b610e83565b6040516001600160a01b039091168152602001610421565b3480156104ba57600080fd5b506103f36104c93660046145b4565b610f1a565b6103f36104dc3660046145de565b611030565b3480156104ed57600080fd5b5061016154610446565b34801561050357600080fd5b506101c954421015610415565b6103f361051e366004614652565b6112d6565b34801561052f57600080fd5b506103f361053e3660046146d6565b6116b2565b34801561054f57600080fd5b5061044661055e36600461459b565b60009081526065602052604090206001015490565b34801561057f57600080fd5b506103f361058e366004614749565b6116e3565b34801561059f57600080fd5b506101ca54610496906001600160a01b031681565b3480156105c057600080fd5b506103f36105cf3660046147e5565b611769565b3480156105e057600080fd5b506104466105ef3660046145b4565b61178b565b34801561060057600080fd5b5061044661177081565b34801561061657600080fd5b506103f36106253660046147e5565b611822565b34801561063657600080fd5b50610446610645366004614811565b611844565b34801561065657600080fd5b506103f3611879565b34801561066b57600080fd5b5061041561067a36600461482c565b6101c76020526000908152604090205460ff1681565b34801561069c57600080fd5b506103f36106ab3660046146d6565b611890565b3480156106bc57600080fd5b506106d06106cb36600461482c565b6118ab565b6040516104219190614847565b3480156106e957600080fd5b506106fd6106f836600461488b565b61194c565b60405161042191906148bf565b34801561071657600080fd5b5061044661072536600461459b565b6119ee565b34801561073657600080fd5b506101cd546104159060ff1681565b34801561075157600080fd5b5060c95460ff16610415565b34801561076957600080fd5b5061049661077836600461459b565b611a71565b34801561078957600080fd5b506104696107983660046148f3565b6040805160e09290921b6001600160e01b0319166020830152805160048184030181526024909201905290565b3480156107d157600080fd5b506104466107e036600461482c565b611ae9565b3480156107f157600080fd5b506103f3611b71565b34801561080657600080fd5b50610469611bd7565b34801561081b57600080fd5b506103f361082a36600461490e565b611c66565b34801561083b57600080fd5b506104466101c85481565b34801561085257600080fd5b506103f3611cb2565b34801561086757600080fd5b506103f3611d23565b34801561087c57600080fd5b5061044661088b36600461482c565b6001600160a01b031660009081526101d1602052604090205460ff1690565b6103f36108b8366004614811565b611d37565b3480156108c957600080fd5b506103f36108d836600461459b565b612030565b3480156108e957600080fd5b5060fb546001600160a01b0316610496565b34801561090757600080fd5b5061049661091636600461499a565b612043565b34801561092757600080fd5b506104156109363660046147e5565b612062565b34801561094757600080fd5b506103f361095636600461488b565b61208d565b34801561096757600080fd5b506103f361097636600461459b565b6120b5565b34801561098757600080fd5b506103f361099636600461499a565b6120c8565b3480156109a757600080fd5b5061046961212a565b3480156109bc57600080fd5b506109c5601081565b60405160ff9091168152602001610421565b3480156109e357600080fd5b506104466101c95481565b3480156109fa57600080fd5b50610446600081565b348015610a0f57600080fd5b506103f3610a1e3660046149ca565b61213a565b348015610a2f57600080fd5b5061044667013fbe85edc9000081565b348015610a4b57600080fd5b5061044660c881565b348015610a6057600080fd5b506103f3610a6f366004614a01565b612200565b348015610a8057600080fd5b50610469610a8f36600461459b565b612238565b348015610aa057600080fd5b50610446610aaf36600461459b565b6123b9565b348015610ac057600080fd5b506104466123d0565b348015610ad557600080fd5b506103f3610ae43660046147e5565b6124d6565b348015610af557600080fd5b506104696124e0565b348015610b0a57600080fd5b506109c5600881565b348015610b1f57600080fd5b506103f3610b2e366004614a5c565b6124ee565b348015610b3f57600080fd5b50610415610b4e366004614a5c565b6001600160a01b0391821660009081526101326020908152604080832093909416825291909152205460ff1690565b348015610b8957600080fd5b5061041561251e565b348015610b9e57600080fd5b50610446610bad36600461459b565b61253a565b348015610bbe57600080fd5b506103f3610bcd36600461482c565b61255c565b348015610bde57600080fd5b50610be7612624565b6040516104219190614a86565b600054610100900460ff1680610c0d575060005460ff16155b610c325760405162461bcd60e51b8152600401610c2990614ac4565b60405180910390fd5b600054610100900460ff16158015610c54576000805461ffff19166101011790555b610c5c6126b6565b610c64612741565b610c6c6127a8565b610cb36040518060400160405280600b81526020016a141c9bdc195c9d1e53919560aa1b81525060405180604001604052806002815260200161050560f41b81525061280f565b610cbb6128a6565b610cc586866124ee565b610cd0600033612904565b610cdb60008a611769565b8a51610cef906101cc9060208e019061427b565b506101ca80546001600160a01b0319166001600160a01b038b161790556101c88890556101c98790556040805160608101825267011c37937e0800008152670101925daa374000602082015266e6ed27d666800091810191909152610d59906101c69060036142fb565b506101ce8490556101cf8390556101d380546001600160a01b0319166001600160a01b038416179055610d8b8a61255c565b8015610d9d576000805461ff00191690555b5050505050505050505050565b60006001600160e01b03198216635a05180f60e01b1480610ddb57506001600160e01b0319821663780e9d6360e01b145b80610dea5750610dea8261290e565b92915050565b606061012d8054610e0090614b12565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2c90614b12565b8015610e795780601f10610e4e57610100808354040283529160200191610e79565b820191906000526020600020905b815481529060010190602001808311610e5c57829003601f168201915b5050505050905090565b600081815261012f60205260408120546001600160a01b0316610efd5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c29565b50600090815261013160205260409020546001600160a01b031690565b6000610f2582611a71565b9050806001600160a01b0316836001600160a01b03161415610f935760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c29565b336001600160a01b0382161480610faf5750610faf8133610b4e565b6110215760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c29565b61102b8383612933565b505050565b33321461104f5760405162461bcd60e51b8152600401610c2990614b47565b60c95460ff16156110725760405162461bcd60e51b8152600401610c2990614b76565b61107a61251e565b6110965760405162461bcd60e51b8152600401610c2990614ba0565b6101d2826040516110a79190614be3565b9081526040519081900360200190205460ff16156111075760405162461bcd60e51b815260206004820152601b60248201527f50726f70657274794e46543a204e6f6e636520776173207573656400000000006044820152606401610c29565b6101d354611126903390849084906001600160a01b03166000806129a2565b6111725760405162461bcd60e51b815260206004820152601e60248201527f50726f70657274794e46543a20496e76616c6964207369676e617475726500006044820152606401610c29565b3360009081526101c7602052604090205460ff16156111e15760405162461bcd60e51b815260206004820152602560248201527f50726f70657274794e46543a20596f75206861766520616c7265616479206d696044820152646e7465642160d81b6064820152608401610c29565b67011c37937e08000034146112085760405162461bcd60e51b8152600401610c2990614bff565b6117706112156101615490565b611220906001614c4c565b111561123e5760405162461bcd60e51b8152600401610c2990614c64565b6101ca546040516000916001600160a01b03169034908381818185875af1925050503d806000811461128c576040519150601f19603f3d011682016040523d82523d6000602084013e611291565b606091505b50509050806112b25760405162461bcd60e51b8152600401610c2990614ca8565b3360008181526101c760205260409020805460ff1916600117905561102b90612a01565b3332146112f55760405162461bcd60e51b8152600401610c2990614b47565b60c95460ff16156113185760405162461bcd60e51b8152600401610c2990614b76565b61132061251e565b61133c5760405162461bcd60e51b8152600401610c2990614ba0565b6101d28260405161134d9190614be3565b9081526040519081900360200190205460ff16156113ad5760405162461bcd60e51b815260206004820152601b60248201527f50726f70657274794e46543a204e6f6e636520776173207573656400000000006044820152606401610c29565b6101d3546113d1903390849084906001600160a01b031660ff808a169089166129a2565b61141d5760405162461bcd60e51b815260206004820152601e60248201527f50726f70657274794e46543a20496e76616c6964207369676e617475726500006044820152606401610c29565b60008360ff16116114705760405162461bcd60e51b815260206004820181905260248201527f50726f70657274794e46543a2057686974656c6973742054696572203c20312e6044820152606401610c29565b60038360ff1611156114c45760405162461bcd60e51b815260206004820181905260248201527f50726f70657274794e46543a2057686974656c6973742054696572203e20332e6044820152606401610c29565b3360009081526101d1602052604090205460ff808516916114e791879116614cfb565b60ff1611156115445760405162461bcd60e51b8152602060048201526024808201527f50726f70657274794e46543a2050726573616c65204c696d69742045786365656044820152636465642160e01b6064820152608401610c29565b60ff84166101c6611556600186614d20565b60ff168154811061156957611569614d43565b906000526020600020015461157e9190614d59565b341461159c5760405162461bcd60e51b8152600401610c2990614bff565b6117708460ff166115ad6101615490565b6115b79190614c4c565b11156115d55760405162461bcd60e51b8152600401610c2990614c64565b6101ca546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611623576040519150601f19603f3d011682016040523d82523d6000602084013e611628565b606091505b50509050806116495760405162461bcd60e51b8152600401610c2990614ca8565b60005b8560ff168110156116aa573360009081526101d160205260408120805460ff169161167683614d78565b91906101000a81548160ff021916908360ff1602179055505061169833612a01565b806116a281614d98565b91505061164c565b505050505050565b6116bc3382612ae6565b6116d85760405162461bcd60e51b8152600401610c2990614db3565b61102b838383612bdf565b60006116ef8133612d8d565b60005b825181101561102b576101d483828151811061171057611710614d43565b60209081029190910181015182546001810184556000938452919092206008820401805460079092166004026101000a63ffffffff8181021990931692909316929092021790558061176181614d98565b9150506116f2565b6117738282612df1565b600082815260976020526040902061102b9082612e17565b600061179683611ae9565b82106117f85760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c29565b506001600160a01b0391909116600090815261015f60209081526040808320938352929052205490565b61182c8282612e2c565b600082815260976020526040902061102b9082612ea6565b60006101c6611854600184614d20565b60ff168154811061186757611867614d43565b90600052602060002001549050919050565b60006118858133612d8d565b61188d612ebb565b50565b61102b83838360405180602001604052806000815250612200565b606060006118b883611ae9565b90506000816001600160401b038111156118d4576118d4614374565b6040519080825280602002602001820160405280156118fd578160200160208202803683370190505b50905060005b8281101561194457611915858261178b565b82828151811061192757611927614d43565b60209081029190910101528061193c81614d98565b915050611903565b509392505050565b611954614341565b60405180608001604052808360008151811061197257611972614d43565b0160209081015160f81c825284519101908490600190811061199657611996614d43565b0160209081015160f81c82528451910190849060029081106119ba576119ba614d43565b0160209081015160f81c82528451910190849060039081106119de576119de614d43565b016020015160f81c905292915050565b60006119fa6101615490565b8210611a5d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c29565b610161828154811061186757611867614d43565b600081815261012f60205260408120546001600160a01b031680610dea5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c29565b60006001600160a01b038216611b545760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c29565b506001600160a01b03166000908152610130602052604090205490565b60fb546001600160a01b03163314611bcb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c29565b611bd56000612f4e565b565b6101cc8054611be590614b12565b80601f0160208091040260200160405190810160405280929190818152602001828054611c1190614b12565b8015611c5e5780601f10611c3357610100808354040283529160200191611c5e565b820191906000526020600020905b815481529060010190602001808311611c4157829003601f168201915b505050505081565b6000611c728133612d8d565b60005b825181101561102b57611ca0838281518110611c9357611c93614d43565b6020026020010151612a01565b80611caa81614d98565b915050611c75565b6000611cbe8133612d8d565b6101ca546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611d0c576040519150601f19603f3d011682016040523d82523d6000602084013e611d11565b606091505b5050905080611d1f57600080fd5b5050565b6000611d2f8133612d8d565b61188d612fa0565b333214611d565760405162461bcd60e51b8152600401610c2990614b47565b60c95460ff1615611d795760405162461bcd60e51b8152600401610c2990614b76565b6101c954421015611dde5760405162461bcd60e51b815260206004820152602960248201527f50726f70657274794e46543a205075626c69632073616c6520686173206e6f7460448201526820737461727465642160b81b6064820152608401610c29565b3360009081526101d06020526040902054601090611e0090839060ff16614cfb565b60ff161115611e685760405162461bcd60e51b815260206004820152602e60248201527f50726f70657274794e46543a204d6178696d756d20616d6f756e74206f66206d60448201526d696e74732065786365656465642160901b6064820152608401610c29565b600860ff82161115611ee25760405162461bcd60e51b815260206004820152603a60248201527f50726f70657274794e46543a204d6178696d756d206d696e7420616d6f756e7460448201527f20706572207472616e73616374696f6e206578636565646564210000000000006064820152608401610c29565b611eef60c8611770614e04565b8160ff16611efd6101615490565b611f079190614c4c565b1115611f255760405162461bcd60e51b8152600401610c2990614c64565b611f3a60ff821667013fbe85edc90000614d59565b3414611f585760405162461bcd60e51b8152600401610c2990614bff565b6101ca546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611fa6576040519150601f19603f3d011682016040523d82523d6000602084013e611fab565b606091505b5050905080611fcc5760405162461bcd60e51b8152600401610c2990614ca8565b3360009081526101d0602052604081208054849290611fef90849060ff16614cfb565b92506101000a81548160ff021916908360ff16021790555060005b8260ff1681101561102b5761201e33612a01565b8061202881614d98565b91505061200a565b600061203c8133612d8d565b506101c855565b600082815260976020526040812061205b9083612ff8565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60006120998133612d8d565b6120ac6101cd805460ff19166001179055565b611d1f82613004565b60006120c18133612d8d565b506101c955565b610192546001600160a01b031633146121235760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610c29565b6101d65550565b606061012e8054610e0090614b12565b6001600160a01b0382163314156121935760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c29565b336000818152610132602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61220a3383612ae6565b6122265760405162461bcd60e51b8152600401610c2990614db3565b61223284848484613018565b50505050565b600081815261012f60205260409020546060906001600160a01b03166122b85760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c29565b60006122c261304b565b6101cd5490915060ff16612364576101cc80546122de90614b12565b80601f016020809104026020016040519081016040528092919081815260200182805461230a90614b12565b80156123575780601f1061232c57610100808354040283529160200191612357565b820191906000526020600020905b81548152906001019060200180831161233a57829003601f168201915b5050505050915050919050565b6000815111612382576040518060200160405280600081525061205b565b8061238c8461305b565b60405160200161239d929190614e1b565b6040516020818303038152906040529392505050565b50919050565b6000818152609760205260408120610dea90613158565b6000806123dd8133612d8d565b6101cf54610191546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b15801561242557600080fd5b505afa158015612439573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245d9190614e4a565b10156124bf5760405162461bcd60e51b815260206004820152602b60248201527f4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e74726163742060448201526a1dda5d1a0819985d58d95d60aa1b6064820152608401610c29565b6124cf6101ce546101cf54613162565b91505b5090565b61182c82826132b0565b6101cb8054611be590614b12565b61019280546001600160a01b039384166001600160a01b0319918216179091556101918054929093169116179055565b60006101c854421015801561253557506101c95442105b905090565b6101c6818154811061254b57600080fd5b600091825260209091200154905081565b60fb546001600160a01b031633146125b65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c29565b6001600160a01b03811661261b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c29565b61188d81612f4e565b606060006126328133612d8d565b6101d48054806020026020016040519081016040528092919081815260200182805480156126ab57602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff168152602001906004019060208260030104928301926001038202915080841161266e5790505b505050505091505090565b600054610100900460ff16806126cf575060005460ff16155b6126eb5760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff1615801561270d576000805461ffff19166101011790555b6127156132d6565b61271d6132d6565b6127256132d6565b61272d6132d6565b801561188d576000805461ff001916905550565b600054610100900460ff168061275a575060005460ff16155b6127765760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff16158015612798576000805461ffff19166101011790555b6127a06132d6565b61272d613340565b600054610100900460ff16806127c1575060005460ff16155b6127dd5760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff161580156127ff576000805461ffff19166101011790555b6128076132d6565b61272d6133a0565b600054610100900460ff1680612828575060005460ff16155b6128445760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff16158015612866576000805461ffff19166101011790555b825161287a9061012d90602086019061427b565b50815161288f9061012e90602085019061427b565b50801561102b576000805461ff0019169055505050565b600054610100900460ff16806128bf575060005460ff16155b6128db5760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff16158015612715576000805461ffff191661010117905561271d6132d6565b6117738282613415565b60006001600160e01b0319821663780e9d6360e01b1480610dea5750610dea8261341f565b60008181526101316020526040902080546001600160a01b0319166001600160a01b038416908117909155819061296982611a71565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080878785856040516020016129bc9493929190614e63565b60408051601f19818403018152919052805160209091012090506129e0818761345f565b6001600160a01b0316856001600160a01b0316149150509695505050505050565b6101d454612a625760405162461bcd60e51b815260206004820152602860248201527f50726f70657274794e46543a204e6f206d6f726520617661696c61626c652050604482015267726f70657274797360c01b6064820152608401610c29565b6000612a6f6101d561347b565b6101d48054919250600091612a849084614ebd565b81548110612a9457612a94614d43565b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff169050612adc6101d48054905083612ad79190614ebd565b613523565b61102b8382613603565b600081815261012f60205260408120546001600160a01b0316612b605760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c29565b6000612b6b83611a71565b9050806001600160a01b0316846001600160a01b03161480612ba65750836001600160a01b0316612b9b84610e83565b6001600160a01b0316145b80612bd757506001600160a01b038082166000908152610132602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316612bf282611a71565b6001600160a01b031614612c5a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610c29565b6001600160a01b038216612cbc5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c29565b612cc7838383613754565b612cd2600082612933565b6001600160a01b038316600090815261013060205260408120805460019290612cfc908490614e04565b90915550506001600160a01b038216600090815261013060205260408120805460019290612d2b908490614c4c565b9091555050600081815261012f602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b612d978282612062565b611d1f57612daf816001600160a01b03166014613782565b612dba836020613782565b604051602001612dcb929190614ed1565b60408051601f198184030181529082905262461bcd60e51b8252610c2991600401614588565b600082815260656020526040902060010154612e0d8133612d8d565b61102b838361391d565b600061205b836001600160a01b0384166139a3565b6001600160a01b0381163314612e9c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c29565b611d1f82826139f2565b600061205b836001600160a01b038416613a59565b60c95460ff16612f045760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c29565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60c95460ff1615612fc35760405162461bcd60e51b8152600401610c2990614b76565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612f313390565b600061205b8383613b4c565b8051611d1f906101cb90602084019061427b565b613023848484612bdf565b61302f84848484613b76565b6122325760405162461bcd60e51b8152600401610c2990614f46565b60606101cb8054610e0090614b12565b60608161307f5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156130a9578061309381614d98565b91506130a29050600a83614f98565b9150613083565b6000816001600160401b038111156130c3576130c3614374565b6040519080825280601f01601f1916602001820160405280156130ed576020820181803683370190505b5090505b8415612bd757613102600183614e04565b915061310f600a86614ebd565b61311a906030614c4c565b60f81b81838151811061312f5761312f614d43565b60200101906001600160f81b031916908160001a905350613151600a86614f98565b94506130f1565b6000610dea825490565b6101915461019254604080516020810186905260008183018190528251808303840181526060830193849052630200057560e51b909352936001600160a01b0390811693634000aea0936131c0939290911691879190606401614fac565b602060405180830381600087803b1580156131da57600080fd5b505af11580156131ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132129190614fdc565b5060008381526101936020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a09091019092528151918301919091209387905291905261326f906001614c4c565b60008581526101936020526040902055612bd78482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6000828152606560205260409020600101546132cc8133612d8d565b61102b83836139f2565b600054610100900460ff16806132ef575060005460ff16155b61330b5760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff1615801561272d576000805461ffff1916610101179055801561188d576000805461ff001916905550565b600054610100900460ff1680613359575060005460ff16155b6133755760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff16158015613397576000805461ffff19166101011790555b61272d33612f4e565b600054610100900460ff16806133b9575060005460ff16155b6133d55760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff161580156133f7576000805461ffff19166101011790555b60c9805460ff19169055801561188d576000805461ff001916905550565b611d1f828261391d565b60006001600160e01b031982166380ac58cd60e01b148061345057506001600160e01b03198216635b5e139f60e01b145b80610dea5750610dea82613c83565b600080600061346e8585613ca8565b9150915061194481613d18565b600033325a845460018601546040516bffffffffffffffffffffffff19606096871b811660208301529490951b90931660348501526048840191909152606883015260888201524260a88201524360c88201819052804060e883015260631901406101088201526101280160408051601f198184030181528282528051602091820120908301520160408051601f198184030181529190528051602090910120918290555090565b6101d454811061353257600080fd5b6101d4805461354390600190614e04565b8154811061355357613553614d43565b90600052602060002090600891828204019190066004029054906101000a900463ffffffff166101d4828154811061358d5761358d614d43565b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff1602179055506101d48054806135d2576135d2614ff9565b600082815260209020600860001990920191820401805463ffffffff600460078516026101000a0219169055905550565b6001600160a01b0382166136595760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c29565b600081815261012f60205260409020546001600160a01b0316156136bf5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c29565b6136cb60008383613754565b6001600160a01b0382166000908152610130602052604081208054600192906136f5908490614c4c565b9091555050600081815261012f602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60c95460ff16156137775760405162461bcd60e51b8152600401610c2990614b76565b61102b838383613ed3565b60606000613791836002614d59565b61379c906002614c4c565b6001600160401b038111156137b3576137b3614374565b6040519080825280601f01601f1916602001820160405280156137dd576020820181803683370190505b509050600360fc1b816000815181106137f8576137f8614d43565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061382757613827614d43565b60200101906001600160f81b031916908160001a905350600061384b846002614d59565b613856906001614c4c565b90505b60018111156138ce576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061388a5761388a614d43565b1a60f81b8282815181106138a0576138a0614d43565b60200101906001600160f81b031916908160001a90535060049490941c936138c78161500f565b9050613859565b50831561205b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c29565b6139278282612062565b611d1f5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561395f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546139ea57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610dea565b506000610dea565b6139fc8282612062565b15611d1f5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60008181526001830160205260408120548015613b42576000613a7d600183614e04565b8554909150600090613a9190600190614e04565b9050818114613af6576000866000018281548110613ab157613ab1614d43565b9060005260206000200154905080876000018481548110613ad457613ad4614d43565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613b0757613b07614ff9565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610dea565b6000915050610dea565b6000826000018281548110613b6357613b63614d43565b9060005260206000200154905092915050565b60006001600160a01b0384163b15613c7857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613bba903390899088908890600401615026565b602060405180830381600087803b158015613bd457600080fd5b505af1925050508015613c04575060408051601f3d908101601f19168201909252613c0191810190615063565b60015b613c5e573d808015613c32576040519150601f19603f3d011682016040523d82523d6000602084013e613c37565b606091505b508051613c565760405162461bcd60e51b8152600401610c2990614f46565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612bd7565b506001949350505050565b60006001600160e01b03198216635a05180f60e01b1480610dea5750610dea82613f8d565b600080825160411415613cdf5760208301516040840151606085015160001a613cd387828585613fc2565b94509450505050613d11565b825160401415613d095760208301516040840151613cfe8683836140af565b935093505050613d11565b506000905060025b9250929050565b6000816004811115613d2c57613d2c615080565b1415613d355750565b6001816004811115613d4957613d49615080565b1415613d975760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c29565b6002816004811115613dab57613dab615080565b1415613df95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c29565b6003816004811115613e0d57613e0d615080565b1415613e665760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c29565b6004816004811115613e7a57613e7a615080565b141561188d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610c29565b6001600160a01b038316613f3057613f2b816101618054600083815261016260205260408120829055600182018355919091527fafbb1c043347995df017ce3291b765e028ad5f784d2aa00c3f5e073760a4de8b0155565b613f53565b816001600160a01b0316836001600160a01b031614613f5357613f5383826140de565b6001600160a01b038216613f6a5761102b81614180565b826001600160a01b0316826001600160a01b03161461102b5761102b8282614235565b60006001600160e01b03198216637965db0b60e01b1480610dea57506301ffc9a760e01b6001600160e01b0319831614610dea565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613ff957506000905060036140a6565b8460ff16601b1415801561401157508460ff16601c14155b1561402257506000905060046140a6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614076573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661409f576000600192509250506140a6565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016140d087828885613fc2565b935093505050935093915050565b600060016140eb84611ae9565b6140f59190614e04565b6000838152610160602052604090205490915080821461414b576001600160a01b038416600090815261015f60209081526040808320858452825280832054848452818420819055835261016090915290208190555b506000918252610160602090815260408084208490556001600160a01b03909416835261015f81528383209183525290812055565b6101615460009061419390600190614e04565b6000838152610162602052604081205461016180549394509092849081106141bd576141bd614d43565b906000526020600020015490508061016183815481106141df576141df614d43565b6000918252602080832090910192909255828152610162909152604080822084905585825281205561016180548061421957614219614ff9565b6001900381819060005260206000200160009055905550505050565b600061424083611ae9565b6001600160a01b03909316600090815261015f6020908152604080832086845282528083208590559382526101609052919091209190915550565b82805461428790614b12565b90600052602060002090601f0160209004810192826142a957600085556142ef565b82601f106142c257805160ff19168380011785556142ef565b828001600101855582156142ef579182015b828111156142ef5782518255916020019190600101906142d4565b506124d292915061435f565b8280548282559060005260206000209081019282156142ef579160200282015b828111156142ef57825182906001600160401b031690559160200191906001019061431b565b60405180608001604052806004906020820280368337509192915050565b5b808211156124d25760008155600101614360565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156143b2576143b2614374565b604052919050565b600082601f8301126143cb57600080fd5b81356001600160401b038111156143e4576143e4614374565b6143f7601f8201601f191660200161438a565b81815284602083860101111561440c57600080fd5b816020850160208301376000918101602001919091529392505050565b80356001600160a01b038116811461444057600080fd5b919050565b6000806000806000806000806000806101408b8d03121561446557600080fd5b8a356001600160401b0381111561447b57600080fd5b6144878d828e016143ba565b9a505061449660208c01614429565b98506144a460408c01614429565b975060608b0135965060808b013595506144c060a08c01614429565b94506144ce60c08c01614429565b935060e08b013592506101008b013591506144ec6101208c01614429565b90509295989b9194979a5092959850565b6001600160e01b03198116811461188d57600080fd5b60006020828403121561452557600080fd5b813561205b816144fd565b60005b8381101561454b578181015183820152602001614533565b838111156122325750506000910152565b60008151808452614574816020860160208601614530565b601f01601f19169290920160200192915050565b60208152600061205b602083018461455c565b6000602082840312156145ad57600080fd5b5035919050565b600080604083850312156145c757600080fd5b6145d083614429565b946020939093013593505050565b600080604083850312156145f157600080fd5b82356001600160401b038082111561460857600080fd5b614614868387016143ba565b9350602085013591508082111561462a57600080fd5b50614637858286016143ba565b9150509250929050565b803560ff8116811461444057600080fd5b6000806000806080858703121561466857600080fd5b61467185614641565b935061467f60208601614641565b925060408501356001600160401b038082111561469b57600080fd5b6146a7888389016143ba565b935060608701359150808211156146bd57600080fd5b506146ca878288016143ba565b91505092959194509250565b6000806000606084860312156146eb57600080fd5b6146f484614429565b925061470260208501614429565b9150604084013590509250925092565b60006001600160401b0382111561472b5761472b614374565b5060051b60200190565b803563ffffffff8116811461444057600080fd5b6000602080838503121561475c57600080fd5b82356001600160401b0381111561477257600080fd5b8301601f8101851361478357600080fd5b803561479661479182614712565b61438a565b81815260059190911b820183019083810190878311156147b557600080fd5b928401925b828410156147da576147cb84614735565b825292840192908401906147ba565b979650505050505050565b600080604083850312156147f857600080fd5b8235915061480860208401614429565b90509250929050565b60006020828403121561482357600080fd5b61205b82614641565b60006020828403121561483e57600080fd5b61205b82614429565b6020808252825182820181905260009190848201906040850190845b8181101561487f57835183529284019291840191600101614863565b50909695505050505050565b60006020828403121561489d57600080fd5b81356001600160401b038111156148b357600080fd5b612bd7848285016143ba565b60808101818360005b60048110156148ea57815160ff168352602092830192909101906001016148c8565b50505092915050565b60006020828403121561490557600080fd5b61205b82614735565b6000602080838503121561492157600080fd5b82356001600160401b0381111561493757600080fd5b8301601f8101851361494857600080fd5b803561495661479182614712565b81815260059190911b8201830190838101908783111561497557600080fd5b928401925b828410156147da5761498b84614429565b8252928401929084019061497a565b600080604083850312156149ad57600080fd5b50508035926020909101359150565b801515811461188d57600080fd5b600080604083850312156149dd57600080fd5b6149e683614429565b915060208301356149f6816149bc565b809150509250929050565b60008060008060808587031215614a1757600080fd5b614a2085614429565b9350614a2e60208601614429565b92506040850135915060608501356001600160401b03811115614a5057600080fd5b6146ca878288016143ba565b60008060408385031215614a6f57600080fd5b614a7883614429565b915061480860208401614429565b6020808252825182820181905260009190848201906040850190845b8181101561487f57835163ffffffff1683529284019291840191600101614aa2565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600181811c90821680614b2657607f821691505b602082108114156123b357634e487b7160e01b600052602260045260246000fd5b60208082526015908201527450726f70657274794e46543a204f6e6c7920454f4160581b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526023908201527f50726f70657274794e46543a2050726573616c65204d696e74206e6f74206f70604082015262656e2160e81b606082015260800190565b60008251614bf5818460208701614530565b9190910192915050565b6020808252601e908201527f50726f70657274794e46543a20496e73756666696369656e7420455448210000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115614c5f57614c5f614c36565b500190565b60208082526024908201527f50726f70657274794e46543a204d6178696d756d20537570706c7920526561636040820152636865642160e01b606082015260800190565b60208082526033908201527f50726f70657274794e46543a20556e61626c6520746f20666f7277617264206d60408201527265737361676520746f2074726561737572792160681b606082015260800190565b600060ff821660ff84168060ff03821115614d1857614d18614c36565b019392505050565b600060ff821660ff841680821015614d3a57614d3a614c36565b90039392505050565b634e487b7160e01b600052603260045260246000fd5b6000816000190483118215151615614d7357614d73614c36565b500290565b600060ff821660ff811415614d8f57614d8f614c36565b60010192915050565b6000600019821415614dac57614dac614c36565b5060010190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082821015614e1657614e16614c36565b500390565b60008351614e2d818460208801614530565b835190830190614e41818360208801614530565b01949350505050565b600060208284031215614e5c57600080fd5b5051919050565b6bffffffffffffffffffffffff198560601b16815260008451614e8d816014850160208901614530565b909101601481019390935250603482015260540192915050565b634e487b7160e01b600052601260045260246000fd5b600082614ecc57614ecc614ea7565b500690565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614f09816017850160208801614530565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614f3a816028840160208801614530565b01602801949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082614fa757614fa7614ea7565b500490565b60018060a01b0384168152826020820152606060408201526000614fd3606083018461455c565b95945050505050565b600060208284031215614fee57600080fd5b815161205b816149bc565b634e487b7160e01b600052603160045260246000fd5b60008161501e5761501e614c36565b506000190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906150599083018461455c565b9695505050505050565b60006020828403121561507557600080fd5b815161205b816144fd565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220392ebcedaeefbfaf920af7bfd93f5b7de1cfa386d2a5b04ccf6222a428d2598264736f6c63430008090033
Deployed Bytecode
0x6080604052600436106103ce5760003560e01c8063729ad39e116101fd578063a217fddf11610118578063d547741f116100ab578063e985e9c51161007a578063e985e9c514610b33578063eb4f847b14610b7d578063ed1088a414610b92578063f2fde38b14610bb2578063f9cc060514610bd257600080fd5b8063d547741f14610ac9578063d547cfb714610ae9578063e41ee46a14610afe578063e821f77214610b1357600080fd5b8063b88d4fde116100e7578063b88d4fde14610a54578063c87b56dd14610a74578063ca15c87314610a94578063d2e2a4ff14610ab457600080fd5b8063a217fddf146109ee578063a22cb46514610a03578063a4a482cb14610a23578063aa592f2514610a3f57600080fd5b80639010d07c1161019057806394985ddd1161015f57806394985ddd1461097b57806395d89b411461099b5780639616a05f146109b05780639b11503e146109d757600080fd5b80639010d07c146108fb57806391d148541461091b578063931688cb1461093b57806393ce660d1461095b57600080fd5b8063857b3f03116101cc578063857b3f0314610870578063858e83b5146108aa5780638967112c146108bd5780638da5cb5b146108dd57600080fd5b8063729ad39e1461080f5780637620de2f1461082f5780637e80c186146108465780638456cb591461085b57600080fd5b806332cb6b0c116102ed5780634f6ccce7116102805780636c10efc31161024f5780636c10efc31461077d57806370a08231146107c5578063715018a6146107e557806372250380146107fa57600080fd5b80634f6ccce71461070a578063518302271461072a5780635c975abb146107455780636352211e1461075d57600080fd5b8063419c2d73116102bc578063419c2d731461065f57806342842e0e14610690578063438b6300146106b0578063472e7eb4146106dd57600080fd5b806332cb6b0c146105f457806336568abe1461060a5780633a74f0321461062a5780633f4ba83a1461064a57600080fd5b80631a6949e31161036557806326e8a9291161033457806326e8a929146105735780632d2c5565146105935780632f2ff15d146105b45780632f745c59146105d457600080fd5b80631a6949e3146104f7578063233a51671461051057806323b872dd14610523578063248a9ca31461054357600080fd5b8063081812fc116103a1578063081812fc14610476578063095ea7b3146104ae57806317781950146104ce57806318160ddd146104e157600080fd5b80630149d825146103d357806301ffc9a7146103f55780630214aef01461042a57806306fdde0314610454575b600080fd5b3480156103df57600080fd5b506103f36103ee366004614445565b610bf4565b005b34801561040157600080fd5b50610415610410366004614513565b610daa565b60405190151581526020015b60405180910390f35b34801561043657600080fd5b5061044667011c37937e08000081565b604051908152602001610421565b34801561046057600080fd5b50610469610df0565b6040516104219190614588565b34801561048257600080fd5b5061049661049136600461459b565b610e83565b6040516001600160a01b039091168152602001610421565b3480156104ba57600080fd5b506103f36104c93660046145b4565b610f1a565b6103f36104dc3660046145de565b611030565b3480156104ed57600080fd5b5061016154610446565b34801561050357600080fd5b506101c954421015610415565b6103f361051e366004614652565b6112d6565b34801561052f57600080fd5b506103f361053e3660046146d6565b6116b2565b34801561054f57600080fd5b5061044661055e36600461459b565b60009081526065602052604090206001015490565b34801561057f57600080fd5b506103f361058e366004614749565b6116e3565b34801561059f57600080fd5b506101ca54610496906001600160a01b031681565b3480156105c057600080fd5b506103f36105cf3660046147e5565b611769565b3480156105e057600080fd5b506104466105ef3660046145b4565b61178b565b34801561060057600080fd5b5061044661177081565b34801561061657600080fd5b506103f36106253660046147e5565b611822565b34801561063657600080fd5b50610446610645366004614811565b611844565b34801561065657600080fd5b506103f3611879565b34801561066b57600080fd5b5061041561067a36600461482c565b6101c76020526000908152604090205460ff1681565b34801561069c57600080fd5b506103f36106ab3660046146d6565b611890565b3480156106bc57600080fd5b506106d06106cb36600461482c565b6118ab565b6040516104219190614847565b3480156106e957600080fd5b506106fd6106f836600461488b565b61194c565b60405161042191906148bf565b34801561071657600080fd5b5061044661072536600461459b565b6119ee565b34801561073657600080fd5b506101cd546104159060ff1681565b34801561075157600080fd5b5060c95460ff16610415565b34801561076957600080fd5b5061049661077836600461459b565b611a71565b34801561078957600080fd5b506104696107983660046148f3565b6040805160e09290921b6001600160e01b0319166020830152805160048184030181526024909201905290565b3480156107d157600080fd5b506104466107e036600461482c565b611ae9565b3480156107f157600080fd5b506103f3611b71565b34801561080657600080fd5b50610469611bd7565b34801561081b57600080fd5b506103f361082a36600461490e565b611c66565b34801561083b57600080fd5b506104466101c85481565b34801561085257600080fd5b506103f3611cb2565b34801561086757600080fd5b506103f3611d23565b34801561087c57600080fd5b5061044661088b36600461482c565b6001600160a01b031660009081526101d1602052604090205460ff1690565b6103f36108b8366004614811565b611d37565b3480156108c957600080fd5b506103f36108d836600461459b565b612030565b3480156108e957600080fd5b5060fb546001600160a01b0316610496565b34801561090757600080fd5b5061049661091636600461499a565b612043565b34801561092757600080fd5b506104156109363660046147e5565b612062565b34801561094757600080fd5b506103f361095636600461488b565b61208d565b34801561096757600080fd5b506103f361097636600461459b565b6120b5565b34801561098757600080fd5b506103f361099636600461499a565b6120c8565b3480156109a757600080fd5b5061046961212a565b3480156109bc57600080fd5b506109c5601081565b60405160ff9091168152602001610421565b3480156109e357600080fd5b506104466101c95481565b3480156109fa57600080fd5b50610446600081565b348015610a0f57600080fd5b506103f3610a1e3660046149ca565b61213a565b348015610a2f57600080fd5b5061044667013fbe85edc9000081565b348015610a4b57600080fd5b5061044660c881565b348015610a6057600080fd5b506103f3610a6f366004614a01565b612200565b348015610a8057600080fd5b50610469610a8f36600461459b565b612238565b348015610aa057600080fd5b50610446610aaf36600461459b565b6123b9565b348015610ac057600080fd5b506104466123d0565b348015610ad557600080fd5b506103f3610ae43660046147e5565b6124d6565b348015610af557600080fd5b506104696124e0565b348015610b0a57600080fd5b506109c5600881565b348015610b1f57600080fd5b506103f3610b2e366004614a5c565b6124ee565b348015610b3f57600080fd5b50610415610b4e366004614a5c565b6001600160a01b0391821660009081526101326020908152604080832093909416825291909152205460ff1690565b348015610b8957600080fd5b5061041561251e565b348015610b9e57600080fd5b50610446610bad36600461459b565b61253a565b348015610bbe57600080fd5b506103f3610bcd36600461482c565b61255c565b348015610bde57600080fd5b50610be7612624565b6040516104219190614a86565b600054610100900460ff1680610c0d575060005460ff16155b610c325760405162461bcd60e51b8152600401610c2990614ac4565b60405180910390fd5b600054610100900460ff16158015610c54576000805461ffff19166101011790555b610c5c6126b6565b610c64612741565b610c6c6127a8565b610cb36040518060400160405280600b81526020016a141c9bdc195c9d1e53919560aa1b81525060405180604001604052806002815260200161050560f41b81525061280f565b610cbb6128a6565b610cc586866124ee565b610cd0600033612904565b610cdb60008a611769565b8a51610cef906101cc9060208e019061427b565b506101ca80546001600160a01b0319166001600160a01b038b161790556101c88890556101c98790556040805160608101825267011c37937e0800008152670101925daa374000602082015266e6ed27d666800091810191909152610d59906101c69060036142fb565b506101ce8490556101cf8390556101d380546001600160a01b0319166001600160a01b038416179055610d8b8a61255c565b8015610d9d576000805461ff00191690555b5050505050505050505050565b60006001600160e01b03198216635a05180f60e01b1480610ddb57506001600160e01b0319821663780e9d6360e01b145b80610dea5750610dea8261290e565b92915050565b606061012d8054610e0090614b12565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2c90614b12565b8015610e795780601f10610e4e57610100808354040283529160200191610e79565b820191906000526020600020905b815481529060010190602001808311610e5c57829003601f168201915b5050505050905090565b600081815261012f60205260408120546001600160a01b0316610efd5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c29565b50600090815261013160205260409020546001600160a01b031690565b6000610f2582611a71565b9050806001600160a01b0316836001600160a01b03161415610f935760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c29565b336001600160a01b0382161480610faf5750610faf8133610b4e565b6110215760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c29565b61102b8383612933565b505050565b33321461104f5760405162461bcd60e51b8152600401610c2990614b47565b60c95460ff16156110725760405162461bcd60e51b8152600401610c2990614b76565b61107a61251e565b6110965760405162461bcd60e51b8152600401610c2990614ba0565b6101d2826040516110a79190614be3565b9081526040519081900360200190205460ff16156111075760405162461bcd60e51b815260206004820152601b60248201527f50726f70657274794e46543a204e6f6e636520776173207573656400000000006044820152606401610c29565b6101d354611126903390849084906001600160a01b03166000806129a2565b6111725760405162461bcd60e51b815260206004820152601e60248201527f50726f70657274794e46543a20496e76616c6964207369676e617475726500006044820152606401610c29565b3360009081526101c7602052604090205460ff16156111e15760405162461bcd60e51b815260206004820152602560248201527f50726f70657274794e46543a20596f75206861766520616c7265616479206d696044820152646e7465642160d81b6064820152608401610c29565b67011c37937e08000034146112085760405162461bcd60e51b8152600401610c2990614bff565b6117706112156101615490565b611220906001614c4c565b111561123e5760405162461bcd60e51b8152600401610c2990614c64565b6101ca546040516000916001600160a01b03169034908381818185875af1925050503d806000811461128c576040519150601f19603f3d011682016040523d82523d6000602084013e611291565b606091505b50509050806112b25760405162461bcd60e51b8152600401610c2990614ca8565b3360008181526101c760205260409020805460ff1916600117905561102b90612a01565b3332146112f55760405162461bcd60e51b8152600401610c2990614b47565b60c95460ff16156113185760405162461bcd60e51b8152600401610c2990614b76565b61132061251e565b61133c5760405162461bcd60e51b8152600401610c2990614ba0565b6101d28260405161134d9190614be3565b9081526040519081900360200190205460ff16156113ad5760405162461bcd60e51b815260206004820152601b60248201527f50726f70657274794e46543a204e6f6e636520776173207573656400000000006044820152606401610c29565b6101d3546113d1903390849084906001600160a01b031660ff808a169089166129a2565b61141d5760405162461bcd60e51b815260206004820152601e60248201527f50726f70657274794e46543a20496e76616c6964207369676e617475726500006044820152606401610c29565b60008360ff16116114705760405162461bcd60e51b815260206004820181905260248201527f50726f70657274794e46543a2057686974656c6973742054696572203c20312e6044820152606401610c29565b60038360ff1611156114c45760405162461bcd60e51b815260206004820181905260248201527f50726f70657274794e46543a2057686974656c6973742054696572203e20332e6044820152606401610c29565b3360009081526101d1602052604090205460ff808516916114e791879116614cfb565b60ff1611156115445760405162461bcd60e51b8152602060048201526024808201527f50726f70657274794e46543a2050726573616c65204c696d69742045786365656044820152636465642160e01b6064820152608401610c29565b60ff84166101c6611556600186614d20565b60ff168154811061156957611569614d43565b906000526020600020015461157e9190614d59565b341461159c5760405162461bcd60e51b8152600401610c2990614bff565b6117708460ff166115ad6101615490565b6115b79190614c4c565b11156115d55760405162461bcd60e51b8152600401610c2990614c64565b6101ca546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611623576040519150601f19603f3d011682016040523d82523d6000602084013e611628565b606091505b50509050806116495760405162461bcd60e51b8152600401610c2990614ca8565b60005b8560ff168110156116aa573360009081526101d160205260408120805460ff169161167683614d78565b91906101000a81548160ff021916908360ff1602179055505061169833612a01565b806116a281614d98565b91505061164c565b505050505050565b6116bc3382612ae6565b6116d85760405162461bcd60e51b8152600401610c2990614db3565b61102b838383612bdf565b60006116ef8133612d8d565b60005b825181101561102b576101d483828151811061171057611710614d43565b60209081029190910181015182546001810184556000938452919092206008820401805460079092166004026101000a63ffffffff8181021990931692909316929092021790558061176181614d98565b9150506116f2565b6117738282612df1565b600082815260976020526040902061102b9082612e17565b600061179683611ae9565b82106117f85760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c29565b506001600160a01b0391909116600090815261015f60209081526040808320938352929052205490565b61182c8282612e2c565b600082815260976020526040902061102b9082612ea6565b60006101c6611854600184614d20565b60ff168154811061186757611867614d43565b90600052602060002001549050919050565b60006118858133612d8d565b61188d612ebb565b50565b61102b83838360405180602001604052806000815250612200565b606060006118b883611ae9565b90506000816001600160401b038111156118d4576118d4614374565b6040519080825280602002602001820160405280156118fd578160200160208202803683370190505b50905060005b8281101561194457611915858261178b565b82828151811061192757611927614d43565b60209081029190910101528061193c81614d98565b915050611903565b509392505050565b611954614341565b60405180608001604052808360008151811061197257611972614d43565b0160209081015160f81c825284519101908490600190811061199657611996614d43565b0160209081015160f81c82528451910190849060029081106119ba576119ba614d43565b0160209081015160f81c82528451910190849060039081106119de576119de614d43565b016020015160f81c905292915050565b60006119fa6101615490565b8210611a5d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c29565b610161828154811061186757611867614d43565b600081815261012f60205260408120546001600160a01b031680610dea5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c29565b60006001600160a01b038216611b545760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c29565b506001600160a01b03166000908152610130602052604090205490565b60fb546001600160a01b03163314611bcb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c29565b611bd56000612f4e565b565b6101cc8054611be590614b12565b80601f0160208091040260200160405190810160405280929190818152602001828054611c1190614b12565b8015611c5e5780601f10611c3357610100808354040283529160200191611c5e565b820191906000526020600020905b815481529060010190602001808311611c4157829003601f168201915b505050505081565b6000611c728133612d8d565b60005b825181101561102b57611ca0838281518110611c9357611c93614d43565b6020026020010151612a01565b80611caa81614d98565b915050611c75565b6000611cbe8133612d8d565b6101ca546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611d0c576040519150601f19603f3d011682016040523d82523d6000602084013e611d11565b606091505b5050905080611d1f57600080fd5b5050565b6000611d2f8133612d8d565b61188d612fa0565b333214611d565760405162461bcd60e51b8152600401610c2990614b47565b60c95460ff1615611d795760405162461bcd60e51b8152600401610c2990614b76565b6101c954421015611dde5760405162461bcd60e51b815260206004820152602960248201527f50726f70657274794e46543a205075626c69632073616c6520686173206e6f7460448201526820737461727465642160b81b6064820152608401610c29565b3360009081526101d06020526040902054601090611e0090839060ff16614cfb565b60ff161115611e685760405162461bcd60e51b815260206004820152602e60248201527f50726f70657274794e46543a204d6178696d756d20616d6f756e74206f66206d60448201526d696e74732065786365656465642160901b6064820152608401610c29565b600860ff82161115611ee25760405162461bcd60e51b815260206004820152603a60248201527f50726f70657274794e46543a204d6178696d756d206d696e7420616d6f756e7460448201527f20706572207472616e73616374696f6e206578636565646564210000000000006064820152608401610c29565b611eef60c8611770614e04565b8160ff16611efd6101615490565b611f079190614c4c565b1115611f255760405162461bcd60e51b8152600401610c2990614c64565b611f3a60ff821667013fbe85edc90000614d59565b3414611f585760405162461bcd60e51b8152600401610c2990614bff565b6101ca546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611fa6576040519150601f19603f3d011682016040523d82523d6000602084013e611fab565b606091505b5050905080611fcc5760405162461bcd60e51b8152600401610c2990614ca8565b3360009081526101d0602052604081208054849290611fef90849060ff16614cfb565b92506101000a81548160ff021916908360ff16021790555060005b8260ff1681101561102b5761201e33612a01565b8061202881614d98565b91505061200a565b600061203c8133612d8d565b506101c855565b600082815260976020526040812061205b9083612ff8565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60006120998133612d8d565b6120ac6101cd805460ff19166001179055565b611d1f82613004565b60006120c18133612d8d565b506101c955565b610192546001600160a01b031633146121235760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610c29565b6101d65550565b606061012e8054610e0090614b12565b6001600160a01b0382163314156121935760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c29565b336000818152610132602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61220a3383612ae6565b6122265760405162461bcd60e51b8152600401610c2990614db3565b61223284848484613018565b50505050565b600081815261012f60205260409020546060906001600160a01b03166122b85760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c29565b60006122c261304b565b6101cd5490915060ff16612364576101cc80546122de90614b12565b80601f016020809104026020016040519081016040528092919081815260200182805461230a90614b12565b80156123575780601f1061232c57610100808354040283529160200191612357565b820191906000526020600020905b81548152906001019060200180831161233a57829003601f168201915b5050505050915050919050565b6000815111612382576040518060200160405280600081525061205b565b8061238c8461305b565b60405160200161239d929190614e1b565b6040516020818303038152906040529392505050565b50919050565b6000818152609760205260408120610dea90613158565b6000806123dd8133612d8d565b6101cf54610191546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b15801561242557600080fd5b505afa158015612439573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245d9190614e4a565b10156124bf5760405162461bcd60e51b815260206004820152602b60248201527f4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e74726163742060448201526a1dda5d1a0819985d58d95d60aa1b6064820152608401610c29565b6124cf6101ce546101cf54613162565b91505b5090565b61182c82826132b0565b6101cb8054611be590614b12565b61019280546001600160a01b039384166001600160a01b0319918216179091556101918054929093169116179055565b60006101c854421015801561253557506101c95442105b905090565b6101c6818154811061254b57600080fd5b600091825260209091200154905081565b60fb546001600160a01b031633146125b65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c29565b6001600160a01b03811661261b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c29565b61188d81612f4e565b606060006126328133612d8d565b6101d48054806020026020016040519081016040528092919081815260200182805480156126ab57602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff168152602001906004019060208260030104928301926001038202915080841161266e5790505b505050505091505090565b600054610100900460ff16806126cf575060005460ff16155b6126eb5760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff1615801561270d576000805461ffff19166101011790555b6127156132d6565b61271d6132d6565b6127256132d6565b61272d6132d6565b801561188d576000805461ff001916905550565b600054610100900460ff168061275a575060005460ff16155b6127765760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff16158015612798576000805461ffff19166101011790555b6127a06132d6565b61272d613340565b600054610100900460ff16806127c1575060005460ff16155b6127dd5760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff161580156127ff576000805461ffff19166101011790555b6128076132d6565b61272d6133a0565b600054610100900460ff1680612828575060005460ff16155b6128445760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff16158015612866576000805461ffff19166101011790555b825161287a9061012d90602086019061427b565b50815161288f9061012e90602085019061427b565b50801561102b576000805461ff0019169055505050565b600054610100900460ff16806128bf575060005460ff16155b6128db5760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff16158015612715576000805461ffff191661010117905561271d6132d6565b6117738282613415565b60006001600160e01b0319821663780e9d6360e01b1480610dea5750610dea8261341f565b60008181526101316020526040902080546001600160a01b0319166001600160a01b038416908117909155819061296982611a71565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080878785856040516020016129bc9493929190614e63565b60408051601f19818403018152919052805160209091012090506129e0818761345f565b6001600160a01b0316856001600160a01b0316149150509695505050505050565b6101d454612a625760405162461bcd60e51b815260206004820152602860248201527f50726f70657274794e46543a204e6f206d6f726520617661696c61626c652050604482015267726f70657274797360c01b6064820152608401610c29565b6000612a6f6101d561347b565b6101d48054919250600091612a849084614ebd565b81548110612a9457612a94614d43565b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff169050612adc6101d48054905083612ad79190614ebd565b613523565b61102b8382613603565b600081815261012f60205260408120546001600160a01b0316612b605760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c29565b6000612b6b83611a71565b9050806001600160a01b0316846001600160a01b03161480612ba65750836001600160a01b0316612b9b84610e83565b6001600160a01b0316145b80612bd757506001600160a01b038082166000908152610132602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316612bf282611a71565b6001600160a01b031614612c5a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610c29565b6001600160a01b038216612cbc5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c29565b612cc7838383613754565b612cd2600082612933565b6001600160a01b038316600090815261013060205260408120805460019290612cfc908490614e04565b90915550506001600160a01b038216600090815261013060205260408120805460019290612d2b908490614c4c565b9091555050600081815261012f602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b612d978282612062565b611d1f57612daf816001600160a01b03166014613782565b612dba836020613782565b604051602001612dcb929190614ed1565b60408051601f198184030181529082905262461bcd60e51b8252610c2991600401614588565b600082815260656020526040902060010154612e0d8133612d8d565b61102b838361391d565b600061205b836001600160a01b0384166139a3565b6001600160a01b0381163314612e9c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c29565b611d1f82826139f2565b600061205b836001600160a01b038416613a59565b60c95460ff16612f045760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c29565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60c95460ff1615612fc35760405162461bcd60e51b8152600401610c2990614b76565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612f313390565b600061205b8383613b4c565b8051611d1f906101cb90602084019061427b565b613023848484612bdf565b61302f84848484613b76565b6122325760405162461bcd60e51b8152600401610c2990614f46565b60606101cb8054610e0090614b12565b60608161307f5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156130a9578061309381614d98565b91506130a29050600a83614f98565b9150613083565b6000816001600160401b038111156130c3576130c3614374565b6040519080825280601f01601f1916602001820160405280156130ed576020820181803683370190505b5090505b8415612bd757613102600183614e04565b915061310f600a86614ebd565b61311a906030614c4c565b60f81b81838151811061312f5761312f614d43565b60200101906001600160f81b031916908160001a905350613151600a86614f98565b94506130f1565b6000610dea825490565b6101915461019254604080516020810186905260008183018190528251808303840181526060830193849052630200057560e51b909352936001600160a01b0390811693634000aea0936131c0939290911691879190606401614fac565b602060405180830381600087803b1580156131da57600080fd5b505af11580156131ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132129190614fdc565b5060008381526101936020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a09091019092528151918301919091209387905291905261326f906001614c4c565b60008581526101936020526040902055612bd78482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6000828152606560205260409020600101546132cc8133612d8d565b61102b83836139f2565b600054610100900460ff16806132ef575060005460ff16155b61330b5760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff1615801561272d576000805461ffff1916610101179055801561188d576000805461ff001916905550565b600054610100900460ff1680613359575060005460ff16155b6133755760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff16158015613397576000805461ffff19166101011790555b61272d33612f4e565b600054610100900460ff16806133b9575060005460ff16155b6133d55760405162461bcd60e51b8152600401610c2990614ac4565b600054610100900460ff161580156133f7576000805461ffff19166101011790555b60c9805460ff19169055801561188d576000805461ff001916905550565b611d1f828261391d565b60006001600160e01b031982166380ac58cd60e01b148061345057506001600160e01b03198216635b5e139f60e01b145b80610dea5750610dea82613c83565b600080600061346e8585613ca8565b9150915061194481613d18565b600033325a845460018601546040516bffffffffffffffffffffffff19606096871b811660208301529490951b90931660348501526048840191909152606883015260888201524260a88201524360c88201819052804060e883015260631901406101088201526101280160408051601f198184030181528282528051602091820120908301520160408051601f198184030181529190528051602090910120918290555090565b6101d454811061353257600080fd5b6101d4805461354390600190614e04565b8154811061355357613553614d43565b90600052602060002090600891828204019190066004029054906101000a900463ffffffff166101d4828154811061358d5761358d614d43565b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff1602179055506101d48054806135d2576135d2614ff9565b600082815260209020600860001990920191820401805463ffffffff600460078516026101000a0219169055905550565b6001600160a01b0382166136595760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c29565b600081815261012f60205260409020546001600160a01b0316156136bf5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c29565b6136cb60008383613754565b6001600160a01b0382166000908152610130602052604081208054600192906136f5908490614c4c565b9091555050600081815261012f602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60c95460ff16156137775760405162461bcd60e51b8152600401610c2990614b76565b61102b838383613ed3565b60606000613791836002614d59565b61379c906002614c4c565b6001600160401b038111156137b3576137b3614374565b6040519080825280601f01601f1916602001820160405280156137dd576020820181803683370190505b509050600360fc1b816000815181106137f8576137f8614d43565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061382757613827614d43565b60200101906001600160f81b031916908160001a905350600061384b846002614d59565b613856906001614c4c565b90505b60018111156138ce576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061388a5761388a614d43565b1a60f81b8282815181106138a0576138a0614d43565b60200101906001600160f81b031916908160001a90535060049490941c936138c78161500f565b9050613859565b50831561205b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c29565b6139278282612062565b611d1f5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561395f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546139ea57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610dea565b506000610dea565b6139fc8282612062565b15611d1f5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60008181526001830160205260408120548015613b42576000613a7d600183614e04565b8554909150600090613a9190600190614e04565b9050818114613af6576000866000018281548110613ab157613ab1614d43565b9060005260206000200154905080876000018481548110613ad457613ad4614d43565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613b0757613b07614ff9565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610dea565b6000915050610dea565b6000826000018281548110613b6357613b63614d43565b9060005260206000200154905092915050565b60006001600160a01b0384163b15613c7857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613bba903390899088908890600401615026565b602060405180830381600087803b158015613bd457600080fd5b505af1925050508015613c04575060408051601f3d908101601f19168201909252613c0191810190615063565b60015b613c5e573d808015613c32576040519150601f19603f3d011682016040523d82523d6000602084013e613c37565b606091505b508051613c565760405162461bcd60e51b8152600401610c2990614f46565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612bd7565b506001949350505050565b60006001600160e01b03198216635a05180f60e01b1480610dea5750610dea82613f8d565b600080825160411415613cdf5760208301516040840151606085015160001a613cd387828585613fc2565b94509450505050613d11565b825160401415613d095760208301516040840151613cfe8683836140af565b935093505050613d11565b506000905060025b9250929050565b6000816004811115613d2c57613d2c615080565b1415613d355750565b6001816004811115613d4957613d49615080565b1415613d975760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c29565b6002816004811115613dab57613dab615080565b1415613df95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c29565b6003816004811115613e0d57613e0d615080565b1415613e665760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c29565b6004816004811115613e7a57613e7a615080565b141561188d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610c29565b6001600160a01b038316613f3057613f2b816101618054600083815261016260205260408120829055600182018355919091527fafbb1c043347995df017ce3291b765e028ad5f784d2aa00c3f5e073760a4de8b0155565b613f53565b816001600160a01b0316836001600160a01b031614613f5357613f5383826140de565b6001600160a01b038216613f6a5761102b81614180565b826001600160a01b0316826001600160a01b03161461102b5761102b8282614235565b60006001600160e01b03198216637965db0b60e01b1480610dea57506301ffc9a760e01b6001600160e01b0319831614610dea565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613ff957506000905060036140a6565b8460ff16601b1415801561401157508460ff16601c14155b1561402257506000905060046140a6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614076573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661409f576000600192509250506140a6565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016140d087828885613fc2565b935093505050935093915050565b600060016140eb84611ae9565b6140f59190614e04565b6000838152610160602052604090205490915080821461414b576001600160a01b038416600090815261015f60209081526040808320858452825280832054848452818420819055835261016090915290208190555b506000918252610160602090815260408084208490556001600160a01b03909416835261015f81528383209183525290812055565b6101615460009061419390600190614e04565b6000838152610162602052604081205461016180549394509092849081106141bd576141bd614d43565b906000526020600020015490508061016183815481106141df576141df614d43565b6000918252602080832090910192909255828152610162909152604080822084905585825281205561016180548061421957614219614ff9565b6001900381819060005260206000200160009055905550505050565b600061424083611ae9565b6001600160a01b03909316600090815261015f6020908152604080832086845282528083208590559382526101609052919091209190915550565b82805461428790614b12565b90600052602060002090601f0160209004810192826142a957600085556142ef565b82601f106142c257805160ff19168380011785556142ef565b828001600101855582156142ef579182015b828111156142ef5782518255916020019190600101906142d4565b506124d292915061435f565b8280548282559060005260206000209081019282156142ef579160200282015b828111156142ef57825182906001600160401b031690559160200191906001019061431b565b60405180608001604052806004906020820280368337509192915050565b5b808211156124d25760008155600101614360565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156143b2576143b2614374565b604052919050565b600082601f8301126143cb57600080fd5b81356001600160401b038111156143e4576143e4614374565b6143f7601f8201601f191660200161438a565b81815284602083860101111561440c57600080fd5b816020850160208301376000918101602001919091529392505050565b80356001600160a01b038116811461444057600080fd5b919050565b6000806000806000806000806000806101408b8d03121561446557600080fd5b8a356001600160401b0381111561447b57600080fd5b6144878d828e016143ba565b9a505061449660208c01614429565b98506144a460408c01614429565b975060608b0135965060808b013595506144c060a08c01614429565b94506144ce60c08c01614429565b935060e08b013592506101008b013591506144ec6101208c01614429565b90509295989b9194979a5092959850565b6001600160e01b03198116811461188d57600080fd5b60006020828403121561452557600080fd5b813561205b816144fd565b60005b8381101561454b578181015183820152602001614533565b838111156122325750506000910152565b60008151808452614574816020860160208601614530565b601f01601f19169290920160200192915050565b60208152600061205b602083018461455c565b6000602082840312156145ad57600080fd5b5035919050565b600080604083850312156145c757600080fd5b6145d083614429565b946020939093013593505050565b600080604083850312156145f157600080fd5b82356001600160401b038082111561460857600080fd5b614614868387016143ba565b9350602085013591508082111561462a57600080fd5b50614637858286016143ba565b9150509250929050565b803560ff8116811461444057600080fd5b6000806000806080858703121561466857600080fd5b61467185614641565b935061467f60208601614641565b925060408501356001600160401b038082111561469b57600080fd5b6146a7888389016143ba565b935060608701359150808211156146bd57600080fd5b506146ca878288016143ba565b91505092959194509250565b6000806000606084860312156146eb57600080fd5b6146f484614429565b925061470260208501614429565b9150604084013590509250925092565b60006001600160401b0382111561472b5761472b614374565b5060051b60200190565b803563ffffffff8116811461444057600080fd5b6000602080838503121561475c57600080fd5b82356001600160401b0381111561477257600080fd5b8301601f8101851361478357600080fd5b803561479661479182614712565b61438a565b81815260059190911b820183019083810190878311156147b557600080fd5b928401925b828410156147da576147cb84614735565b825292840192908401906147ba565b979650505050505050565b600080604083850312156147f857600080fd5b8235915061480860208401614429565b90509250929050565b60006020828403121561482357600080fd5b61205b82614641565b60006020828403121561483e57600080fd5b61205b82614429565b6020808252825182820181905260009190848201906040850190845b8181101561487f57835183529284019291840191600101614863565b50909695505050505050565b60006020828403121561489d57600080fd5b81356001600160401b038111156148b357600080fd5b612bd7848285016143ba565b60808101818360005b60048110156148ea57815160ff168352602092830192909101906001016148c8565b50505092915050565b60006020828403121561490557600080fd5b61205b82614735565b6000602080838503121561492157600080fd5b82356001600160401b0381111561493757600080fd5b8301601f8101851361494857600080fd5b803561495661479182614712565b81815260059190911b8201830190838101908783111561497557600080fd5b928401925b828410156147da5761498b84614429565b8252928401929084019061497a565b600080604083850312156149ad57600080fd5b50508035926020909101359150565b801515811461188d57600080fd5b600080604083850312156149dd57600080fd5b6149e683614429565b915060208301356149f6816149bc565b809150509250929050565b60008060008060808587031215614a1757600080fd5b614a2085614429565b9350614a2e60208601614429565b92506040850135915060608501356001600160401b03811115614a5057600080fd5b6146ca878288016143ba565b60008060408385031215614a6f57600080fd5b614a7883614429565b915061480860208401614429565b6020808252825182820181905260009190848201906040850190845b8181101561487f57835163ffffffff1683529284019291840191600101614aa2565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600181811c90821680614b2657607f821691505b602082108114156123b357634e487b7160e01b600052602260045260246000fd5b60208082526015908201527450726f70657274794e46543a204f6e6c7920454f4160581b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526023908201527f50726f70657274794e46543a2050726573616c65204d696e74206e6f74206f70604082015262656e2160e81b606082015260800190565b60008251614bf5818460208701614530565b9190910192915050565b6020808252601e908201527f50726f70657274794e46543a20496e73756666696369656e7420455448210000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115614c5f57614c5f614c36565b500190565b60208082526024908201527f50726f70657274794e46543a204d6178696d756d20537570706c7920526561636040820152636865642160e01b606082015260800190565b60208082526033908201527f50726f70657274794e46543a20556e61626c6520746f20666f7277617264206d60408201527265737361676520746f2074726561737572792160681b606082015260800190565b600060ff821660ff84168060ff03821115614d1857614d18614c36565b019392505050565b600060ff821660ff841680821015614d3a57614d3a614c36565b90039392505050565b634e487b7160e01b600052603260045260246000fd5b6000816000190483118215151615614d7357614d73614c36565b500290565b600060ff821660ff811415614d8f57614d8f614c36565b60010192915050565b6000600019821415614dac57614dac614c36565b5060010190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082821015614e1657614e16614c36565b500390565b60008351614e2d818460208801614530565b835190830190614e41818360208801614530565b01949350505050565b600060208284031215614e5c57600080fd5b5051919050565b6bffffffffffffffffffffffff198560601b16815260008451614e8d816014850160208901614530565b909101601481019390935250603482015260540192915050565b634e487b7160e01b600052601260045260246000fd5b600082614ecc57614ecc614ea7565b500690565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614f09816017850160208801614530565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614f3a816028840160208801614530565b01602801949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082614fa757614fa7614ea7565b500490565b60018060a01b0384168152826020820152606060408201526000614fd3606083018461455c565b95945050505050565b600060208284031215614fee57600080fd5b815161205b816149bc565b634e487b7160e01b600052603160045260246000fd5b60008161501e5761501e614c36565b506000190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906150599083018461455c565b9695505050505050565b60006020828403121561507557600080fd5b815161205b816144fd565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220392ebcedaeefbfaf920af7bfd93f5b7de1cfa386d2a5b04ccf6222a428d2598264736f6c63430008090033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.