Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 42 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Gen Token | 17482894 | 498 days ago | IN | 0.069 ETH | 0.00482673 | ||||
Gen Token | 17482835 | 498 days ago | IN | 0.069 ETH | 0.00507767 | ||||
Gen Token | 17482832 | 498 days ago | IN | 0.069 ETH | 0.0050108 | ||||
Gen Token | 17482832 | 498 days ago | IN | 0.069 ETH | 0.00501184 | ||||
Gen Token | 17482829 | 498 days ago | IN | 0.069 ETH | 0.00522857 | ||||
Gen Token | 17482776 | 498 days ago | IN | 0.069 ETH | 0.00496269 | ||||
Gen Token | 17482771 | 498 days ago | IN | 0.069 ETH | 0.00043451 | ||||
Gen Token | 17482734 | 498 days ago | IN | 0.069 ETH | 0.00484958 | ||||
Gen Token | 17482714 | 498 days ago | IN | 0.069 ETH | 0.00541586 | ||||
Gen Token | 17482707 | 498 days ago | IN | 0.069 ETH | 0.00479312 | ||||
Gen Token | 17482704 | 498 days ago | IN | 0.069 ETH | 0.00045937 | ||||
Gen Token | 17482585 | 498 days ago | IN | 0.069 ETH | 0.00046312 | ||||
Gen Token | 17482569 | 498 days ago | IN | 0.069 ETH | 0.00459119 | ||||
Gen Token | 17482557 | 498 days ago | IN | 0.069 ETH | 0.00457548 | ||||
Gen Token | 17482553 | 498 days ago | IN | 0.069 ETH | 0.00474941 | ||||
Gen Token | 17482535 | 498 days ago | IN | 0.069 ETH | 0.00463653 | ||||
Gen Token | 17482524 | 498 days ago | IN | 0.069 ETH | 0.00538537 | ||||
Gen Token | 17482502 | 498 days ago | IN | 0.069 ETH | 0.00501959 | ||||
Gen Token | 17482463 | 498 days ago | IN | 0.069 ETH | 0.00505617 | ||||
Gen Token | 17482422 | 498 days ago | IN | 0.069 ETH | 0.00508924 | ||||
Gen Token | 17482392 | 498 days ago | IN | 0.069 ETH | 0.0057865 | ||||
Gen Token | 17482377 | 498 days ago | IN | 0.069 ETH | 0.00684742 | ||||
Gen Token | 17482369 | 498 days ago | IN | 0.069 ETH | 0.00644043 | ||||
Gen Token | 17482361 | 498 days ago | IN | 0.069 ETH | 0.00460562 | ||||
Gen Token | 17482358 | 498 days ago | IN | 0.069 ETH | 0.00042998 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
17482894 | 498 days ago | 0.069 ETH | ||||
17482835 | 498 days ago | 0.069 ETH | ||||
17482832 | 498 days ago | 0.069 ETH | ||||
17482832 | 498 days ago | 0.069 ETH | ||||
17482829 | 498 days ago | 0.069 ETH | ||||
17482776 | 498 days ago | 0.069 ETH | ||||
17482734 | 498 days ago | 0.069 ETH | ||||
17482714 | 498 days ago | 0.069 ETH | ||||
17482707 | 498 days ago | 0.069 ETH | ||||
17482569 | 498 days ago | 0.069 ETH | ||||
17482557 | 498 days ago | 0.069 ETH | ||||
17482553 | 498 days ago | 0.069 ETH | ||||
17482535 | 498 days ago | 0.069 ETH | ||||
17482524 | 498 days ago | 0.069 ETH | ||||
17482502 | 498 days ago | 0.069 ETH | ||||
17482463 | 498 days ago | 0.069 ETH | ||||
17482422 | 498 days ago | 0.069 ETH | ||||
17482392 | 498 days ago | 0.069 ETH | ||||
17482377 | 498 days ago | 0.069 ETH | ||||
17482369 | 498 days ago | 0.069 ETH | ||||
17482361 | 498 days ago | 0.069 ETH | ||||
17482355 | 498 days ago | 0.069 ETH | ||||
17482352 | 498 days ago | 0.069 ETH | ||||
17482348 | 498 days ago | 0.069 ETH | ||||
17482299 | 498 days ago | 0.069 ETH |
Loading...
Loading
Contract Name:
CSKGen
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: CODESEKAI pragma solidity =0.8.19; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; interface INFTCORE { enum MintType { Whitelist, Waitlist, Mint } function mint( address _userAddr, string calldata metadata, MintType _mintType ) external; } contract CSKGen is EIP712, AccessControl, ReentrancyGuard { INFTCORE public nftCore; address payable public adminWallet; address public signWallet; uint256 public constant MAXIMUM_MINT_PRICE = 0.08 ether; uint256 public MINT_PRICE = 0.08 ether; uint256 public WHITELIST_PRICE = 0.069 ether; uint256 public WAITLIST_PRICE = 0.069 ether; struct MintAmount { uint8 WlRound; uint8 PbRound; } struct MintInfo { address minter; uint256 timestamp; uint256 mintType; uint256 metadata; uint256 nonce; bytes signature; } enum MintType { Whitelist, Waitlist, Mint } enum Whitelist { Add, Remove } event SetNftCore( address indexed prevNftCore, address indexed newNftCore ); event SetAdminWallet( address indexed prevAdminWallet, address indexed adminWallet ); event SetSignWallet( address indexed prevSignWallet, address indexed signWallet ); event SetPrice( uint256 indexed mintType, uint256 indexed prevPrice, uint256 indexed newPrice ); event SetWhitelist( uint256 indexed mintType, address[] indexed _userAddresses ); event GenToken( address indexed minter, uint256 indexed mintType, uint256 indexed metadata ); event SetTimelock( address indexed prevTimelockAddress, address indexed newTimeLockAddress ); /// @dev why you are reading this line ? string public constant SIGNING_DOMAIN = "CODESEKAI"; string public constant SIGNATURE_VERSION = "1"; bytes32 public constant TIMELOCK_DEV_ROLE = keccak256("TIMELOCK_DEV_ROLE"); address public timelockAddress; constructor( address _nftCore, address payable _adminWallet, address _signWallet, address _timelockAddress ) EIP712(SIGNING_DOMAIN, SIGNATURE_VERSION) { require(_nftCore != address(0), "Invalid _nftCore address"); require(_adminWallet != address(0), "Invalid _adminWallet address"); require(_signWallet != address(0), "Invalid _signWallet address"); require(_timelockAddress != address(0), "Invalid address"); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(TIMELOCK_DEV_ROLE, _timelockAddress); nftCore = INFTCORE(_nftCore); adminWallet = _adminWallet; signWallet = _signWallet; timelockAddress = _timelockAddress; } mapping(MintType => mapping(address => bool)) public wlLists; mapping(address => MintAmount) public mintTotalCount; mapping(address => uint256) public genTokenNonces; function getTotalMinted() public view returns (uint8, uint8) { return ( mintTotalCount[msg.sender].WlRound, mintTotalCount[msg.sender].PbRound ); } function setNftCore( address _newNftCore ) public onlyRole(TIMELOCK_DEV_ROLE) { require(_newNftCore != address(0), "Invalid _newNftCore address"); address prevNftCore = address(nftCore); nftCore = INFTCORE(_newNftCore); emit SetNftCore(prevNftCore, _newNftCore); } function setSignWallet( address _newSignWallet ) public onlyRole(TIMELOCK_DEV_ROLE) { require(_newSignWallet != address(0), "Invalid _newSignWallet address"); address prevSignWallet = signWallet; signWallet = _newSignWallet; emit SetSignWallet(prevSignWallet, _newSignWallet); } function setPrice( MintType _mintType, uint256 newPrice ) public onlyRole(TIMELOCK_DEV_ROLE) { require( newPrice <= MAXIMUM_MINT_PRICE, "New mint price exceeds the maximum allowed value" ); uint256 prevPrice; if (_mintType == MintType.Mint) { require( newPrice > WAITLIST_PRICE, "MINT_PRICE must be greater than WAITLIST_PRICE" ); prevPrice = MINT_PRICE; MINT_PRICE = newPrice; } else if (_mintType == MintType.Whitelist) { require( newPrice <= WAITLIST_PRICE, "WHITELIST_PRICE must be less than or equal to WAITLIST_PRICE" ); prevPrice = WHITELIST_PRICE; WHITELIST_PRICE = newPrice; } else if (_mintType == MintType.Waitlist) { require( newPrice >= WHITELIST_PRICE && newPrice < MINT_PRICE, "WAITLIST_PRICE must be between WHITELIST_PRICE and MINT_PRICE" ); prevPrice = WAITLIST_PRICE; WAITLIST_PRICE = newPrice; } emit SetPrice(uint256(_mintType), prevPrice, newPrice); } function checkWl( MintType wlTier, address _address ) public view returns (bool) { return wlLists[wlTier][_address]; } //@dev call this to set wlLists before start function setWhitelists( MintType wlType, address[] memory _userAddresses, Whitelist _doType ) public onlyRole(TIMELOCK_DEV_ROLE) { if (_doType == Whitelist.Add) { for (uint32 i = 0; i < _userAddresses.length; i++) { if (!wlLists[wlType][_userAddresses[i]]) { wlLists[wlType][_userAddresses[i]] = true; } } } else if (_doType == Whitelist.Remove) { for (uint32 i = 0; i < _userAddresses.length; i++) { if (wlLists[wlType][_userAddresses[i]]) { wlLists[wlType][_userAddresses[i]] = false; } } } emit SetWhitelist(uint256(wlType), _userAddresses); } function loopGenToken(MintType _mintType, uint256 metadata) internal { string memory results = Strings.toString(metadata); if (_mintType == MintType.Mint) { mintTotalCount[msg.sender].PbRound += 1; nftCore.mint(msg.sender, results, INFTCORE.MintType.Mint); } else if (_mintType == MintType.Whitelist) { mintTotalCount[msg.sender].WlRound += 1; nftCore.mint(msg.sender, results, INFTCORE.MintType.Whitelist); } else if (_mintType == MintType.Waitlist) { mintTotalCount[msg.sender].WlRound += 1; nftCore.mint(msg.sender, results, INFTCORE.MintType.Waitlist); } } function _hash(MintInfo memory info) internal view returns (bytes32) { return _hashTypedDataV4( keccak256( abi.encode( keccak256( "MintInfo(address minter,uint256 timestamp,uint256 mintType,uint256 metadata,uint256 nonce)" ), info.minter, info.timestamp, info.mintType, info.metadata, info.nonce ) ) ); } function _verify(MintInfo memory info) internal view returns (address) { bytes32 digest = _hash(info); return ECDSA.recover(digest, info.signature); } function getTime() external view returns (uint256) { return block.timestamp; } function genToken(MintInfo calldata info) external payable nonReentrant { uint256 ethAmount; MintType mintType; require(block.timestamp <= info.timestamp + 30 seconds, "Times out"); require(info.minter == msg.sender, "not minter"); address signer = _verify(info); require(signer == signWallet, "not signed"); require(info.nonce >= genTokenNonces[msg.sender]++, "Invalid nonce"); if (info.mintType == 0) { require(mintTotalCount[msg.sender].WlRound == 0, "Wl Minted"); ethAmount = WHITELIST_PRICE; mintType = MintType.Whitelist; } else if (info.mintType == 1) { require(mintTotalCount[msg.sender].WlRound == 0, "Wl Minted"); ethAmount = WAITLIST_PRICE; mintType = MintType.Waitlist; } else if (info.mintType == 2) { require(mintTotalCount[msg.sender].PbRound == 0, "Pb Minted"); ethAmount = MINT_PRICE; mintType = MintType.Mint; } else { revert("Incorrect Minting Type: Out Of Range"); } require(msg.value == ethAmount, "Invalid Amount"); (bool sent, ) = adminWallet.call{value: msg.value}(""); require(sent, "Failed to send Ether"); loopGenToken(mintType, info.metadata); emit GenToken(info.minter, info.mintType, info.metadata); } function grantRole( bytes32 role, address account ) public virtual override(AccessControl) onlyRole(TIMELOCK_DEV_ROLE) { _grantRole(role, account); } function renounceRole( bytes32 role, address account ) public virtual override(AccessControl) { require( !(hasRole(DEFAULT_ADMIN_ROLE, account)), "AccessControl: cannot renounce the DEFAULT_ADMIN_ROLE account" ); super.renounceRole(role, account); } function revokeRole( bytes32 role, address account ) public virtual override(AccessControl) onlyRole(TIMELOCK_DEV_ROLE) { _revokeRole(role, account); } function setAdminWallet( address payable _adminWallet ) public onlyRole(DEFAULT_ADMIN_ROLE) { require(_adminWallet != address(0), "Invalid address"); address prevAdminWallet = adminWallet; adminWallet = _adminWallet; emit SetAdminWallet(prevAdminWallet, adminWallet); } function setTimelock( address newTimelockAddress ) external onlyRole(TIMELOCK_DEV_ROLE) { require( newTimelockAddress != address(0), "Invalid newTimelockAddress address" ); address prevTimelockAddress = timelockAddress; timelockAddress = newTimelockAddress; _revokeRole(TIMELOCK_DEV_ROLE, prevTimelockAddress); _grantRole(TIMELOCK_DEV_ROLE, newTimelockAddress); emit SetTimelock(prevTimelockAddress, newTimelockAddress); } }
// 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 (last updated v4.9.0) (interfaces/IERC5267.sol) pragma solidity ^0.8.0; interface IERC5267 { /** * @dev MAY be emitted to signal that the domain could have changed. */ event EIP712DomainChanged(); /** * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 * signature. */ function eip712Domain() external view returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// 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.8.0) (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; // EIP-712 is Final as of 2022-08-11. This file is deprecated. import "./EIP712.sol";
// 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 (last updated v4.9.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.8; import "./ECDSA.sol"; import "../ShortStrings.sol"; import "../../interfaces/IERC5267.sol"; /** * @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]. * * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the * separator from the immutable values, which is cheaper than accessing a cached version in cold storage. * * _Available since v3.4._ * * @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment */ abstract contract EIP712 is IERC5267 { using ShortStrings for *; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); // 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 _cachedDomainSeparator; uint256 private immutable _cachedChainId; address private immutable _cachedThis; bytes32 private immutable _hashedName; bytes32 private immutable _hashedVersion; ShortString private immutable _name; ShortString private immutable _version; string private _nameFallback; string private _versionFallback; /** * @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) { _name = name.toShortStringWithFallback(_nameFallback); _version = version.toShortStringWithFallback(_versionFallback); _hashedName = keccak256(bytes(name)); _hashedVersion = keccak256(bytes(version)); _cachedChainId = block.chainid; _cachedDomainSeparator = _buildDomainSeparator(); _cachedThis = address(this); } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _cachedThis && block.chainid == _cachedChainId) { return _cachedDomainSeparator; } else { return _buildDomainSeparator(); } } function _buildDomainSeparator() private view returns (bytes32) { return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, 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 See {EIP-5267}. * * _Available since v4.9._ */ function eip712Domain() public view virtual override returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ) { return ( hex"0f", // 01111 _name.toStringWithFallback(_nameFallback), _version.toStringWithFallback(_versionFallback), block.chainid, address(this), bytes32(0), new uint256[](0) ); } }
// 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/ShortStrings.sol) pragma solidity ^0.8.8; import "./StorageSlot.sol"; // | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | // | length | 0x BB | type ShortString is bytes32; /** * @dev This library provides functions to convert short memory strings * into a `ShortString` type that can be used as an immutable variable. * * Strings of arbitrary length can be optimized using this library if * they are short enough (up to 31 bytes) by packing them with their * length (1 byte) in a single EVM word (32 bytes). Additionally, a * fallback mechanism can be used for every other case. * * Usage example: * * ```solidity * contract Named { * using ShortStrings for *; * * ShortString private immutable _name; * string private _nameFallback; * * constructor(string memory contractName) { * _name = contractName.toShortStringWithFallback(_nameFallback); * } * * function name() external view returns (string memory) { * return _name.toStringWithFallback(_nameFallback); * } * } * ``` */ library ShortStrings { // Used as an identifier for strings longer than 31 bytes. bytes32 private constant _FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF; error StringTooLong(string str); error InvalidShortString(); /** * @dev Encode a string of at most 31 chars into a `ShortString`. * * This will trigger a `StringTooLong` error is the input string is too long. */ function toShortString(string memory str) internal pure returns (ShortString) { bytes memory bstr = bytes(str); if (bstr.length > 31) { revert StringTooLong(str); } return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length)); } /** * @dev Decode a `ShortString` back to a "normal" string. */ function toString(ShortString sstr) internal pure returns (string memory) { uint256 len = byteLength(sstr); // using `new string(len)` would work locally but is not memory safe. string memory str = new string(32); /// @solidity memory-safe-assembly assembly { mstore(str, len) mstore(add(str, 0x20), sstr) } return str; } /** * @dev Return the length of a `ShortString`. */ function byteLength(ShortString sstr) internal pure returns (uint256) { uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF; if (result > 31) { revert InvalidShortString(); } return result; } /** * @dev Encode a string into a `ShortString`, or write it to storage if it is too long. */ function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) { if (bytes(value).length < 32) { return toShortString(value); } else { StorageSlot.getStringSlot(store).value = value; return ShortString.wrap(_FALLBACK_SENTINEL); } } /** * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}. */ function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) { if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) { return toString(value); } else { return store; } } /** * @dev Return the length of a string that was encoded to `ShortString` or written to storage using {setWithFallback}. * * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of * actual characters as the UTF-8 encoding of a single character can span over multiple bytes. */ function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) { if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) { return byteLength(value); } else { return bytes(store).length; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
// 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":"_nftCore","type":"address"},{"internalType":"address payable","name":"_adminWallet","type":"address"},{"internalType":"address","name":"_signWallet","type":"address"},{"internalType":"address","name":"_timelockAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":true,"internalType":"uint256","name":"mintType","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"metadata","type":"uint256"}],"name":"GenToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevAdminWallet","type":"address"},{"indexed":true,"internalType":"address","name":"adminWallet","type":"address"}],"name":"SetAdminWallet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevNftCore","type":"address"},{"indexed":true,"internalType":"address","name":"newNftCore","type":"address"}],"name":"SetNftCore","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"mintType","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"prevPrice","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"SetPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevSignWallet","type":"address"},{"indexed":true,"internalType":"address","name":"signWallet","type":"address"}],"name":"SetSignWallet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevTimelockAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newTimeLockAddress","type":"address"}],"name":"SetTimelock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"mintType","type":"uint256"},{"indexed":true,"internalType":"address[]","name":"_userAddresses","type":"address[]"}],"name":"SetWhitelist","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNATURE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNING_DOMAIN","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIMELOCK_DEV_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WAITLIST_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELIST_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum CSKGen.MintType","name":"wlTier","type":"uint8"},{"internalType":"address","name":"_address","type":"address"}],"name":"checkWl","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"mintType","type":"uint256"},{"internalType":"uint256","name":"metadata","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct CSKGen.MintInfo","name":"info","type":"tuple"}],"name":"genToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"genTokenNonces","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":[],"name":"getTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalMinted","outputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint8","name":"","type":"uint8"}],"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":"","type":"address"}],"name":"mintTotalCount","outputs":[{"internalType":"uint8","name":"WlRound","type":"uint8"},{"internalType":"uint8","name":"PbRound","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftCore","outputs":[{"internalType":"contract INFTCORE","name":"","type":"address"}],"stateMutability":"view","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 payable","name":"_adminWallet","type":"address"}],"name":"setAdminWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newNftCore","type":"address"}],"name":"setNftCore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum CSKGen.MintType","name":"_mintType","type":"uint8"},{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newSignWallet","type":"address"}],"name":"setSignWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTimelockAddress","type":"address"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum CSKGen.MintType","name":"wlType","type":"uint8"},{"internalType":"address[]","name":"_userAddresses","type":"address[]"},{"internalType":"enum CSKGen.Whitelist","name":"_doType","type":"uint8"}],"name":"setWhitelists","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timelockAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum CSKGen.MintType","name":"","type":"uint8"},{"internalType":"address","name":"","type":"address"}],"name":"wlLists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
61016060405267011c37937e08000060075566f523226980800060085566f52322698080006009553480156200003457600080fd5b506040516200308438038062003084833981016040819052620000579162000467565b6040805180820182526009815268434f444553454b414960b81b602080830191909152825180840190935260018352603160f81b90830152906200009d8260006200032d565b61012052620000ae8160016200032d565b61014052815160208084019190912060e052815190820120610100524660a0526200013c60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05260016003556001600160a01b038416620001a65760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964205f6e6674436f72652061646472657373000000000000000060448201526064015b60405180910390fd5b6001600160a01b038316620001fe5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964205f61646d696e57616c6c657420616464726573730000000060448201526064016200019d565b6001600160a01b038216620002565760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964205f7369676e57616c6c65742061646472657373000000000060448201526064016200019d565b6001600160a01b038116620002a05760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016200019d565b620002ad60003362000366565b620002d97fc333ad7c59d0314e06cdfc5ceb07dfd5c920357439ea113d519954117258ede28262000366565b600480546001600160a01b039586166001600160a01b03199182161790915560058054948616948216949094179093556006805492851692841692909217909155600a8054919093169116179055620006b5565b60006020835110156200034d5762000345836200040b565b905062000360565b816200035a848262000574565b5060ff90505b92915050565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff16620004075760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620003c63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080829050601f8151111562000439578260405163305a27a960e01b81526004016200019d919062000640565b8051620004468262000690565b179392505050565b6001600160a01b03811681146200046457600080fd5b50565b600080600080608085870312156200047e57600080fd5b84516200048b816200044e565b60208601519094506200049e816200044e565b6040860151909350620004b1816200044e565b6060860151909250620004c4816200044e565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620004fa57607f821691505b6020821081036200051b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200056f57600081815260208120601f850160051c810160208610156200054a5750805b601f850160051c820191505b818110156200056b5782815560010162000556565b5050505b505050565b81516001600160401b03811115620005905762000590620004cf565b620005a881620005a18454620004e5565b8462000521565b602080601f831160018114620005e05760008415620005c75750858301515b600019600386901b1c1916600185901b1785556200056b565b600085815260208120601f198616915b828110156200061157888601518255948401946001909101908401620005f0565b5085821015620006305787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083528351808285015260005b818110156200066f5785810183015185820160400152820162000651565b506000604082860101526040601f19601f8301168501019250505092915050565b805160208083015191908110156200051b5760001960209190910360031b1b16919050565b60805160a05160c05160e051610100516101205161014051612974620007106000396000610fe201526000610fb80152600061217c01526000612154015260006120af015260006120d90152600061210301526129746000f3fe6080604052600436106101e35760003560e01c80636a00670b11610102578063a415729611610095578063db654ccc11610064578063db654ccc146105fb578063dd825c7d14610617578063e3faad941461062a578063e57348171461065f57600080fd5b8063a41572961461056b578063bdacb303146105a5578063c002d23d146105c5578063d547741f146105db57600080fd5b806391d14854116100d157806391d14854146104db5780639cbe6621146104fb578063a217fddf14610534578063a319e9331461054957600080fd5b80636a00670b146104535780637a81308f146104735780637e5b2d041461049357806384b0196e146104b357600080fd5b806336568abe1161017a5780634ce74859116101495780634ce74859146103ea578063557ed1ba1461040a5780635850f3671461041d5780635ac121121461043357600080fd5b806336568abe1461034f5780633671dfa31461036f57806336b19cd7146103aa5780634bc66f32146103ca57600080fd5b8063248a9ca3116101b6578063248a9ca3146102bd578063288234d5146102ed5780632f2ff15d1461030f578063350829331461032f57600080fd5b806301ffc9a7146101e85780630c5ff1021461021d5780630ca1c5c91461025557806317e7f29514610299575b600080fd5b3480156101f457600080fd5b50610208610203366004612296565b61068c565b60405190151581526020015b60405180910390f35b34801561022957600080fd5b5060045461023d906001600160a01b031681565b6040516001600160a01b039091168152602001610214565b34801561026157600080fd5b50336000908152600c602052604090205460ff808216916101009004165b6040805160ff938416815292909116602083015201610214565b3480156102a557600080fd5b506102af60085481565b604051908152602001610214565b3480156102c957600080fd5b506102af6102d83660046122c0565b60009081526002602052604090206001015490565b3480156102f957600080fd5b5061030d6103083660046122ee565b6106c3565b005b34801561031b57600080fd5b5061030d61032a36600461230b565b610789565b34801561033b57600080fd5b5061030d61034a3660046122ee565b6107b0565b34801561035b57600080fd5b5061030d61036a36600461230b565b610856565b34801561037b57600080fd5b5061020861038a36600461234f565b600b60209081526000928352604080842090915290825290205460ff1681565b3480156103b657600080fd5b5060055461023d906001600160a01b031681565b3480156103d657600080fd5b50600a5461023d906001600160a01b031681565b3480156103f657600080fd5b5060065461023d906001600160a01b031681565b34801561041657600080fd5b50426102af565b34801561042957600080fd5b506102af60095481565b34801561043f57600080fd5b5061020861044e36600461234f565b6108e2565b34801561045f57600080fd5b5061030d61046e36600461237b565b61093d565b34801561047f57600080fd5b5061030d61048e3660046122ee565b610be1565b34801561049f57600080fd5b5061030d6104ae366004612424565b610ca2565b3480156104bf57600080fd5b506104c8610faa565b6040516102149796959493929190612549565b3480156104e757600080fd5b506102086104f636600461230b565b611032565b34801561050757600080fd5b5061027f6105163660046122ee565b600c6020526000908152604090205460ff8082169161010090041682565b34801561054057600080fd5b506102af600081565b34801561055557600080fd5b506102af60008051602061291f83398151915281565b34801561057757600080fd5b50610598604051806040016040528060018152602001603160f81b81525081565b60405161021491906125df565b3480156105b157600080fd5b5061030d6105c03660046122ee565b61105d565b3480156105d157600080fd5b506102af60075481565b3480156105e757600080fd5b5061030d6105f636600461230b565b61116a565b34801561060757600080fd5b506102af67011c37937e08000081565b61030d6106253660046125f2565b61118c565b34801561063657600080fd5b5061059860405180604001604052806009815260200168434f444553454b414960b81b81525081565b34801561066b57600080fd5b506102af61067a3660046122ee565b600d6020526000908152604090205481565b60006001600160e01b03198216637965db0b60e01b14806106bd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008051602061291f8339815191526106db816115c4565b6001600160a01b0382166107365760405162461bcd60e51b815260206004820152601e60248201527f496e76616c6964205f6e65775369676e57616c6c65742061646472657373000060448201526064015b60405180910390fd5b600680546001600160a01b038481166001600160a01b0319831681179093556040519116919082907fee4c3cf1717b34f7a1f905f40b8f0d3ffd04a996be6ec99ff91fdedd008b0e2c90600090a3505050565b60008051602061291f8339815191526107a1816115c4565b6107ab83836115ce565b505050565b60006107bb816115c4565b6001600160a01b0382166108035760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161072d565b600580546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f9f0ac88be9159761bacf6c9e7c294c397ebf594607f6b3f2f70e7e0841ea68e890600090a3505050565b610861600082611032565b156108d45760405162461bcd60e51b815260206004820152603d60248201527f416363657373436f6e74726f6c3a2063616e6e6f742072656e6f756e6365207460448201527f68652044454641554c545f41444d494e5f524f4c45206163636f756e74000000606482015260840161072d565b6108de8282611654565b5050565b6000600b60008460028111156108fa576108fa61262d565b600281111561090b5761090b61262d565b8152602080820192909252604090810160009081206001600160a01b038616825290925290205460ff16905092915050565b60008051602061291f833981519152610955816115c4565b67011c37937e0800008211156109c65760405162461bcd60e51b815260206004820152603060248201527f4e6577206d696e74207072696365206578636565647320746865206d6178696d60448201526f756d20616c6c6f7765642076616c756560801b606482015260840161072d565b600060028460028111156109dc576109dc61262d565b03610a57576009548311610a495760405162461bcd60e51b815260206004820152602e60248201527f4d494e545f5052494345206d7573742062652067726561746572207468616e2060448201526d574149544c4953545f505249434560901b606482015260840161072d565b506007805490839055610b9e565b6000846002811115610a6b57610a6b61262d565b03610af657600954831115610ae85760405162461bcd60e51b815260206004820152603c60248201527f57484954454c4953545f5052494345206d757374206265206c6573732074686160448201527f6e206f7220657175616c20746f20574149544c4953545f505249434500000000606482015260840161072d565b506008805490839055610b9e565b6001846002811115610b0a57610b0a61262d565b03610b9e576008548310158015610b22575060075483105b610b945760405162461bcd60e51b815260206004820152603d60248201527f574149544c4953545f5052494345206d757374206265206265747765656e205760448201527f484954454c4953545f505249434520616e64204d494e545f5052494345000000606482015260840161072d565b5060098054908390555b8281856002811115610bb257610bb261262d565b6040517f18e75bb8c091a6448c12a2023f055b2714c151b941a91df8b9938788769ffe1390600090a450505050565b60008051602061291f833981519152610bf9816115c4565b6001600160a01b038216610c4f5760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964205f6e65774e6674436f726520616464726573730000000000604482015260640161072d565b600480546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f26e637105b1af53dcf9b93dae3393d26193ee1e3695148cf81ef9894597ba8dc90600090a3505050565b60008051602061291f833981519152610cba816115c4565b6000826001811115610cce57610cce61262d565b03610e085760005b83518163ffffffff161015610e0257600b6000866002811115610cfb57610cfb61262d565b6002811115610d0c57610d0c61262d565b81526020019081526020016000206000858363ffffffff1681518110610d3457610d34612643565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16610df0576001600b6000876002811115610d7757610d7761262d565b6002811115610d8857610d8861262d565b81526020019081526020016000206000868463ffffffff1681518110610db057610db0612643565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610dfa8161266f565b915050610cd6565b50610f53565b6001826001811115610e1c57610e1c61262d565b03610f535760005b83518163ffffffff161015610f5157600b6000866002811115610e4957610e4961262d565b6002811115610e5a57610e5a61262d565b81526020019081526020016000206000858363ffffffff1681518110610e8257610e82612643565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1615610f3f576000600b6000876002811115610ec657610ec661262d565b6002811115610ed757610ed761262d565b81526020019081526020016000206000868463ffffffff1681518110610eff57610eff612643565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610f498161266f565b915050610e24565b505b82604051610f619190612692565b6040518091039020846002811115610f7b57610f7b61262d565b6040517f7587f49af662e6b152fa7aa19388f072a753a94cc7fd402fd5ab6f8f5e709f0490600090a350505050565b600060608082808083610fdd7f0000000000000000000000000000000000000000000000000000000000000000836116ce565b6110087f000000000000000000000000000000000000000000000000000000000000000060016116ce565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061291f833981519152611075816115c4565b6001600160a01b0382166110d65760405162461bcd60e51b815260206004820152602260248201527f496e76616c6964206e657754696d656c6f636b41646472657373206164647265604482015261737360f01b606482015260840161072d565b600a80546001600160a01b038481166001600160a01b03198316179092551661110d60008051602061291f83398151915282611779565b61112560008051602061291f833981519152846115ce565b826001600160a01b0316816001600160a01b03167f91aa98337922135c1d3ae8654f8d0b938c01a35c402eb21e568af3755e4dcd7960405160405180910390a3505050565b60008051602061291f833981519152611182816115c4565b6107ab8383611779565b6111946117e0565b6000806111a66020840135601e6126d1565b4211156111e15760405162461bcd60e51b8152602060048201526009602482015268151a5b595cc81bdd5d60ba1b604482015260640161072d565b336111ef60208501856122ee565b6001600160a01b0316146112325760405162461bcd60e51b815260206004820152600a6024820152693737ba1036b4b73a32b960b11b604482015260640161072d565b6000611245611240856126e4565b611839565b6006549091506001600160a01b038083169116146112925760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cda59db995960b21b604482015260640161072d565b336000908152600d602052604081208054916112ad836127bd565b91905055846080013510156112f45760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964206e6f6e636560981b604482015260640161072d565b836040013560000361135a57336000908152600c602052604090205460ff161561134c5760405162461bcd60e51b815260206004820152600960248201526815db08135a5b9d195960ba1b604482015260640161072d565b60085492506000915061147f565b83604001356001036113c057336000908152600c602052604090205460ff16156113b25760405162461bcd60e51b815260206004820152600960248201526815db08135a5b9d195960ba1b604482015260640161072d565b60095492506001915061147f565b836040013560020361142b57336000908152600c6020526040902054610100900460ff161561141d5760405162461bcd60e51b8152602060048201526009602482015268141888135a5b9d195960ba1b604482015260640161072d565b60075492506002915061147f565b60405162461bcd60e51b8152602060048201526024808201527f496e636f7272656374204d696e74696e6720547970653a204f7574204f662052604482015263616e676560e01b606482015260840161072d565b8234146114bf5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908105b5bdd5b9d60921b604482015260640161072d565b6005546040516000916001600160a01b03169034908381818185875af1925050503d806000811461150c576040519150601f19603f3d011682016040523d82523d6000602084013e611511565b606091505b50509050806115595760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640161072d565b61156783866060013561185c565b6060850135604086013561157e60208801886122ee565b6001600160a01b03167fd055e13f40038f5cc1a6d1e5729d9892eaba9837b8fd01d4a4485972fb64878960405160405180910390a4505050506115c16001600355565b50565b6115c18133611a4e565b6115d88282611032565b6108de5760008281526002602090815260408083206001600160a01b03851684529091529020805460ff191660011790556116103390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b03811633146116c45760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161072d565b6108de8282611779565b606060ff83146116e8576116e183611aa7565b90506106bd565b8180546116f4906127d6565b80601f0160208091040260200160405190810160405280929190818152602001828054611720906127d6565b801561176d5780601f106117425761010080835404028352916020019161176d565b820191906000526020600020905b81548152906001019060200180831161175057829003601f168201915b505050505090506106bd565b6117838282611032565b156108de5760008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6002600354036118325760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161072d565b6002600355565b60008061184583611ae6565b9050611855818460a00151611b81565b9392505050565b600061186782611ba5565b9050600283600281111561187d5761187d61262d565b0361193457336000908152600c6020526040902080546001919082906118ac908290610100900460ff16612810565b825460ff9182166101009390930a92830291909202199091161790555060048054604051636a4b888360e01b81526001600160a01b0390911691636a4b8883916118fd913391869160029101612829565b600060405180830381600087803b15801561191757600080fd5b505af115801561192b573d6000803e3d6000fd5b50505050505050565b60008360028111156119485761194861262d565b036119c157336000908152600c6020526040812080546001929061197090849060ff16612810565b825460ff9182166101009390930a92830291909202199091161790555060048054604051636a4b888360e01b81526001600160a01b0390911691636a4b8883916118fd913391869160009101612829565b60018360028111156119d5576119d561262d565b036107ab57336000908152600c602052604081208054600192906119fd90849060ff16612810565b825460ff9182166101009390930a92830291909202199091161790555060048054604051636a4b888360e01b81526001600160a01b0390911691636a4b8883916118fd913391869160019101612829565b611a588282611032565b6108de57611a6581611c38565b611a70836020611c4a565b604051602001611a8192919061287b565b60408051601f198184030181529082905262461bcd60e51b825261072d916004016125df565b60606000611ab483611de6565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60006106bd7fd1d19c980d7604d976814647c9a9b39959dc6227e523b32841291602411835a883600001518460200151856040015186606001518760800151604051602001611b66969594939291909586526001600160a01b0394909416602086015260408501929092526060840152608083015260a082015260c00190565b60405160208183030381529060405280519060200120611e0e565b6000806000611b908585611e3b565b91509150611b9d81611e80565b509392505050565b60606000611bb283611fca565b600101905060008167ffffffffffffffff811115611bd257611bd26123a5565b6040519080825280601f01601f191660200182016040528015611bfc576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611c0657509392505050565b60606106bd6001600160a01b03831660145b60606000611c598360026128f0565b611c649060026126d1565b67ffffffffffffffff811115611c7c57611c7c6123a5565b6040519080825280601f01601f191660200182016040528015611ca6576020820181803683370190505b509050600360fc1b81600081518110611cc157611cc1612643565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611cf057611cf0612643565b60200101906001600160f81b031916908160001a9053506000611d148460026128f0565b611d1f9060016126d1565b90505b6001811115611d97576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d5357611d53612643565b1a60f81b828281518110611d6957611d69612643565b60200101906001600160f81b031916908160001a90535060049490941c93611d9081612907565b9050611d22565b5083156118555760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161072d565b600060ff8216601f8111156106bd57604051632cd44ac360e21b815260040160405180910390fd5b60006106bd611e1b6120a2565b8360405161190160f01b8152600281019290925260228201526042902090565b6000808251604103611e715760208301516040840151606085015160001a611e65878285856121d2565b94509450505050611e79565b506000905060025b9250929050565b6000816004811115611e9457611e9461262d565b03611e9c5750565b6001816004811115611eb057611eb061262d565b03611efd5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161072d565b6002816004811115611f1157611f1161262d565b03611f5e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161072d565b6003816004811115611f7257611f7261262d565b036115c15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161072d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106120095772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612035576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061205357662386f26fc10000830492506010015b6305f5e100831061206b576305f5e100830492506008015b612710831061207f57612710830492506004015b60648310612091576064830492506002015b600a83106106bd5760010192915050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156120fb57507f000000000000000000000000000000000000000000000000000000000000000046145b1561212557507f000000000000000000000000000000000000000000000000000000000000000090565b6121cd604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612209575060009050600361228d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561225d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166122865760006001925092505061228d565b9150600090505b94509492505050565b6000602082840312156122a857600080fd5b81356001600160e01b03198116811461185557600080fd5b6000602082840312156122d257600080fd5b5035919050565b6001600160a01b03811681146115c157600080fd5b60006020828403121561230057600080fd5b8135611855816122d9565b6000806040838503121561231e57600080fd5b823591506020830135612330816122d9565b809150509250929050565b80356003811061234a57600080fd5b919050565b6000806040838503121561236257600080fd5b61236b8361233b565b91506020830135612330816122d9565b6000806040838503121561238e57600080fd5b6123978361233b565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156123de576123de6123a5565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561240d5761240d6123a5565b604052919050565b80356002811061234a57600080fd5b60008060006060848603121561243957600080fd5b6124428461233b565b925060208085013567ffffffffffffffff8082111561246057600080fd5b818701915087601f83011261247457600080fd5b813581811115612486576124866123a5565b8060051b91506124978483016123e4565b818152918301840191848101908a8411156124b157600080fd5b938501935b838510156124db57843592506124cb836122d9565b82825293850193908501906124b6565b8097505050505050506124f060408501612415565b90509250925092565b60005b838110156125145781810151838201526020016124fc565b50506000910152565b600081518084526125358160208601602086016124f9565b601f01601f19169290920160200192915050565b60ff60f81b881681526000602060e08184015261256960e084018a61251d565b838103604085015261257b818a61251d565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156125cd578351835292840192918401916001016125b1565b50909c9b505050505050505050505050565b602081526000611855602083018461251d565b60006020828403121561260457600080fd5b813567ffffffffffffffff81111561261b57600080fd5b820160c0818503121561185557600080fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff80831681810361268857612688612659565b6001019392505050565b815160009082906020808601845b838110156126c55781516001600160a01b0316855293820193908201906001016126a0565b50929695505050505050565b808201808211156106bd576106bd612659565b600060c082360312156126f657600080fd5b6126fe6123bb565b8235612709816122d9565b808252506020808401358183015260408401356040830152606084013560608301526080840135608083015260a084013567ffffffffffffffff8082111561275057600080fd5b9085019036601f83011261276357600080fd5b813581811115612775576127756123a5565b612787601f8201601f191685016123e4565b9150808252368482850101111561279d57600080fd5b80848401858401376000908201909301929092525060a082015292915050565b6000600182016127cf576127cf612659565b5060010190565b600181811c908216806127ea57607f821691505b60208210810361280a57634e487b7160e01b600052602260045260246000fd5b50919050565b60ff81811683821601908111156106bd576106bd612659565b6001600160a01b038416815260606020820181905260009061284d9083018561251d565b90506003831061286d57634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516128b38160178501602088016124f9565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516128e48160288401602088016124f9565b01602801949350505050565b80820281158282048414176106bd576106bd612659565b60008161291657612916612659565b50600019019056fec333ad7c59d0314e06cdfc5ceb07dfd5c920357439ea113d519954117258ede2a2646970667358221220a3d2c919353551d671c83ef1edcc5696309ec14af7326995672cd661d732ff7664736f6c634300081300330000000000000000000000000d7d3a744da812c51b489e0b2e5b88fc38a84256000000000000000000000000d7e32913932a04e9d13c490bfbabbff848dec706000000000000000000000000f12cd914a5e1c74408014b83022ba16f8e95711a000000000000000000000000b4a2994802c46d7bd3d3ea2eda50a583610e2757
Deployed Bytecode
0x6080604052600436106101e35760003560e01c80636a00670b11610102578063a415729611610095578063db654ccc11610064578063db654ccc146105fb578063dd825c7d14610617578063e3faad941461062a578063e57348171461065f57600080fd5b8063a41572961461056b578063bdacb303146105a5578063c002d23d146105c5578063d547741f146105db57600080fd5b806391d14854116100d157806391d14854146104db5780639cbe6621146104fb578063a217fddf14610534578063a319e9331461054957600080fd5b80636a00670b146104535780637a81308f146104735780637e5b2d041461049357806384b0196e146104b357600080fd5b806336568abe1161017a5780634ce74859116101495780634ce74859146103ea578063557ed1ba1461040a5780635850f3671461041d5780635ac121121461043357600080fd5b806336568abe1461034f5780633671dfa31461036f57806336b19cd7146103aa5780634bc66f32146103ca57600080fd5b8063248a9ca3116101b6578063248a9ca3146102bd578063288234d5146102ed5780632f2ff15d1461030f578063350829331461032f57600080fd5b806301ffc9a7146101e85780630c5ff1021461021d5780630ca1c5c91461025557806317e7f29514610299575b600080fd5b3480156101f457600080fd5b50610208610203366004612296565b61068c565b60405190151581526020015b60405180910390f35b34801561022957600080fd5b5060045461023d906001600160a01b031681565b6040516001600160a01b039091168152602001610214565b34801561026157600080fd5b50336000908152600c602052604090205460ff808216916101009004165b6040805160ff938416815292909116602083015201610214565b3480156102a557600080fd5b506102af60085481565b604051908152602001610214565b3480156102c957600080fd5b506102af6102d83660046122c0565b60009081526002602052604090206001015490565b3480156102f957600080fd5b5061030d6103083660046122ee565b6106c3565b005b34801561031b57600080fd5b5061030d61032a36600461230b565b610789565b34801561033b57600080fd5b5061030d61034a3660046122ee565b6107b0565b34801561035b57600080fd5b5061030d61036a36600461230b565b610856565b34801561037b57600080fd5b5061020861038a36600461234f565b600b60209081526000928352604080842090915290825290205460ff1681565b3480156103b657600080fd5b5060055461023d906001600160a01b031681565b3480156103d657600080fd5b50600a5461023d906001600160a01b031681565b3480156103f657600080fd5b5060065461023d906001600160a01b031681565b34801561041657600080fd5b50426102af565b34801561042957600080fd5b506102af60095481565b34801561043f57600080fd5b5061020861044e36600461234f565b6108e2565b34801561045f57600080fd5b5061030d61046e36600461237b565b61093d565b34801561047f57600080fd5b5061030d61048e3660046122ee565b610be1565b34801561049f57600080fd5b5061030d6104ae366004612424565b610ca2565b3480156104bf57600080fd5b506104c8610faa565b6040516102149796959493929190612549565b3480156104e757600080fd5b506102086104f636600461230b565b611032565b34801561050757600080fd5b5061027f6105163660046122ee565b600c6020526000908152604090205460ff8082169161010090041682565b34801561054057600080fd5b506102af600081565b34801561055557600080fd5b506102af60008051602061291f83398151915281565b34801561057757600080fd5b50610598604051806040016040528060018152602001603160f81b81525081565b60405161021491906125df565b3480156105b157600080fd5b5061030d6105c03660046122ee565b61105d565b3480156105d157600080fd5b506102af60075481565b3480156105e757600080fd5b5061030d6105f636600461230b565b61116a565b34801561060757600080fd5b506102af67011c37937e08000081565b61030d6106253660046125f2565b61118c565b34801561063657600080fd5b5061059860405180604001604052806009815260200168434f444553454b414960b81b81525081565b34801561066b57600080fd5b506102af61067a3660046122ee565b600d6020526000908152604090205481565b60006001600160e01b03198216637965db0b60e01b14806106bd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008051602061291f8339815191526106db816115c4565b6001600160a01b0382166107365760405162461bcd60e51b815260206004820152601e60248201527f496e76616c6964205f6e65775369676e57616c6c65742061646472657373000060448201526064015b60405180910390fd5b600680546001600160a01b038481166001600160a01b0319831681179093556040519116919082907fee4c3cf1717b34f7a1f905f40b8f0d3ffd04a996be6ec99ff91fdedd008b0e2c90600090a3505050565b60008051602061291f8339815191526107a1816115c4565b6107ab83836115ce565b505050565b60006107bb816115c4565b6001600160a01b0382166108035760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161072d565b600580546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f9f0ac88be9159761bacf6c9e7c294c397ebf594607f6b3f2f70e7e0841ea68e890600090a3505050565b610861600082611032565b156108d45760405162461bcd60e51b815260206004820152603d60248201527f416363657373436f6e74726f6c3a2063616e6e6f742072656e6f756e6365207460448201527f68652044454641554c545f41444d494e5f524f4c45206163636f756e74000000606482015260840161072d565b6108de8282611654565b5050565b6000600b60008460028111156108fa576108fa61262d565b600281111561090b5761090b61262d565b8152602080820192909252604090810160009081206001600160a01b038616825290925290205460ff16905092915050565b60008051602061291f833981519152610955816115c4565b67011c37937e0800008211156109c65760405162461bcd60e51b815260206004820152603060248201527f4e6577206d696e74207072696365206578636565647320746865206d6178696d60448201526f756d20616c6c6f7765642076616c756560801b606482015260840161072d565b600060028460028111156109dc576109dc61262d565b03610a57576009548311610a495760405162461bcd60e51b815260206004820152602e60248201527f4d494e545f5052494345206d7573742062652067726561746572207468616e2060448201526d574149544c4953545f505249434560901b606482015260840161072d565b506007805490839055610b9e565b6000846002811115610a6b57610a6b61262d565b03610af657600954831115610ae85760405162461bcd60e51b815260206004820152603c60248201527f57484954454c4953545f5052494345206d757374206265206c6573732074686160448201527f6e206f7220657175616c20746f20574149544c4953545f505249434500000000606482015260840161072d565b506008805490839055610b9e565b6001846002811115610b0a57610b0a61262d565b03610b9e576008548310158015610b22575060075483105b610b945760405162461bcd60e51b815260206004820152603d60248201527f574149544c4953545f5052494345206d757374206265206265747765656e205760448201527f484954454c4953545f505249434520616e64204d494e545f5052494345000000606482015260840161072d565b5060098054908390555b8281856002811115610bb257610bb261262d565b6040517f18e75bb8c091a6448c12a2023f055b2714c151b941a91df8b9938788769ffe1390600090a450505050565b60008051602061291f833981519152610bf9816115c4565b6001600160a01b038216610c4f5760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964205f6e65774e6674436f726520616464726573730000000000604482015260640161072d565b600480546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f26e637105b1af53dcf9b93dae3393d26193ee1e3695148cf81ef9894597ba8dc90600090a3505050565b60008051602061291f833981519152610cba816115c4565b6000826001811115610cce57610cce61262d565b03610e085760005b83518163ffffffff161015610e0257600b6000866002811115610cfb57610cfb61262d565b6002811115610d0c57610d0c61262d565b81526020019081526020016000206000858363ffffffff1681518110610d3457610d34612643565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16610df0576001600b6000876002811115610d7757610d7761262d565b6002811115610d8857610d8861262d565b81526020019081526020016000206000868463ffffffff1681518110610db057610db0612643565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610dfa8161266f565b915050610cd6565b50610f53565b6001826001811115610e1c57610e1c61262d565b03610f535760005b83518163ffffffff161015610f5157600b6000866002811115610e4957610e4961262d565b6002811115610e5a57610e5a61262d565b81526020019081526020016000206000858363ffffffff1681518110610e8257610e82612643565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1615610f3f576000600b6000876002811115610ec657610ec661262d565b6002811115610ed757610ed761262d565b81526020019081526020016000206000868463ffffffff1681518110610eff57610eff612643565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610f498161266f565b915050610e24565b505b82604051610f619190612692565b6040518091039020846002811115610f7b57610f7b61262d565b6040517f7587f49af662e6b152fa7aa19388f072a753a94cc7fd402fd5ab6f8f5e709f0490600090a350505050565b600060608082808083610fdd7f434f444553454b41490000000000000000000000000000000000000000000009836116ce565b6110087f310000000000000000000000000000000000000000000000000000000000000160016116ce565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061291f833981519152611075816115c4565b6001600160a01b0382166110d65760405162461bcd60e51b815260206004820152602260248201527f496e76616c6964206e657754696d656c6f636b41646472657373206164647265604482015261737360f01b606482015260840161072d565b600a80546001600160a01b038481166001600160a01b03198316179092551661110d60008051602061291f83398151915282611779565b61112560008051602061291f833981519152846115ce565b826001600160a01b0316816001600160a01b03167f91aa98337922135c1d3ae8654f8d0b938c01a35c402eb21e568af3755e4dcd7960405160405180910390a3505050565b60008051602061291f833981519152611182816115c4565b6107ab8383611779565b6111946117e0565b6000806111a66020840135601e6126d1565b4211156111e15760405162461bcd60e51b8152602060048201526009602482015268151a5b595cc81bdd5d60ba1b604482015260640161072d565b336111ef60208501856122ee565b6001600160a01b0316146112325760405162461bcd60e51b815260206004820152600a6024820152693737ba1036b4b73a32b960b11b604482015260640161072d565b6000611245611240856126e4565b611839565b6006549091506001600160a01b038083169116146112925760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cda59db995960b21b604482015260640161072d565b336000908152600d602052604081208054916112ad836127bd565b91905055846080013510156112f45760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964206e6f6e636560981b604482015260640161072d565b836040013560000361135a57336000908152600c602052604090205460ff161561134c5760405162461bcd60e51b815260206004820152600960248201526815db08135a5b9d195960ba1b604482015260640161072d565b60085492506000915061147f565b83604001356001036113c057336000908152600c602052604090205460ff16156113b25760405162461bcd60e51b815260206004820152600960248201526815db08135a5b9d195960ba1b604482015260640161072d565b60095492506001915061147f565b836040013560020361142b57336000908152600c6020526040902054610100900460ff161561141d5760405162461bcd60e51b8152602060048201526009602482015268141888135a5b9d195960ba1b604482015260640161072d565b60075492506002915061147f565b60405162461bcd60e51b8152602060048201526024808201527f496e636f7272656374204d696e74696e6720547970653a204f7574204f662052604482015263616e676560e01b606482015260840161072d565b8234146114bf5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908105b5bdd5b9d60921b604482015260640161072d565b6005546040516000916001600160a01b03169034908381818185875af1925050503d806000811461150c576040519150601f19603f3d011682016040523d82523d6000602084013e611511565b606091505b50509050806115595760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640161072d565b61156783866060013561185c565b6060850135604086013561157e60208801886122ee565b6001600160a01b03167fd055e13f40038f5cc1a6d1e5729d9892eaba9837b8fd01d4a4485972fb64878960405160405180910390a4505050506115c16001600355565b50565b6115c18133611a4e565b6115d88282611032565b6108de5760008281526002602090815260408083206001600160a01b03851684529091529020805460ff191660011790556116103390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b03811633146116c45760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161072d565b6108de8282611779565b606060ff83146116e8576116e183611aa7565b90506106bd565b8180546116f4906127d6565b80601f0160208091040260200160405190810160405280929190818152602001828054611720906127d6565b801561176d5780601f106117425761010080835404028352916020019161176d565b820191906000526020600020905b81548152906001019060200180831161175057829003601f168201915b505050505090506106bd565b6117838282611032565b156108de5760008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6002600354036118325760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161072d565b6002600355565b60008061184583611ae6565b9050611855818460a00151611b81565b9392505050565b600061186782611ba5565b9050600283600281111561187d5761187d61262d565b0361193457336000908152600c6020526040902080546001919082906118ac908290610100900460ff16612810565b825460ff9182166101009390930a92830291909202199091161790555060048054604051636a4b888360e01b81526001600160a01b0390911691636a4b8883916118fd913391869160029101612829565b600060405180830381600087803b15801561191757600080fd5b505af115801561192b573d6000803e3d6000fd5b50505050505050565b60008360028111156119485761194861262d565b036119c157336000908152600c6020526040812080546001929061197090849060ff16612810565b825460ff9182166101009390930a92830291909202199091161790555060048054604051636a4b888360e01b81526001600160a01b0390911691636a4b8883916118fd913391869160009101612829565b60018360028111156119d5576119d561262d565b036107ab57336000908152600c602052604081208054600192906119fd90849060ff16612810565b825460ff9182166101009390930a92830291909202199091161790555060048054604051636a4b888360e01b81526001600160a01b0390911691636a4b8883916118fd913391869160019101612829565b611a588282611032565b6108de57611a6581611c38565b611a70836020611c4a565b604051602001611a8192919061287b565b60408051601f198184030181529082905262461bcd60e51b825261072d916004016125df565b60606000611ab483611de6565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60006106bd7fd1d19c980d7604d976814647c9a9b39959dc6227e523b32841291602411835a883600001518460200151856040015186606001518760800151604051602001611b66969594939291909586526001600160a01b0394909416602086015260408501929092526060840152608083015260a082015260c00190565b60405160208183030381529060405280519060200120611e0e565b6000806000611b908585611e3b565b91509150611b9d81611e80565b509392505050565b60606000611bb283611fca565b600101905060008167ffffffffffffffff811115611bd257611bd26123a5565b6040519080825280601f01601f191660200182016040528015611bfc576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611c0657509392505050565b60606106bd6001600160a01b03831660145b60606000611c598360026128f0565b611c649060026126d1565b67ffffffffffffffff811115611c7c57611c7c6123a5565b6040519080825280601f01601f191660200182016040528015611ca6576020820181803683370190505b509050600360fc1b81600081518110611cc157611cc1612643565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611cf057611cf0612643565b60200101906001600160f81b031916908160001a9053506000611d148460026128f0565b611d1f9060016126d1565b90505b6001811115611d97576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d5357611d53612643565b1a60f81b828281518110611d6957611d69612643565b60200101906001600160f81b031916908160001a90535060049490941c93611d9081612907565b9050611d22565b5083156118555760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161072d565b600060ff8216601f8111156106bd57604051632cd44ac360e21b815260040160405180910390fd5b60006106bd611e1b6120a2565b8360405161190160f01b8152600281019290925260228201526042902090565b6000808251604103611e715760208301516040840151606085015160001a611e65878285856121d2565b94509450505050611e79565b506000905060025b9250929050565b6000816004811115611e9457611e9461262d565b03611e9c5750565b6001816004811115611eb057611eb061262d565b03611efd5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161072d565b6002816004811115611f1157611f1161262d565b03611f5e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161072d565b6003816004811115611f7257611f7261262d565b036115c15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161072d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106120095772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612035576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061205357662386f26fc10000830492506010015b6305f5e100831061206b576305f5e100830492506008015b612710831061207f57612710830492506004015b60648310612091576064830492506002015b600a83106106bd5760010192915050565b6000306001600160a01b037f000000000000000000000000328d21e542c982cebc009283d53362bdb2a920b3161480156120fb57507f000000000000000000000000000000000000000000000000000000000000000146145b1561212557507f1459926b55e5dba3bfc6adc2fc96dd95eb86fc413dc67395cbe4de1bf14987c090565b6121cd604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f7693a2e17e78f0447d28587fc26d4921d42e5bed8b7f75a9e7bbaa048823e565918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612209575060009050600361228d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561225d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166122865760006001925092505061228d565b9150600090505b94509492505050565b6000602082840312156122a857600080fd5b81356001600160e01b03198116811461185557600080fd5b6000602082840312156122d257600080fd5b5035919050565b6001600160a01b03811681146115c157600080fd5b60006020828403121561230057600080fd5b8135611855816122d9565b6000806040838503121561231e57600080fd5b823591506020830135612330816122d9565b809150509250929050565b80356003811061234a57600080fd5b919050565b6000806040838503121561236257600080fd5b61236b8361233b565b91506020830135612330816122d9565b6000806040838503121561238e57600080fd5b6123978361233b565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156123de576123de6123a5565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561240d5761240d6123a5565b604052919050565b80356002811061234a57600080fd5b60008060006060848603121561243957600080fd5b6124428461233b565b925060208085013567ffffffffffffffff8082111561246057600080fd5b818701915087601f83011261247457600080fd5b813581811115612486576124866123a5565b8060051b91506124978483016123e4565b818152918301840191848101908a8411156124b157600080fd5b938501935b838510156124db57843592506124cb836122d9565b82825293850193908501906124b6565b8097505050505050506124f060408501612415565b90509250925092565b60005b838110156125145781810151838201526020016124fc565b50506000910152565b600081518084526125358160208601602086016124f9565b601f01601f19169290920160200192915050565b60ff60f81b881681526000602060e08184015261256960e084018a61251d565b838103604085015261257b818a61251d565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156125cd578351835292840192918401916001016125b1565b50909c9b505050505050505050505050565b602081526000611855602083018461251d565b60006020828403121561260457600080fd5b813567ffffffffffffffff81111561261b57600080fd5b820160c0818503121561185557600080fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff80831681810361268857612688612659565b6001019392505050565b815160009082906020808601845b838110156126c55781516001600160a01b0316855293820193908201906001016126a0565b50929695505050505050565b808201808211156106bd576106bd612659565b600060c082360312156126f657600080fd5b6126fe6123bb565b8235612709816122d9565b808252506020808401358183015260408401356040830152606084013560608301526080840135608083015260a084013567ffffffffffffffff8082111561275057600080fd5b9085019036601f83011261276357600080fd5b813581811115612775576127756123a5565b612787601f8201601f191685016123e4565b9150808252368482850101111561279d57600080fd5b80848401858401376000908201909301929092525060a082015292915050565b6000600182016127cf576127cf612659565b5060010190565b600181811c908216806127ea57607f821691505b60208210810361280a57634e487b7160e01b600052602260045260246000fd5b50919050565b60ff81811683821601908111156106bd576106bd612659565b6001600160a01b038416815260606020820181905260009061284d9083018561251d565b90506003831061286d57634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516128b38160178501602088016124f9565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516128e48160288401602088016124f9565b01602801949350505050565b80820281158282048414176106bd576106bd612659565b60008161291657612916612659565b50600019019056fec333ad7c59d0314e06cdfc5ceb07dfd5c920357439ea113d519954117258ede2a2646970667358221220a3d2c919353551d671c83ef1edcc5696309ec14af7326995672cd661d732ff7664736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000d7d3a744da812c51b489e0b2e5b88fc38a84256000000000000000000000000d7e32913932a04e9d13c490bfbabbff848dec706000000000000000000000000f12cd914a5e1c74408014b83022ba16f8e95711a000000000000000000000000b4a2994802c46d7bd3d3ea2eda50a583610e2757
-----Decoded View---------------
Arg [0] : _nftCore (address): 0x0d7d3a744Da812C51B489e0b2E5b88fc38a84256
Arg [1] : _adminWallet (address): 0xd7e32913932A04E9D13C490bfbaBBFf848Dec706
Arg [2] : _signWallet (address): 0xf12cd914a5E1c74408014B83022Ba16f8e95711A
Arg [3] : _timelockAddress (address): 0xB4A2994802c46d7bd3d3eA2Eda50a583610e2757
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000d7d3a744da812c51b489e0b2e5b88fc38a84256
Arg [1] : 000000000000000000000000d7e32913932a04e9d13c490bfbabbff848dec706
Arg [2] : 000000000000000000000000f12cd914a5e1c74408014b83022ba16f8e95711a
Arg [3] : 000000000000000000000000b4a2994802c46d7bd3d3ea2eda50a583610e2757
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.