Overview
ETH Balance
0.0012 ETH
ETH Value
$2.83 (@ $2,362.02/ETH)Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 134,768 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Mint NFT Claim | 250390481 | 7 days ago | IN | 0.0004 ETH | 0.00000326 | ||||
Mint NFT Claim | 250385604 | 7 days ago | IN | 0.0002 ETH | 0.0000049 | ||||
Mint NFT Claim | 250385554 | 7 days ago | IN | 0.0002 ETH | 0.00000501 | ||||
Mint NFT Claim | 250384857 | 7 days ago | IN | 0.0006 ETH | 0.00000778 | ||||
Mint NFT Claim | 250383952 | 7 days ago | IN | 0.0002 ETH | 0.00000946 | ||||
Mint NFT Claim | 250383500 | 7 days ago | IN | 0.0006 ETH | 0.00001015 | ||||
Mint NFT Claim | 250383458 | 7 days ago | IN | 0.0004 ETH | 0.00001047 | ||||
Mint NFT Claim | 250383442 | 7 days ago | IN | 0.0003 ETH | 0.00001055 | ||||
Mint NFT Claim | 250383383 | 7 days ago | IN | 0.0003 ETH | 0.00001077 | ||||
Mint NFT Claim | 250383354 | 7 days ago | IN | 0.0002 ETH | 0.00001044 | ||||
Mint NFT Claim | 250383180 | 7 days ago | IN | 0.0002 ETH | 0.00000809 | ||||
Mint NFT Claim | 250383138 | 7 days ago | IN | 0.0003 ETH | 0.00000792 | ||||
Mint NFT Claim | 250383136 | 7 days ago | IN | 0.0006 ETH | 0.00000796 | ||||
Mint NFT Claim | 250383018 | 7 days ago | IN | 0.0002 ETH | 0.00000691 | ||||
Mint NFT Claim | 250383008 | 7 days ago | IN | 0.0002 ETH | 0.00000692 | ||||
Mint NFT Claim | 250382993 | 7 days ago | IN | 0.0002 ETH | 0.00000693 | ||||
Mint NFT Claim | 250382926 | 7 days ago | IN | 0.0003 ETH | 0.00000682 | ||||
Mint NFT Claim | 250382920 | 7 days ago | IN | 0.0006 ETH | 0.0000068 | ||||
Mint NFT Claim | 250382867 | 7 days ago | IN | 0.0005 ETH | 0.00000665 | ||||
Mint NFT Claim | 250382859 | 7 days ago | IN | 0.0002 ETH | 0.00000661 | ||||
Mint NFT Claim | 250382737 | 7 days ago | IN | 0.0005 ETH | 0.00000475 | ||||
Mint NFT Claim | 250382609 | 7 days ago | IN | 0.0004 ETH | 0.00000415 | ||||
Mint NFT Claim | 250382419 | 7 days ago | IN | 0.0002 ETH | 0.00000436 | ||||
Mint NFT Claim | 250382233 | 7 days ago | IN | 0.0002 ETH | 0.00000355 | ||||
Mint NFT Claim | 250382130 | 7 days ago | IN | 0.0004 ETH | 0.0000034 |
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
250390481 | 7 days ago | 0.0004 ETH | ||||
250385604 | 7 days ago | 0.0002 ETH | ||||
250385554 | 7 days ago | 0.0002 ETH | ||||
250384857 | 7 days ago | 0.0006 ETH | ||||
250383952 | 7 days ago | 0.0002 ETH | ||||
250383500 | 7 days ago | 0.0006 ETH | ||||
250383458 | 7 days ago | 0.0004 ETH | ||||
250383442 | 7 days ago | 0.0003 ETH | ||||
250383383 | 7 days ago | 0.0003 ETH | ||||
250383354 | 7 days ago | 0.0002 ETH | ||||
250383180 | 7 days ago | 0.0002 ETH | ||||
250383138 | 7 days ago | 0.0003 ETH | ||||
250383136 | 7 days ago | 0.0006 ETH | ||||
250383018 | 7 days ago | 0.0002 ETH | ||||
250383008 | 7 days ago | 0.0002 ETH | ||||
250382993 | 7 days ago | 0.0002 ETH | ||||
250382926 | 7 days ago | 0.0003 ETH | ||||
250382920 | 7 days ago | 0.0006 ETH | ||||
250382867 | 7 days ago | 0.0005 ETH | ||||
250382859 | 7 days ago | 0.0002 ETH | ||||
250382737 | 7 days ago | 0.0005 ETH | ||||
250382609 | 7 days ago | 0.0004 ETH | ||||
250382419 | 7 days ago | 0.0002 ETH | ||||
250382233 | 7 days ago | 0.0002 ETH | ||||
250382130 | 7 days ago | 0.0004 ETH |
Loading...
Loading
Contract Name:
MintWithClaim
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // _____ .__ // / \ ___________ ____ | | ____ // / \ / \_/ __ \_ __ \_/ ___\| | _/ __ \ // / Y \ ___/| | \/\ \___| |_\ ___/ // \____|__ /\___ >__| \___ >____/\___ > // \/ \/ \/ \/ pragma solidity ^0.8.9; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; interface IErc721AccessControl { function CLAIM_ISSUER_ROLE() external view returns (bytes32); function hasRole( bytes32 role, address account ) external view returns (bool); function ownerOf(uint256 tokenId) external view returns (address); function mintNFT( address recipient, string memory tokenUri ) external returns (uint256); } contract MintWithClaim is AccessControl { struct Domain { string name; string version; address verifyingContract; uint256 chainId; } struct AttestClaim { address to; address from; string tokenUri; uint256 timestamp; uint256 fee; } bytes32 private constant DOMAIN_HASH = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); bytes32 private constant ATTESTED_HASH = keccak256( "AttestClaim(address to,address from,string tokenUri,uint256 timestamp,uint256 fee)" ); mapping(bytes32 => bool) isClaimUsed; address public treasury; constructor(address _treasury) { treasury = _treasury; _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); } function mintNFTClaim( Domain calldata domain, AttestClaim calldata message, bytes memory sign ) external payable returns (uint256) { require(verifyClaim(domain, message, sign) == true, "not allowed"); require(msg.value == message.fee, "fee required"); bool sent = payable(treasury).send(msg.value); require(sent, "fee failed"); IErc721AccessControl nft = IErc721AccessControl( domain.verifyingContract ); uint256 tokenId = nft.mintNFT(message.to, message.tokenUri); isClaimUsed[keccak256(abi.encodePacked(sign))] = true; return tokenId; } function verifyClaim( Domain calldata domain, AttestClaim calldata message, bytes memory sign ) public view returns (bool) { // verify token owner IErc721AccessControl nft = IErc721AccessControl( domain.verifyingContract ); bool isDuplicate = isClaimUsed[keccak256(abi.encodePacked(sign))] == true; bool isFromSender = message.to == msg.sender; // verify claim signature bytes32 digest = hashTypedDataV4(domain, message); address issuerAddress = ECDSA.recover(digest, sign); bool isSignValid = issuerAddress == message.from; // verify issuer role bool issuerHasRole = nft.hasRole( nft.CLAIM_ISSUER_ROLE(), issuerAddress ); return isSignValid && issuerHasRole && isFromSender && !isDuplicate; } function hashTypedDataV4( Domain calldata domain, AttestClaim calldata message ) internal view returns (bytes32) { return ECDSA.toTypedDataHash( keccak256( abi.encode( DOMAIN_HASH, keccak256(abi.encodePacked(domain.name)), keccak256(abi.encodePacked(domain.version)), block.chainid, address(domain.verifyingContract) ) ), _keccak256AttestClaim(message) ); } function _keccak256AttestClaim( AttestClaim calldata message ) internal pure returns (bytes32) { return keccak256( abi.encode( /** * Make sure to match order of variables as in the types array used with ethers.js */ ATTESTED_HASH, message.to, message.from, keccak256(abi.encodePacked(message.tokenUri)), message.timestamp, message.fee ) ); } function setTreasury(address _treasury) public { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "not allowed"); treasury = _treasury; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * 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}: * * ```solidity * 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. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } 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"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"uint256","name":"chainId","type":"uint256"}],"internalType":"struct MintWithClaim.Domain","name":"domain","type":"tuple"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"string","name":"tokenUri","type":"string"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"internalType":"struct MintWithClaim.AttestClaim","name":"message","type":"tuple"},{"internalType":"bytes","name":"sign","type":"bytes"}],"name":"mintNFTClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","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":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"uint256","name":"chainId","type":"uint256"}],"internalType":"struct MintWithClaim.Domain","name":"domain","type":"tuple"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"string","name":"tokenUri","type":"string"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"internalType":"struct MintWithClaim.AttestClaim","name":"message","type":"tuple"},{"internalType":"bytes","name":"sign","type":"bytes"}],"name":"verifyClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051620014633803806200146383398101604081905261003191610109565b600280546001600160a01b0319166001600160a01b03831617905561005760003361005d565b50610139565b610067828261006b565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610067576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556100c53390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006020828403121561011b57600080fd5b81516001600160a01b038116811461013257600080fd5b9392505050565b61131a80620001496000396000f3fe60806040526004361061009c5760003560e01c806391d148541161006457806391d148541461018e578063a217fddf146101ae578063ab49cd56146101c3578063d547741f146101d6578063f0f44260146101f6578063f13c7db71461021657600080fd5b806301ffc9a7146100a1578063248a9ca3146100d65780632f2ff15d1461011457806336568abe1461013657806361d027b314610156575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610ee1565b610236565b60405190151581526020015b60405180910390f35b3480156100e257600080fd5b506101066100f1366004610f0b565b60009081526020819052604090206001015490565b6040519081526020016100cd565b34801561012057600080fd5b5061013461012f366004610f40565b61026d565b005b34801561014257600080fd5b50610134610151366004610f40565b610297565b34801561016257600080fd5b50600254610176906001600160a01b031681565b6040516001600160a01b0390911681526020016100cd565b34801561019a57600080fd5b506100c16101a9366004610f40565b61031a565b3480156101ba57600080fd5b50610106600081565b6101066101d1366004610f82565b610343565b3480156101e257600080fd5b506101346101f1366004610f40565b61052b565b34801561020257600080fd5b5061013461021136600461108c565b610550565b34801561022257600080fd5b506100c1610231366004610f82565b6105b7565b60006001600160e01b03198216637965db0b60e01b148061026757506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008281526020819052604090206001015461028881610785565b6102928383610792565b505050565b6001600160a01b038116331461030c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6103168282610816565b5050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006103508484846105b7565b151560011461038f5760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b6044820152606401610303565b826080013534146103d15760405162461bcd60e51b815260206004820152600c60248201526b199959481c995c5d5a5c995960a21b6044820152606401610303565b6002546040516000916001600160a01b0316903480156108fc029184818181858888f193505050509050806104355760405162461bcd60e51b815260206004820152600a6024820152691999594819985a5b195960b21b6044820152606401610303565b6000610447606087016040880161108c565b905060006001600160a01b03821663eacabe14610467602089018961108c565b61047460408a018a6110a7565b6040518463ffffffff1660e01b8152600401610492939291906110ee565b6020604051808303816000875af11580156104b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d5919061112e565b90506001806000876040516020016104ed919061116b565b60408051808303601f19018152918152815160209283012083529082019290925201600020805460ff19169115159190911790559695505050505050565b60008281526020819052604090206001015461054681610785565b6102928383610816565b61055b60003361031a565b6105955760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b6044820152606401610303565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000806105ca606086016040870161108c565b9050600060016000856040516020016105e3919061116b565b60408051601f198184030181529181528151602092830120835282820193909352910160009081205460ff16151560011492509033906106259088018861108c565b6001600160a01b0316149050600061063d888861087b565b9050600061064b8288610992565b9050600061065f60408a0160208b0161108c565b6001600160a01b0316826001600160a01b03161490506000866001600160a01b03166391d14854886001600160a01b031663a044e70f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e8919061112e565b6040516001600160e01b031960e084901b16815260048101919091526001600160a01b0386166024820152604401602060405180830381865afa158015610733573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107579190611187565b90508180156107635750805b801561076c5750845b8015610776575085155b9b9a5050505050505050505050565b61078f81336109b6565b50565b61079c828261031a565b610316576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556107d23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610820828261031a565b15610316576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061098b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6108ab85806110a7565b6040516020016108bc9291906111a9565b604051602081830303815290604052805190602001208580602001906108e291906110a7565b6040516020016108f39291906111a9565b604051602081830303815290604052805190602001204687604001602081019061091d919061108c565b604080516020810196909652850193909352606084019190915260808301526001600160a01b031660a082015260c0016040516020818303038152906040528051906020012061096c84610a0f565b60405161190160f01b8152600281019290925260228201526042902090565b9392505050565b60008060006109a18585610ae0565b915091506109ae81610b25565b509392505050565b6109c0828261031a565b610316576109cd81610c6f565b6109d8836020610c81565b6040516020016109e99291906111b9565b60408051601f198184030181529082905262461bcd60e51b82526103039160040161122e565b60007f673a4e6708f72fd90c94e70de2c98a45180b5871fa5a8a8cae68034db9f2c68d610a3f602084018461108c565b610a4f604085016020860161108c565b610a5c60408601866110a7565b604051602001610a6d9291906111a9565b60408051601f198184030181528282528051602091820120908301959095526001600160a01b0393841690820152911660608083019190915260808083019390935284013560a08201529083013560c082015260e001604051602081830303815290604052805190602001209050919050565b6000808251604103610b165760208301516040840151606085015160001a610b0a87828585610e1d565b94509450505050610b1e565b506000905060025b9250929050565b6000816004811115610b3957610b39611261565b03610b415750565b6001816004811115610b5557610b55611261565b03610ba25760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610303565b6002816004811115610bb657610bb6611261565b03610c035760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610303565b6003816004811115610c1757610c17611261565b0361078f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610303565b60606102676001600160a01b03831660145b60606000610c9083600261128d565b610c9b9060026112a4565b67ffffffffffffffff811115610cb357610cb3610f6c565b6040519080825280601f01601f191660200182016040528015610cdd576020820181803683370190505b509050600360fc1b81600081518110610cf857610cf86112b7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610d2757610d276112b7565b60200101906001600160f81b031916908160001a9053506000610d4b84600261128d565b610d569060016112a4565b90505b6001811115610dce576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610d8a57610d8a6112b7565b1a60f81b828281518110610da057610da06112b7565b60200101906001600160f81b031916908160001a90535060049490941c93610dc7816112cd565b9050610d59565b50831561098b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610303565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610e545750600090506003610ed8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610ea8573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ed157600060019250925050610ed8565b9150600090505b94509492505050565b600060208284031215610ef357600080fd5b81356001600160e01b03198116811461098b57600080fd5b600060208284031215610f1d57600080fd5b5035919050565b80356001600160a01b0381168114610f3b57600080fd5b919050565b60008060408385031215610f5357600080fd5b82359150610f6360208401610f24565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610f9757600080fd5b833567ffffffffffffffff80821115610faf57600080fd5b9085019060808288031215610fc357600080fd5b90935060208501359080821115610fd957600080fd5b9085019060a08288031215610fed57600080fd5b9092506040850135908082111561100357600080fd5b818601915086601f83011261101757600080fd5b81358181111561102957611029610f6c565b604051601f8201601f19908116603f0116810190838211818310171561105157611051610f6c565b8160405282815289602084870101111561106a57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561109e57600080fd5b61098b82610f24565b6000808335601e198436030181126110be57600080fd5b83018035915067ffffffffffffffff8211156110d957600080fd5b602001915036819003821315610b1e57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60006020828403121561114057600080fd5b5051919050565b60005b8381101561116257818101518382015260200161114a565b50506000910152565b6000825161117d818460208701611147565b9190910192915050565b60006020828403121561119957600080fd5b8151801515811461098b57600080fd5b8183823760009101908152919050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516111f1816017850160208801611147565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611222816028840160208801611147565b01602801949350505050565b602081526000825180602084015261124d816040850160208701611147565b601f01601f19169190910160400192915050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761026757610267611277565b8082018082111561026757610267611277565b634e487b7160e01b600052603260045260246000fd5b6000816112dc576112dc611277565b50600019019056fea26469706673582212202551798bfbaca8151aa85b28350aff9a0799316339b4778a6d7adab6a90a55a964736f6c63430008110033000000000000000000000000c5d5846b013d7929dac053d4030b00047a14dde3
Deployed Bytecode
0x60806040526004361061009c5760003560e01c806391d148541161006457806391d148541461018e578063a217fddf146101ae578063ab49cd56146101c3578063d547741f146101d6578063f0f44260146101f6578063f13c7db71461021657600080fd5b806301ffc9a7146100a1578063248a9ca3146100d65780632f2ff15d1461011457806336568abe1461013657806361d027b314610156575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610ee1565b610236565b60405190151581526020015b60405180910390f35b3480156100e257600080fd5b506101066100f1366004610f0b565b60009081526020819052604090206001015490565b6040519081526020016100cd565b34801561012057600080fd5b5061013461012f366004610f40565b61026d565b005b34801561014257600080fd5b50610134610151366004610f40565b610297565b34801561016257600080fd5b50600254610176906001600160a01b031681565b6040516001600160a01b0390911681526020016100cd565b34801561019a57600080fd5b506100c16101a9366004610f40565b61031a565b3480156101ba57600080fd5b50610106600081565b6101066101d1366004610f82565b610343565b3480156101e257600080fd5b506101346101f1366004610f40565b61052b565b34801561020257600080fd5b5061013461021136600461108c565b610550565b34801561022257600080fd5b506100c1610231366004610f82565b6105b7565b60006001600160e01b03198216637965db0b60e01b148061026757506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008281526020819052604090206001015461028881610785565b6102928383610792565b505050565b6001600160a01b038116331461030c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6103168282610816565b5050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006103508484846105b7565b151560011461038f5760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b6044820152606401610303565b826080013534146103d15760405162461bcd60e51b815260206004820152600c60248201526b199959481c995c5d5a5c995960a21b6044820152606401610303565b6002546040516000916001600160a01b0316903480156108fc029184818181858888f193505050509050806104355760405162461bcd60e51b815260206004820152600a6024820152691999594819985a5b195960b21b6044820152606401610303565b6000610447606087016040880161108c565b905060006001600160a01b03821663eacabe14610467602089018961108c565b61047460408a018a6110a7565b6040518463ffffffff1660e01b8152600401610492939291906110ee565b6020604051808303816000875af11580156104b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d5919061112e565b90506001806000876040516020016104ed919061116b565b60408051808303601f19018152918152815160209283012083529082019290925201600020805460ff19169115159190911790559695505050505050565b60008281526020819052604090206001015461054681610785565b6102928383610816565b61055b60003361031a565b6105955760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b6044820152606401610303565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000806105ca606086016040870161108c565b9050600060016000856040516020016105e3919061116b565b60408051601f198184030181529181528151602092830120835282820193909352910160009081205460ff16151560011492509033906106259088018861108c565b6001600160a01b0316149050600061063d888861087b565b9050600061064b8288610992565b9050600061065f60408a0160208b0161108c565b6001600160a01b0316826001600160a01b03161490506000866001600160a01b03166391d14854886001600160a01b031663a044e70f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e8919061112e565b6040516001600160e01b031960e084901b16815260048101919091526001600160a01b0386166024820152604401602060405180830381865afa158015610733573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107579190611187565b90508180156107635750805b801561076c5750845b8015610776575085155b9b9a5050505050505050505050565b61078f81336109b6565b50565b61079c828261031a565b610316576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556107d23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610820828261031a565b15610316576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061098b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6108ab85806110a7565b6040516020016108bc9291906111a9565b604051602081830303815290604052805190602001208580602001906108e291906110a7565b6040516020016108f39291906111a9565b604051602081830303815290604052805190602001204687604001602081019061091d919061108c565b604080516020810196909652850193909352606084019190915260808301526001600160a01b031660a082015260c0016040516020818303038152906040528051906020012061096c84610a0f565b60405161190160f01b8152600281019290925260228201526042902090565b9392505050565b60008060006109a18585610ae0565b915091506109ae81610b25565b509392505050565b6109c0828261031a565b610316576109cd81610c6f565b6109d8836020610c81565b6040516020016109e99291906111b9565b60408051601f198184030181529082905262461bcd60e51b82526103039160040161122e565b60007f673a4e6708f72fd90c94e70de2c98a45180b5871fa5a8a8cae68034db9f2c68d610a3f602084018461108c565b610a4f604085016020860161108c565b610a5c60408601866110a7565b604051602001610a6d9291906111a9565b60408051601f198184030181528282528051602091820120908301959095526001600160a01b0393841690820152911660608083019190915260808083019390935284013560a08201529083013560c082015260e001604051602081830303815290604052805190602001209050919050565b6000808251604103610b165760208301516040840151606085015160001a610b0a87828585610e1d565b94509450505050610b1e565b506000905060025b9250929050565b6000816004811115610b3957610b39611261565b03610b415750565b6001816004811115610b5557610b55611261565b03610ba25760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610303565b6002816004811115610bb657610bb6611261565b03610c035760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610303565b6003816004811115610c1757610c17611261565b0361078f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610303565b60606102676001600160a01b03831660145b60606000610c9083600261128d565b610c9b9060026112a4565b67ffffffffffffffff811115610cb357610cb3610f6c565b6040519080825280601f01601f191660200182016040528015610cdd576020820181803683370190505b509050600360fc1b81600081518110610cf857610cf86112b7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610d2757610d276112b7565b60200101906001600160f81b031916908160001a9053506000610d4b84600261128d565b610d569060016112a4565b90505b6001811115610dce576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610d8a57610d8a6112b7565b1a60f81b828281518110610da057610da06112b7565b60200101906001600160f81b031916908160001a90535060049490941c93610dc7816112cd565b9050610d59565b50831561098b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610303565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610e545750600090506003610ed8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610ea8573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ed157600060019250925050610ed8565b9150600090505b94509492505050565b600060208284031215610ef357600080fd5b81356001600160e01b03198116811461098b57600080fd5b600060208284031215610f1d57600080fd5b5035919050565b80356001600160a01b0381168114610f3b57600080fd5b919050565b60008060408385031215610f5357600080fd5b82359150610f6360208401610f24565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610f9757600080fd5b833567ffffffffffffffff80821115610faf57600080fd5b9085019060808288031215610fc357600080fd5b90935060208501359080821115610fd957600080fd5b9085019060a08288031215610fed57600080fd5b9092506040850135908082111561100357600080fd5b818601915086601f83011261101757600080fd5b81358181111561102957611029610f6c565b604051601f8201601f19908116603f0116810190838211818310171561105157611051610f6c565b8160405282815289602084870101111561106a57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561109e57600080fd5b61098b82610f24565b6000808335601e198436030181126110be57600080fd5b83018035915067ffffffffffffffff8211156110d957600080fd5b602001915036819003821315610b1e57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60006020828403121561114057600080fd5b5051919050565b60005b8381101561116257818101518382015260200161114a565b50506000910152565b6000825161117d818460208701611147565b9190910192915050565b60006020828403121561119957600080fd5b8151801515811461098b57600080fd5b8183823760009101908152919050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516111f1816017850160208801611147565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611222816028840160208801611147565b01602801949350505050565b602081526000825180602084015261124d816040850160208701611147565b601f01601f19169190910160400192915050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761026757610267611277565b8082018082111561026757610267611277565b634e487b7160e01b600052603260045260246000fd5b6000816112dc576112dc611277565b50600019019056fea26469706673582212202551798bfbaca8151aa85b28350aff9a0799316339b4778a6d7adab6a90a55a964736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c5d5846b013d7929dac053d4030b00047a14dde3
-----Decoded View---------------
Arg [0] : _treasury (address): 0xC5d5846b013D7929dAC053d4030b00047A14DDE3
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000c5d5846b013d7929dac053d4030b00047a14dde3
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ZKSYNC | 45.80% | $2,361.74 | 0.0343 | $81.01 | |
ETH | 30.60% | $2,363.19 | 0.0229 | $54.12 | |
BLAST | 12.11% | $2,362.93 | 0.00906207 | $21.41 | |
TAIKO | 4.94% | $2,363.19 | 0.0037 | $8.74 | |
BSC | 2.06% | $543.88 | 0.0067 | $3.64 | |
ARB | Ether (ETH) | 1.59% | $2,343.31 | 0.0012 | $2.81 |
OPBNB | 1.29% | $543.79 | 0.0042 | $2.28 | |
KROMA | 1.20% | $2,363.62 | 0.0009 | $2.13 | |
OP | 0.40% | $2,363.17 | 0.0003 | $0.708951 | |
POL | <0.01% | $0.404377 | 0.0406 | $0.016418 | |
CELO | <0.01% | $0.443175 | 0.0011 | $0.000487 | |
GLMR | <0.01% | $0.166124 | 0.0002 | $0.000033 |
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.