Polygon Sponsored slots available. Book your slot here!
Overview
TokenID
53
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xdD67E2ae...5fF2a1151 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
ERC1155Ikasumi
Compiler Version
v0.8.4+commit.c7e474f2
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @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 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)); } } /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } } /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @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 Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } /** * @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; } } /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } /** * @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; } /** * @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); } /** * @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; } } /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; } /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector). @param operator The address which initiated the transfer (i.e. msg.sender) @param from The address which previously owned the token @param id The ID of the token being transferred @param value The amount of tokens being transferred @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector). @param operator The address which initiated the batch transfer (i.e. msg.sender) @param from The address which previously owned the token @param ids An array containing ids of each token being transferred (order and length must match values array) @param values An array containing amounts of each token being transferred (order and length must match ids array) @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); } /** * @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, _msgSender()); _; } /** * @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 override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", 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 override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } } /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); } /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev 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 Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(_msgSender() != operator, "ERC1155: setting approval status for self"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `account`. * * Emits a {TransferSingle} event. * * Requirements: * * - `account` cannot be the zero address. * - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _balances[id][account] += amount; emit TransferSingle(operator, address(0), account, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } } /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. */ abstract contract ERC1155Supply is ERC1155 { mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates weither any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return ERC1155Supply.totalSupply(id) > 0; } /** * @dev See {ERC1155-_mint}. */ function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal virtual override { super._mint(account, id, amount, data); _totalSupply[id] += amount; } /** * @dev See {ERC1155-_mintBatch}. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._mintBatch(to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } } /** * @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() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } /** * @dev {ERC1155} token, including: * * - a minter role that allows for token minting (creation) * * This contract uses {AccessControl} to lock permissioned functions using the * different roles - head to its documentation for details. * * The account that deploys the contract will be granted the minter role, as well * as the default admin role, which will let it grant minter role to other accounts. */ contract ERC1155_Yuzu is Ownable, AccessControl, ERC1155Supply { // Token name string private _name; // Token symbol string private _symbol; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 internal _tokenIdCounter; /** * Special setting to give special minting permissions * whoCanMint = 0: only minter can mint * whoCanMint = 1: only original creator of the Item can mint, multiple times * whoCanMint = 2: anyone can arbitrarily mint */ uint8 public whoCanMint; // nft item creators list, used to pay royalties mapping(uint256 => address) public creators; /** * @dev Grants `DEFAULT_ADMIN_ROLE`, and `MINTER_ROLE` to the account that * deploys the contract. And initializes the contract by setting a `name` * and a `symbol` to the token collection. */ constructor(address owner, string memory uri, string memory name_, string memory symbol_, uint8 whoCanMint_) Ownable() ERC1155(uri) { _setupRole(DEFAULT_ADMIN_ROLE, owner); _setupRole(MINTER_ROLE, owner); transferOwnership(owner); _name = name_; _symbol = symbol_; whoCanMint = whoCanMint_; } /** * @dev See {IERC721Metadata-name}. */ function name() external view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() external view virtual returns (string memory) { return _symbol; } /** * @dev Find next available tokenId */ function findNextTokenId() internal { do { _tokenIdCounter++; } while(exists(_tokenIdCounter)); } /// Overrides minting function to keep track of item creators function _mint(address to, uint256 tokenId, uint256 amount, bytes memory data) internal virtual override { creators[tokenId] = _msgSender(); super._mint(to, tokenId, amount, data); } function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual override { super._mintBatch(to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { creators[ids[i]] = _msgSender(); } } /** * @dev Creates `amount` new tokens for `to`, using the next available `id`. * * - the caller must have the `MINTER_ROLE`. */ function autoMint(address to, uint256 amount) public onlyMinter returns (uint256) { findNextTokenId(); _mint(to, _tokenIdCounter, amount, "0x"); return _tokenIdCounter; } /** * @dev Creates `amounts` new tokens for `to`, using the next available `ids`. * * - the caller must have the `MINTER_ROLE`. */ function autoMintBatch(address to, uint256[] memory amounts) external onlyMinter { require(to != address(0), "ERC1155: mint to the zero address"); for (uint256 i = 0; i < amounts.length; i++) { autoMint(to, amounts[i]); } } /** * @dev Creates `amount` new tokens for `to`, of token type `id`. * * See {ERC1155-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`. */ function mint( address to, uint256 id, uint256 amount, bytes memory data ) external virtual canMint(id) { _mint(to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] variant of {mint}. */ function mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) external virtual onlyMinter { _mintBatch(to, ids, amounts, data); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControl, ERC1155) returns (bool) { return super.supportsInterface(interfaceId); } function addMinter(address account) external onlyMinter { grantRole(MINTER_ROLE, account); } function isMinter(address account) public view returns (bool) { return hasRole(MINTER_ROLE, account); } /** * Check if a user can mint, and optionally check if an user can mint more of an specific token * Who can mint? * Case 1: a minter can mint * Case 2: a creator can mint more items if he is allowed to * Case 3: arbitrary minting is possible if set (not recommended) * @param _id: NFT token ID (optional) */ function canIMint(uint256 _id) public view returns (bool) { return isMinter(msg.sender) || // a minter can mint (whoCanMint == 1 && _id == 0) || // a creator can mint for the first time any item (whoCanMint == 1 && _id > 0 && creators[_id] == msg.sender) || // a creator can add more items to its own NFT items whoCanMint == 2 // if anyone can mint, allow any mint request ; } /** * Open modifier to anyone can mint possibility */ modifier onlyMinter() { require( canIMint(0), // it allows minters or anyone if anyone can mint is set "ERC1155Yuzu: must have minter role to mint" ); _; } /** * Open modifier to check who can mint, allowing the restriction that only creators can mint their own token */ modifier canMint(uint256 _tokenId) { require( canIMint(_tokenId), // it allows minters or anyone if anyone can mint is set, but also check if only the creator can mint its token "ERC1155Yuzu: must have minter role to mint" ); _; } } /** * * ERC1155 Marketplace Ikasumi v.2 * @title ERC1155Ikasumi * * ERC-1155 Marketplace with tokens and royalties support */ contract ERC1155Marketplace is ERC1155_Yuzu, ReentrancyGuard { using Address for address; using SafeERC20 for IERC20; // admin address, the owner of the marketplace address public admin; // IERC20 token to be used for payments IERC20 public paymentToken; // commission rate is a value from 0 to 100 uint256 public commissionRate; // royalties commission rate is a value from 0 to 100 uint256 public royaltiesCommissionRate; // a sale object struct Sale { uint256 qty; // qty for sale uint256 price; // price address user; // seller address wallet; // seller wallet } // opened sales by tokenIds mapping(uint256 => Sale[]) public openSales; // length of the array mapping(uint256 => uint256) public openSalesLength; // a buy offer object struct Offer { uint256 qty; // qty for buying uint256 price; // buy price address user; // buyer } // opened offers by tokenIds mapping(uint256 => Offer[]) public openOffers; // length of the array mapping(uint256 => uint256) public openOffersLength; event Bid( uint256 indexed tokenId, address indexed from, uint256 qty, uint256 price); event Sell( uint256 indexed tokenId, address indexed to, uint256 qty, uint256 price); event Commission( uint256 indexed tokenId, address indexed from, address indexed to, uint256 value); event Royalty( uint256 indexed tokenId, address indexed from, address indexed to, uint256 value); event Buy( uint256 indexed tokenId, address indexed from, address indexed to, uint256 value); event CancelSale(uint256 indexed tokenId, uint256 index); event CancelBid(uint256 indexed tokenId, uint256 index); constructor( IERC20 _paymentToken, address _owner, address _admin, uint256 _commissionRate, uint256 _royaltiesCommissionRate, string memory name, string memory symbol, uint8 _whoCanMint, string memory uri) ERC1155_Yuzu(_owner, uri, name, symbol, _whoCanMint) { require(_commissionRate + _royaltiesCommissionRate < 100, "Ikasumi: total commissions should be lower than 100"); admin = _admin; commissionRate = _commissionRate; royaltiesCommissionRate = _royaltiesCommissionRate; paymentToken = _paymentToken; } /** * Any user can sell X items at Y price each, valid ownership and qty of the sell will be handled by the UI * All selling options are shown as “Listings” in the UI * Any user can buy W items at Y price, of one listing, they cannot combine two listings in one transaction, given that W>0 and W<=Y * Restrictions: * Limit the sell to owned items, the user cannot sell items do not have */ function sell(uint256 tokenId, uint256 qty, uint256 price, address wallet) external { // Limit the sell to owned items, the user cannot sell items do not have require(balanceOf(_msgSender(), tokenId) >= qty, "Ikasumi: you do not have enough tokens to sell"); // set approval for all items of the user is not set already if (!isApprovedForAll(_msgSender(), address(this))) { setApprovalForAll(address(this), true); } // add the selling option to openSales Sale memory sale = Sale(qty, price, _msgSender(), wallet); // An owner can add only one selling listing for one item at a time, new listings for one item will replace the old ones openSales[tokenId].push(sale); openSalesLength[tokenId] = openSales[tokenId].length; emit Sell(tokenId, _msgSender(), qty, price); } /** * Buy an NTF item, specifying qty to buy and index offer * Funds are transferred from the caller user directly, previous approval required */ function buy(uint256 tokenId, uint256 index, uint256 qty) external nonReentrant { // validate user require(openSales[tokenId][index].user != _msgSender() , "Ikasumi: the user cannot buy his own offer"); // transfer ownership // we need to call a transferFrom from this contract, which is the one with permission to sell the NFT callOptionalReturn(this, abi.encodeWithSelector(this.safeTransferFrom.selector, openSales[tokenId][index].user, _msgSender(), tokenId, qty, "0x")); /** * distribute funds between owner, creator and admin * This function will transfer the funds from the buyer, which must have previously approve the funds to the contract, to the beneficiaries of the sale * The "true" parameter at the end means: do a transferFrom */ distributeFunds(qty * openSales[tokenId][index].price, _msgSender(), openSales[tokenId][index].wallet, tokenId, true); // substract items sold openSales[tokenId][index].qty -= qty; } // cancel the sale function cancelSale(uint256 tokenId, uint256 index) external { // Only the original bidder can cancel his bids require(openSales[tokenId][index].user == _msgSender(), "Ikasumi: only the original seller can cancel his sales"); // remove the sale openSales[tokenId][index].qty = 0; emit CancelSale(tokenId, index); } /** * Any user can make an offer of X items at Y price each * Funds of the offer are stored on the contract * All offers are shown as “Offers” in the UI * Restrictions * A buyer cannot add an offer bigger than the total supply */ function bid(uint256 tokenId, uint256 qty, uint256 price) external nonReentrant { require(qty>0, "Iksasumi: qty has to be positive"); require(price>0, "Iksasumi: price has to be positive"); require(qty <= totalSupply(tokenId), "Iksasumi: not enough items for sale"); // transfer qty * price tokens to the contract uint256 total = qty * price; paymentToken.safeTransferFrom(_msgSender(), address(this), total); // record the offer Offer memory theBid = Offer(qty, price, _msgSender()); openOffers[tokenId].push(theBid); openOffersLength[tokenId] = openOffers[tokenId].length; emit Bid(tokenId, _msgSender(), qty, price); } // cancel the offer and return funds function cancelBid(uint256 tokenId, uint256 index) external nonReentrant { // Only the original bidder can cancel his bids require(openOffers[tokenId][index].user == _msgSender(), "Ikasumi: only the original bidder can cancel his bids"); // save the total uint256 total = openOffers[tokenId][index].qty * openOffers[tokenId][index].price; // remove the bid openOffers[tokenId][index].qty = 0; // return the funds paymentToken.safeTransfer(_msgSender(), total); emit CancelBid(tokenId, index); } // owner accepts the bid and distribute the funds function acceptBid(uint256 tokenId, uint256 index, uint256 qty) external nonReentrant { // validate user require(openOffers[tokenId][index].user != _msgSender() , "Ikasumi: the user cannot accept his own bid"); // set approval for all items of the user is not set already if (!isApprovedForAll(_msgSender(), address(this))) { setApprovalForAll(address(this), true); } // transfer item to bidder // we need to call a transferFrom from this contract, which is the one with permission to sell the NFT callOptionalReturn(this, abi.encodeWithSelector(this.safeTransferFrom.selector, _msgSender(), openOffers[tokenId][index].user, tokenId, qty, "0x")); /** * distribute funds between owner, creator and admin * This function will transfer the funds from the contract, which must have previously sent to the contract, to the beneficiaries of the sale * The "false" parameter at the end means: do a simple transfer */ distributeFunds(qty * openOffers[tokenId][index].price, openOffers[tokenId][index].user, _msgSender(), tokenId, false); // substract items sold openOffers[tokenId][index].qty -= qty; } /** * do the funds distribution between owner, creator and admin * @param totalPrice the total value to distribute * @param from if useTransferFrom is true then the "from" is the origin of the funds, if false, then the "from" is only used for logs purposes * @param to is the owner of the token on sale / bid * @param tokenId is the token being sold * @param useTransferFrom if true the transfer will be made from to, if not, a simple transfer will be done from the contract to the beneficiaries */ function distributeFunds(uint256 totalPrice, address from, address to, uint256 tokenId, bool useTransferFrom) internal { // calculate amounts uint256 amount4admin = totalPrice * commissionRate / 100; uint256 amount4creator = totalPrice * royaltiesCommissionRate / 100; uint256 amount4owner = totalPrice - amount4admin - amount4creator; // to owner if (useTransferFrom) { paymentToken.safeTransferFrom(from, to, amount4owner); } else { paymentToken.safeTransfer(to, amount4owner); } emit Buy(tokenId, from, to, amount4owner); // to creator if (amount4creator>0) { if (useTransferFrom) { paymentToken.safeTransferFrom(from, creators[tokenId], amount4creator); } else { paymentToken.safeTransfer(creators[tokenId], amount4creator); } emit Royalty(tokenId, from, creators[tokenId], amount4creator); } // to admin if (amount4admin>0) { if (useTransferFrom) { paymentToken.safeTransferFrom(from, admin, amount4admin); } else { paymentToken.safeTransfer(admin, amount4admin); } emit Commission(tokenId, from, admin, amount4admin); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC1155 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "Ikasumi: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "Ikasumi: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "Ikasumi: ERC20 operation did not succeed"); } } // update contract fields function updateAdmin(address _admin, uint256 _commissionRate, uint256 _royaltiesCommissionRate, uint8 _whoCanMint, IERC20 _paymentToken) external onlyOwner() { require(_commissionRate + _royaltiesCommissionRate < 100, "Ikasumi: total commissions should be lower than 100"); admin = _admin; commissionRate = _commissionRate; royaltiesCommissionRate = _royaltiesCommissionRate; whoCanMint = _whoCanMint; paymentToken = _paymentToken; } } /** * Marketplace with Lazy Minting feature */ contract ERC1155Ikasumi is ERC1155Marketplace, EIP712 { string private constant SIGNING_DOMAIN = "ERC1155Ikasumi-Voucher"; string private constant SIGNATURE_VERSION = "1"; constructor(IERC20 _paymentToken, address _owner, address _admin, uint256 _commissionRate, uint256 _royaltiesCommissionRate, string memory name, string memory symbol, uint8 _whoCanMint, string memory uri) ERC1155Marketplace(_paymentToken, _owner, _admin, _commissionRate, _royaltiesCommissionRate, name, symbol, _whoCanMint, uri) EIP712(SIGNING_DOMAIN, SIGNATURE_VERSION) {} // minted qty for each voucher ID mapping(uint256 => uint256) public vouchersMintedQty; // minted NFT ID for each voucher ID mapping(uint256 => uint256) public vouchersNFTIds; event LazyMint(uint256 indexed tokenId, address indexed from, address indexed to, uint256 value); /// @notice Redeems an NFTVoucher for an actual NFT, creating it in the process. function redeem( uint256 nftId, uint256 id, uint256 nftPostId, uint256 qty, uint256 price, uint256 collectionId, uint256 chainId, address author, uint256 salt, bytes memory signature, uint256 qtyToMint ) external nonReentrant { require(chainId == getChainId(), "Ikasumi: Wrong chain"); require(vouchersMintedQty[id] + qtyToMint <= qty, "Ikasumi: the qty exceeds the amount available for minting"); require(nftId == 0 || exists(nftId), "Ikasumi: Wrong NFT ID"); // make sure signature is valid and get the address of the signer verify(id, nftPostId, qty, price, collectionId, chainId, author, salt, address(this), signature, owner()); // allow to mint less qty of the amounts in voucher, until all qtys are minted // first time minting? find the next available tokenId or use the existing NFT Id if it was passed to the function if (vouchersNFTIds[id]==0) { if (nftId>0) { vouchersNFTIds[id] = nftId; } else { findNextTokenId(); vouchersNFTIds[id] = _tokenIdCounter; } } // mint the items _mint(_msgSender(), vouchersNFTIds[id], qtyToMint, '0x'); // manually set the creator / author for the tokenId just minted // the author is set by the contract owner in the signed message, and this is meant to receive royalties creators[vouchersNFTIds[id]] = author; // distribute payments distributeFunds(qtyToMint * price, _msgSender(), owner(), vouchersNFTIds[id], true); // Inform the Lazy Mint emit LazyMint(vouchersNFTIds[id], _msgSender(), owner(), qtyToMint * price); // keep track of minted qties vouchersMintedQty[id] += qtyToMint; } function domainSeparator() external view returns (bytes32) { return _domainSeparatorV4(); } function verify( uint256 id, uint256 nftPostId, uint256 qty, uint256 price, uint256 collectionId, uint256 chainId, address author, uint256 salt, address thisContract, bytes memory signature, address signer ) internal view { bytes32 digest = _hashTypedDataV4( keccak256( abi.encode( keccak256("NFTVoucher(uint256 id,uint256 nftPostId,uint256 qty,uint256 price,uint256 collectionId,uint256 chainId,address author,uint256 salt,address thisContract)"), id, nftPostId, qty, price, collectionId, chainId, author, salt, thisContract ) ) ); address recoveredSigner = ECDSA.recover(digest, signature); require(recoveredSigner == signer, "Ikasumi: wrong signature"); } function getChainId() public view returns (uint256) { return block.chainid; } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_paymentToken","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"uint256","name":"_commissionRate","type":"uint256"},{"internalType":"uint256","name":"_royaltiesCommissionRate","type":"uint256"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"_whoCanMint","type":"uint8"},{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"qty","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Bid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"CancelBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"CancelSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Commission","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"LazyMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Royalty","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"qty","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Sell","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"qty","type":"uint256"}],"name":"acceptBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"autoMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"autoMintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"qty","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"bid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"qty","type":"uint256"}],"name":"buy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"canIMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"cancelBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"cancelSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"commissionRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"creators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"domainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"openOffers","outputs":[{"internalType":"uint256","name":"qty","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"openOffersLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"openSales","outputs":[{"internalType":"uint256","name":"qty","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"wallet","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"openSalesLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"nftPostId","type":"uint256"},{"internalType":"uint256","name":"qty","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"author","type":"address"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"qtyToMint","type":"uint256"}],"name":"redeem","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":[],"name":"royaltiesCommissionRate","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":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"qty","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"address","name":"wallet","type":"address"}],"name":"sell","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"uint256","name":"_commissionRate","type":"uint256"},{"internalType":"uint256","name":"_royaltiesCommissionRate","type":"uint256"},{"internalType":"uint8","name":"_whoCanMint","type":"uint8"},{"internalType":"contract IERC20","name":"_paymentToken","type":"address"}],"name":"updateAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"vouchersMintedQty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"vouchersNFTIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whoCanMint","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101206040523480156200001257600080fd5b506040516200505e3803806200505e833981016040819052620000359162000600565b6040518060400160405280601681526020017f45524331313535496b6173756d692d566f756368657200000000000000000000815250604051806040016040528060018152602001603160f81b8152508a8a8a8a8a8a8a8a8a878185858583620000ae620000a8620002a660201b60201c565b620002aa565b620000b981620002fa565b50620000c760008662000313565b620000f37f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68662000313565b620000fe856200031f565b82516200011390600690602086019062000478565b5081516200012990600790602085019062000478565b506009805460ff191660ff9290921691909117905550506001600b555060649050620001568688620006ee565b10620001cf5760405162461bcd60e51b815260206004820152603360248201527f496b6173756d693a20746f74616c20636f6d6d697373696f6e732073686f756c60448201527f64206265206c6f776572207468616e203130300000000000000000000000000060648201526084015b60405180910390fd5b5050600c80546001600160a01b039687166001600160a01b031991821617909155600e949094555050600f55600d80549490921693169290921790915550815160209283012081519183019190912060c082815260e08290524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818901819052818301979097526060810195909552608080860193909352308583015280518086039092018252939092019092528051930192909220909152610100525062000766975050505050505050565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516200030f90600490602084019062000478565b5050565b6200030f8282620003f0565b6000546001600160a01b031633146200037b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620001c6565b6001600160a01b038116620003e25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620001c6565b620003ed81620002aa565b50565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200030f5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b828054620004869062000713565b90600052602060002090601f016020900481019282620004aa5760008555620004f5565b82601f10620004c557805160ff1916838001178555620004f5565b82800160010185558215620004f5579182015b82811115620004f5578251825591602001919060010190620004d8565b506200050392915062000507565b5090565b5b8082111562000503576000815560010162000508565b80516001600160a01b03811681146200053657600080fd5b919050565b600082601f8301126200054c578081fd5b81516001600160401b038082111562000569576200056962000750565b604051601f8301601f19908116603f0116810190828211818310171562000594576200059462000750565b81604052838152602092508683858801011115620005b0578485fd5b8491505b83821015620005d35785820183015181830184015290820190620005b4565b83821115620005e457848385830101525b9695505050505050565b805160ff811681146200053657600080fd5b60008060008060008060008060006101208a8c0312156200061f578485fd5b6200062a8a6200051e565b98506200063a60208b016200051e565b97506200064a60408b016200051e565b60608b015160808c015160a08d015192995090975095506001600160401b038082111562000676578586fd5b620006848d838e016200053b565b955060c08c01519150808211156200069a578485fd5b620006a88d838e016200053b565b9450620006b860e08d01620005ee565b93506101008c0151915080821115620006cf578283fd5b50620006de8c828d016200053b565b9150509295985092959850929598565b600082198211156200070e57634e487b7160e01b81526011600452602481fd5b500190565b600181811c908216806200072857607f821691505b602082108114156200074a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160a05160c05160e051610100516148b3620007ab6000396000612d0101526000612d5001526000612d2b01526000612caf01526000612cd801526148b36000f3fe608060405234801561001057600080fd5b50600436106102f05760003560e01c8063731133e91161019d578063bd85b039116100e9578063dc234f5a116100a2578063f242432a1161007c578063f242432a1461078d578063f2fde38b146107a0578063f698da25146107b3578063f851a440146107bb57600080fd5b8063dc234f5a1461071e578063e22b862c14610731578063e985e9c51461075157600080fd5b8063bd85b0391461065b578063cd53d08e1461067b578063ce15d87c146106a4578063d1389512146106c4578063d5391393146106e4578063d547741f1461070b57600080fd5b806395d89b4111610156578063a217fddf11610130578063a217fddf1461061a578063a22cb46514610622578063a2d0d02914610635578063aa271e1a1461064857600080fd5b806395d89b41146105ec578063983b2d56146105f45780639fa6b40c1461060757600080fd5b8063731133e9146105295780637447298f1461053c578063745e96d71461057357806380149609146105865780638da5cb5b146105c857806391d14854146105d957600080fd5b80633408e4701161025c5780634c2decc0116102155780635478e770116101ef5780635478e770146104e557806356bee561146104f85780635ea1d6f814610518578063715018a61461052157600080fd5b80634c2decc0146104845780634e1273f4146104a35780634f558e79146104c357600080fd5b80633408e4701461042957806336568abe1461042f578063373f68d11461044257806340993b261461044b5780634b3936051461045e5780634c22ce0b1461047157600080fd5b80631f7fdffa116102ae5780631f7fdffa1461038e578063248a9ca3146103a15780632ac9bf09146103c55780632eb2c2d6146103d85780632f2ff15d146103eb5780633013ce29146103fe57600080fd5b8062fdd58e146102f557806301ffc9a71461031b57806306fdde031461033e5780630948e8461461035357806309d0ffa8146103685780630e89341c1461037b575b600080fd5b610308610303366004613e7f565b6107ce565b6040519081526020015b60405180910390f35b61032e61032936600461407b565b610867565b6040519015158152602001610312565b610346610878565b60405161031291906143f9565b610366610361366004613efe565b61090a565b005b6103666103763660046140b3565b6109f8565b61034661038936600461403f565b610b33565b61036661039c366004613dbc565b610bc7565b6103086103af36600461403f565b6000908152600160208190526040909120015490565b6103666103d33660046140d4565b610bff565b6103666103e6366004613c60565b610e46565b6103666103f9366004614057565b610edd565b600d54610411906001600160a01b031681565b6040516001600160a01b039091168152602001610312565b46610308565b61036661043d366004614057565b610f09565b610308600f5481565b6103666104593660046140d4565b610f87565b61036661046c3660046140b3565b61120a565b61036661047f366004613d6f565b611418565b6009546104919060ff1681565b60405160ff9091168152602001610312565b6104b66104b1366004613f61565b6114b4565b60405161031291906143b8565b61032e6104d136600461403f565b600090815260056020526040902054151590565b61032e6104f336600461403f565b611615565b61030861050636600461403f565b60136020526000908152604090205481565b610308600e5481565b61036661168b565b610366610537366004613eaa565b6116c1565b61054f61054a3660046140b3565b6116f3565b6040805193845260208401929092526001600160a01b031690820152606001610312565b610308610581366004613e7f565b61173e565b6105996105943660046140b3565b6117a0565b6040805194855260208501939093526001600160a01b0391821692840192909252166060820152608001610312565b6000546001600160a01b0316610411565b61032e6105e7366004614057565b6117f3565b61034661181e565b610366610602366004613c0c565b61182d565b61036661061536600461413f565b611880565b610308600081565b610366610630366004613e52565b611b78565b6103666106433660046140d4565b611c4f565b61032e610656366004613c0c565b611ec6565b61030861066936600461403f565b60009081526005602052604090205490565b61041161068936600461403f565b600a602052600090815260409020546001600160a01b031681565b6103086106b236600461403f565b60156020526000908152604090205481565b6103086106d236600461403f565b60116020526000908152604090205481565b6103087f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610366610719366004614057565b611ef2565b61036661072c3660046140ff565b611f19565b61030861073f36600461403f565b60146020526000908152604090205481565b61032e61075f366004613c28565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b61036661079b366004613d09565b6120a1565b6103666107ae366004613c0c565b612128565b6103086121c0565b600c54610411906001600160a01b031681565b60006001600160a01b03831661083f5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060009081526002602090815260408083206001600160a01b03949094168352929052205490565b6000610872826121cf565b92915050565b606060068054610887906146f6565b80601f01602080910402602001604051908101604052809291908181526020018280546108b3906146f6565b80156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b5050505050905090565b6000546001600160a01b031633146109345760405162461bcd60e51b8152600401610836906144e3565b60646109408486614645565b106109a95760405162461bcd60e51b815260206004820152603360248201527f496b6173756d693a20746f74616c20636f6d6d697373696f6e732073686f756c604482015272064206265206c6f776572207468616e2031303606c1b6064820152608401610836565b600c80546001600160a01b039687166001600160a01b031991821617909155600e94909455600f929092556009805460ff90921660ff19909216919091179055600d8054919093169116179055565b6000828152601060205260409020805433919083908110610a2957634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260049092020101546001600160a01b031614610ab25760405162461bcd60e51b815260206004820152603660248201527f496b6173756d693a206f6e6c7920746865206f726967696e616c2073656c6c65604482015275722063616e2063616e63656c206869732073616c657360501b6064820152608401610836565b6000828152601060205260408120805483908110610ae057634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160000181905550817f62f362ec9f7b9b102a4244ce20b4b58f82ab3e1a2c681c73637a4a7cf91cb78582604051610b2791815260200190565b60405180910390a25050565b606060048054610b42906146f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6e906146f6565b8015610bbb5780601f10610b9057610100808354040283529160200191610bbb565b820191906000526020600020905b815481529060010190602001808311610b9e57829003601f168201915b50505050509050919050565b610bd16000611615565b610bed5760405162461bcd60e51b815260040161083690614560565b610bf98484848461220f565b50505050565b6002600b541415610c225760405162461bcd60e51b8152600401610836906145eb565b6002600b5581610c745760405162461bcd60e51b815260206004820181905260248201527f496b736173756d693a207174792068617320746f20626520706f7369746976656044820152606401610836565b60008111610ccf5760405162461bcd60e51b815260206004820152602260248201527f496b736173756d693a2070726963652068617320746f20626520706f73697469604482015261766560f01b6064820152608401610836565b600083815260056020526040902054821115610d395760405162461bcd60e51b815260206004820152602360248201527f496b736173756d693a206e6f7420656e6f756768206974656d7320666f722073604482015262616c6560e81b6064820152608401610836565b6000610d45828461467d565b9050610d5f33600d546001600160a01b0316903084612297565b60006040518060600160405280858152602001848152602001610d7f3390565b6001600160a01b0390811690915260008781526012602090815260408083208054600180820183558286528486208851600390930201918255878501519082015586830151600290910180546001600160a01b031916919096161790945589835292546013909152919020559050336001600160a01b0316857f3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b708686604051610e32929190918252602082015260400190565b60405180910390a350506001600b55505050565b6001600160a01b038516331480610e625750610e62853361075f565b610ec95760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610836565b610ed68585858585612302565b5050505050565b60008281526001602081905260409091200154610efa81336124bd565b610f048383612521565b505050565b6001600160a01b0381163314610f795760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610836565b610f83828261258c565b5050565b6002600b541415610faa5760405162461bcd60e51b8152600401610836906145eb565b6002600b556000838152601060205260409020805433919084908110610fe057634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260049092020101546001600160a01b0316141561105e5760405162461bcd60e51b815260206004820152602a60248201527f496b6173756d693a2074686520757365722063616e6e6f7420627579206869736044820152691037bbb71037b33332b960b11b6064820152608401610836565b60008381526010602052604090208054611106913091637921219560e11b91908690811061109c57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600490910201600201546001600160a01b03163387866040516024016110cf9493929190614375565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526125f3565b600083815260106020526040902080546111aa91908490811061113957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600402016001015482611156919061467d565b33600086815260106020526040902080548690811061118557634e487b7160e01b600052603260045260246000fd5b60009182526020909120600360049092020101546001600160a01b0316866001612771565b60008381526010602052604090208054829190849081106111db57634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160000160008282546111fb919061469c565b90915550506001600b55505050565b6002600b54141561122d5760405162461bcd60e51b8152600401610836906145eb565b6002600b55600082815260126020526040902080543391908390811061126357634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260039092020101546001600160a01b0316146112eb5760405162461bcd60e51b815260206004820152603560248201527f496b6173756d693a206f6e6c7920746865206f726967696e616c206269646465604482015274722063616e2063616e63656c20686973206269647360581b6064820152608401610836565b600082815260126020526040812080548390811061131957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600302016001015460126000858152602001908152602001600020838154811061135d57634e487b7160e01b600052603260045260246000fd5b906000526020600020906003020160000154611379919061467d565b600084815260126020526040812080549293509091849081106113ac57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600390910201556113d433600d546001600160a01b031690836129a7565b827f7277fc1cd614e04155fd1e358fe63c0576fc211585e1ec95403495e0272eeb4c8360405161140691815260200190565b60405180910390a250506001600b5550565b6114226000611615565b61143e5760405162461bcd60e51b815260040161083690614560565b6001600160a01b0382166114645760405162461bcd60e51b8152600401610836906145aa565b60005b8151811015610f04576114a18383838151811061149457634e487b7160e01b600052603260045260246000fd5b602002602001015161173e565b50806114ac8161475d565b915050611467565b606081518351146115195760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610836565b600083516001600160401b0381111561154257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561156b578160200160208202803683370190505b50905060005b845181101561160d576115d285828151811061159d57634e487b7160e01b600052603260045260246000fd5b60200260200101518583815181106115c557634e487b7160e01b600052603260045260246000fd5b60200260200101516107ce565b8282815181106115f257634e487b7160e01b600052603260045260246000fd5b60209081029190910101526116068161475d565b9050611571565b509392505050565b600061162033611ec6565b80611639575060095460ff166001148015611639575081155b80611676575060095460ff1660011480156116545750600082115b801561167657506000828152600a60205260409020546001600160a01b031633145b8061087257505060095460ff16600214919050565b6000546001600160a01b031633146116b55760405162461bcd60e51b8152600401610836906144e3565b6116bf60006129d7565b565b826116cb81611615565b6116e75760405162461bcd60e51b815260040161083690614560565b610ed685858585612a27565b6012602052816000526040600020818154811061170f57600080fd5b60009182526020909120600390910201805460018201546002909201549093509091506001600160a01b031683565b600061174a6000611615565b6117665760405162461bcd60e51b815260040161083690614560565b61176e612a51565b611796836008548460405180604001604052806002815260200161060f60f31b815250612a27565b5060085492915050565b601060205281600052604060002081815481106117bc57600080fd5b6000918252602090912060049091020180546001820154600283015460039093015491945092506001600160a01b03918216911684565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060078054610887906146f6565b6118376000611615565b6118535760405162461bcd60e51b815260040161083690614560565b61187d7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a682610edd565b50565b6002600b5414156118a35760405162461bcd60e51b8152600401610836906145eb565b6002600b554685146118ee5760405162461bcd60e51b815260206004820152601460248201527324b5b0b9bab6b49d102bb937b7339031b430b4b760611b6044820152606401610836565b60008a815260146020526040902054889061190a908390614645565b111561197e5760405162461bcd60e51b815260206004820152603960248201527f496b6173756d693a207468652071747920657863656564732074686520616d6f60448201527f756e7420617661696c61626c6520666f72206d696e74696e67000000000000006064820152608401610836565b8a1580611998575060008b81526005602052604090205415155b6119dc5760405162461bcd60e51b8152602060048201526015602482015274125ad85cdd5b5a4e8815dc9bdb99c8139195081251605a1b6044820152606401610836565b611a008a8a8a8a8a8a8a8a308b6119fb6000546001600160a01b031690565b612a7e565b60008a815260156020526040902054611a4a578a15611a2f5760008a81526015602052604090208b9055611a4a565b611a37612a51565b60085460008b8152601560205260409020555b611a8333601560008d8152602001908152602001600020548360405180604001604052806002815260200161060f60f31b815250612a27565b60008a8152601560209081526040808320548352600a909152902080546001600160a01b0319166001600160a01b038616179055611ae7611ac4888361467d565b336000546001600160a01b031660008e8152601560205260409020546001612771565b600080548b825260156020526040909120546001600160a01b039091169033907ffd97862d5a5b5a3eb526cec9bc4d060e4927fa2388f7f3178f09a250dd864ab1611b328b8661467d565b60405190815260200160405180910390a460008a81526014602052604081208054839290611b61908490614645565b90915550506001600b555050505050505050505050565b336001600160a01b0383161415611be35760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610836565b3360008181526003602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6002600b541415611c725760405162461bcd60e51b8152600401610836906145eb565b6002600b556000838152601260205260409020805433919084908110611ca857634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260039092020101546001600160a01b03161415611d275760405162461bcd60e51b815260206004820152602b60248201527f496b6173756d693a2074686520757365722063616e6e6f74206163636570742060448201526a1a1a5cc81bdddb88189a5960aa1b6064820152608401610836565b611d55335b6001600160a01b0316600090815260036020908152604080832030845290915290205460ff1690565b611d6457611d64306001611b78565b611dd130637921219560e11b336000878152601260205260409020805487908110611d9f57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260039092020101546040516110cf92916001600160a01b03169089908890602401614375565b60008381526012602052604090208054611e75919084908110611e0457634e487b7160e01b600052603260045260246000fd5b90600052602060002090600302016001015482611e21919061467d565b6000858152601260205260409020805485908110611e4f57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600390910201600201546001600160a01b031633866000612771565b6000838152601260205260409020805482919084908110611ea657634e487b7160e01b600052603260045260246000fd5b906000526020600020906003020160000160008282546111fb919061469c565b60006108727f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6836117f3565b60008281526001602081905260409091200154611f0f81336124bd565b610f04838361258c565b82611f2433866107ce565b1015611f895760405162461bcd60e51b815260206004820152602e60248201527f496b6173756d693a20796f7520646f206e6f74206861766520656e6f7567682060448201526d1d1bdad95b9cc81d1bc81cd95b1b60921b6064820152608401610836565b611f9233611d2c565b611fa157611fa1306001611b78565b60006040518060800160405280858152602001848152602001611fc13390565b6001600160a01b039081168252848116602092830152600088815260108352604080822080546001818101835582855286852088516004909302019182558787015190820155828701516002820180549187166001600160a01b031992831617905560608801516003909201805492909616911617909355898252915460119093522055905061204e3390565b6001600160a01b0316857fce55bfae73b3c55d09c9fb6723466656ecb31fc2f7c5b90c296456857480c88c8686604051612092929190918252602082015260400190565b60405180910390a35050505050565b6001600160a01b0385163314806120bd57506120bd853361075f565b61211b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610836565b610ed68585858585612b98565b6000546001600160a01b031633146121525760405162461bcd60e51b8152600401610836906144e3565b6001600160a01b0381166121b75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610836565b61187d816129d7565b60006121ca612cab565b905090565b60006001600160e01b03198216636cdb3d1360e11b148061220057506001600160e01b031982166303a24d0760e21b145b80610872575061087282612da1565b61221b84848484612dd6565b60005b8351811015610ed65733600a600086848151811061224c57634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806122909061475d565b905061221e565b6040516001600160a01b0380851660248301528316604482015260648101829052610bf99085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612e75565b81518351146123235760405162461bcd60e51b815260040161083690614518565b6001600160a01b0384166123495760405162461bcd60e51b815260040161083690614454565b3360005b845181101561244f57600085828151811061237857634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106123a457634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038e1683529093529190912054909150818110156123f55760405162461bcd60e51b815260040161083690614499565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612434908490614645565b92505081905550505050806124489061475d565b905061234d565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161249f9291906143cb565b60405180910390a46124b5818787878787612f47565b505050505050565b6124c782826117f3565b610f83576124df816001600160a01b031660146130b2565b6124ea8360206130b2565b6040516020016124fb929190614268565b60408051601f198184030181529082905262461bcd60e51b8252610836916004016143f9565b61252b82826117f3565b610f835760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b61259682826117f3565b15610f835760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0382163b61264a5760405162461bcd60e51b815260206004820152601d60248201527f496b6173756d693a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610836565b600080836001600160a01b031683604051612665919061424c565b6000604051808303816000865af19150503d80600081146126a2576040519150601f19603f3d011682016040523d82523d6000602084013e6126a7565b606091505b5091509150816126f95760405162461bcd60e51b815260206004820152601e60248201527f496b6173756d693a206c6f772d6c6576656c2063616c6c206661696c656400006044820152606401610836565b805115610bf957808060200190518101906127149190614023565b610bf95760405162461bcd60e51b815260206004820152602860248201527f496b6173756d693a204552433230206f7065726174696f6e20646964206e6f74604482015267081cdd58d8d9595960c21b6064820152608401610836565b60006064600e5487612783919061467d565b61278d919061465d565b905060006064600f54886127a1919061467d565b6127ab919061465d565b90506000816127ba848a61469c565b6127c4919061469c565b905083156127e957600d546127e4906001600160a01b0316888884612297565b612800565b600d54612800906001600160a01b031687836129a7565b856001600160a01b0316876001600160a01b0316867f07f87664c10527a8207b443cccf57f3c20f25bd1165eeae416be79890a35892c8460405161284691815260200190565b60405180910390a4811561290857831561288a576000858152600a6020526040902054600d54612885916001600160a01b03918216918a911685612297565b6128b3565b6000858152600a6020526040902054600d546128b3916001600160a01b039182169116846129a7565b6000858152600a60209081526040918290205491518481526001600160a01b03928316928a169188917f802713d7f9cc0dcd6072902b48c61c206c34d6ca5f5288b580a6f86f9c9fe150910160405180910390a45b821561299d57831561293857600c54600d54612933916001600160a01b03918216918a911686612297565b612955565b600c54600d54612955916001600160a01b039182169116856129a7565b600c546040518481526001600160a01b039182169189169087907f9577cd5ef459a0bf97b597490f08f1e93e995b9394e4c577932db36e71c4500c9060200160405180910390a45b5050505050505050565b6040516001600160a01b038316602482015260448101829052610f0490849063a9059cbb60e01b906064016122cb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000838152600a6020526040902080546001600160a01b03191633179055610bf98484848461329a565b60088054906000612a618361475d565b9091555050600854600090815260056020526040902054612a5157565b604080517f286c81460df074c46ce5aeb2d5be03f72c20e6c506d2bae9048ed617d90c3dba60208201529081018c9052606081018b9052608081018a905260a0810189905260c0810188905260e081018790526001600160a01b0380871661010083015261012082018690528416610140820152600090612b189061016001604051602081830303815290604052805190602001206132cf565b90506000612b26828561331d565b9050826001600160a01b0316816001600160a01b031614612b895760405162461bcd60e51b815260206004820152601860248201527f496b6173756d693a2077726f6e67207369676e617475726500000000000000006044820152606401610836565b50505050505050505050505050565b6001600160a01b038416612bbe5760405162461bcd60e51b815260040161083690614454565b60008381526002602090815260408083206001600160a01b0389168452909152902054339083811015612c035760405162461bcd60e51b815260040161083690614499565b60008581526002602090815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290612c42908490614645565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612ca2828888888888613339565b50505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000461415612cfa57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b90565b60006001600160e01b03198216637965db0b60e01b148061087257506301ffc9a760e01b6001600160e01b0319831614610872565b612de284848484613403565b60005b8351811015610ed657828181518110612e0e57634e487b7160e01b600052603260045260246000fd5b602002602001015160056000868481518110612e3a57634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000828254612e5f9190614645565b90915550612e6e90508161475d565b9050612de5565b6000612eca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661356b9092919063ffffffff16565b805190915015610f045780806020019051810190612ee89190614023565b610f045760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610836565b6001600160a01b0384163b156124b55760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612f8b90899089908890889088906004016142dd565b602060405180830381600087803b158015612fa557600080fd5b505af1925050508015612fd5575060408051601f3d908101601f19168201909252612fd291810190614097565b60015b61308257612fe16147a4565b806308c379a0141561301b5750612ff66147bb565b80613001575061301d565b8060405162461bcd60e51b815260040161083691906143f9565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610836565b6001600160e01b0319811663bc197c8160e01b14612ca25760405162461bcd60e51b81526004016108369061440c565b606060006130c183600261467d565b6130cc906002614645565b6001600160401b038111156130f157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561311b576020820181803683370190505b509050600360fc1b8160008151811061314457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061318157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006131a584600261467d565b6131b0906001614645565b90505b6001811115613244576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106131f257634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061321657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361323d816146df565b90506131b3565b5083156132935760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610836565b9392505050565b6132a684848484613582565b600083815260056020526040812080548492906132c4908490614645565b909155505050505050565b60006108726132dc612cab565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061332c858561363c565b9150915061160d816136ac565b6001600160a01b0384163b156124b55760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061337d908990899088908890889060040161433b565b602060405180830381600087803b15801561339757600080fd5b505af19250505080156133c7575060408051601f3d908101601f191682019092526133c491810190614097565b60015b6133d357612fe16147a4565b6001600160e01b0319811663f23a6e6160e01b14612ca25760405162461bcd60e51b81526004016108369061440c565b6001600160a01b0384166134295760405162461bcd60e51b8152600401610836906145aa565b815183511461344a5760405162461bcd60e51b815260040161083690614518565b3360005b84518110156135035783818151811061347757634e487b7160e01b600052603260045260246000fd5b6020026020010151600260008784815181106134a357634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546134eb9190614645565b909155508190506134fb8161475d565b91505061344e565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516135549291906143cb565b60405180910390a4610ed681600087878787612f47565b606061357a84846000856138ad565b949350505050565b6001600160a01b0384166135a85760405162461bcd60e51b8152600401610836906145aa565b60008381526002602090815260408083206001600160a01b03881684529091528120805433928592916135dc908490614645565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610ed681600087878787613339565b6000808251604114156136735760208301516040840151606085015160001a613667878285856139d5565b945094505050506136a5565b82516040141561369d5760208301516040840151613692868383613ac2565b9350935050506136a5565b506000905060025b9250929050565b60008160048111156136ce57634e487b7160e01b600052602160045260246000fd5b14156136d75750565b60018160048111156136f957634e487b7160e01b600052602160045260246000fd5b14156137475760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610836565b600281600481111561376957634e487b7160e01b600052602160045260246000fd5b14156137b75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610836565b60038160048111156137d957634e487b7160e01b600052602160045260246000fd5b14156138325760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610836565b600481600481111561385457634e487b7160e01b600052602160045260246000fd5b141561187d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610836565b60608247101561390e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610836565b843b61395c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610836565b600080866001600160a01b03168587604051613978919061424c565b60006040518083038185875af1925050503d80600081146139b5576040519150601f19603f3d011682016040523d82523d6000602084013e6139ba565b606091505b50915091506139ca828286613af1565b979650505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613a0c5750600090506003613ab9565b8460ff16601b14158015613a2457508460ff16601c14155b15613a355750600090506004613ab9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a89573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613ab257600060019250925050613ab9565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01613ae3878288856139d5565b935093505050935093915050565b60608315613b00575081613293565b825115613b105782518084602001fd5b8160405162461bcd60e51b815260040161083691906143f9565b600082601f830112613b3a578081fd5b81356020613b4782614622565b604051613b548282614731565b8381528281019150858301600585901b87018401881015613b73578586fd5b855b85811015613b9157813584529284019290840190600101613b75565b5090979650505050505050565b600082601f830112613bae578081fd5b81356001600160401b03811115613bc757613bc761478e565b604051613bde601f8301601f191660200182614731565b818152846020838601011115613bf2578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215613c1d578081fd5b813561329381614844565b60008060408385031215613c3a578081fd5b8235613c4581614844565b91506020830135613c5581614844565b809150509250929050565b600080600080600060a08688031215613c77578081fd5b8535613c8281614844565b94506020860135613c9281614844565b935060408601356001600160401b0380821115613cad578283fd5b613cb989838a01613b2a565b94506060880135915080821115613cce578283fd5b613cda89838a01613b2a565b93506080880135915080821115613cef578283fd5b50613cfc88828901613b9e565b9150509295509295909350565b600080600080600060a08688031215613d20578081fd5b8535613d2b81614844565b94506020860135613d3b81614844565b9350604086013592506060860135915060808601356001600160401b03811115613d63578182fd5b613cfc88828901613b9e565b60008060408385031215613d81578182fd5b8235613d8c81614844565b915060208301356001600160401b03811115613da6578182fd5b613db285828601613b2a565b9150509250929050565b60008060008060808587031215613dd1578384fd5b8435613ddc81614844565b935060208501356001600160401b0380821115613df7578485fd5b613e0388838901613b2a565b94506040870135915080821115613e18578384fd5b613e2488838901613b2a565b93506060870135915080821115613e39578283fd5b50613e4687828801613b9e565b91505092959194509250565b60008060408385031215613e64578182fd5b8235613e6f81614844565b91506020830135613c5581614859565b60008060408385031215613e91578182fd5b8235613e9c81614844565b946020939093013593505050565b60008060008060808587031215613ebf578182fd5b8435613eca81614844565b9350602085013592506040850135915060608501356001600160401b03811115613ef2578182fd5b613e4687828801613b9e565b600080600080600060a08688031215613f15578283fd5b8535613f2081614844565b94506020860135935060408601359250606086013560ff81168114613f43578182fd5b91506080860135613f5381614844565b809150509295509295909350565b60008060408385031215613f73578182fd5b82356001600160401b0380821115613f89578384fd5b818501915085601f830112613f9c578384fd5b81356020613fa982614622565b604051613fb68282614731565b8381528281019150858301600585901b870184018b1015613fd5578889fd5b8896505b84871015614000578035613fec81614844565b835260019690960195918301918301613fd9565b5096505086013592505080821115614016578283fd5b50613db285828601613b2a565b600060208284031215614034578081fd5b815161329381614859565b600060208284031215614050578081fd5b5035919050565b60008060408385031215614069578182fd5b823591506020830135613c5581614844565b60006020828403121561408c578081fd5b813561329381614867565b6000602082840312156140a8578081fd5b815161329381614867565b600080604083850312156140c5578182fd5b50508035926020909101359150565b6000806000606084860312156140e8578081fd5b505081359360208301359350604090920135919050565b60008060008060808587031215614114578182fd5b843593506020850135925060408501359150606085013561413481614844565b939692955090935050565b60008060008060008060008060008060006101608c8e031215614160578889fd5b8b359a5060208c0135995060408c0135985060608c0135975060808c0135965060a08c0135955060c08c0135945060e08c013561419c81614844565b93506101008c013592506101208c01356001600160401b038111156141bf578283fd5b6141cb8e828f01613b9e565b9250506101408c013590509295989b509295989b9093969950565b6000815180845260208085019450808401835b83811015614215578151875295820195908201906001016141f9565b509495945050505050565b600081518084526142388160208601602086016146b3565b601f01601f19169290920160200192915050565b6000825161425e8184602087016146b3565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516142a08160178501602088016146b3565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516142d18160288401602088016146b3565b01602801949350505050565b6001600160a01b0386811682528516602082015260a060408201819052600090614309908301866141e6565b828103606084015261431b81866141e6565b9050828103608084015261432f8185614220565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906139ca90830184614220565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260029082015261060f60f31b60c082015260e00190565b60208152600061329360208301846141e6565b6040815260006143de60408301856141e6565b82810360208401526143f081856141e6565b95945050505050565b6020815260006132936020830184614220565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6020808252602a908201527f4552433131353559757a753a206d7573742068617665206d696e74657220726f6040820152691b19481d1bc81b5a5b9d60b21b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006001600160401b0382111561463b5761463b61478e565b5060051b60200190565b6000821982111561465857614658614778565b500190565b60008261467857634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561469757614697614778565b500290565b6000828210156146ae576146ae614778565b500390565b60005b838110156146ce5781810151838201526020016146b6565b83811115610bf95750506000910152565b6000816146ee576146ee614778565b506000190190565b600181811c9082168061470a57607f821691505b6020821081141561472b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b03811182821017156147565761475661478e565b6040525050565b600060001982141561477157614771614778565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115612d9e57600481823e5160e01c90565b600060443d10156147c95790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156147f857505050505090565b82850191508151818111156148105750505050505090565b843d870101602082850101111561482a5750505050505090565b61483960208286010187614731565b509095945050505050565b6001600160a01b038116811461187d57600080fd5b801515811461187d57600080fd5b6001600160e01b03198116811461187d57600080fdfea264697066735822122086902f370be8e7575fb3254ddff8de920f6ed63e10d4a44738574bae5332fd4564736f6c63430008040033000000000000000000000000e4379a25a0db888e19ec2c14416fe68a62aca5cc000000000000000000000000e4379a25a0db888e19ec2c14416fe68a62aca5cc000000000000000000000000e4379a25a0db888e19ec2c14416fe68a62aca5cc000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000b496b6173756d69204e46540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002494e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c68747470733a2f2f7770736d617274636f6e7472616374732e636f6d00000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102f05760003560e01c8063731133e91161019d578063bd85b039116100e9578063dc234f5a116100a2578063f242432a1161007c578063f242432a1461078d578063f2fde38b146107a0578063f698da25146107b3578063f851a440146107bb57600080fd5b8063dc234f5a1461071e578063e22b862c14610731578063e985e9c51461075157600080fd5b8063bd85b0391461065b578063cd53d08e1461067b578063ce15d87c146106a4578063d1389512146106c4578063d5391393146106e4578063d547741f1461070b57600080fd5b806395d89b4111610156578063a217fddf11610130578063a217fddf1461061a578063a22cb46514610622578063a2d0d02914610635578063aa271e1a1461064857600080fd5b806395d89b41146105ec578063983b2d56146105f45780639fa6b40c1461060757600080fd5b8063731133e9146105295780637447298f1461053c578063745e96d71461057357806380149609146105865780638da5cb5b146105c857806391d14854146105d957600080fd5b80633408e4701161025c5780634c2decc0116102155780635478e770116101ef5780635478e770146104e557806356bee561146104f85780635ea1d6f814610518578063715018a61461052157600080fd5b80634c2decc0146104845780634e1273f4146104a35780634f558e79146104c357600080fd5b80633408e4701461042957806336568abe1461042f578063373f68d11461044257806340993b261461044b5780634b3936051461045e5780634c22ce0b1461047157600080fd5b80631f7fdffa116102ae5780631f7fdffa1461038e578063248a9ca3146103a15780632ac9bf09146103c55780632eb2c2d6146103d85780632f2ff15d146103eb5780633013ce29146103fe57600080fd5b8062fdd58e146102f557806301ffc9a71461031b57806306fdde031461033e5780630948e8461461035357806309d0ffa8146103685780630e89341c1461037b575b600080fd5b610308610303366004613e7f565b6107ce565b6040519081526020015b60405180910390f35b61032e61032936600461407b565b610867565b6040519015158152602001610312565b610346610878565b60405161031291906143f9565b610366610361366004613efe565b61090a565b005b6103666103763660046140b3565b6109f8565b61034661038936600461403f565b610b33565b61036661039c366004613dbc565b610bc7565b6103086103af36600461403f565b6000908152600160208190526040909120015490565b6103666103d33660046140d4565b610bff565b6103666103e6366004613c60565b610e46565b6103666103f9366004614057565b610edd565b600d54610411906001600160a01b031681565b6040516001600160a01b039091168152602001610312565b46610308565b61036661043d366004614057565b610f09565b610308600f5481565b6103666104593660046140d4565b610f87565b61036661046c3660046140b3565b61120a565b61036661047f366004613d6f565b611418565b6009546104919060ff1681565b60405160ff9091168152602001610312565b6104b66104b1366004613f61565b6114b4565b60405161031291906143b8565b61032e6104d136600461403f565b600090815260056020526040902054151590565b61032e6104f336600461403f565b611615565b61030861050636600461403f565b60136020526000908152604090205481565b610308600e5481565b61036661168b565b610366610537366004613eaa565b6116c1565b61054f61054a3660046140b3565b6116f3565b6040805193845260208401929092526001600160a01b031690820152606001610312565b610308610581366004613e7f565b61173e565b6105996105943660046140b3565b6117a0565b6040805194855260208501939093526001600160a01b0391821692840192909252166060820152608001610312565b6000546001600160a01b0316610411565b61032e6105e7366004614057565b6117f3565b61034661181e565b610366610602366004613c0c565b61182d565b61036661061536600461413f565b611880565b610308600081565b610366610630366004613e52565b611b78565b6103666106433660046140d4565b611c4f565b61032e610656366004613c0c565b611ec6565b61030861066936600461403f565b60009081526005602052604090205490565b61041161068936600461403f565b600a602052600090815260409020546001600160a01b031681565b6103086106b236600461403f565b60156020526000908152604090205481565b6103086106d236600461403f565b60116020526000908152604090205481565b6103087f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610366610719366004614057565b611ef2565b61036661072c3660046140ff565b611f19565b61030861073f36600461403f565b60146020526000908152604090205481565b61032e61075f366004613c28565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b61036661079b366004613d09565b6120a1565b6103666107ae366004613c0c565b612128565b6103086121c0565b600c54610411906001600160a01b031681565b60006001600160a01b03831661083f5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060009081526002602090815260408083206001600160a01b03949094168352929052205490565b6000610872826121cf565b92915050565b606060068054610887906146f6565b80601f01602080910402602001604051908101604052809291908181526020018280546108b3906146f6565b80156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b5050505050905090565b6000546001600160a01b031633146109345760405162461bcd60e51b8152600401610836906144e3565b60646109408486614645565b106109a95760405162461bcd60e51b815260206004820152603360248201527f496b6173756d693a20746f74616c20636f6d6d697373696f6e732073686f756c604482015272064206265206c6f776572207468616e2031303606c1b6064820152608401610836565b600c80546001600160a01b039687166001600160a01b031991821617909155600e94909455600f929092556009805460ff90921660ff19909216919091179055600d8054919093169116179055565b6000828152601060205260409020805433919083908110610a2957634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260049092020101546001600160a01b031614610ab25760405162461bcd60e51b815260206004820152603660248201527f496b6173756d693a206f6e6c7920746865206f726967696e616c2073656c6c65604482015275722063616e2063616e63656c206869732073616c657360501b6064820152608401610836565b6000828152601060205260408120805483908110610ae057634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160000181905550817f62f362ec9f7b9b102a4244ce20b4b58f82ab3e1a2c681c73637a4a7cf91cb78582604051610b2791815260200190565b60405180910390a25050565b606060048054610b42906146f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6e906146f6565b8015610bbb5780601f10610b9057610100808354040283529160200191610bbb565b820191906000526020600020905b815481529060010190602001808311610b9e57829003601f168201915b50505050509050919050565b610bd16000611615565b610bed5760405162461bcd60e51b815260040161083690614560565b610bf98484848461220f565b50505050565b6002600b541415610c225760405162461bcd60e51b8152600401610836906145eb565b6002600b5581610c745760405162461bcd60e51b815260206004820181905260248201527f496b736173756d693a207174792068617320746f20626520706f7369746976656044820152606401610836565b60008111610ccf5760405162461bcd60e51b815260206004820152602260248201527f496b736173756d693a2070726963652068617320746f20626520706f73697469604482015261766560f01b6064820152608401610836565b600083815260056020526040902054821115610d395760405162461bcd60e51b815260206004820152602360248201527f496b736173756d693a206e6f7420656e6f756768206974656d7320666f722073604482015262616c6560e81b6064820152608401610836565b6000610d45828461467d565b9050610d5f33600d546001600160a01b0316903084612297565b60006040518060600160405280858152602001848152602001610d7f3390565b6001600160a01b0390811690915260008781526012602090815260408083208054600180820183558286528486208851600390930201918255878501519082015586830151600290910180546001600160a01b031916919096161790945589835292546013909152919020559050336001600160a01b0316857f3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b708686604051610e32929190918252602082015260400190565b60405180910390a350506001600b55505050565b6001600160a01b038516331480610e625750610e62853361075f565b610ec95760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610836565b610ed68585858585612302565b5050505050565b60008281526001602081905260409091200154610efa81336124bd565b610f048383612521565b505050565b6001600160a01b0381163314610f795760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610836565b610f83828261258c565b5050565b6002600b541415610faa5760405162461bcd60e51b8152600401610836906145eb565b6002600b556000838152601060205260409020805433919084908110610fe057634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260049092020101546001600160a01b0316141561105e5760405162461bcd60e51b815260206004820152602a60248201527f496b6173756d693a2074686520757365722063616e6e6f7420627579206869736044820152691037bbb71037b33332b960b11b6064820152608401610836565b60008381526010602052604090208054611106913091637921219560e11b91908690811061109c57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600490910201600201546001600160a01b03163387866040516024016110cf9493929190614375565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526125f3565b600083815260106020526040902080546111aa91908490811061113957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600402016001015482611156919061467d565b33600086815260106020526040902080548690811061118557634e487b7160e01b600052603260045260246000fd5b60009182526020909120600360049092020101546001600160a01b0316866001612771565b60008381526010602052604090208054829190849081106111db57634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160000160008282546111fb919061469c565b90915550506001600b55505050565b6002600b54141561122d5760405162461bcd60e51b8152600401610836906145eb565b6002600b55600082815260126020526040902080543391908390811061126357634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260039092020101546001600160a01b0316146112eb5760405162461bcd60e51b815260206004820152603560248201527f496b6173756d693a206f6e6c7920746865206f726967696e616c206269646465604482015274722063616e2063616e63656c20686973206269647360581b6064820152608401610836565b600082815260126020526040812080548390811061131957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600302016001015460126000858152602001908152602001600020838154811061135d57634e487b7160e01b600052603260045260246000fd5b906000526020600020906003020160000154611379919061467d565b600084815260126020526040812080549293509091849081106113ac57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600390910201556113d433600d546001600160a01b031690836129a7565b827f7277fc1cd614e04155fd1e358fe63c0576fc211585e1ec95403495e0272eeb4c8360405161140691815260200190565b60405180910390a250506001600b5550565b6114226000611615565b61143e5760405162461bcd60e51b815260040161083690614560565b6001600160a01b0382166114645760405162461bcd60e51b8152600401610836906145aa565b60005b8151811015610f04576114a18383838151811061149457634e487b7160e01b600052603260045260246000fd5b602002602001015161173e565b50806114ac8161475d565b915050611467565b606081518351146115195760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610836565b600083516001600160401b0381111561154257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561156b578160200160208202803683370190505b50905060005b845181101561160d576115d285828151811061159d57634e487b7160e01b600052603260045260246000fd5b60200260200101518583815181106115c557634e487b7160e01b600052603260045260246000fd5b60200260200101516107ce565b8282815181106115f257634e487b7160e01b600052603260045260246000fd5b60209081029190910101526116068161475d565b9050611571565b509392505050565b600061162033611ec6565b80611639575060095460ff166001148015611639575081155b80611676575060095460ff1660011480156116545750600082115b801561167657506000828152600a60205260409020546001600160a01b031633145b8061087257505060095460ff16600214919050565b6000546001600160a01b031633146116b55760405162461bcd60e51b8152600401610836906144e3565b6116bf60006129d7565b565b826116cb81611615565b6116e75760405162461bcd60e51b815260040161083690614560565b610ed685858585612a27565b6012602052816000526040600020818154811061170f57600080fd5b60009182526020909120600390910201805460018201546002909201549093509091506001600160a01b031683565b600061174a6000611615565b6117665760405162461bcd60e51b815260040161083690614560565b61176e612a51565b611796836008548460405180604001604052806002815260200161060f60f31b815250612a27565b5060085492915050565b601060205281600052604060002081815481106117bc57600080fd5b6000918252602090912060049091020180546001820154600283015460039093015491945092506001600160a01b03918216911684565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060078054610887906146f6565b6118376000611615565b6118535760405162461bcd60e51b815260040161083690614560565b61187d7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a682610edd565b50565b6002600b5414156118a35760405162461bcd60e51b8152600401610836906145eb565b6002600b554685146118ee5760405162461bcd60e51b815260206004820152601460248201527324b5b0b9bab6b49d102bb937b7339031b430b4b760611b6044820152606401610836565b60008a815260146020526040902054889061190a908390614645565b111561197e5760405162461bcd60e51b815260206004820152603960248201527f496b6173756d693a207468652071747920657863656564732074686520616d6f60448201527f756e7420617661696c61626c6520666f72206d696e74696e67000000000000006064820152608401610836565b8a1580611998575060008b81526005602052604090205415155b6119dc5760405162461bcd60e51b8152602060048201526015602482015274125ad85cdd5b5a4e8815dc9bdb99c8139195081251605a1b6044820152606401610836565b611a008a8a8a8a8a8a8a8a308b6119fb6000546001600160a01b031690565b612a7e565b60008a815260156020526040902054611a4a578a15611a2f5760008a81526015602052604090208b9055611a4a565b611a37612a51565b60085460008b8152601560205260409020555b611a8333601560008d8152602001908152602001600020548360405180604001604052806002815260200161060f60f31b815250612a27565b60008a8152601560209081526040808320548352600a909152902080546001600160a01b0319166001600160a01b038616179055611ae7611ac4888361467d565b336000546001600160a01b031660008e8152601560205260409020546001612771565b600080548b825260156020526040909120546001600160a01b039091169033907ffd97862d5a5b5a3eb526cec9bc4d060e4927fa2388f7f3178f09a250dd864ab1611b328b8661467d565b60405190815260200160405180910390a460008a81526014602052604081208054839290611b61908490614645565b90915550506001600b555050505050505050505050565b336001600160a01b0383161415611be35760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610836565b3360008181526003602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6002600b541415611c725760405162461bcd60e51b8152600401610836906145eb565b6002600b556000838152601260205260409020805433919084908110611ca857634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260039092020101546001600160a01b03161415611d275760405162461bcd60e51b815260206004820152602b60248201527f496b6173756d693a2074686520757365722063616e6e6f74206163636570742060448201526a1a1a5cc81bdddb88189a5960aa1b6064820152608401610836565b611d55335b6001600160a01b0316600090815260036020908152604080832030845290915290205460ff1690565b611d6457611d64306001611b78565b611dd130637921219560e11b336000878152601260205260409020805487908110611d9f57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260039092020101546040516110cf92916001600160a01b03169089908890602401614375565b60008381526012602052604090208054611e75919084908110611e0457634e487b7160e01b600052603260045260246000fd5b90600052602060002090600302016001015482611e21919061467d565b6000858152601260205260409020805485908110611e4f57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600390910201600201546001600160a01b031633866000612771565b6000838152601260205260409020805482919084908110611ea657634e487b7160e01b600052603260045260246000fd5b906000526020600020906003020160000160008282546111fb919061469c565b60006108727f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6836117f3565b60008281526001602081905260409091200154611f0f81336124bd565b610f04838361258c565b82611f2433866107ce565b1015611f895760405162461bcd60e51b815260206004820152602e60248201527f496b6173756d693a20796f7520646f206e6f74206861766520656e6f7567682060448201526d1d1bdad95b9cc81d1bc81cd95b1b60921b6064820152608401610836565b611f9233611d2c565b611fa157611fa1306001611b78565b60006040518060800160405280858152602001848152602001611fc13390565b6001600160a01b039081168252848116602092830152600088815260108352604080822080546001818101835582855286852088516004909302019182558787015190820155828701516002820180549187166001600160a01b031992831617905560608801516003909201805492909616911617909355898252915460119093522055905061204e3390565b6001600160a01b0316857fce55bfae73b3c55d09c9fb6723466656ecb31fc2f7c5b90c296456857480c88c8686604051612092929190918252602082015260400190565b60405180910390a35050505050565b6001600160a01b0385163314806120bd57506120bd853361075f565b61211b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610836565b610ed68585858585612b98565b6000546001600160a01b031633146121525760405162461bcd60e51b8152600401610836906144e3565b6001600160a01b0381166121b75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610836565b61187d816129d7565b60006121ca612cab565b905090565b60006001600160e01b03198216636cdb3d1360e11b148061220057506001600160e01b031982166303a24d0760e21b145b80610872575061087282612da1565b61221b84848484612dd6565b60005b8351811015610ed65733600a600086848151811061224c57634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806122909061475d565b905061221e565b6040516001600160a01b0380851660248301528316604482015260648101829052610bf99085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612e75565b81518351146123235760405162461bcd60e51b815260040161083690614518565b6001600160a01b0384166123495760405162461bcd60e51b815260040161083690614454565b3360005b845181101561244f57600085828151811061237857634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106123a457634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038e1683529093529190912054909150818110156123f55760405162461bcd60e51b815260040161083690614499565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612434908490614645565b92505081905550505050806124489061475d565b905061234d565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161249f9291906143cb565b60405180910390a46124b5818787878787612f47565b505050505050565b6124c782826117f3565b610f83576124df816001600160a01b031660146130b2565b6124ea8360206130b2565b6040516020016124fb929190614268565b60408051601f198184030181529082905262461bcd60e51b8252610836916004016143f9565b61252b82826117f3565b610f835760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b61259682826117f3565b15610f835760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0382163b61264a5760405162461bcd60e51b815260206004820152601d60248201527f496b6173756d693a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610836565b600080836001600160a01b031683604051612665919061424c565b6000604051808303816000865af19150503d80600081146126a2576040519150601f19603f3d011682016040523d82523d6000602084013e6126a7565b606091505b5091509150816126f95760405162461bcd60e51b815260206004820152601e60248201527f496b6173756d693a206c6f772d6c6576656c2063616c6c206661696c656400006044820152606401610836565b805115610bf957808060200190518101906127149190614023565b610bf95760405162461bcd60e51b815260206004820152602860248201527f496b6173756d693a204552433230206f7065726174696f6e20646964206e6f74604482015267081cdd58d8d9595960c21b6064820152608401610836565b60006064600e5487612783919061467d565b61278d919061465d565b905060006064600f54886127a1919061467d565b6127ab919061465d565b90506000816127ba848a61469c565b6127c4919061469c565b905083156127e957600d546127e4906001600160a01b0316888884612297565b612800565b600d54612800906001600160a01b031687836129a7565b856001600160a01b0316876001600160a01b0316867f07f87664c10527a8207b443cccf57f3c20f25bd1165eeae416be79890a35892c8460405161284691815260200190565b60405180910390a4811561290857831561288a576000858152600a6020526040902054600d54612885916001600160a01b03918216918a911685612297565b6128b3565b6000858152600a6020526040902054600d546128b3916001600160a01b039182169116846129a7565b6000858152600a60209081526040918290205491518481526001600160a01b03928316928a169188917f802713d7f9cc0dcd6072902b48c61c206c34d6ca5f5288b580a6f86f9c9fe150910160405180910390a45b821561299d57831561293857600c54600d54612933916001600160a01b03918216918a911686612297565b612955565b600c54600d54612955916001600160a01b039182169116856129a7565b600c546040518481526001600160a01b039182169189169087907f9577cd5ef459a0bf97b597490f08f1e93e995b9394e4c577932db36e71c4500c9060200160405180910390a45b5050505050505050565b6040516001600160a01b038316602482015260448101829052610f0490849063a9059cbb60e01b906064016122cb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000838152600a6020526040902080546001600160a01b03191633179055610bf98484848461329a565b60088054906000612a618361475d565b9091555050600854600090815260056020526040902054612a5157565b604080517f286c81460df074c46ce5aeb2d5be03f72c20e6c506d2bae9048ed617d90c3dba60208201529081018c9052606081018b9052608081018a905260a0810189905260c0810188905260e081018790526001600160a01b0380871661010083015261012082018690528416610140820152600090612b189061016001604051602081830303815290604052805190602001206132cf565b90506000612b26828561331d565b9050826001600160a01b0316816001600160a01b031614612b895760405162461bcd60e51b815260206004820152601860248201527f496b6173756d693a2077726f6e67207369676e617475726500000000000000006044820152606401610836565b50505050505050505050505050565b6001600160a01b038416612bbe5760405162461bcd60e51b815260040161083690614454565b60008381526002602090815260408083206001600160a01b0389168452909152902054339083811015612c035760405162461bcd60e51b815260040161083690614499565b60008581526002602090815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290612c42908490614645565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612ca2828888888888613339565b50505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000089461415612cfa57507fce1715d831fd500df44b5044b5f03b60c929f36dd3040bc6685811baea7122d790565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f4af8fee1e67bd52025f3878e1433e40b61d2b9a829b018394c63456a75583605828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b90565b60006001600160e01b03198216637965db0b60e01b148061087257506301ffc9a760e01b6001600160e01b0319831614610872565b612de284848484613403565b60005b8351811015610ed657828181518110612e0e57634e487b7160e01b600052603260045260246000fd5b602002602001015160056000868481518110612e3a57634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000828254612e5f9190614645565b90915550612e6e90508161475d565b9050612de5565b6000612eca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661356b9092919063ffffffff16565b805190915015610f045780806020019051810190612ee89190614023565b610f045760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610836565b6001600160a01b0384163b156124b55760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612f8b90899089908890889088906004016142dd565b602060405180830381600087803b158015612fa557600080fd5b505af1925050508015612fd5575060408051601f3d908101601f19168201909252612fd291810190614097565b60015b61308257612fe16147a4565b806308c379a0141561301b5750612ff66147bb565b80613001575061301d565b8060405162461bcd60e51b815260040161083691906143f9565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610836565b6001600160e01b0319811663bc197c8160e01b14612ca25760405162461bcd60e51b81526004016108369061440c565b606060006130c183600261467d565b6130cc906002614645565b6001600160401b038111156130f157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561311b576020820181803683370190505b509050600360fc1b8160008151811061314457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061318157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006131a584600261467d565b6131b0906001614645565b90505b6001811115613244576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106131f257634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061321657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361323d816146df565b90506131b3565b5083156132935760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610836565b9392505050565b6132a684848484613582565b600083815260056020526040812080548492906132c4908490614645565b909155505050505050565b60006108726132dc612cab565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061332c858561363c565b9150915061160d816136ac565b6001600160a01b0384163b156124b55760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061337d908990899088908890889060040161433b565b602060405180830381600087803b15801561339757600080fd5b505af19250505080156133c7575060408051601f3d908101601f191682019092526133c491810190614097565b60015b6133d357612fe16147a4565b6001600160e01b0319811663f23a6e6160e01b14612ca25760405162461bcd60e51b81526004016108369061440c565b6001600160a01b0384166134295760405162461bcd60e51b8152600401610836906145aa565b815183511461344a5760405162461bcd60e51b815260040161083690614518565b3360005b84518110156135035783818151811061347757634e487b7160e01b600052603260045260246000fd5b6020026020010151600260008784815181106134a357634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546134eb9190614645565b909155508190506134fb8161475d565b91505061344e565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516135549291906143cb565b60405180910390a4610ed681600087878787612f47565b606061357a84846000856138ad565b949350505050565b6001600160a01b0384166135a85760405162461bcd60e51b8152600401610836906145aa565b60008381526002602090815260408083206001600160a01b03881684529091528120805433928592916135dc908490614645565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610ed681600087878787613339565b6000808251604114156136735760208301516040840151606085015160001a613667878285856139d5565b945094505050506136a5565b82516040141561369d5760208301516040840151613692868383613ac2565b9350935050506136a5565b506000905060025b9250929050565b60008160048111156136ce57634e487b7160e01b600052602160045260246000fd5b14156136d75750565b60018160048111156136f957634e487b7160e01b600052602160045260246000fd5b14156137475760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610836565b600281600481111561376957634e487b7160e01b600052602160045260246000fd5b14156137b75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610836565b60038160048111156137d957634e487b7160e01b600052602160045260246000fd5b14156138325760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610836565b600481600481111561385457634e487b7160e01b600052602160045260246000fd5b141561187d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610836565b60608247101561390e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610836565b843b61395c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610836565b600080866001600160a01b03168587604051613978919061424c565b60006040518083038185875af1925050503d80600081146139b5576040519150601f19603f3d011682016040523d82523d6000602084013e6139ba565b606091505b50915091506139ca828286613af1565b979650505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613a0c5750600090506003613ab9565b8460ff16601b14158015613a2457508460ff16601c14155b15613a355750600090506004613ab9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a89573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613ab257600060019250925050613ab9565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01613ae3878288856139d5565b935093505050935093915050565b60608315613b00575081613293565b825115613b105782518084602001fd5b8160405162461bcd60e51b815260040161083691906143f9565b600082601f830112613b3a578081fd5b81356020613b4782614622565b604051613b548282614731565b8381528281019150858301600585901b87018401881015613b73578586fd5b855b85811015613b9157813584529284019290840190600101613b75565b5090979650505050505050565b600082601f830112613bae578081fd5b81356001600160401b03811115613bc757613bc761478e565b604051613bde601f8301601f191660200182614731565b818152846020838601011115613bf2578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215613c1d578081fd5b813561329381614844565b60008060408385031215613c3a578081fd5b8235613c4581614844565b91506020830135613c5581614844565b809150509250929050565b600080600080600060a08688031215613c77578081fd5b8535613c8281614844565b94506020860135613c9281614844565b935060408601356001600160401b0380821115613cad578283fd5b613cb989838a01613b2a565b94506060880135915080821115613cce578283fd5b613cda89838a01613b2a565b93506080880135915080821115613cef578283fd5b50613cfc88828901613b9e565b9150509295509295909350565b600080600080600060a08688031215613d20578081fd5b8535613d2b81614844565b94506020860135613d3b81614844565b9350604086013592506060860135915060808601356001600160401b03811115613d63578182fd5b613cfc88828901613b9e565b60008060408385031215613d81578182fd5b8235613d8c81614844565b915060208301356001600160401b03811115613da6578182fd5b613db285828601613b2a565b9150509250929050565b60008060008060808587031215613dd1578384fd5b8435613ddc81614844565b935060208501356001600160401b0380821115613df7578485fd5b613e0388838901613b2a565b94506040870135915080821115613e18578384fd5b613e2488838901613b2a565b93506060870135915080821115613e39578283fd5b50613e4687828801613b9e565b91505092959194509250565b60008060408385031215613e64578182fd5b8235613e6f81614844565b91506020830135613c5581614859565b60008060408385031215613e91578182fd5b8235613e9c81614844565b946020939093013593505050565b60008060008060808587031215613ebf578182fd5b8435613eca81614844565b9350602085013592506040850135915060608501356001600160401b03811115613ef2578182fd5b613e4687828801613b9e565b600080600080600060a08688031215613f15578283fd5b8535613f2081614844565b94506020860135935060408601359250606086013560ff81168114613f43578182fd5b91506080860135613f5381614844565b809150509295509295909350565b60008060408385031215613f73578182fd5b82356001600160401b0380821115613f89578384fd5b818501915085601f830112613f9c578384fd5b81356020613fa982614622565b604051613fb68282614731565b8381528281019150858301600585901b870184018b1015613fd5578889fd5b8896505b84871015614000578035613fec81614844565b835260019690960195918301918301613fd9565b5096505086013592505080821115614016578283fd5b50613db285828601613b2a565b600060208284031215614034578081fd5b815161329381614859565b600060208284031215614050578081fd5b5035919050565b60008060408385031215614069578182fd5b823591506020830135613c5581614844565b60006020828403121561408c578081fd5b813561329381614867565b6000602082840312156140a8578081fd5b815161329381614867565b600080604083850312156140c5578182fd5b50508035926020909101359150565b6000806000606084860312156140e8578081fd5b505081359360208301359350604090920135919050565b60008060008060808587031215614114578182fd5b843593506020850135925060408501359150606085013561413481614844565b939692955090935050565b60008060008060008060008060008060006101608c8e031215614160578889fd5b8b359a5060208c0135995060408c0135985060608c0135975060808c0135965060a08c0135955060c08c0135945060e08c013561419c81614844565b93506101008c013592506101208c01356001600160401b038111156141bf578283fd5b6141cb8e828f01613b9e565b9250506101408c013590509295989b509295989b9093969950565b6000815180845260208085019450808401835b83811015614215578151875295820195908201906001016141f9565b509495945050505050565b600081518084526142388160208601602086016146b3565b601f01601f19169290920160200192915050565b6000825161425e8184602087016146b3565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516142a08160178501602088016146b3565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516142d18160288401602088016146b3565b01602801949350505050565b6001600160a01b0386811682528516602082015260a060408201819052600090614309908301866141e6565b828103606084015261431b81866141e6565b9050828103608084015261432f8185614220565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906139ca90830184614220565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260029082015261060f60f31b60c082015260e00190565b60208152600061329360208301846141e6565b6040815260006143de60408301856141e6565b82810360208401526143f081856141e6565b95945050505050565b6020815260006132936020830184614220565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6020808252602a908201527f4552433131353559757a753a206d7573742068617665206d696e74657220726f6040820152691b19481d1bc81b5a5b9d60b21b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006001600160401b0382111561463b5761463b61478e565b5060051b60200190565b6000821982111561465857614658614778565b500190565b60008261467857634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561469757614697614778565b500290565b6000828210156146ae576146ae614778565b500390565b60005b838110156146ce5781810151838201526020016146b6565b83811115610bf95750506000910152565b6000816146ee576146ee614778565b506000190190565b600181811c9082168061470a57607f821691505b6020821081141561472b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b03811182821017156147565761475661478e565b6040525050565b600060001982141561477157614771614778565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115612d9e57600481823e5160e01c90565b600060443d10156147c95790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156147f857505050505090565b82850191508151818111156148105750505050505090565b843d870101602082850101111561482a5750505050505090565b61483960208286010187614731565b509095945050505050565b6001600160a01b038116811461187d57600080fd5b801515811461187d57600080fd5b6001600160e01b03198116811461187d57600080fdfea264697066735822122086902f370be8e7575fb3254ddff8de920f6ed63e10d4a44738574bae5332fd4564736f6c63430008040033
Loading...
Loading
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.