ERC-721
Overview
Max Total Supply
586 VOU
Holders
84
Total Transfers
-
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
Voucher
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; // ityvusnkqpoooggoopppqkncuvyrl // tvsohdmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmaepsvt // lfoammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbkvj // xgmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmhnz // yhmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmwsl // ipmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmqj // ibmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmn // ommmmmmmmmmmmmmmmmmabokcfnmmdyjjljjttramwcnpgwmmmmmmmmmmmmmmmmmmmmmht // xmmmmmmmmmmmmmmbkfri rmaz hdz ummbammmmmmmmmmmmmmmmdz // emmmmmmmmmmdqyi zbj wy fmwi tuwmmmmmmmmmmmmmmdr // immmmmmmmmmmr j iz kdt kmmmmmmmmmmmmmmmwi // rmmmmmmmmmmmn iyukogggpqnuyj gy smmgsmmmmmmmmmmmmn // tmmmmmmmmmmmms jvqhmmmmmmmmmmmmmmapvi y nmdj rammmmmmmmmmdi // dmmmmmmmmmmmmk znhmmmmmdcrtttrzxukbmmmmdsi qmy rmmmmmmmmmmmy // nmmmmmmmmmmmmmhuvqammmmmmmmr lqmmmmhl gv kmmmmmmmmmms // ihmmmmmmmmmmmmmmmmmmmmmmmmg fmmmmme y xmmmmmmmmmmk // lhmmmmmmmmmmmmmmmmmmmmmmmecufuuxl wmmmmmmt xmmmmmmmmmmn // iqmmmmmmmmmmmmmmmmmmmmmmmmwqfl ummmmmmmz kmmmmmmmmmmf // jwmmmmmmmmmmmmmmmmmmmmmovj iammmmmmmi iammmmmmmmmmj // hmmmmmmmmmmmmmmmmmmmmmw smmmmmmmp qmmmmmmmmmmg // ummmmmmmmmmmmmmmmmmmmmmc ldmmmmmmhi cmmmmmmmmmmmz // hmmmmmmmmmmmmgbmmmmmmmmqnqczi kmmmmmmol nmmmmmmmmmmmq // lmmmmmmmmmmmmy juemmmmmeul jmmmmmgy jgmmmmmmmmmmmbi // zmmmmmmmmmmmk iycnl qmhpfl icdmmmmmmmmmmmwl // ymmmmmmmmmmmx j iuwmmmmmmmmmmmmwj // zmmmmmmmmmmmc zqdmmmmmmmmmmmmmbl // immmmmmmmmmmar lxqammmmmmmmmmmmmmmq // gmmmmmmmmmmmmgsyj jycqhmmmmmmmmmmmmmmmmmax // zmmmmmmmmmmmmmmmmmwc nqqogbammmmmmmmmmmmmmmmmmmmmmql // nmmmmmmmmmmmmmmmmmt vmmmmmmmmmmmmmmmmmmmmmmmmmmmot // kmmmmmmmmmmmmmmmmdwhhgczi emmmmmmmmmmmmmmmmmmmmmmmmmpt // yemmmmmmmmmmmmmmwpfj rmmmmmmmmmmmmmmmmmmmmmmmbcl // iammmmmmmmmmmgl qmmmmmmmmmmmmmmmmmmmdguj // cmmmmmmmmmmmmr lammmmmmmmmmmbegqsvt // bmmmmmmmmmmmmgkcz ymmmmmmmmmmmd // mmmmmmmmmmmmdgct gmmmmmmmmmmme // immmmmmmmmmmd zmmmmmmmmmmmms // ammmmmmmmmmmwpuzi emmmmmmmmmmmmt // qmmmmmmmmmmmmmmmmwgnfrl fmmmmmmmmmmmmg // lammmmmmmmmmmmmmmmmmmmmddmmmmmmmmmmmmmt // rdmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmc // jemmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmk // xbmmmmmmmmmmmmmmmmmmmmmmmmmmmmmc // rnhmmmmmmmmmmmmmmmmmmmmmmmmgt // lxngwmmmmmmmmmmmmmmmmwkr // jzxfcnkqppqkcxj import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import "operator-filter-registry/src/UpdatableOperatorFilterer.sol"; import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS, CANONICAL_CORI_SUBSCRIPTION} from "operator-filter-registry/src/lib/Constants.sol"; import "./interfaces/IPet.sol"; contract Voucher is ERC721URIStorage, ERC721Burnable, AccessControl, Ownable, ERC2981, UpdatableOperatorFilterer { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant REDEEMER_ROLE = keccak256("REDEEMER_ROLE"); string public baseURI; uint256 public totalSupply; struct VoucherToken { address to; // The recipient of the voucher uint256 tokenId; // The token ID of the voucher uint256 price; // The price, in wei, of one voucher uint256 expiry; // The time after which the attestation is no longer valid, where zero indicates no expiry } mapping(bytes32 => bool) public vouchersUsed; address public pet; /// @notice Emitted when the new base URI is set /// @param who Admin that set the base URI event BaseURISet(address indexed who); /// @notice Emitted when the new Pet address is set /// @param pet Address of a new Pet contract /// @param who Admin that set the Pet event PetSet(address indexed pet, address indexed who); /// @notice Emitted when setRoyaltyInfo is called /// @param royaltyReceiver Account to receive sale royalties /// @param royaltyNumerator Fraction relative to ROYALTY_DENOMINATOR event RoyaltyInfoSet(address royaltyReceiver, uint256 royaltyNumerator); /// @notice Emitted when withdraw /// @param to Account who receive the amount /// @param amount Amount of witdhrawal /// @param who Admin that withdraw event Withdraw(address indexed to, uint256 amount, address indexed who); constructor(string memory _uri, address _pet) ERC721("Voucher", "VOU") UpdatableOperatorFilterer( CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS, CANONICAL_CORI_SUBSCRIPTION, true ) { require(_pet != address(0), "cannot set pet to zero address"); _grantRole(DEFAULT_ADMIN_ROLE, _msgSender()); _grantRole(MINTER_ROLE, _msgSender()); _grantRole(REDEEMER_ROLE, _msgSender()); baseURI = _uri; pet = _pet; emit BaseURISet(_msgSender()); emit PetSet(_pet, _msgSender()); } function _baseURI() internal view override returns (string memory) { return baseURI; } /// @notice Sets a base URI /// @param _uri Base URI function setBaseURI(string calldata _uri) external onlyRole(DEFAULT_ADMIN_ROLE) { baseURI = _uri; emit BaseURISet(_msgSender()); } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); } /// @notice Sets a Pet contract address /// @param _pet Pet contract address function setPet(address _pet) public onlyRole(DEFAULT_ADMIN_ROLE) { require(_pet != address(0), "cannot set pet to zero address"); require(_pet != pet, "pet should be different from the current"); pet = _pet; emit PetSet(_pet, _msgSender()); } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override { super._beforeTokenTransfer(_from, _to, _tokenId); if (_from == address(0)) { totalSupply++; } if (_to == address(0)) { totalSupply--; } } /// @notice Returns the hash of a voucher /// @param _voucher The voucher contains to, tokenId, price, expiry /// @return The hash of the voucher function hashVoucher(VoucherToken calldata _voucher) public view returns (bytes32) { return keccak256(abi.encode(block.chainid, _voucher)); } /// @notice Mint (purchase) a new voucher /// @param _voucher The voucher contains to, tokenId, price, expiry /// @param _signature The signed by an address with the Minter role /// @param _signer The signer of the signature function mintTo( VoucherToken calldata _voucher, bytes calldata _signature, address _signer ) external payable { bytes32 voucherHashed = hashVoucher(_voucher); bool signatureValid = SignatureChecker.isValidSignatureNow( _signer, ECDSA.toEthSignedMessageHash(voucherHashed), _signature ); require(hasRole(MINTER_ROLE, _signer), "invalid signer"); require(signatureValid, "invalid signature"); require(msg.value == _voucher.price, "payment mismatch"); require(_voucher.expiry > block.timestamp, "voucher has been expired"); require(!vouchersUsed[voucherHashed], "voucher has been already used"); require(IERC721(pet).balanceOf(pet) > totalSupply, "insufficient pet supply"); vouchersUsed[voucherHashed] = true; require(_voucher.to != address(0), "cannot mint to zero address"); _safeMint(_voucher.to, _voucher.tokenId); } /// @notice Redeem a voucher /// @param _voucherTokenId The voucher token ID to be redeemed /// @param _petTokenId The pet token ID function redeemVoucher(uint256 _voucherTokenId, uint256 _petTokenId) external onlyRole(REDEEMER_ROLE) { address owner = ownerOf(_voucherTokenId); _burn(_voucherTokenId); // Pet is a pre-minted token IERC721(pet).transferFrom(address(pet), owner, _petTokenId); } function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { super._burn(tokenId); } function _withdraw(address _to, uint256 _amount) internal onlyRole(DEFAULT_ADMIN_ROLE) { require(_to != address(0), "cannot withdraw to zero address"); uint256 balance = address(this).balance; require(balance > 0, "no balance"); require(balance >= _amount, "insufficient balance"); // This forwards all available gas. Be sure to check the return value! (bool success, ) = _to.call{value: _amount}(""); require(success, "withdraw failed"); emit Withdraw(_to, _amount, _msgSender()); } /// @notice Withdraw amount of native coins to a specific account /// @param _to Recipient address /// @param _amount Native coins amount function withdraw(address _to, uint256 _amount) external onlyRole(DEFAULT_ADMIN_ROLE) { _withdraw(_to, _amount); } /// @notice Withdraw all amount of native coints to a specific account /// @param _to Recipient address function withdrawAll(address _to) external onlyRole(DEFAULT_ADMIN_ROLE) { _withdraw(_to, address(this).balance); } // ERC2981 Secondary sale royalties // =========================================================================== /// @notice Set the royalty info for all tokens /// @param _royaltyReceiver Account to receive sale royalties /// @param _royaltyNumerator Fraction relative to ROYALTY_DENOMINATOR (which is <= 10000) function setRoyaltyInfo(address _royaltyReceiver, uint96 _royaltyNumerator) external onlyRole(DEFAULT_ADMIN_ROLE) { _setDefaultRoyalty(_royaltyReceiver, _royaltyNumerator); emit RoyaltyInfoSet(_royaltyReceiver, _royaltyNumerator); } // UpdatableOperatorFilterer // =========================================================================== // The following function overrides are specific to OpenSea's UpdatableOperatorFilterer function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } function owner() public view virtual override(Ownable, UpdatableOperatorFilterer) returns (address) { return Ownable.owner(); } // Required by Solidity. // =========================================================================== function supportsInterface(bytes4 interfaceId) public view override(ERC2981, ERC721, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorage is ERC721 { using Strings for uint256; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev See {ERC721-_burn}. This override additionally checks to see if a * token-specific URI was set for the token, and if so, it deletes the token URI from * the storage mapping. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721Burnable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../utils/Context.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _burn(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.1) (utils/cryptography/SignatureChecker.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; import "../Address.sol"; import "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like * Argent and Gnosis Safe. * * _Available since v4.1._ */ library SignatureChecker { /** * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidSignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature); if (error == ECDSA.RecoverError.NoError && recovered == signer) { return true; } (bool success, bytes memory result) = signer.staticcall( abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature) ); return (success && result.length == 32 && abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; /** * @title UpdatableOperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. This contract allows the Owner to update the * OperatorFilterRegistry address via updateOperatorFilterRegistryAddress, including to the zero address, * which will bypass registry checks. * Note that OpenSea will still disable creator earnings enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract UpdatableOperatorFilterer { /// @dev Emitted when an operator is not allowed. error OperatorNotAllowed(address operator); /// @dev Emitted when someone other than the owner is trying to call an only owner function. error OnlyOwner(); event OperatorFilterRegistryAddressUpdated(address newRegistry); IOperatorFilterRegistry public operatorFilterRegistry; /// @dev The constructor that is called when the contract is being deployed. constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) { IOperatorFilterRegistry registry = IOperatorFilterRegistry(_registry); operatorFilterRegistry = registry; // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(registry).code.length > 0) { if (subscribe) { registry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { registry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { registry.register(address(this)); } } } } /** * @dev A helper function to check if the operator is allowed. */ modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } /** * @dev A helper function to check if the operator approval is allowed. */ modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be bypassed. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public virtual { if (msg.sender != owner()) { revert OnlyOwner(); } operatorFilterRegistry = IOperatorFilterRegistry(newRegistry); emit OperatorFilterRegistryAddressUpdated(newRegistry); } /** * @dev Assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract. */ function owner() public view virtual returns (address); /** * @dev A helper function to check if the operator is allowed. */ function _checkFilterOperator(address operator) internal view virtual { IOperatorFilterRegistry registry = operatorFilterRegistry; // Check registry code length to facilitate testing in environments without a deployed registry. if (address(registry) != address(0) && address(registry).code.length > 0) { // under normal circumstances, this function will revert rather than return false, but inheriting contracts // may specify their own OperatorFilterRegistry implementations, which may behave differently if (!registry.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E; address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IPet { /// @notice Emitted when the new base URI is set /// @param who Admin that set the base URI event BaseURISet(address indexed who); /// @notice Emitted when the token ID is set to clone flag /// @param tokenId Token ID /// @param clone Clone flag /// @param who Admin that set the clone flag event CloneSet(uint256 tokenId, bool clone, address indexed who); /// @notice Emitted when the account is set to custodial status /// @param account Account to be set /// @param status Custodial status /// @param who Admin that set the clone flag event CustodialSet(address account, bool status, address indexed who); /// @notice Emitted when setRoyaltyInfo is called /// @param royaltyReceiver Account to receive sale royalties /// @param royaltyNumerator Fraction relative to ROYALTY_DENOMINATOR event RoyaltyInfoSet(address royaltyReceiver, uint256 royaltyNumerator); /// @notice Emitted when a new Immutable X is set /// @param who Admin that set the Immutable X /// @param imx New Immutable X address event IMXSet(address indexed who, address indexed imx); /// @notice Sets a base URI /// @param _uri Base URI function setBaseURI(string calldata _uri) external; /// @notice Set clone flag for a specific token /// @param _tokenId Token ID /// @param _clone Clone status function setClone(uint256 _tokenId, bool _clone) external; /// @notice Check if the token is cloned /// @param _tokenId Token ID /// @return clone_ Cloned falg function isClone(uint256 _tokenId) external view returns (bool); /// @notice Set a custodial /// @param _account Custodial account /// @param _status Account status function setCustodial(address _account, bool _status) external; /// @notice Check if the account is cusotodial /// @param _account Account to be checked /// @return status_ Account status function isCustodial(address _account) external view returns (bool); /// @notice Mints a signle pet to a specific address /// @param _to Receiver address /// @param _tokenId Token ID /// @param _custodial Custodial flag /// @param _clone Clone flag function mintTo( address _to, uint256 _tokenId, bool _custodial, bool _clone ) external; /// @notice Mints multiple pets to a list of addresses /// @param _tos List of receiver addresses /// @param _tokenIds Token IDs /// @param _custodial Custodial flag /// @param _clone Clone flag function multiMintTo( address[] memory _tos, uint256[] memory _tokenIds, bool _custodial, bool _clone ) external; /// @notice Mints a single pet to this contract /// @param _tokenId Token ID function mintToContract(uint256 _tokenId) external; /// @notice Mints multiple pets to this contract /// @param _tokenIds Token IDs function multiMintToContract(uint256[] memory _tokenIds) external; /// @notice Transfers multiple pets at once /// @param _froms Token owners /// @param _tos Token receivers /// @param _tokenIds Token IDs function bulkTransferFrom( address[] memory _froms, address[] memory _tos, uint256[] memory _tokenIds ) external; /// @notice Transfers multiple pets from custodials at once /// @param _froms Token owners /// @param _tos Token receivers /// @param _tokenIds Token IDs /// @param _custodials Token IDs function bulkTransferFromCustodials( address[] memory _froms, address[] memory _tos, uint256[] memory _tokenIds, bool[] memory _custodials ) external; /// @notice Set the royalty info for all tokens /// @param _royaltyReceiver Account to receive sale royalties /// @param _royaltyNumerator Fraction relative to ROYALTY_DENOMINATOR (which is <= 10000) function setRoyaltyInfo(address _royaltyReceiver, uint96 _royaltyNumerator) external; /// @notice Sets the Immutable X address /// @param _imx New Immutable X function setIMX(address _imx) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); 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: invalid token ID"); 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) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token 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: caller is not token 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) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // 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); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { 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. /// @solidity memory-safe-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 { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. * * _Available since v4.1._ */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { /** * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns * true if supplied registrant address is not registered. */ function isOperatorAllowed(address registrant, address operator) external view returns (bool); /** * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner. */ function register(address registrant) external; /** * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes. */ function registerAndSubscribe(address registrant, address subscription) external; /** * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another * address without subscribing. */ function registerAndCopyEntries(address registrant, address registrantToCopy) external; /** * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. * Note that this does not remove any filtered addresses or codeHashes. * Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes. */ function unregister(address addr) external; /** * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered. */ function updateOperator(address registrant, address operator, bool filtered) external; /** * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates. */ function updateOperators(address registrant, address[] calldata operators, bool filtered) external; /** * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered. */ function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; /** * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates. */ function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; /** * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous * subscription if present. * Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, * subscriptions will not be forwarded. Instead the former subscription's existing entries will still be * used. */ function subscribe(address registrant, address registrantToSubscribe) external; /** * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes. */ function unsubscribe(address registrant, bool copyExistingEntries) external; /** * @notice Get the subscription address of a given registrant, if any. */ function subscriptionOf(address addr) external returns (address registrant); /** * @notice Get the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscribers(address registrant) external returns (address[] memory); /** * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscriberAt(address registrant, uint256 index) external returns (address); /** * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr. */ function copyEntriesOf(address registrant, address registrantToCopy) external; /** * @notice Returns true if operator is filtered by a given address or its subscription. */ function isOperatorFiltered(address registrant, address operator) external returns (bool); /** * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription. */ function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); /** * @notice Returns true if a codeHash is filtered by a given address or its subscription. */ function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); /** * @notice Returns a list of filtered operators for a given address or its subscription. */ function filteredOperators(address addr) external returns (address[] memory); /** * @notice Returns the set of filtered codeHashes for a given address or its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashes(address addr) external returns (bytes32[] memory); /** * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredOperatorAt(address registrant, uint256 index) external returns (address); /** * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); /** * @notice Returns true if an address has registered */ function isRegistered(address addr) external returns (bool); /** * @dev Convenience method to compute the code hash of an arbitrary contract */ function codeHashOf(address addr) external returns (bytes32); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_uri","type":"string"},{"internalType":"address","name":"_pet","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"who","type":"address"}],"name":"BaseURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRegistry","type":"address"}],"name":"OperatorFilterRegistryAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pet","type":"address"},{"indexed":true,"internalType":"address","name":"who","type":"address"}],"name":"PetSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"royaltyReceiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"royaltyNumerator","type":"uint256"}],"name":"RoyaltyInfoSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"who","type":"address"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REDEEMER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","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":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"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":"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":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"internalType":"struct Voucher.VoucherToken","name":"_voucher","type":"tuple"}],"name":"hashVoucher","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"internalType":"struct Voucher.VoucherToken","name":"_voucher","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"address","name":"_signer","type":"address"}],"name":"mintTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorFilterRegistry","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_voucherTokenId","type":"uint256"},{"internalType":"uint256","name":"_petTokenId","type":"uint256"}],"name":"redeemVoucher","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":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pet","type":"address"}],"name":"setPet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyReceiver","type":"address"},{"internalType":"uint96","name":"_royaltyNumerator","type":"uint96"}],"name":"setRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRegistry","type":"address"}],"name":"updateOperatorFilterRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"vouchersUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162003efd38038062003efd8339810160408190526200003491620004a4565b6daaeb6d7670e522a718067333cd4e733cc6cdda760b79bafa08df41ecfa224f810dceb66001604051806040016040528060078152602001662b37bab1b432b960c91b81525060405180604001604052806003815260200162564f5560e81b8152508160009081620000a791906200061b565b506001620000b682826200061b565b505050620000d3620000cd6200037660201b60201c565b6200037a565b600b80546001600160a01b0319166001600160a01b03851690811790915583903b156200020c5781156200016b57604051633e9f1edf60e11b81523060048201526001600160a01b038481166024830152821690637d3e3dbe906044015b600060405180830381600087803b1580156200014c57600080fd5b505af115801562000161573d6000803e3d6000fd5b505050506200020c565b6001600160a01b03831615620001b05760405163a0af290360e01b81523060048201526001600160a01b03848116602483015282169063a0af29039060440162000131565b604051632210724360e11b81523060048201526001600160a01b03821690634420e48690602401600060405180830381600087803b158015620001f257600080fd5b505af115801562000207573d6000803e3d6000fd5b505050505b5050506001600160a01b03821690506200026c5760405162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74207365742070657420746f207a65726f20616464726573730000604482015260640160405180910390fd5b62000279600033620003cc565b620002a57f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633620003cc565b620002d17f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc33620003cc565b600c620002df83826200061b565b50600f80546001600160a01b0319166001600160a01b038316179055620003033390565b6001600160a01b03167fa2b2bd6c0f211eadf80d98a27dc090d2e2f25fafbf2f2a2c9dfc255134c6b17260405160405180910390a260405133906001600160a01b038316907f5fa1d367db1be72bee0b865157da9ef8559f1052270cff5be9967626f2063b5990600090a35050620006e7565b3390565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008281526007602090815260408083206001600160a01b038516845290915290205460ff166200046d5760008281526007602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200042c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200049f57600080fd5b919050565b60008060408385031215620004b857600080fd5b82516001600160401b0380821115620004d057600080fd5b818501915085601f830112620004e557600080fd5b815181811115620004fa57620004fa62000471565b604051601f8201601f19908116603f0116810190838211818310171562000525576200052562000471565b816040528281526020935088848487010111156200054257600080fd5b600091505b8282101562000566578482018401518183018501529083019062000547565b60008484830101528096505050506200058181860162000487565b925050509250929050565b600181811c90821680620005a157607f821691505b602082108103620005c257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200061657600081815260208120601f850160051c81016020861015620005f15750805b601f850160051c820191505b818110156200061257828155600101620005fd565b5050505b505050565b81516001600160401b0381111562000637576200063762000471565b6200064f816200064884546200058c565b84620005c8565b602080601f8311600181146200068757600084156200066e5750858301515b600019600386901b1c1916600185901b17855562000612565b600085815260208120601f198616915b82811015620006b85788860151825594840194600190910190840162000697565b5085821015620006d75787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61380680620006f76000396000f3fe6080604052600436106102bb5760003560e01c80637fa46ab41161016e578063b8d1e532116100cb578063e9b7d7dd1161007f578063f3fef3a311610064578063f3fef3a314610814578063fa09e63014610834578063fa70d0b01461085457600080fd5b8063e9b7d7dd146107d4578063f2fde38b146107f457600080fd5b8063d5391393116100b0578063d539139314610737578063d547741f1461076b578063e985e9c51461078b57600080fd5b8063b8d1e532146106f7578063c87b56dd1461071757600080fd5b8063a217fddf11610122578063af3a885b11610107578063af3a885b14610687578063b0ccc31e146106b7578063b88d4fde146106d757600080fd5b8063a217fddf14610652578063a22cb4651461066757600080fd5b806391d148541161015357806391d14854146105d757806395d89b411461061d5780639a9d0d681461063257600080fd5b80637fa46ab41461058e5780638da5cb5b146105c257600080fd5b80632f2ff15d1161021c57806355f804b3116101d05780636c0360eb116101b55780636c0360eb1461054457806370a0823114610559578063715018a61461057957600080fd5b806355f804b3146105045780636352211e1461052457600080fd5b806342842e0e1161020157806342842e0e146104a457806342966c68146104c4578063554394e1146104e457600080fd5b80632f2ff15d1461046457806336568abe1461048457600080fd5b806318160ddd11610273578063248a9ca311610258578063248a9ca3146103d557806325551067146104055780632a55205a1461042557600080fd5b806318160ddd1461039157806323b872dd146103b557600080fd5b806306fdde03116102a457806306fdde0314610317578063081812fc14610339578063095ea7b31461037157600080fd5b806301ffc9a7146102c057806302fa7c47146102f5575b600080fd5b3480156102cc57600080fd5b506102e06102db366004612fb2565b610867565b60405190151581526020015b60405180910390f35b34801561030157600080fd5b50610315610310366004612feb565b610878565b005b34801561032357600080fd5b5061032c6108e1565b6040516102ec9190613083565b34801561034557600080fd5b50610359610354366004613096565b610973565b6040516001600160a01b0390911681526020016102ec565b34801561037d57600080fd5b5061031561038c3660046130af565b61099a565b34801561039d57600080fd5b506103a7600d5481565b6040519081526020016102ec565b3480156103c157600080fd5b506103156103d03660046130d9565b6109b3565b3480156103e157600080fd5b506103a76103f0366004613096565b60009081526007602052604090206001015490565b34801561041157600080fd5b50610315610420366004613115565b6109de565b34801561043157600080fd5b50610445610440366004613115565b610aa9565b604080516001600160a01b0390931683526020830191909152016102ec565b34801561047057600080fd5b5061031561047f366004613137565b610b66565b34801561049057600080fd5b5061031561049f366004613137565b610b8b565b3480156104b057600080fd5b506103156104bf3660046130d9565b610c1c565b3480156104d057600080fd5b506103156104df366004613096565b610c41565b3480156104f057600080fd5b506103a76104ff36600461317b565b610cbb565b34801561051057600080fd5b5061031561051f3660046131d9565b610ced565b34801561053057600080fd5b5061035961053f366004613096565b610d36565b34801561055057600080fd5b5061032c610d9b565b34801561056557600080fd5b506103a761057436600461321b565b610e29565b34801561058557600080fd5b50610315610ec3565b34801561059a57600080fd5b506103a77f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc81565b3480156105ce57600080fd5b50610359610ed7565b3480156105e357600080fd5b506102e06105f2366004613137565b60009182526007602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561062957600080fd5b5061032c610ef0565b34801561063e57600080fd5b5061031561064d36600461321b565b610eff565b34801561065e57600080fd5b506103a7600081565b34801561067357600080fd5b50610315610682366004613244565b611032565b34801561069357600080fd5b506102e06106a2366004613096565b600e6020526000908152604090205460ff1681565b3480156106c357600080fd5b50600b54610359906001600160a01b031681565b3480156106e357600080fd5b506103156106f2366004613286565b611046565b34801561070357600080fd5b5061031561071236600461321b565b611073565b34801561072357600080fd5b5061032c610732366004613096565b611119565b34801561074357600080fd5b506103a77f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b34801561077757600080fd5b50610315610786366004613137565b611124565b34801561079757600080fd5b506102e06107a6366004613362565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156107e057600080fd5b50600f54610359906001600160a01b031681565b34801561080057600080fd5b5061031561080f36600461321b565b611149565b34801561082057600080fd5b5061031561082f3660046130af565b6111d6565b34801561084057600080fd5b5061031561084f36600461321b565b6111eb565b61031561086236600461338c565b611200565b6000610872826115a9565b92915050565b6000610883816115e7565b61088d83836115f1565b604080516001600160a01b03851681526bffffffffffffffffffffffff841660208201527f984cbbb47b413608120ad6b444ea0004fe19b6f88a5c0992e612b97fd3cb631e910160405180910390a1505050565b6060600080546108f0906133f2565b80601f016020809104026020016040519081016040528092919081815260200182805461091c906133f2565b80156109695780601f1061093e57610100808354040283529160200191610969565b820191906000526020600020905b81548152906001019060200180831161094c57829003601f168201915b5050505050905090565b600061097e8261170b565b506000908152600460205260409020546001600160a01b031690565b816109a48161176f565b6109ae8383611863565b505050565b826001600160a01b03811633146109cd576109cd3361176f565b6109d884848461198f565b50505050565b7f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc610a08816115e7565b6000610a1384610d36565b9050610a1e84611a06565b600f546040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482018190529183166024820152604481018590526323b872dd90606401600060405180830381600087803b158015610a8b57600080fd5b505af1158015610a9f573d6000803e3d6000fd5b5050505050505050565b6000828152600a602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff16928201929092528291610b285750604080518082019091526009546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090610b4c906bffffffffffffffffffffffff168761343c565b610b569190613469565b91519350909150505b9250929050565b600082815260076020526040902060010154610b81816115e7565b6109ae8383611a0f565b6001600160a01b0381163314610c0e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610c188282611ab1565b5050565b826001600160a01b0381163314610c3657610c363361176f565b6109d8848484611b34565b610c4c335b82611b4f565b610caf5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c05565b610cb881611a06565b50565b60004682604051602001610cd092919061347d565b604051602081830303815290604052805190602001209050919050565b6000610cf8816115e7565b600c610d05838583613506565b5060405133907fa2b2bd6c0f211eadf80d98a27dc090d2e2f25fafbf2f2a2c9dfc255134c6b17290600090a2505050565b6000818152600260205260408120546001600160a01b0316806108725760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c05565b600c8054610da8906133f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dd4906133f2565b8015610e215780601f10610df657610100808354040283529160200191610e21565b820191906000526020600020905b815481529060010190602001808311610e0457829003601f168201915b505050505081565b60006001600160a01b038216610ea75760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610c05565b506001600160a01b031660009081526003602052604090205490565b610ecb611bce565b610ed56000611c2d565b565b6000610eeb6008546001600160a01b031690565b905090565b6060600180546108f0906133f2565b6000610f0a816115e7565b6001600160a01b038216610f605760405162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74207365742070657420746f207a65726f206164647265737300006044820152606401610c05565b600f546001600160a01b0390811690831603610fe45760405162461bcd60e51b815260206004820152602860248201527f7065742073686f756c6420626520646966666572656e742066726f6d2074686560448201527f2063757272656e740000000000000000000000000000000000000000000000006064820152608401610c05565b600f80546001600160a01b0319166001600160a01b0384169081179091556040513391907f5fa1d367db1be72bee0b865157da9ef8559f1052270cff5be9967626f2063b5990600090a35050565b8161103c8161176f565b6109ae8383611c7f565b836001600160a01b0381163314611060576110603361176f565b61106c85858585611c8a565b5050505050565b61107b610ed7565b6001600160a01b0316336001600160a01b0316146110c5576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600b80546001600160a01b0319166001600160a01b0383169081179091556040519081527f9f513fe86dc42fdbac355fa4d9b1d5be7b5e6cd2df67e30db8003766568de4769060200160405180910390a150565b606061087282611d03565b60008281526007602052604090206001015461113f816115e7565b6109ae8383611ab1565b611151611bce565b6001600160a01b0381166111cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c05565b610cb881611c2d565b60006111e1816115e7565b6109ae8383611dfe565b60006111f6816115e7565b610c188247611dfe565b600061120b85610cbb565b905060006112588361121c84611fe7565b87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061202292505050565b6001600160a01b03841660009081527fa4bfd7afe708e2e87e7f0e2ad9b4d545417e0f795f57b5c5ab5d799c565a04f4602052604090205490915060ff166112e25760405162461bcd60e51b815260206004820152600e60248201527f696e76616c6964207369676e65720000000000000000000000000000000000006044820152606401610c05565b8061132f5760405162461bcd60e51b815260206004820152601160248201527f696e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610c05565b856040013534146113825760405162461bcd60e51b815260206004820152601060248201527f7061796d656e74206d69736d61746368000000000000000000000000000000006044820152606401610c05565b428660600135116113d55760405162461bcd60e51b815260206004820152601860248201527f766f756368657220686173206265656e206578706972656400000000000000006044820152606401610c05565b6000828152600e602052604090205460ff16156114345760405162461bcd60e51b815260206004820152601d60248201527f766f756368657220686173206265656e20616c726561647920757365640000006044820152606401610c05565b600d54600f546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201819052906370a0823190602401602060405180830381865afa158015611499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bd91906135c6565b1161150a5760405162461bcd60e51b815260206004820152601760248201527f696e73756666696369656e742070657420737570706c790000000000000000006044820152606401610c05565b6000828152600e602090815260408220805460ff191660011790556115319088018861321b565b6001600160a01b0316036115875760405162461bcd60e51b815260206004820152601b60248201527f63616e6e6f74206d696e7420746f207a65726f206164647265737300000000006044820152606401610c05565b6115a1611597602088018861321b565b8760200135612194565b505050505050565b60006001600160e01b031982167f2a55205a0000000000000000000000000000000000000000000000000000000014806108725750610872826121ae565b610cb881336121ec565b6127106bffffffffffffffffffffffff821611156116775760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610c05565b6001600160a01b0382166116cd5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610c05565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600955565b6000818152600260205260409020546001600160a01b0316610cb85760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c05565b600b546001600160a01b0316801580159061179457506000816001600160a01b03163b115b15610c18576040517fc61711340000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03838116602483015282169063c617113490604401602060405180830381865afa1580156117fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182291906135df565b610c18576040517fede71dcc0000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610c05565b600061186e82610d36565b9050806001600160a01b0316836001600160a01b0316036118f75760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610c05565b336001600160a01b0382161480611913575061191381336107a6565b6119855760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610c05565b6109ae838361226c565b61199833610c46565b6119fb5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c05565b6109ae8383836122da565b610cb8816124b2565b60008281526007602090815260408083206001600160a01b038516845290915290205460ff16610c185760008281526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611a6d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526007602090815260408083206001600160a01b038516845290915290205460ff1615610c185760008281526007602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6109ae83838360405180602001604052806000815250611046565b600080611b5b83610d36565b9050806001600160a01b0316846001600160a01b03161480611ba257506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80611bc65750836001600160a01b0316611bbb84610973565b6001600160a01b0316145b949350505050565b33611bd7610ed7565b6001600160a01b031614610ed55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c05565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610c183383836124f2565b611c943383611b4f565b611cf75760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c05565b6109d8848484846125c0565b6060611d0e8261170b565b60008281526006602052604081208054611d27906133f2565b80601f0160208091040260200160405190810160405280929190818152602001828054611d53906133f2565b8015611da05780601f10611d7557610100808354040283529160200191611da0565b820191906000526020600020905b815481529060010190602001808311611d8357829003601f168201915b505050505090506000611db161263e565b90508051600003611dc3575092915050565b815115611df5578082604051602001611ddd9291906135fc565b60405160208183030381529060405292505050919050565b611bc68461264d565b6000611e09816115e7565b6001600160a01b038316611e5f5760405162461bcd60e51b815260206004820152601f60248201527f63616e6e6f7420776974686472617720746f207a65726f2061646472657373006044820152606401610c05565b4780611ead5760405162461bcd60e51b815260206004820152600a60248201527f6e6f2062616c616e6365000000000000000000000000000000000000000000006044820152606401610c05565b82811015611efd5760405162461bcd60e51b815260206004820152601460248201527f696e73756666696369656e742062616c616e63650000000000000000000000006044820152606401610c05565b6000846001600160a01b03168460405160006040518083038185875af1925050503d8060008114611f4a576040519150601f19603f3d011682016040523d82523d6000602084013e611f4f565b606091505b5050905080611fa05760405162461bcd60e51b815260206004820152600f60248201527f7769746864726177206661696c656400000000000000000000000000000000006044820152606401610c05565b60405184815233906001600160a01b038716907f56c54ba9bd38d8fd62012e42c7ee564519b09763c426d331b3661b537ead19b29060200160405180910390a35050505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01610cd0565b600080600061203185856126b3565b9092509050600081600481111561204a5761204a61362b565b1480156120685750856001600160a01b0316826001600160a01b0316145b156120785760019250505061218d565b600080876001600160a01b0316631626ba7e60e01b88886040516024016120a0929190613641565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199094169390931790925290516120f3919061365a565b600060405180830381855afa9150503d806000811461212e576040519150601f19603f3d011682016040523d82523d6000602084013e612133565b606091505b5091509150818015612146575080516020145b8015612186575080517f1626ba7e000000000000000000000000000000000000000000000000000000009061218490830160209081019084016135c6565b145b9450505050505b9392505050565b610c188282604051806020016040528060008152506126f5565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610872575061087282612773565b60008281526007602090815260408083206001600160a01b038516845290915290205460ff16610c185761222a816001600160a01b0316601461280e565b61223583602061280e565b604051602001612246929190613676565b60408051601f198184030181529082905262461bcd60e51b8252610c0591600401613083565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122a182610d36565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b826001600160a01b03166122ed82610d36565b6001600160a01b0316146123695760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610c05565b6001600160a01b0382166123e45760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610c05565b6123ef8383836129d3565b6123fa60008261226c565b6001600160a01b03831660009081526003602052604081208054600192906124239084906136f7565b90915550506001600160a01b038216600090815260036020526040812080546001929061245190849061370a565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6124bb81612a1f565b600081815260066020526040902080546124d4906133f2565b159050610cb8576000818152600660205260408120610cb891612f4e565b816001600160a01b0316836001600160a01b0316036125535760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c05565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6125cb8484846122da565b6125d784848484612ac6565b6109d85760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610c05565b6060600c80546108f0906133f2565b60606126588261170b565b600061266261263e565b90506000815111612682576040518060200160405280600081525061218d565b8061268c84612c12565b60405160200161269d9291906135fc565b6040516020818303038152906040529392505050565b60008082516041036126e95760208301516040840151606085015160001a6126dd87828585612d13565b94509450505050610b5f565b50600090506002610b5f565b6126ff8383612e00565b61270c6000848484612ac6565b6109ae5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610c05565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806127d657506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061087257507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610872565b6060600061281d83600261343c565b61282890600261370a565b67ffffffffffffffff81111561284057612840613270565b6040519080825280601f01601f19166020018201604052801561286a576020820181803683370190505b509050600360fc1b816000815181106128855761288561371d565b60200101906001600160f81b031916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106128d0576128d061371d565b60200101906001600160f81b031916908160001a90535060006128f484600261343c565b6128ff90600161370a565b90505b6001811115612984577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106129405761294061371d565b1a60f81b8282815181106129565761295661371d565b60200101906001600160f81b031916908160001a90535060049490941c9361297d81613733565b9050612902565b50831561218d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c05565b6001600160a01b0383166129f757600d80549060006129f18361374a565b91905055505b6001600160a01b0382166109ae57600d8054906000612a1583613733565b9190505550505050565b6000612a2a82610d36565b9050612a38816000846129d3565b612a4360008361226c565b6001600160a01b0381166000908152600360205260408120805460019290612a6c9084906136f7565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b15612c0757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612b0a903390899088908890600401613763565b6020604051808303816000875af1925050508015612b45575060408051601f3d908101601f19168201909252612b429181019061379f565b60015b612bed573d808015612b73576040519150601f19603f3d011682016040523d82523d6000602084013e612b78565b606091505b508051600003612be55760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610c05565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611bc6565b506001949350505050565b606081600003612c395750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612c635780612c4d8161374a565b9150612c5c9050600a83613469565b9150612c3d565b60008167ffffffffffffffff811115612c7e57612c7e613270565b6040519080825280601f01601f191660200182016040528015612ca8576020820181803683370190505b5090505b8415611bc657612cbd6001836136f7565b9150612cca600a866137bc565b612cd590603061370a565b60f81b818381518110612cea57612cea61371d565b60200101906001600160f81b031916908160001a905350612d0c600a86613469565b9450612cac565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612d4a5750600090506003612df7565b8460ff16601b14158015612d6257508460ff16601c14155b15612d735750600090506004612df7565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612dc7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612df057600060019250925050612df7565b9150600090505b94509492505050565b6001600160a01b038216612e565760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c05565b6000818152600260205260409020546001600160a01b031615612ebb5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c05565b612ec7600083836129d3565b6001600160a01b0382166000908152600360205260408120805460019290612ef090849061370a565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b508054612f5a906133f2565b6000825580601f10612f6a575050565b601f016020900490600052602060002090810190610cb891905b80821115612f985760008155600101612f84565b5090565b6001600160e01b031981168114610cb857600080fd5b600060208284031215612fc457600080fd5b813561218d81612f9c565b80356001600160a01b0381168114612fe657600080fd5b919050565b60008060408385031215612ffe57600080fd5b61300783612fcf565b915060208301356bffffffffffffffffffffffff8116811461302857600080fd5b809150509250929050565b60005b8381101561304e578181015183820152602001613036565b50506000910152565b6000815180845261306f816020860160208601613033565b601f01601f19169290920160200192915050565b60208152600061218d6020830184613057565b6000602082840312156130a857600080fd5b5035919050565b600080604083850312156130c257600080fd5b6130cb83612fcf565b946020939093013593505050565b6000806000606084860312156130ee57600080fd5b6130f784612fcf565b925061310560208501612fcf565b9150604084013590509250925092565b6000806040838503121561312857600080fd5b50508035926020909101359150565b6000806040838503121561314a57600080fd5b8235915061315a60208401612fcf565b90509250929050565b60006080828403121561317557600080fd5b50919050565b60006080828403121561318d57600080fd5b61218d8383613163565b60008083601f8401126131a957600080fd5b50813567ffffffffffffffff8111156131c157600080fd5b602083019150836020828501011115610b5f57600080fd5b600080602083850312156131ec57600080fd5b823567ffffffffffffffff81111561320357600080fd5b61320f85828601613197565b90969095509350505050565b60006020828403121561322d57600080fd5b61218d82612fcf565b8015158114610cb857600080fd5b6000806040838503121561325757600080fd5b61326083612fcf565b9150602083013561302881613236565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561329c57600080fd5b6132a585612fcf565b93506132b360208601612fcf565b925060408501359150606085013567ffffffffffffffff808211156132d757600080fd5b818701915087601f8301126132eb57600080fd5b8135818111156132fd576132fd613270565b604051601f8201601f19908116603f0116810190838211818310171561332557613325613270565b816040528281528a602084870101111561333e57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561337557600080fd5b61337e83612fcf565b915061315a60208401612fcf565b60008060008060c085870312156133a257600080fd5b6133ac8686613163565b9350608085013567ffffffffffffffff8111156133c857600080fd5b6133d487828801613197565b90945092506133e7905060a08601612fcf565b905092959194509250565b600181811c9082168061340657607f821691505b60208210810361317557634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761087257610872613426565b634e487b7160e01b600052601260045260246000fd5b60008261347857613478613453565b500490565b82815260a081016001600160a01b0361349584612fcf565b1660208301526020830135604083015260408301356060830152606083013560808301529392505050565b601f8211156109ae57600081815260208120601f850160051c810160208610156134e75750805b601f850160051c820191505b818110156115a1578281556001016134f3565b67ffffffffffffffff83111561351e5761351e613270565b6135328361352c83546133f2565b836134c0565b6000601f841160018114613566576000851561354e5750838201355b600019600387901b1c1916600186901b17835561106c565b600083815260209020601f19861690835b828110156135975786850135825560209485019460019092019101613577565b50868210156135b45760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000602082840312156135d857600080fd5b5051919050565b6000602082840312156135f157600080fd5b815161218d81613236565b6000835161360e818460208801613033565b835190830190613622818360208801613033565b01949350505050565b634e487b7160e01b600052602160045260246000fd5b828152604060208201526000611bc66040830184613057565b6000825161366c818460208701613033565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516136ae816017850160208801613033565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516136eb816028840160208801613033565b01602801949350505050565b8181038181111561087257610872613426565b8082018082111561087257610872613426565b634e487b7160e01b600052603260045260246000fd5b60008161374257613742613426565b506000190190565b60006001820161375c5761375c613426565b5060010190565b60006001600160a01b038087168352808616602084015250836040830152608060608301526137956080830184613057565b9695505050505050565b6000602082840312156137b157600080fd5b815161218d81612f9c565b6000826137cb576137cb613453565b50069056fea264697066735822122072da1677f7cd41ac4f585cc52afe26764e4660109748c744d8170af5817b401164736f6c6343000813003300000000000000000000000000000000000000000000000000000000000000400000000000000000000000006f1ee0b02bcb1e57d4f1f5b9ed3ae4c142424e65000000000000000000000000000000000000000000000000000000000000002768747470733a2f2f73746f726167652e7065746176657273652e636f6d2f766f7563686572732f00000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106102bb5760003560e01c80637fa46ab41161016e578063b8d1e532116100cb578063e9b7d7dd1161007f578063f3fef3a311610064578063f3fef3a314610814578063fa09e63014610834578063fa70d0b01461085457600080fd5b8063e9b7d7dd146107d4578063f2fde38b146107f457600080fd5b8063d5391393116100b0578063d539139314610737578063d547741f1461076b578063e985e9c51461078b57600080fd5b8063b8d1e532146106f7578063c87b56dd1461071757600080fd5b8063a217fddf11610122578063af3a885b11610107578063af3a885b14610687578063b0ccc31e146106b7578063b88d4fde146106d757600080fd5b8063a217fddf14610652578063a22cb4651461066757600080fd5b806391d148541161015357806391d14854146105d757806395d89b411461061d5780639a9d0d681461063257600080fd5b80637fa46ab41461058e5780638da5cb5b146105c257600080fd5b80632f2ff15d1161021c57806355f804b3116101d05780636c0360eb116101b55780636c0360eb1461054457806370a0823114610559578063715018a61461057957600080fd5b806355f804b3146105045780636352211e1461052457600080fd5b806342842e0e1161020157806342842e0e146104a457806342966c68146104c4578063554394e1146104e457600080fd5b80632f2ff15d1461046457806336568abe1461048457600080fd5b806318160ddd11610273578063248a9ca311610258578063248a9ca3146103d557806325551067146104055780632a55205a1461042557600080fd5b806318160ddd1461039157806323b872dd146103b557600080fd5b806306fdde03116102a457806306fdde0314610317578063081812fc14610339578063095ea7b31461037157600080fd5b806301ffc9a7146102c057806302fa7c47146102f5575b600080fd5b3480156102cc57600080fd5b506102e06102db366004612fb2565b610867565b60405190151581526020015b60405180910390f35b34801561030157600080fd5b50610315610310366004612feb565b610878565b005b34801561032357600080fd5b5061032c6108e1565b6040516102ec9190613083565b34801561034557600080fd5b50610359610354366004613096565b610973565b6040516001600160a01b0390911681526020016102ec565b34801561037d57600080fd5b5061031561038c3660046130af565b61099a565b34801561039d57600080fd5b506103a7600d5481565b6040519081526020016102ec565b3480156103c157600080fd5b506103156103d03660046130d9565b6109b3565b3480156103e157600080fd5b506103a76103f0366004613096565b60009081526007602052604090206001015490565b34801561041157600080fd5b50610315610420366004613115565b6109de565b34801561043157600080fd5b50610445610440366004613115565b610aa9565b604080516001600160a01b0390931683526020830191909152016102ec565b34801561047057600080fd5b5061031561047f366004613137565b610b66565b34801561049057600080fd5b5061031561049f366004613137565b610b8b565b3480156104b057600080fd5b506103156104bf3660046130d9565b610c1c565b3480156104d057600080fd5b506103156104df366004613096565b610c41565b3480156104f057600080fd5b506103a76104ff36600461317b565b610cbb565b34801561051057600080fd5b5061031561051f3660046131d9565b610ced565b34801561053057600080fd5b5061035961053f366004613096565b610d36565b34801561055057600080fd5b5061032c610d9b565b34801561056557600080fd5b506103a761057436600461321b565b610e29565b34801561058557600080fd5b50610315610ec3565b34801561059a57600080fd5b506103a77f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc81565b3480156105ce57600080fd5b50610359610ed7565b3480156105e357600080fd5b506102e06105f2366004613137565b60009182526007602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561062957600080fd5b5061032c610ef0565b34801561063e57600080fd5b5061031561064d36600461321b565b610eff565b34801561065e57600080fd5b506103a7600081565b34801561067357600080fd5b50610315610682366004613244565b611032565b34801561069357600080fd5b506102e06106a2366004613096565b600e6020526000908152604090205460ff1681565b3480156106c357600080fd5b50600b54610359906001600160a01b031681565b3480156106e357600080fd5b506103156106f2366004613286565b611046565b34801561070357600080fd5b5061031561071236600461321b565b611073565b34801561072357600080fd5b5061032c610732366004613096565b611119565b34801561074357600080fd5b506103a77f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b34801561077757600080fd5b50610315610786366004613137565b611124565b34801561079757600080fd5b506102e06107a6366004613362565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156107e057600080fd5b50600f54610359906001600160a01b031681565b34801561080057600080fd5b5061031561080f36600461321b565b611149565b34801561082057600080fd5b5061031561082f3660046130af565b6111d6565b34801561084057600080fd5b5061031561084f36600461321b565b6111eb565b61031561086236600461338c565b611200565b6000610872826115a9565b92915050565b6000610883816115e7565b61088d83836115f1565b604080516001600160a01b03851681526bffffffffffffffffffffffff841660208201527f984cbbb47b413608120ad6b444ea0004fe19b6f88a5c0992e612b97fd3cb631e910160405180910390a1505050565b6060600080546108f0906133f2565b80601f016020809104026020016040519081016040528092919081815260200182805461091c906133f2565b80156109695780601f1061093e57610100808354040283529160200191610969565b820191906000526020600020905b81548152906001019060200180831161094c57829003601f168201915b5050505050905090565b600061097e8261170b565b506000908152600460205260409020546001600160a01b031690565b816109a48161176f565b6109ae8383611863565b505050565b826001600160a01b03811633146109cd576109cd3361176f565b6109d884848461198f565b50505050565b7f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc610a08816115e7565b6000610a1384610d36565b9050610a1e84611a06565b600f546040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482018190529183166024820152604481018590526323b872dd90606401600060405180830381600087803b158015610a8b57600080fd5b505af1158015610a9f573d6000803e3d6000fd5b5050505050505050565b6000828152600a602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff16928201929092528291610b285750604080518082019091526009546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090610b4c906bffffffffffffffffffffffff168761343c565b610b569190613469565b91519350909150505b9250929050565b600082815260076020526040902060010154610b81816115e7565b6109ae8383611a0f565b6001600160a01b0381163314610c0e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610c188282611ab1565b5050565b826001600160a01b0381163314610c3657610c363361176f565b6109d8848484611b34565b610c4c335b82611b4f565b610caf5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c05565b610cb881611a06565b50565b60004682604051602001610cd092919061347d565b604051602081830303815290604052805190602001209050919050565b6000610cf8816115e7565b600c610d05838583613506565b5060405133907fa2b2bd6c0f211eadf80d98a27dc090d2e2f25fafbf2f2a2c9dfc255134c6b17290600090a2505050565b6000818152600260205260408120546001600160a01b0316806108725760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c05565b600c8054610da8906133f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dd4906133f2565b8015610e215780601f10610df657610100808354040283529160200191610e21565b820191906000526020600020905b815481529060010190602001808311610e0457829003601f168201915b505050505081565b60006001600160a01b038216610ea75760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610c05565b506001600160a01b031660009081526003602052604090205490565b610ecb611bce565b610ed56000611c2d565b565b6000610eeb6008546001600160a01b031690565b905090565b6060600180546108f0906133f2565b6000610f0a816115e7565b6001600160a01b038216610f605760405162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74207365742070657420746f207a65726f206164647265737300006044820152606401610c05565b600f546001600160a01b0390811690831603610fe45760405162461bcd60e51b815260206004820152602860248201527f7065742073686f756c6420626520646966666572656e742066726f6d2074686560448201527f2063757272656e740000000000000000000000000000000000000000000000006064820152608401610c05565b600f80546001600160a01b0319166001600160a01b0384169081179091556040513391907f5fa1d367db1be72bee0b865157da9ef8559f1052270cff5be9967626f2063b5990600090a35050565b8161103c8161176f565b6109ae8383611c7f565b836001600160a01b0381163314611060576110603361176f565b61106c85858585611c8a565b5050505050565b61107b610ed7565b6001600160a01b0316336001600160a01b0316146110c5576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600b80546001600160a01b0319166001600160a01b0383169081179091556040519081527f9f513fe86dc42fdbac355fa4d9b1d5be7b5e6cd2df67e30db8003766568de4769060200160405180910390a150565b606061087282611d03565b60008281526007602052604090206001015461113f816115e7565b6109ae8383611ab1565b611151611bce565b6001600160a01b0381166111cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c05565b610cb881611c2d565b60006111e1816115e7565b6109ae8383611dfe565b60006111f6816115e7565b610c188247611dfe565b600061120b85610cbb565b905060006112588361121c84611fe7565b87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061202292505050565b6001600160a01b03841660009081527fa4bfd7afe708e2e87e7f0e2ad9b4d545417e0f795f57b5c5ab5d799c565a04f4602052604090205490915060ff166112e25760405162461bcd60e51b815260206004820152600e60248201527f696e76616c6964207369676e65720000000000000000000000000000000000006044820152606401610c05565b8061132f5760405162461bcd60e51b815260206004820152601160248201527f696e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610c05565b856040013534146113825760405162461bcd60e51b815260206004820152601060248201527f7061796d656e74206d69736d61746368000000000000000000000000000000006044820152606401610c05565b428660600135116113d55760405162461bcd60e51b815260206004820152601860248201527f766f756368657220686173206265656e206578706972656400000000000000006044820152606401610c05565b6000828152600e602052604090205460ff16156114345760405162461bcd60e51b815260206004820152601d60248201527f766f756368657220686173206265656e20616c726561647920757365640000006044820152606401610c05565b600d54600f546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201819052906370a0823190602401602060405180830381865afa158015611499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bd91906135c6565b1161150a5760405162461bcd60e51b815260206004820152601760248201527f696e73756666696369656e742070657420737570706c790000000000000000006044820152606401610c05565b6000828152600e602090815260408220805460ff191660011790556115319088018861321b565b6001600160a01b0316036115875760405162461bcd60e51b815260206004820152601b60248201527f63616e6e6f74206d696e7420746f207a65726f206164647265737300000000006044820152606401610c05565b6115a1611597602088018861321b565b8760200135612194565b505050505050565b60006001600160e01b031982167f2a55205a0000000000000000000000000000000000000000000000000000000014806108725750610872826121ae565b610cb881336121ec565b6127106bffffffffffffffffffffffff821611156116775760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610c05565b6001600160a01b0382166116cd5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610c05565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600955565b6000818152600260205260409020546001600160a01b0316610cb85760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c05565b600b546001600160a01b0316801580159061179457506000816001600160a01b03163b115b15610c18576040517fc61711340000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03838116602483015282169063c617113490604401602060405180830381865afa1580156117fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182291906135df565b610c18576040517fede71dcc0000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610c05565b600061186e82610d36565b9050806001600160a01b0316836001600160a01b0316036118f75760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610c05565b336001600160a01b0382161480611913575061191381336107a6565b6119855760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610c05565b6109ae838361226c565b61199833610c46565b6119fb5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c05565b6109ae8383836122da565b610cb8816124b2565b60008281526007602090815260408083206001600160a01b038516845290915290205460ff16610c185760008281526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611a6d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526007602090815260408083206001600160a01b038516845290915290205460ff1615610c185760008281526007602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6109ae83838360405180602001604052806000815250611046565b600080611b5b83610d36565b9050806001600160a01b0316846001600160a01b03161480611ba257506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80611bc65750836001600160a01b0316611bbb84610973565b6001600160a01b0316145b949350505050565b33611bd7610ed7565b6001600160a01b031614610ed55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c05565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610c183383836124f2565b611c943383611b4f565b611cf75760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c05565b6109d8848484846125c0565b6060611d0e8261170b565b60008281526006602052604081208054611d27906133f2565b80601f0160208091040260200160405190810160405280929190818152602001828054611d53906133f2565b8015611da05780601f10611d7557610100808354040283529160200191611da0565b820191906000526020600020905b815481529060010190602001808311611d8357829003601f168201915b505050505090506000611db161263e565b90508051600003611dc3575092915050565b815115611df5578082604051602001611ddd9291906135fc565b60405160208183030381529060405292505050919050565b611bc68461264d565b6000611e09816115e7565b6001600160a01b038316611e5f5760405162461bcd60e51b815260206004820152601f60248201527f63616e6e6f7420776974686472617720746f207a65726f2061646472657373006044820152606401610c05565b4780611ead5760405162461bcd60e51b815260206004820152600a60248201527f6e6f2062616c616e6365000000000000000000000000000000000000000000006044820152606401610c05565b82811015611efd5760405162461bcd60e51b815260206004820152601460248201527f696e73756666696369656e742062616c616e63650000000000000000000000006044820152606401610c05565b6000846001600160a01b03168460405160006040518083038185875af1925050503d8060008114611f4a576040519150601f19603f3d011682016040523d82523d6000602084013e611f4f565b606091505b5050905080611fa05760405162461bcd60e51b815260206004820152600f60248201527f7769746864726177206661696c656400000000000000000000000000000000006044820152606401610c05565b60405184815233906001600160a01b038716907f56c54ba9bd38d8fd62012e42c7ee564519b09763c426d331b3661b537ead19b29060200160405180910390a35050505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01610cd0565b600080600061203185856126b3565b9092509050600081600481111561204a5761204a61362b565b1480156120685750856001600160a01b0316826001600160a01b0316145b156120785760019250505061218d565b600080876001600160a01b0316631626ba7e60e01b88886040516024016120a0929190613641565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199094169390931790925290516120f3919061365a565b600060405180830381855afa9150503d806000811461212e576040519150601f19603f3d011682016040523d82523d6000602084013e612133565b606091505b5091509150818015612146575080516020145b8015612186575080517f1626ba7e000000000000000000000000000000000000000000000000000000009061218490830160209081019084016135c6565b145b9450505050505b9392505050565b610c188282604051806020016040528060008152506126f5565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610872575061087282612773565b60008281526007602090815260408083206001600160a01b038516845290915290205460ff16610c185761222a816001600160a01b0316601461280e565b61223583602061280e565b604051602001612246929190613676565b60408051601f198184030181529082905262461bcd60e51b8252610c0591600401613083565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122a182610d36565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b826001600160a01b03166122ed82610d36565b6001600160a01b0316146123695760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610c05565b6001600160a01b0382166123e45760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610c05565b6123ef8383836129d3565b6123fa60008261226c565b6001600160a01b03831660009081526003602052604081208054600192906124239084906136f7565b90915550506001600160a01b038216600090815260036020526040812080546001929061245190849061370a565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6124bb81612a1f565b600081815260066020526040902080546124d4906133f2565b159050610cb8576000818152600660205260408120610cb891612f4e565b816001600160a01b0316836001600160a01b0316036125535760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c05565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6125cb8484846122da565b6125d784848484612ac6565b6109d85760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610c05565b6060600c80546108f0906133f2565b60606126588261170b565b600061266261263e565b90506000815111612682576040518060200160405280600081525061218d565b8061268c84612c12565b60405160200161269d9291906135fc565b6040516020818303038152906040529392505050565b60008082516041036126e95760208301516040840151606085015160001a6126dd87828585612d13565b94509450505050610b5f565b50600090506002610b5f565b6126ff8383612e00565b61270c6000848484612ac6565b6109ae5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610c05565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806127d657506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061087257507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610872565b6060600061281d83600261343c565b61282890600261370a565b67ffffffffffffffff81111561284057612840613270565b6040519080825280601f01601f19166020018201604052801561286a576020820181803683370190505b509050600360fc1b816000815181106128855761288561371d565b60200101906001600160f81b031916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106128d0576128d061371d565b60200101906001600160f81b031916908160001a90535060006128f484600261343c565b6128ff90600161370a565b90505b6001811115612984577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106129405761294061371d565b1a60f81b8282815181106129565761295661371d565b60200101906001600160f81b031916908160001a90535060049490941c9361297d81613733565b9050612902565b50831561218d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c05565b6001600160a01b0383166129f757600d80549060006129f18361374a565b91905055505b6001600160a01b0382166109ae57600d8054906000612a1583613733565b9190505550505050565b6000612a2a82610d36565b9050612a38816000846129d3565b612a4360008361226c565b6001600160a01b0381166000908152600360205260408120805460019290612a6c9084906136f7565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b15612c0757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612b0a903390899088908890600401613763565b6020604051808303816000875af1925050508015612b45575060408051601f3d908101601f19168201909252612b429181019061379f565b60015b612bed573d808015612b73576040519150601f19603f3d011682016040523d82523d6000602084013e612b78565b606091505b508051600003612be55760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610c05565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611bc6565b506001949350505050565b606081600003612c395750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612c635780612c4d8161374a565b9150612c5c9050600a83613469565b9150612c3d565b60008167ffffffffffffffff811115612c7e57612c7e613270565b6040519080825280601f01601f191660200182016040528015612ca8576020820181803683370190505b5090505b8415611bc657612cbd6001836136f7565b9150612cca600a866137bc565b612cd590603061370a565b60f81b818381518110612cea57612cea61371d565b60200101906001600160f81b031916908160001a905350612d0c600a86613469565b9450612cac565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612d4a5750600090506003612df7565b8460ff16601b14158015612d6257508460ff16601c14155b15612d735750600090506004612df7565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612dc7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612df057600060019250925050612df7565b9150600090505b94509492505050565b6001600160a01b038216612e565760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c05565b6000818152600260205260409020546001600160a01b031615612ebb5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c05565b612ec7600083836129d3565b6001600160a01b0382166000908152600360205260408120805460019290612ef090849061370a565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b508054612f5a906133f2565b6000825580601f10612f6a575050565b601f016020900490600052602060002090810190610cb891905b80821115612f985760008155600101612f84565b5090565b6001600160e01b031981168114610cb857600080fd5b600060208284031215612fc457600080fd5b813561218d81612f9c565b80356001600160a01b0381168114612fe657600080fd5b919050565b60008060408385031215612ffe57600080fd5b61300783612fcf565b915060208301356bffffffffffffffffffffffff8116811461302857600080fd5b809150509250929050565b60005b8381101561304e578181015183820152602001613036565b50506000910152565b6000815180845261306f816020860160208601613033565b601f01601f19169290920160200192915050565b60208152600061218d6020830184613057565b6000602082840312156130a857600080fd5b5035919050565b600080604083850312156130c257600080fd5b6130cb83612fcf565b946020939093013593505050565b6000806000606084860312156130ee57600080fd5b6130f784612fcf565b925061310560208501612fcf565b9150604084013590509250925092565b6000806040838503121561312857600080fd5b50508035926020909101359150565b6000806040838503121561314a57600080fd5b8235915061315a60208401612fcf565b90509250929050565b60006080828403121561317557600080fd5b50919050565b60006080828403121561318d57600080fd5b61218d8383613163565b60008083601f8401126131a957600080fd5b50813567ffffffffffffffff8111156131c157600080fd5b602083019150836020828501011115610b5f57600080fd5b600080602083850312156131ec57600080fd5b823567ffffffffffffffff81111561320357600080fd5b61320f85828601613197565b90969095509350505050565b60006020828403121561322d57600080fd5b61218d82612fcf565b8015158114610cb857600080fd5b6000806040838503121561325757600080fd5b61326083612fcf565b9150602083013561302881613236565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561329c57600080fd5b6132a585612fcf565b93506132b360208601612fcf565b925060408501359150606085013567ffffffffffffffff808211156132d757600080fd5b818701915087601f8301126132eb57600080fd5b8135818111156132fd576132fd613270565b604051601f8201601f19908116603f0116810190838211818310171561332557613325613270565b816040528281528a602084870101111561333e57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561337557600080fd5b61337e83612fcf565b915061315a60208401612fcf565b60008060008060c085870312156133a257600080fd5b6133ac8686613163565b9350608085013567ffffffffffffffff8111156133c857600080fd5b6133d487828801613197565b90945092506133e7905060a08601612fcf565b905092959194509250565b600181811c9082168061340657607f821691505b60208210810361317557634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761087257610872613426565b634e487b7160e01b600052601260045260246000fd5b60008261347857613478613453565b500490565b82815260a081016001600160a01b0361349584612fcf565b1660208301526020830135604083015260408301356060830152606083013560808301529392505050565b601f8211156109ae57600081815260208120601f850160051c810160208610156134e75750805b601f850160051c820191505b818110156115a1578281556001016134f3565b67ffffffffffffffff83111561351e5761351e613270565b6135328361352c83546133f2565b836134c0565b6000601f841160018114613566576000851561354e5750838201355b600019600387901b1c1916600186901b17835561106c565b600083815260209020601f19861690835b828110156135975786850135825560209485019460019092019101613577565b50868210156135b45760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000602082840312156135d857600080fd5b5051919050565b6000602082840312156135f157600080fd5b815161218d81613236565b6000835161360e818460208801613033565b835190830190613622818360208801613033565b01949350505050565b634e487b7160e01b600052602160045260246000fd5b828152604060208201526000611bc66040830184613057565b6000825161366c818460208701613033565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516136ae816017850160208801613033565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516136eb816028840160208801613033565b01602801949350505050565b8181038181111561087257610872613426565b8082018082111561087257610872613426565b634e487b7160e01b600052603260045260246000fd5b60008161374257613742613426565b506000190190565b60006001820161375c5761375c613426565b5060010190565b60006001600160a01b038087168352808616602084015250836040830152608060608301526137956080830184613057565b9695505050505050565b6000602082840312156137b157600080fd5b815161218d81612f9c565b6000826137cb576137cb613453565b50069056fea264697066735822122072da1677f7cd41ac4f585cc52afe26764e4660109748c744d8170af5817b401164736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000400000000000000000000000006f1ee0b02bcb1e57d4f1f5b9ed3ae4c142424e65000000000000000000000000000000000000000000000000000000000000002768747470733a2f2f73746f726167652e7065746176657273652e636f6d2f766f7563686572732f00000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _uri (string): https://storage.petaverse.com/vouchers/
Arg [1] : _pet (address): 0x6F1EE0B02BCB1E57d4f1F5b9eD3AE4C142424e65
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000006f1ee0b02bcb1e57d4f1f5b9ed3ae4c142424e65
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000027
Arg [3] : 68747470733a2f2f73746f726167652e7065746176657273652e636f6d2f766f
Arg [4] : 7563686572732f00000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.