Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 37 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer | 20261204 | 69 days ago | IN | 0 ETH | 0.00065841 | ||||
Transfer | 20069392 | 96 days ago | IN | 0 ETH | 0.00937546 | ||||
Transfer | 19749068 | 141 days ago | IN | 0 ETH | 0.00047579 | ||||
Transfer | 19749025 | 141 days ago | IN | 0 ETH | 0.00027295 | ||||
Approve | 19719881 | 145 days ago | IN | 0 ETH | 0.00067557 | ||||
Transfer | 19715396 | 146 days ago | IN | 0 ETH | 0.00061159 | ||||
Transfer | 19715394 | 146 days ago | IN | 0 ETH | 0.00098136 | ||||
Transfer | 19715394 | 146 days ago | IN | 0 ETH | 0.0008861 | ||||
Transfer | 19715375 | 146 days ago | IN | 0 ETH | 0.00081437 | ||||
Transfer | 19715276 | 146 days ago | IN | 0 ETH | 0.00054257 | ||||
Transfer | 19715265 | 146 days ago | IN | 0 ETH | 0.00060992 | ||||
Transfer | 19715265 | 146 days ago | IN | 0 ETH | 0.00060992 | ||||
Transfer | 19714949 | 146 days ago | IN | 0 ETH | 0.00057145 | ||||
Transfer | 19714949 | 146 days ago | IN | 0 ETH | 0.00057145 | ||||
Transfer | 19714949 | 146 days ago | IN | 0 ETH | 0.00057145 | ||||
Transfer | 19714915 | 146 days ago | IN | 0 ETH | 0.00022418 | ||||
Transfer | 19707226 | 147 days ago | IN | 0 ETH | 0.00065048 | ||||
Transfer | 19661217 | 153 days ago | IN | 0 ETH | 0.00131041 | ||||
Transfer | 19661137 | 153 days ago | IN | 0 ETH | 0.00093989 | ||||
Transfer | 19660111 | 153 days ago | IN | 0 ETH | 0.00084215 | ||||
Transfer | 19660070 | 153 days ago | IN | 0 ETH | 0.00075441 | ||||
Transfer | 19610791 | 160 days ago | IN | 0 ETH | 0.00117771 | ||||
Transfer | 19602899 | 161 days ago | IN | 0 ETH | 0.00187376 | ||||
Transfer | 19576427 | 165 days ago | IN | 0 ETH | 0.00261765 | ||||
Transfer | 19568856 | 166 days ago | IN | 0 ETH | 0.00350575 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
EgorasSmartGenerator
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// File: contracts/lib/ERC20Events.sol pragma solidity ^0.8.20; library ERC20Events { event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 amount); } // File: contracts/lib/ERC721Events.sol pragma solidity ^0.8.20; library ERC721Events { event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); event Approval( address indexed owner, address indexed spender, uint256 indexed id ); event Transfer(address indexed from, address indexed to, uint256 indexed id); } // File: contracts/lib/DoubleEndedQueue.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/DoubleEndedQueue.sol) // Modified by Pandora Labs to support native uint256 operations pragma solidity ^0.8.20; /** * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that * the existing queue contents are left in storage. * * The struct is called `Uint256Deque`. This data structure can only be used in storage, and not in memory. * * ```solidity * DoubleEndedQueue.Uint256Deque queue; * ``` */ library DoubleEndedQueue { /** * @dev An operation (e.g. {front}) couldn't be completed due to the queue being empty. */ error QueueEmpty(); /** * @dev A push operation couldn't be completed due to the queue being full. */ error QueueFull(); /** * @dev An operation (e.g. {at}) couldn't be completed due to an index being out of bounds. */ error QueueOutOfBounds(); /** * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access. * * Struct members have an underscore prefix indicating that they are "private" and should not be read or written to * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and * lead to unexpected behavior. * * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around. */ struct Uint256Deque { uint128 _begin; uint128 _end; mapping(uint128 index => uint256) _data; } /** * @dev Inserts an item at the end of the queue. * * Reverts with {QueueFull} if the queue is full. */ function pushBack(Uint256Deque storage deque, uint256 value) internal { unchecked { uint128 backIndex = deque._end; if (backIndex + 1 == deque._begin) revert QueueFull(); deque._data[backIndex] = value; deque._end = backIndex + 1; } } /** * @dev Removes the item at the end of the queue and returns it. * * Reverts with {QueueEmpty} if the queue is empty. */ function popBack( Uint256Deque storage deque ) internal returns (uint256 value) { unchecked { uint128 backIndex = deque._end; if (backIndex == deque._begin) revert QueueEmpty(); --backIndex; value = deque._data[backIndex]; delete deque._data[backIndex]; deque._end = backIndex; } } /** * @dev Inserts an item at the beginning of the queue. * * Reverts with {QueueFull} if the queue is full. */ function pushFront(Uint256Deque storage deque, uint256 value) internal { unchecked { uint128 frontIndex = deque._begin - 1; if (frontIndex == deque._end) revert QueueFull(); deque._data[frontIndex] = value; deque._begin = frontIndex; } } /** * @dev Removes the item at the beginning of the queue and returns it. * * Reverts with `QueueEmpty` if the queue is empty. */ function popFront( Uint256Deque storage deque ) internal returns (uint256 value) { unchecked { uint128 frontIndex = deque._begin; if (frontIndex == deque._end) revert QueueEmpty(); value = deque._data[frontIndex]; delete deque._data[frontIndex]; deque._begin = frontIndex + 1; } } /** * @dev Returns the item at the beginning of the queue. * * Reverts with `QueueEmpty` if the queue is empty. */ function front( Uint256Deque storage deque ) internal view returns (uint256 value) { if (empty(deque)) revert QueueEmpty(); return deque._data[deque._begin]; } /** * @dev Returns the item at the end of the queue. * * Reverts with `QueueEmpty` if the queue is empty. */ function back( Uint256Deque storage deque ) internal view returns (uint256 value) { if (empty(deque)) revert QueueEmpty(); unchecked { return deque._data[deque._end - 1]; } } /** * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at * `length(deque) - 1`. * * Reverts with `QueueOutOfBounds` if the index is out of bounds. */ function at( Uint256Deque storage deque, uint256 index ) internal view returns (uint256 value) { if (index >= length(deque)) revert QueueOutOfBounds(); // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128 unchecked { return deque._data[deque._begin + uint128(index)]; } } /** * @dev Resets the queue back to being empty. * * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses * out on potential gas refunds. */ function clear(Uint256Deque storage deque) internal { deque._begin = 0; deque._end = 0; } /** * @dev Returns the number of items in the queue. */ function length(Uint256Deque storage deque) internal view returns (uint256) { unchecked { return uint256(deque._end - deque._begin); } } /** * @dev Returns true if the queue is empty. */ function empty(Uint256Deque storage deque) internal view returns (bool) { return deque._end == deque._begin; } } // File: @openzeppelin/contracts/utils/introspection/IERC165.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @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); } // File: @openzeppelin/contracts/interfaces/IERC165.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; // File: contracts/interfaces/IERC404.sol //SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IERC404 is IERC165 { error NotFound(); error InvalidTokenId(); error AlreadyExists(); error InvalidRecipient(); error InvalidSender(); error InvalidSpender(); error InvalidOperator(); error UnsafeRecipient(); error RecipientIsERC721TransferExempt(); error Unauthorized(); error InsufficientAllowance(); error DecimalsTooLow(); error PermitDeadlineExpired(); error InvalidSigner(); error InvalidApproval(); error OwnedIndexOverflow(); error MintLimitReached(); error InvalidExemption(); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function erc20TotalSupply() external view returns (uint256); function erc721TotalSupply() external view returns (uint256); function balanceOf(address owner_) external view returns (uint256); function erc721BalanceOf(address owner_) external view returns (uint256); function erc20BalanceOf(address owner_) external view returns (uint256); function erc721TransferExempt(address account_) external view returns (bool); function isApprovedForAll( address owner_, address operator_ ) external view returns (bool); function allowance( address owner_, address spender_ ) external view returns (uint256); function owned(address owner_) external view returns (uint256[] memory); function ownerOf(uint256 id_) external view returns (address erc721Owner); function tokenURI(uint256 id_) external view returns (string memory); function approve( address spender_, uint256 valueOrId_ ) external returns (bool); function erc20Approve( address spender_, uint256 value_ ) external returns (bool); function erc721Approve(address spender_, uint256 id_) external; function setApprovalForAll(address operator_, bool approved_) external; function transferFrom( address from_, address to_, uint256 valueOrId_ ) external returns (bool); function erc20TransferFrom( address from_, address to_, uint256 value_ ) external returns (bool); function erc721TransferFrom(address from_, address to_, uint256 id_) external; function transfer(address to_, uint256 amount_) external returns (bool); function getERC721QueueLength() external view returns (uint256); function getERC721TokensInQueue( uint256 start_, uint256 count_ ) external view returns (uint256[] memory); function setSelfERC721TransferExempt(bool state_) external; function safeTransferFrom(address from_, address to_, uint256 id_) external; function safeTransferFrom( address from_, address to_, uint256 id_, bytes calldata data_ ) external; function DOMAIN_SEPARATOR() external view returns (bytes32); function permit( address owner_, address spender_, uint256 value_, uint256 deadline_, uint8 v_, bytes32 r_, bytes32 s_ ) external; } // File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be * reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } // File: @openzeppelin/contracts/interfaces/IERC721Receiver.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721Receiver.sol) pragma solidity ^0.8.20; // File: contracts/ERC404.sol pragma solidity ^0.8.20; abstract contract ERC404 is IERC404 { using DoubleEndedQueue for DoubleEndedQueue.Uint256Deque; /// @dev The queue of ERC-721 tokens stored in the contract. DoubleEndedQueue.Uint256Deque private _storedERC721Ids; /// @dev Token name string public name; /// @dev Token symbol string public symbol; /// @dev Decimals for ERC-20 representation uint8 public immutable decimals; /// @dev Units for ERC-20 representation uint256 public immutable units; /// @dev Total ERC-721 supply uint256 private maxTotalSupplyERC721; /// @dev Total supply in ERC-20 representation uint256 private _totalSupply; /// @dev Current mint counter which also represents the highest /// minted id, monotonically increasing to ensure accurate ownership uint256 public minted; /// @dev Initial chain id for EIP-2612 support uint256 internal immutable _INITIAL_CHAIN_ID; /// @dev Initial domain separator for EIP-2612 support bytes32 internal immutable _INITIAL_DOMAIN_SEPARATOR; /// @dev Balance of user in ERC-20 representation mapping(address => uint256) public balanceOf; /// @dev Allowance of user in ERC-20 representation mapping(address => mapping(address => uint256)) public allowance; /// @dev Approval in ERC-721 representaion mapping(uint256 => address) public getApproved; /// @dev Approval for all in ERC-721 representation mapping(address => mapping(address => bool)) public isApprovedForAll; /// @dev Packed representation of ownerOf and owned indices mapping(uint256 => uint256) internal _ownedData; /// @dev Array of owned ids in ERC-721 representation mapping(address => uint256[]) internal _owned; /// @dev Addresses that are exempt from ERC-721 transfer, typically for gas savings (pairs, routers, etc) mapping(address => bool) internal _erc721TransferExempt; /// @dev EIP-2612 nonces mapping(address => uint256) public nonces; /// @dev Address bitmask for packed ownership data uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; /// @dev Owned index bitmask for packed ownership data uint256 private constant _BITMASK_OWNED_INDEX = ((1 << 96) - 1) << 160; /// @dev Constant for token id encoding uint256 public constant ID_ENCODING_PREFIX = 1 << 255; constructor( string memory name_, string memory symbol_, uint8 decimals_, uint256 maxTotalSupplyERC721_ ) { name = name_; symbol = symbol_; maxTotalSupplyERC721 = maxTotalSupplyERC721_; if (decimals_ < 18) { revert DecimalsTooLow(); } decimals = decimals_; units = 10 ** decimals; // EIP-2612 initialization _INITIAL_CHAIN_ID = block.chainid; _INITIAL_DOMAIN_SEPARATOR = _computeDomainSeparator(); } /// @notice Function to find owner of a given ERC-721 token function ownerOf( uint256 id_ ) public view virtual returns (address erc721Owner) { erc721Owner = _getOwnerOf(id_); if (!_isValidTokenId(id_)) { revert InvalidTokenId(); } if (erc721Owner == address(0)) { revert NotFound(); } } function owned( address owner_ ) public view virtual returns (uint256[] memory) { return _owned[owner_]; } function erc721BalanceOf( address owner_ ) public view virtual returns (uint256) { return _owned[owner_].length; } function erc20BalanceOf( address owner_ ) public view virtual returns (uint256) { return balanceOf[owner_]; } function erc20TotalSupply() public view virtual returns (uint256) { return _totalSupply; } function totalSupply() public view virtual returns (uint256) { // remove on bscscan & etherscan // if (minted > 0) { // return maxTotalSupplyERC721; // } return _totalSupply; } function erc721TotalSupply() public view virtual returns (uint256) { return minted; } function getERC721QueueLength() public view virtual returns (uint256) { return _storedERC721Ids.length(); } function getERC721TokensInQueue( uint256 start_, uint256 count_ ) public view virtual returns (uint256[] memory) { uint256[] memory tokensInQueue = new uint256[](count_); for (uint256 i = start_; i < start_ + count_; ) { tokensInQueue[i - start_] = _storedERC721Ids.at(i); unchecked { ++i; } } return tokensInQueue; } /// @notice tokenURI must be implemented by child contract function tokenURI(uint256 id_) public view virtual returns (string memory); /// @notice Function for token approvals /// @dev This function assumes the operator is attempting to approve /// an ERC-721 if valueOrId_ is a possibly valid ERC-721 token id. /// Unlike setApprovalForAll, spender_ must be allowed to be 0x0 so /// that approval can be revoked. function approve( address spender_, uint256 valueOrId_ ) public virtual returns (bool) { if (_isValidTokenId(valueOrId_)) { erc721Approve(spender_, valueOrId_); } else { return erc20Approve(spender_, valueOrId_); } return true; } function erc721Approve(address spender_, uint256 id_) public virtual { // Intention is to approve as ERC-721 token (id). address erc721Owner = _getOwnerOf(id_); if ( msg.sender != erc721Owner && !isApprovedForAll[erc721Owner][msg.sender] ) { revert Unauthorized(); } getApproved[id_] = spender_; emit ERC721Events.Approval(erc721Owner, spender_, id_); } /// @dev Providing type(uint256).max for approval value results in an /// unlimited approval that is not deducted from on transfers. function erc20Approve( address spender_, uint256 value_ ) public virtual returns (bool) { // Prevent granting 0x0 an ERC-20 allowance. if (spender_ == address(0)) { revert InvalidSpender(); } allowance[msg.sender][spender_] = value_; emit ERC20Events.Approval(msg.sender, spender_, value_); return true; } /// @notice Function for ERC-721 approvals function setApprovalForAll(address operator_, bool approved_) public virtual { // Prevent approvals to 0x0. if (operator_ == address(0)) { revert InvalidOperator(); } isApprovedForAll[msg.sender][operator_] = approved_; emit ERC721Events.ApprovalForAll(msg.sender, operator_, approved_); } /// @notice Function for mixed transfers from an operator that may be different than 'from'. /// @dev This function assumes the operator is attempting to transfer an ERC-721 /// if valueOrId is a possible valid token id. function transferFrom( address from_, address to_, uint256 valueOrId_ ) public virtual returns (bool) { if (_isValidTokenId(valueOrId_)) { erc721TransferFrom(from_, to_, valueOrId_); } else { // Intention is to transfer as ERC-20 token (value). return erc20TransferFrom(from_, to_, valueOrId_); } return true; } /// @notice Function for ERC-721 transfers from. /// @dev This function is recommended for ERC721 transfers. function erc721TransferFrom( address from_, address to_, uint256 id_ ) public virtual { // Prevent minting tokens from 0x0. if (from_ == address(0)) { revert InvalidSender(); } // Prevent burning tokens to 0x0. if (to_ == address(0)) { revert InvalidRecipient(); } if (from_ != _getOwnerOf(id_)) { revert Unauthorized(); } // Check that the operator is either the sender or approved for the transfer. if ( msg.sender != from_ && !isApprovedForAll[from_][msg.sender] && msg.sender != getApproved[id_] ) { revert Unauthorized(); } // We only need to check ERC-721 transfer exempt status for the recipient // since the sender being ERC-721 transfer exempt means they have already // had their ERC-721s stripped away during the rebalancing process. if (erc721TransferExempt(to_)) { revert RecipientIsERC721TransferExempt(); } // Transfer 1 * units ERC-20 and 1 ERC-721 token. // ERC-721 transfer exemptions handled above. Can't make it to this point if either is transfer exempt. _transferERC20(from_, to_, units); _transferERC721(from_, to_, id_); } /// @notice Function for ERC-20 transfers from. /// @dev This function is recommended for ERC20 transfers function erc20TransferFrom( address from_, address to_, uint256 value_ ) public virtual returns (bool) { // Prevent minting tokens from 0x0. if (from_ == address(0)) { revert InvalidSender(); } // Prevent burning tokens to 0x0. if (to_ == address(0)) { revert InvalidRecipient(); } uint256 allowed = allowance[from_][msg.sender]; // Check that the operator has sufficient allowance. if (allowed != type(uint256).max) { allowance[from_][msg.sender] = allowed - value_; } // Transferring ERC-20s directly requires the _transferERC20WithERC721 function. // Handles ERC-721 exemptions internally. return _transferERC20WithERC721(from_, to_, value_); } /// @notice Function for ERC-20 transfers. /// @dev This function assumes the operator is attempting to transfer as ERC-20 /// given this function is only supported on the ERC-20 interface. /// Treats even large amounts that are valid ERC-721 ids as ERC-20s. function transfer(address to_, uint256 value_) public virtual returns (bool) { // Prevent burning tokens to 0x0. if (to_ == address(0)) { revert InvalidRecipient(); } // Transferring ERC-20s directly requires the _transferERC20WithERC721 function. // Handles ERC-721 exemptions internally. return _transferERC20WithERC721(msg.sender, to_, value_); } /// @notice Function for ERC-721 transfers with contract support. /// This function only supports moving valid ERC-721 ids, as it does not exist on the ERC-20 /// spec and will revert otherwise. function safeTransferFrom( address from_, address to_, uint256 id_ ) public virtual { safeTransferFrom(from_, to_, id_, ""); } /// @notice Function for ERC-721 transfers with contract support and callback data. /// This function only supports moving valid ERC-721 ids, as it does not exist on the /// ERC-20 spec and will revert otherwise. function safeTransferFrom( address from_, address to_, uint256 id_, bytes memory data_ ) public virtual { if (!_isValidTokenId(id_)) { revert InvalidTokenId(); } transferFrom(from_, to_, id_); if ( to_.code.length != 0 && IERC721Receiver(to_).onERC721Received(msg.sender, from_, id_, data_) != IERC721Receiver.onERC721Received.selector ) { revert UnsafeRecipient(); } } /// @notice Function for EIP-2612 permits (ERC-20 only). /// @dev Providing type(uint256).max for permit value results in an /// unlimited approval that is not deducted from on transfers. function permit( address owner_, address spender_, uint256 value_, uint256 deadline_, uint8 v_, bytes32 r_, bytes32 s_ ) public virtual { if (deadline_ < block.timestamp) { revert PermitDeadlineExpired(); } // permit cannot be used for ERC-721 token approvals, so ensure // the value does not fall within the valid range of ERC-721 token ids. if (_isValidTokenId(value_)) { revert InvalidApproval(); } if (spender_ == address(0)) { revert InvalidSpender(); } unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner_, spender_, value_, nonces[owner_]++, deadline_ ) ) ) ), v_, r_, s_ ); if (recoveredAddress == address(0) || recoveredAddress != owner_) { revert InvalidSigner(); } allowance[recoveredAddress][spender_] = value_; } emit ERC20Events.Approval(owner_, spender_, value_); } /// @notice Returns domain initial domain separator, or recomputes if chain id is not equal to initial chain id function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == _INITIAL_CHAIN_ID ? _INITIAL_DOMAIN_SEPARATOR : _computeDomainSeparator(); } function supportsInterface( bytes4 interfaceId ) public view virtual returns (bool) { return interfaceId == type(IERC404).interfaceId || interfaceId == type(IERC165).interfaceId; } /// @notice Function for self-exemption function setSelfERC721TransferExempt(bool state_) public virtual { _setERC721TransferExempt(msg.sender, state_); } /// @notice Function to check if address is transfer exempt function erc721TransferExempt( address target_ ) public view virtual returns (bool) { return target_ == address(0) || _erc721TransferExempt[target_]; } /// @notice For a token token id to be considered valid, it just needs /// to fall within the range of possible token ids, it does not /// necessarily have to be minted yet. function _isValidTokenId(uint256 id_) internal pure returns (bool) { return id_ > ID_ENCODING_PREFIX && id_ != type(uint256).max; } /// @notice Internal function to compute domain separator for EIP-2612 permits function _computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /// @notice This is the lowest level ERC-20 transfer function, which /// should be used for both normal ERC-20 transfers as well as minting. /// Note that this function allows transfers to and from 0x0. function _transferERC20( address from_, address to_, uint256 value_ ) internal virtual { // Minting is a special case for which we should not check the balance of // the sender, and we should increase the total supply. if (from_ == address(0)) { _totalSupply += value_; } else { // Deduct value from sender's balance. balanceOf[from_] -= value_; } // Update the recipient's balance. // Can be unchecked because on mint, adding to totalSupply is checked, and on transfer balance deduction is checked. unchecked { balanceOf[to_] += value_; } emit ERC20Events.Transfer(from_, to_, value_); } /// @notice Consolidated record keeping function for transferring ERC-721s. /// @dev Assign the token to the new owner, and remove from the old owner. /// Note that this function allows transfers to and from 0x0. /// Does not handle ERC-721 exemptions. function _transferERC721( address from_, address to_, uint256 id_ ) internal virtual { // If this is not a mint, handle record keeping for transfer from previous owner. if (from_ != address(0)) { // On transfer of an NFT, any previous approval is reset. delete getApproved[id_]; uint256 updatedId = _owned[from_][_owned[from_].length - 1]; if (updatedId != id_) { uint256 updatedIndex = _getOwnedIndex(id_); // update _owned for sender _owned[from_][updatedIndex] = updatedId; // update index for the moved id _setOwnedIndex(updatedId, updatedIndex); } // pop _owned[from_].pop(); } // Check if this is a burn. if (to_ != address(0)) { // If not a burn, update the owner of the token to the new owner. // Update owner of the token to the new owner. _setOwnerOf(id_, to_); // Push token onto the new owner's stack. _owned[to_].push(id_); // Update index for new owner's stack. _setOwnedIndex(id_, _owned[to_].length - 1); } else { // If this is a burn, reset the owner of the token to 0x0 by deleting the token from _ownedData. delete _ownedData[id_]; } emit ERC721Events.Transfer(from_, to_, id_); } /// @notice Internal function for ERC-20 transfers. Also handles any ERC-721 transfers that may be required. // Handles ERC-721 exemptions. function _transferERC20WithERC721( address from_, address to_, uint256 value_ ) internal virtual returns (bool) { uint256 erc20BalanceOfSenderBefore = erc20BalanceOf(from_); uint256 erc20BalanceOfReceiverBefore = erc20BalanceOf(to_); _transferERC20(from_, to_, value_); // Preload for gas savings on branches bool isFromERC721TransferExempt = erc721TransferExempt(from_); bool isToERC721TransferExempt = erc721TransferExempt(to_); // Skip _withdrawAndStoreERC721 and/or _retrieveOrMintERC721 for ERC-721 transfer exempt addresses // 1) to save gas // 2) because ERC-721 transfer exempt addresses won't always have/need ERC-721s corresponding to their ERC20s. if (isFromERC721TransferExempt && isToERC721TransferExempt) { // Case 1) Both sender and recipient are ERC-721 transfer exempt. No ERC-721s need to be transferred. // NOOP. } else if (isFromERC721TransferExempt) { // Case 2) The sender is ERC-721 transfer exempt, but the recipient is not. Contract should not attempt // to transfer ERC-721s from the sender, but the recipient should receive ERC-721s // from the bank/minted for any whole number increase in their balance. // Only cares about whole number increments. uint256 tokensToRetrieveOrMint = (balanceOf[to_] / units) - (erc20BalanceOfReceiverBefore / units); for (uint256 i = 0; i < tokensToRetrieveOrMint; ) { _retrieveOrMintERC721(to_); unchecked { ++i; } } } else if (isToERC721TransferExempt) { // Case 3) The sender is not ERC-721 transfer exempt, but the recipient is. Contract should attempt // to withdraw and store ERC-721s from the sender, but the recipient should not // receive ERC-721s from the bank/minted. // Only cares about whole number increments. uint256 tokensToWithdrawAndStore = (erc20BalanceOfSenderBefore / units) - (balanceOf[from_] / units); for (uint256 i = 0; i < tokensToWithdrawAndStore; ) { _withdrawAndStoreERC721(from_); unchecked { ++i; } } } else { // Case 4) Neither the sender nor the recipient are ERC-721 transfer exempt. // Strategy: // 1. First deal with the whole tokens. These are easy and will just be transferred. // 2. Look at the fractional part of the value: // a) If it causes the sender to lose a whole token that was represented by an NFT due to a // fractional part being transferred, withdraw and store an additional NFT from the sender. // b) If it causes the receiver to gain a whole new token that should be represented by an NFT // due to receiving a fractional part that completes a whole token, retrieve or mint an NFT to the recevier. // Whole tokens worth of ERC-20s get transferred as ERC-721s without any burning/minting. uint256 nftsToTransfer = value_ / units; for (uint256 i = 0; i < nftsToTransfer; ) { // Pop from sender's ERC-721 stack and transfer them (LIFO) uint256 indexOfLastToken = _owned[from_].length - 1; uint256 tokenId = _owned[from_][indexOfLastToken]; _transferERC721(from_, to_, tokenId); unchecked { ++i; } } // If the transfer changes either the sender or the recipient's holdings from a fractional to a non-fractional // amount (or vice versa), adjust ERC-721s. // First check if the send causes the sender to lose a whole token that was represented by an ERC-721 // due to a fractional part being transferred. // // Process: // Take the difference between the whole number of tokens before and after the transfer for the sender. // If that difference is greater than the number of ERC-721s transferred (whole units), then there was // an additional ERC-721 lost due to the fractional portion of the transfer. // If this is a self-send and the before and after balances are equal (not always the case but often), // then no ERC-721s will be lost here. if ( erc20BalanceOfSenderBefore / units - erc20BalanceOf(from_) / units > nftsToTransfer ) { _withdrawAndStoreERC721(from_); } // Then, check if the transfer causes the receiver to gain a whole new token which requires gaining // an additional ERC-721. // // Process: // Take the difference between the whole number of tokens before and after the transfer for the recipient. // If that difference is greater than the number of ERC-721s transferred (whole units), then there was // an additional ERC-721 gained due to the fractional portion of the transfer. // Again, for self-sends where the before and after balances are equal, no ERC-721s will be gained here. if ( erc20BalanceOf(to_) / units - erc20BalanceOfReceiverBefore / units > nftsToTransfer ) { _retrieveOrMintERC721(to_); } } return true; } /// @notice Internal function for ERC20 minting /// @dev This function will allow minting of new ERC20s. /// If mintCorrespondingERC721s_ is true, and the recipient is not ERC-721 exempt, it will /// also mint the corresponding ERC721s. /// Handles ERC-721 exemptions. function _mintERC20(address to_, uint256 value_) internal virtual { /// You cannot mint to the zero address (you can't mint and immediately burn in the same transfer). if (to_ == address(0)) { revert InvalidRecipient(); } if (_totalSupply + value_ > ID_ENCODING_PREFIX) { revert MintLimitReached(); } _transferERC20WithERC721(address(0), to_, value_); } /// @notice Internal function for ERC-721 minting and retrieval from the bank. /// @dev This function will allow minting of new ERC-721s up to the total fractional supply. It will /// first try to pull from the bank, and if the bank is empty, it will mint a new token. /// Does not handle ERC-721 exemptions. function _retrieveOrMintERC721(address to_) internal virtual { if (to_ == address(0)) { revert InvalidRecipient(); } uint256 id; if (!_storedERC721Ids.empty()) { // If there are any tokens in the bank, use those first. // Pop off the end of the queue (FIFO). id = _storedERC721Ids.popBack(); } else { // Otherwise, mint a new token, should not be able to go over the total fractional supply. ++minted; // Reserve max uint256 for approvals if (minted == type(uint256).max) { revert MintLimitReached(); } id = ID_ENCODING_PREFIX + minted; } address erc721Owner = _getOwnerOf(id); // The token should not already belong to anyone besides 0x0 or this contract. // If it does, something is wrong, as this should never happen. if (erc721Owner != address(0)) { revert AlreadyExists(); } // Transfer the token to the recipient, either transferring from the contract's bank or minting. // Does not handle ERC-721 exemptions. _transferERC721(erc721Owner, to_, id); } /// @notice Internal function for ERC-721 deposits to bank (this contract). /// @dev This function will allow depositing of ERC-721s to the bank, which can be retrieved by future minters. // Does not handle ERC-721 exemptions. function _withdrawAndStoreERC721(address from_) internal virtual { if (from_ == address(0)) { revert InvalidSender(); } // Retrieve the latest token added to the owner's stack (LIFO). uint256 id = _owned[from_][_owned[from_].length - 1]; // Transfer to 0x0. // Does not handle ERC-721 exemptions. _transferERC721(from_, address(0), id); // Record the token in the contract's bank queue. _storedERC721Ids.pushFront(id); } /// @notice Initialization function to set pairs / etc, saving gas by avoiding mint / burn on unnecessary targets function _setERC721TransferExempt( address target_, bool state_ ) internal virtual { if (target_ == address(0)) { revert InvalidExemption(); } // Adjust the ERC721 balances of the target to respect exemption rules. // Despite this logic, it is still recommended practice to exempt prior to the target // having an active balance. if (state_) { _clearERC721Balance(target_); } else { _reinstateERC721Balance(target_); } _erc721TransferExempt[target_] = state_; } /// @notice Function to reinstate balance on exemption removal function _reinstateERC721Balance(address target_) private { uint256 expectedERC721Balance = erc20BalanceOf(target_) / units; uint256 actualERC721Balance = erc721BalanceOf(target_); for (uint256 i = 0; i < expectedERC721Balance - actualERC721Balance; ) { // Transfer ERC721 balance in from pool _retrieveOrMintERC721(target_); unchecked { ++i; } } } /// @notice Function to clear balance on exemption inclusion function _clearERC721Balance(address target_) private { uint256 erc721Balance = erc721BalanceOf(target_); for (uint256 i = 0; i < erc721Balance; ) { // Transfer out ERC721 balance _withdrawAndStoreERC721(target_); unchecked { ++i; } } } function _getOwnerOf( uint256 id_ ) internal view virtual returns (address ownerOf_) { uint256 data = _ownedData[id_]; assembly { ownerOf_ := and(data, _BITMASK_ADDRESS) } } function _setOwnerOf(uint256 id_, address owner_) internal virtual { uint256 data = _ownedData[id_]; assembly { data := add( and(data, _BITMASK_OWNED_INDEX), and(owner_, _BITMASK_ADDRESS) ) } _ownedData[id_] = data; } function _getOwnedIndex( uint256 id_ ) internal view virtual returns (uint256 ownedIndex_) { uint256 data = _ownedData[id_]; assembly { ownedIndex_ := shr(160, data) } } function _setOwnedIndex(uint256 id_, uint256 index_) internal virtual { uint256 data = _ownedData[id_]; if (index_ > _BITMASK_OWNED_INDEX >> 160) { revert OwnedIndexOverflow(); } assembly { data := add( and(data, _BITMASK_ADDRESS), and(shl(160, index_), _BITMASK_OWNED_INDEX) ) } _ownedData[id_] = data; } } // File: @openzeppelin/contracts/utils/math/SignedMath.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @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); } } } // File: @openzeppelin/contracts/utils/math/Math.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the 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 towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (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 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) 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. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 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. uint256 twos = denominator & (0 - denominator); 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 (unsignedRoundsUp(rounding) && 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 * towards zero. * * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } } // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @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), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(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) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } 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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } } // File: @openzeppelin/contracts/utils/Context.sol // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } } // File: @openzeppelin/contracts/access/Ownable.sol // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File: contracts/examples/EgorasSmartGenerator.sol pragma solidity ^0.8.0; contract EgorasSmartGenerator is Ownable, ERC404 { constructor( string memory name_, string memory symbol_, uint8 decimals_, uint256 maxTotalSupplyERC721_, address initialOwner_, address initialMintRecipient_ ) ERC404(name_, symbol_, decimals_, maxTotalSupplyERC721_) Ownable(initialOwner_) { // Do not mint the ERC721s to the initial owner, as it's a waste of gas. _setERC721TransferExempt(initialMintRecipient_, true); _mintERC20(initialMintRecipient_, maxTotalSupplyERC721_ * units); } function tokenURI(uint256 id_) public pure override returns (string memory) { return string.concat("https://tokens.egoras.com/tokens/", Strings.toString(id_) , ".json"); } function setERC721TransferExempt( address account_, bool value_ ) external onlyOwner { _setERC721TransferExempt(account_, value_); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"uint256","name":"maxTotalSupplyERC721_","type":"uint256"},{"internalType":"address","name":"initialOwner_","type":"address"},{"internalType":"address","name":"initialMintRecipient_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyExists","type":"error"},{"inputs":[],"name":"DecimalsTooLow","type":"error"},{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"InvalidApproval","type":"error"},{"inputs":[],"name":"InvalidExemption","type":"error"},{"inputs":[],"name":"InvalidOperator","type":"error"},{"inputs":[],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidSender","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[],"name":"InvalidSpender","type":"error"},{"inputs":[],"name":"InvalidTokenId","type":"error"},{"inputs":[],"name":"MintLimitReached","type":"error"},{"inputs":[],"name":"NotFound","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnedIndexOverflow","type":"error"},{"inputs":[],"name":"PermitDeadlineExpired","type":"error"},{"inputs":[],"name":"QueueEmpty","type":"error"},{"inputs":[],"name":"QueueFull","type":"error"},{"inputs":[],"name":"QueueOutOfBounds","type":"error"},{"inputs":[],"name":"RecipientIsERC721TransferExempt","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UnsafeRecipient","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ID_ENCODING_PREFIX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender_","type":"address"},{"internalType":"uint256","name":"valueOrId_","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"erc20Approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"erc20BalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc20TotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"erc20TransferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"erc721Approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"erc721BalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc721TotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target_","type":"address"}],"name":"erc721TransferExempt","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"erc721TransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getERC721QueueLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"start_","type":"uint256"},{"internalType":"uint256","name":"count_","type":"uint256"}],"name":"getERC721TokensInQueue","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"owned","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"erc721Owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"spender_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"},{"internalType":"uint256","name":"deadline_","type":"uint256"},{"internalType":"uint8","name":"v_","type":"uint8"},{"internalType":"bytes32","name":"r_","type":"bytes32"},{"internalType":"bytes32","name":"s_","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"},{"internalType":"bytes","name":"data_","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator_","type":"address"},{"internalType":"bool","name":"approved_","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"},{"internalType":"bool","name":"value_","type":"bool"}],"name":"setERC721TransferExempt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"state_","type":"bool"}],"name":"setSelfERC721TransferExempt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"valueOrId_","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"units","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
61010060405234801562000011575f80fd5b506040516200355c3803806200355c833981016040819052620000349162000c99565b85858585856001600160a01b0381166200006757604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b620000728162000121565b50600362000081858262000dcd565b50600462000090848262000dcd565b506005819055601260ff83161015620000bc576040516398790fd560e01b815260040160405180910390fd5b60ff82166080819052620000d290600a62000fa6565b60a0524660c052620000e362000170565b60e05250620000fa9250839150600190506200020b565b620001158160a051856200010f919062000fbd565b62000280565b505050505050620010e0565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6003604051620001a3919062000fd7565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6001600160a01b038216620002335760405163a41e3d3f60e01b815260040160405180910390fd5b80156200024b576200024582620002ef565b62000256565b620002568262000326565b6001600160a01b03919091165f908152600e60205260409020805460ff1916911515919091179055565b6001600160a01b038216620002a857604051634e46966960e11b815260040160405180910390fd5b600160ff1b81600654620002bd919062001051565b1115620002dd5760405163303b682f60e01b815260040160405180910390fd5b620002ea5f8383620003aa565b505050565b6001600160a01b0381165f908152600d6020526040812054905b81811015620002ea576200031d8362000649565b60010162000309565b60a0515f906200034a836001600160a01b03165f9081526008602052604090205490565b62000356919062001067565b90505f62000378836001600160a01b03165f908152600d602052604090205490565b90505f5b62000388828462001087565b811015620003a4576200039b84620006da565b6001016200037c565b50505050565b6001600160a01b038381165f90815260086020526040808220549285168252812054909190620003dc868686620007cd565b5f620003e8876200087b565b90505f620003f6876200087b565b9050818015620004035750805b6200063b5781156200047c575f60a0518462000420919062001067565b60a0516001600160a01b038a165f9081526008602052604090205462000447919062001067565b62000453919062001087565b90505f5b8181101562000474576200046b89620006da565b60010162000457565b50506200063b565b8015620004e75760a0516001600160a01b0389165f908152600860205260408120549091620004ab9162001067565b60a051620004ba908762001067565b620004c6919062001087565b90505f5b818110156200047457620004de8a62000649565b600101620004ca565b5f60a05187620004f8919062001067565b90505f5b8181101562000585576001600160a01b038a165f908152600d60205260408120546200052b9060019062001087565b6001600160a01b038c165f908152600d6020526040812080549293509091839081106200055c576200055c6200109d565b905f5260205f20015490506200057a8c8c83620008b060201b60201c565b5050600101620004fc565b5060a0518190620005aa8b6001600160a01b03165f9081526008602052604090205490565b620005b6919062001067565b60a051620005c5908862001067565b620005d1919062001087565b1115620005e357620005e38962000649565b8060a05185620005f4919062001067565b60a0516001600160a01b038b165f908152600860205260409020546200061b919062001067565b62000627919062001087565b111562000639576200063988620006da565b505b506001979650505050505050565b6001600160a01b0381166200067157604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381165f908152600d602052604081208054620006989060019062001087565b81548110620006ab57620006ab6200109d565b905f5260205f2001549050620006c9825f83620008b060201b60201c565b620006d660018262000a7f565b5050565b6001600160a01b0381166200070257604051634e46966960e11b815260040160405180910390fd5b5f62000722600154600160801b81046001600160801b0390811691161490565b6200073b5762000733600162000ae8565b905062000789565b60075f81546200074b90620010b1565b90915550600754600101620007735760405163303b682f60e01b815260040160405180910390fd5b6007546200078690600160ff1b62001051565b90505b5f818152600c60205260409020546001600160a01b03168015620007c05760405163119b4fd360e11b815260040160405180910390fd5b620002ea818484620008b0565b6001600160a01b038316620007fb578060065f828254620007ef919062001051565b909155506200082a9050565b6001600160a01b0383165f90815260086020526040812080548392906200082490849062001087565b90915550505b6001600160a01b038083165f81815260086020526040908190208054850190555190918516905f805160206200353c833981519152906200086e9085815260200190565b60405180910390a3505050565b5f6001600160a01b0382161580620008aa57506001600160a01b0382165f908152600e602052604090205460ff165b92915050565b6001600160a01b03831615620009c0575f818152600a6020908152604080832080546001600160a01b03191690556001600160a01b0386168352600d90915281208054620009019060019062001087565b815481106200091457620009146200109d565b905f5260205f200154905081811462000982575f828152600c602052604081205460a01c6001600160a01b0386165f908152600d6020526040902080549192508391839081106200096957620009696200109d565b5f9182526020909120015562000980828262000b56565b505b6001600160a01b0384165f908152600d60205260409020805480620009ab57620009ab620010cc565b600190038181905f5260205f20015f90559055505b6001600160a01b0382161562000a3c575f818152600c6020908152604080832080546001600160a01b0319166001600160a01b038716908101909155808452600d8352908320805460018181018355828652938520018590559252905462000a3691839162000a30919062001087565b62000b56565b62000a4b565b5f818152600c60205260408120555b80826001600160a01b0316846001600160a01b03165f805160206200353c83398151915260405160405180910390a4505050565b81546001600160801b038082165f190191600160801b900481169082160362000abb57604051638acb5f2760e01b815260040160405180910390fd5b6001600160801b03165f81815260018401602052604090209190915581546001600160801b031916179055565b80545f906001600160801b03600160801b820481169116810362000b1f576040516375e52f4f60e01b815260040160405180910390fd5b5f19016001600160801b039081165f818152600185016020526040812080549190558454909216600160801b909102179092555090565b5f828152600c60205260409020546001600160601b0382111562000b8d57604051633f2cd0e360e21b815260040160405180910390fd5b5f928352600c60205260409092206001600160a01b039290921660a09190911b6001600160a01b031916019055565b634e487b7160e01b5f52604160045260245ffd5b5f82601f83011262000be0575f80fd5b81516001600160401b038082111562000bfd5762000bfd62000bbc565b604051601f8301601f19908116603f0116810190828211818310171562000c285762000c2862000bbc565b816040528381526020925086602085880101111562000c45575f80fd5b5f91505b8382101562000c68578582018301518183018401529082019062000c49565b5f602085830101528094505050505092915050565b80516001600160a01b038116811462000c94575f80fd5b919050565b5f805f805f8060c0878903121562000caf575f80fd5b86516001600160401b038082111562000cc6575f80fd5b62000cd48a838b0162000bd0565b9750602089015191508082111562000cea575f80fd5b5062000cf989828a0162000bd0565b955050604087015160ff8116811462000d10575f80fd5b6060880151909450925062000d286080880162000c7d565b915062000d3860a0880162000c7d565b90509295509295509295565b600181811c9082168062000d5957607f821691505b60208210810362000d7857634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620002ea57805f5260205f20601f840160051c8101602085101562000da55750805b601f840160051c820191505b8181101562000dc6575f815560010162000db1565b5050505050565b81516001600160401b0381111562000de95762000de962000bbc565b62000e018162000dfa845462000d44565b8462000d7e565b602080601f83116001811462000e37575f841562000e1f5750858301515b5f19600386901b1c1916600185901b17855562000e91565b5f85815260208120601f198616915b8281101562000e675788860151825594840194600190910190840162000e46565b508582101562000e8557878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52601160045260245ffd5b600181815b8085111562000eed57815f190482111562000ed15762000ed162000e99565b8085161562000edf57918102915b93841c939080029062000eb2565b509250929050565b5f8262000f0557506001620008aa565b8162000f1357505f620008aa565b816001811462000f2c576002811462000f375762000f57565b6001915050620008aa565b60ff84111562000f4b5762000f4b62000e99565b50506001821b620008aa565b5060208310610133831016604e8410600b841016171562000f7c575081810a620008aa565b62000f88838362000ead565b805f190482111562000f9e5762000f9e62000e99565b029392505050565b5f62000fb660ff84168362000ef5565b9392505050565b8082028115828204841417620008aa57620008aa62000e99565b5f80835462000fe68162000d44565b60018281168015620010015760018114620010175762001045565b60ff198416875282151583028701945062001045565b875f526020805f205f5b858110156200103c5781548a82015290840190820162001021565b50505082870194505b50929695505050505050565b80820180821115620008aa57620008aa62000e99565b5f826200108257634e487b7160e01b5f52601260045260245ffd5b500490565b81810381811115620008aa57620008aa62000e99565b634e487b7160e01b5f52603260045260245ffd5b5f60018201620010c557620010c562000e99565b5060010190565b634e487b7160e01b5f52603160045260245ffd5b60805160a05160c05160e0516123db620011615f395f6107a101525f61077101525f818161044501528181610f8b01528181611352015281816113950152818161140c01528181611436015281816114880152818161152f0152818161157b015281816115bf015281816115e60152611a2501525f61034401526123db5ff3fe608060405234801561000f575f80fd5b506004361061023f575f3560e01c80638a696e5011610135578063c6e672b9116100b4578063dd63769911610079578063dd63769914610566578063dfabc03314610579578063e985e9c51461058c578063f2fde38b146105b9578063f780bc1a146105cc575f80fd5b8063c6e672b9146104f0578063c87b56dd14610503578063d505accf14610516578063d96ca0b914610529578063dd62ed3e1461053c575f80fd5b8063a9059cbb116100fa578063a9059cbb1461047a578063b1ab93171461048d578063b3f9ea34146104ad578063b88d4fde146104d5578063c5ab3ba6146104e8575f80fd5b80638a696e50146104155780638da5cb5b1461042857806395d89b4114610438578063976a843514610440578063a22cb46514610467575f80fd5b80633644e515116101c15780636e8f624b116101865780636e8f624b146103c457806370a08231146103cf578063715018a6146103ee5780637ecebe00146103f657806389fb4c6614610324575f80fd5b80633644e5151461037857806342842e0e146103805780634d966072146103955780634f02c420146103a85780636352211e146103b1575f80fd5b806309674eb01161020757806309674eb01461030957806309f0ef651461031157806318160ddd1461032457806323b872dd1461032c578063313ce5671461033f575f80fd5b806301ffc9a71461024357806302519da31461026b57806306fdde03146102a1578063081812fc146102b6578063095ea7b3146102f6575b5f80fd5b610256610251366004611e27565b6105df565b60405190151581526020015b60405180910390f35b610293610279366004611e58565b6001600160a01b03165f9081526008602052604090205490565b604051908152602001610262565b6102a9610615565b6040516102629190611ebe565b6102de6102c4366004611ed0565b600a6020525f90815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610262565b610256610304366004611ee7565b6106a1565b6102936106d9565b61025661031f366004611e58565b610702565b600654610293565b61025661033a366004611f0f565b610732565b6103667f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610262565b61029361076e565b61039361038e366004611f0f565b6107c3565b005b6102566103a3366004611ee7565b6107e2565b61029360075481565b6102de6103bf366004611ed0565b61086d565b610293600160ff1b81565b6102936103dd366004611e58565b60086020525f908152604090205481565b6103936108d6565b610293610404366004611e58565b600f6020525f908152604090205481565b610393610423366004611f57565b6108e9565b5f546001600160a01b03166102de565b6102a96108f6565b6102937f000000000000000000000000000000000000000000000000000000000000000081565b610393610475366004611f70565b610903565b610256610488366004611ee7565b610995565b6104a061049b366004611e58565b6109c8565b6040516102629190611fa1565b6102936104bb366004611e58565b6001600160a01b03165f908152600d602052604090205490565b6103936104e3366004611ff8565b610a31565b600754610293565b6103936104fe366004611f70565b610b1c565b6102a9610511366004611ed0565b610b32565b6103936105243660046120cd565b610b63565b610256610537366004611f0f565b610da0565b61029361054a36600461213a565b600960209081525f928352604080842090915290825290205481565b610393610574366004611f0f565b610e5c565b610393610587366004611ee7565b610fba565b61025661059a36600461213a565b600b60209081525f928352604080842090915290825290205460ff1681565b6103936105c7366004611e58565b61107c565b6104a06105da366004612162565b6110bb565b5f6001600160e01b0319821663caf91ff560e01b148061060f57506001600160e01b031982166301ffc9a760e01b145b92915050565b6003805461062290612182565b80601f016020809104026020016040519081016040528092919081815260200182805461064e90612182565b80156106995780601f1061067057610100808354040283529160200191610699565b820191905f5260205f20905b81548152906001019060200180831161067c57829003601f168201915b505050505081565b5f6106ab82611157565b156106bf576106ba8383610fba565b6106d0565b6106c983836107e2565b905061060f565b50600192915050565b5f6106fd6001546001600160801b03808216600160801b9092048116919091031690565b905090565b5f6001600160a01b038216158061060f5750506001600160a01b03165f908152600e602052604090205460ff1690565b5f61073c82611157565b156107515761074c848484610e5c565b610763565b61075c848484610da0565b9050610767565b5060015b9392505050565b5f7f0000000000000000000000000000000000000000000000000000000000000000461461079e576106fd61116e565b507f000000000000000000000000000000000000000000000000000000000000000090565b6107dd83838360405180602001604052805f815250610a31565b505050565b5f6001600160a01b03831661080a57604051635461585f60e01b815260040160405180910390fd5b335f8181526009602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350600192915050565b5f818152600c60205260409020546001600160a01b031661088d82611157565b6108aa576040516307ed98ed60e31b815260040160405180910390fd5b6001600160a01b0381166108d15760405163c5723b5160e01b815260040160405180910390fd5b919050565b6108de611207565b6108e75f611233565b565b6108f33382611282565b50565b6004805461062290612182565b6001600160a01b03821661092a5760405163ccea9e6f60e01b815260040160405180910390fd5b335f818152600b602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b5f6001600160a01b0383166109bd57604051634e46966960e11b815260040160405180910390fd5b6107673384846112f0565b6001600160a01b0381165f908152600d6020908152604091829020805483518184028101840190945280845260609392830182828015610a2557602002820191905f5260205f20905b815481526020019060010190808311610a11575b50505050509050919050565b610a3a82611157565b610a57576040516307ed98ed60e31b815260040160405180910390fd5b610a62848484610732565b506001600160a01b0383163b15801590610af85750604051630a85bd0160e11b808252906001600160a01b0385169063150b7a0290610aab9033908990889088906004016121ba565b6020604051808303815f875af1158015610ac7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610aeb91906121f6565b6001600160e01b03191614155b15610b1657604051633da6393160e01b815260040160405180910390fd5b50505050565b610b24611207565b610b2e8282611282565b5050565b6060610b3d82611656565b604051602001610b4d9190612211565b6040516020818303038152906040529050919050565b42841015610b84576040516305787bdf60e01b815260040160405180910390fd5b610b8d85611157565b15610bab576040516303e7c1bd60e31b815260040160405180910390fd5b6001600160a01b038616610bd257604051635461585f60e01b815260040160405180910390fd5b5f6001610bdd61076e565b6001600160a01b038a81165f818152600f602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f1981840301815282825280516020918201205f84529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610ce5573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b0381161580610d1a5750876001600160a01b0316816001600160a01b031614155b15610d3857604051632057875960e21b815260040160405180910390fd5b6001600160a01b039081165f9081526009602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b5f6001600160a01b038416610dc857604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b038316610def57604051634e46966960e11b815260040160405180910390fd5b6001600160a01b0384165f9081526009602090815260408083203384529091529020545f198114610e4857610e248382612282565b6001600160a01b0386165f9081526009602090815260408083203384529091529020555b610e538585856112f0565b95945050505050565b6001600160a01b038316610e8357604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b038216610eaa57604051634e46966960e11b815260040160405180910390fd5b5f818152600c60205260409020546001600160a01b03848116911614610ee2576040516282b42960e81b815260040160405180910390fd5b336001600160a01b03841614801590610f1e57506001600160a01b0383165f908152600b6020908152604080832033845290915290205460ff16155b8015610f4057505f818152600a60205260409020546001600160a01b03163314155b15610f5d576040516282b42960e81b815260040160405180910390fd5b610f6682610702565b15610f8457604051635ce7539760e01b815260040160405180910390fd5b610faf83837f00000000000000000000000000000000000000000000000000000000000000006116e6565b6107dd83838361179f565b5f818152600c60205260409020546001600160a01b031633811480159061100457506001600160a01b0381165f908152600b6020908152604080832033845290915290205460ff16155b15611021576040516282b42960e81b815260040160405180910390fd5b5f828152600a602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b611084611207565b6001600160a01b0381166110b257604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6108f381611233565b60605f8267ffffffffffffffff8111156110d7576110d7611fe4565b604051908082528060200260200182016040528015611100578160200160208202803683370190505b509050835b61110f8486612295565b81101561114f5761112160018261196b565b8261112c8784612282565b8151811061113c5761113c6122a8565b6020908102919091010152600101611105565b509392505050565b5f600160ff1b8211801561060f5750505f19141590565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f600360405161119f91906122bc565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b5f546001600160a01b031633146108e75760405163118cdaa760e01b81523360048201526024016110a9565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0382166112a95760405163a41e3d3f60e01b815260040160405180910390fd5b80156112bd576112b8826119d4565b6112c6565b6112c682611a07565b6001600160a01b03919091165f908152600e60205260409020805460ff1916911515919091179055565b6001600160a01b038381165f908152600860205260408082205492851682528120549091906113208686866116e6565b5f61132a87610702565b90505f61133687610702565b90508180156113425750805b6116485781156113e8575f6113777f00000000000000000000000000000000000000000000000000000000000000008561235a565b6001600160a01b0389165f908152600860205260409020546113ba907f00000000000000000000000000000000000000000000000000000000000000009061235a565b6113c49190612282565b90505f5b818110156113e1576113d989611a91565b6001016113c8565b5050611648565b8015611482576001600160a01b0388165f90815260086020526040812054611431907f00000000000000000000000000000000000000000000000000000000000000009061235a565b61145b7f00000000000000000000000000000000000000000000000000000000000000008761235a565b6114659190612282565b90505f5b818110156113e15761147a8a611b76565b600101611469565b5f6114ad7f00000000000000000000000000000000000000000000000000000000000000008861235a565b90505f5b8181101561152b576001600160a01b038a165f908152600d60205260408120546114dd90600190612282565b6001600160a01b038c165f908152600d60205260408120805492935090918390811061150b5761150b6122a8565b905f5260205f20015490506115218c8c8361179f565b50506001016114b1565b50807f000000000000000000000000000000000000000000000000000000000000000061156c8b6001600160a01b03165f9081526008602052604090205490565b611576919061235a565b6115a07f00000000000000000000000000000000000000000000000000000000000000008861235a565b6115aa9190612282565b11156115b9576115b989611b76565b806115e47f00000000000000000000000000000000000000000000000000000000000000008661235a565b7f00000000000000000000000000000000000000000000000000000000000000006116238b6001600160a01b03165f9081526008602052604090205490565b61162d919061235a565b6116379190612282565b11156116465761164688611a91565b505b506001979650505050505050565b60605f61166283611bf3565b60010190505f8167ffffffffffffffff81111561168157611681611fe4565b6040519080825280601f01601f1916602001820160405280156116ab576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846116b557509392505050565b6001600160a01b038316611710578060065f8282546117059190612295565b9091555061173d9050565b6001600160a01b0383165f9081526008602052604081208054839290611737908490612282565b90915550505b6001600160a01b038083165f81815260086020526040908190208054850190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906117929085815260200190565b60405180910390a3505050565b6001600160a01b038316156118a0575f818152600a6020908152604080832080546001600160a01b03191690556001600160a01b0386168352600d909152812080546117ed90600190612282565b815481106117fd576117fd6122a8565b905f5260205f2001549050818114611865575f828152600c602052604081205460a01c6001600160a01b0386165f908152600d60205260409020805491925083918390811061184e5761184e6122a8565b5f918252602090912001556118638282611cca565b505b6001600160a01b0384165f908152600d6020526040902080548061188b5761188b612379565b600190038181905f5260205f20015f90559055505b6001600160a01b03821615611916575f818152600c6020908152604080832080546001600160a01b0319166001600160a01b038716908101909155808452600d8352908320805460018181018355828652938520018590559252905461191191839161190c9190612282565b611cca565b611925565b5f818152600c60205260408120555b80826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b5f61198e83546001600160801b03808216600160801b9092048116919091031690565b82106119ad5760405163580821e760e01b815260040160405180910390fd5b5081546001600160801b039081168201165f90815260018301602052604090205492915050565b6001600160a01b0381165f908152600d6020526040812054905b818110156107dd576119ff83611b76565b6001016119ee565b6001600160a01b0381165f90815260086020526040812054611a4a907f00000000000000000000000000000000000000000000000000000000000000009061235a565b90505f611a6b836001600160a01b03165f908152600d602052604090205490565b90505f5b611a798284612282565b811015610b1657611a8984611a91565b600101611a6f565b6001600160a01b038116611ab857604051634e46966960e11b815260040160405180910390fd5b5f611ad7600154600160801b81046001600160801b0390811691161490565b611aec57611ae56001611d34565b9050611b35565b60075f8154611afa9061238d565b90915550600754600101611b215760405163303b682f60e01b815260040160405180910390fd5b600754611b3290600160ff1b612295565b90505b5f818152600c60205260409020546001600160a01b03168015611b6b5760405163119b4fd360e11b815260040160405180910390fd5b6107dd81848461179f565b6001600160a01b038116611b9d57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381165f908152600d602052604081208054611bc290600190612282565b81548110611bd257611bd26122a8565b905f5260205f2001549050611be8825f8361179f565b610b2e600182611da1565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611c315772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611c5d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611c7b57662386f26fc10000830492506010015b6305f5e1008310611c93576305f5e100830492506008015b6127108310611ca757612710830492506004015b60648310611cb9576064830492506002015b600a831061060f5760010192915050565b5f828152600c60205260409020546bffffffffffffffffffffffff821115611d0557604051633f2cd0e360e21b815260040160405180910390fd5b5f928352600c60205260409092206001600160a01b039290921660a09190911b6001600160a01b031916019055565b80545f906001600160801b03600160801b8204811691168103611d6a576040516375e52f4f60e01b815260040160405180910390fd5b5f19016001600160801b039081165f818152600185016020526040812080549190558454909216600160801b909102179092555090565b81546001600160801b038082165f190191600160801b9004811690821603611ddc57604051638acb5f2760e01b815260040160405180910390fd5b6001600160801b03165f81815260018401602052604090209190915581546fffffffffffffffffffffffffffffffff1916179055565b6001600160e01b0319811681146108f3575f80fd5b5f60208284031215611e37575f80fd5b813561076781611e12565b80356001600160a01b03811681146108d1575f80fd5b5f60208284031215611e68575f80fd5b61076782611e42565b5f5b83811015611e8b578181015183820152602001611e73565b50505f910152565b5f8151808452611eaa816020860160208601611e71565b601f01601f19169290920160200192915050565b602081525f6107676020830184611e93565b5f60208284031215611ee0575f80fd5b5035919050565b5f8060408385031215611ef8575f80fd5b611f0183611e42565b946020939093013593505050565b5f805f60608486031215611f21575f80fd5b611f2a84611e42565b9250611f3860208501611e42565b9150604084013590509250925092565b803580151581146108d1575f80fd5b5f60208284031215611f67575f80fd5b61076782611f48565b5f8060408385031215611f81575f80fd5b611f8a83611e42565b9150611f9860208401611f48565b90509250929050565b602080825282518282018190525f9190848201906040850190845b81811015611fd857835183529284019291840191600101611fbc565b50909695505050505050565b634e487b7160e01b5f52604160045260245ffd5b5f805f806080858703121561200b575f80fd5b61201485611e42565b935061202260208601611e42565b925060408501359150606085013567ffffffffffffffff80821115612045575f80fd5b818701915087601f830112612058575f80fd5b81358181111561206a5761206a611fe4565b604051601f8201601f19908116603f0116810190838211818310171561209257612092611fe4565b816040528281528a60208487010111156120aa575f80fd5b826020860160208301375f60208483010152809550505050505092959194509250565b5f805f805f805f60e0888a0312156120e3575f80fd5b6120ec88611e42565b96506120fa60208901611e42565b95506040880135945060608801359350608088013560ff8116811461211d575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f806040838503121561214b575f80fd5b61215483611e42565b9150611f9860208401611e42565b5f8060408385031215612173575f80fd5b50508035926020909101359150565b600181811c9082168061219657607f821691505b6020821081036121b457634e487b7160e01b5f52602260045260245ffd5b50919050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906121ec90830184611e93565b9695505050505050565b5f60208284031215612206575f80fd5b815161076781611e12565b7f68747470733a2f2f746f6b656e732e65676f7261732e636f6d2f746f6b656e738152602f60f81b60208201525f8251612252816021850160208701611e71565b64173539b7b760d91b6021939091019283015250602601919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561060f5761060f61226e565b8082018082111561060f5761060f61226e565b634e487b7160e01b5f52603260045260245ffd5b5f8083545f60018260011c915060018316806122d957607f831692505b602080841082036122f857634e487b7160e01b5f52602260045260245ffd5b81801561230c57600181146123215761234c565b60ff198616895284151585028901965061234c565b5f8a8152602090205f5b868110156123445781548b82015290850190830161232b565b505084890196505b509498975050505050505050565b5f8261237457634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603160045260245ffd5b5f6001820161239e5761239e61226e565b506001019056fea26469706673582212207ac9c6d29640ff10720f4e5061023b5b8891f3d72ad4ffbfe584b73793e8fe4a64736f6c63430008180033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000003a980000000000000000000000006f24c8ade0fa9e348cf75d0ffe82a958d8ea859a000000000000000000000000de41bab358b663293179858a6e97c8b183979348000000000000000000000000000000000000000000000000000000000000000a45676f73746174696f6e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044553544100000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061023f575f3560e01c80638a696e5011610135578063c6e672b9116100b4578063dd63769911610079578063dd63769914610566578063dfabc03314610579578063e985e9c51461058c578063f2fde38b146105b9578063f780bc1a146105cc575f80fd5b8063c6e672b9146104f0578063c87b56dd14610503578063d505accf14610516578063d96ca0b914610529578063dd62ed3e1461053c575f80fd5b8063a9059cbb116100fa578063a9059cbb1461047a578063b1ab93171461048d578063b3f9ea34146104ad578063b88d4fde146104d5578063c5ab3ba6146104e8575f80fd5b80638a696e50146104155780638da5cb5b1461042857806395d89b4114610438578063976a843514610440578063a22cb46514610467575f80fd5b80633644e515116101c15780636e8f624b116101865780636e8f624b146103c457806370a08231146103cf578063715018a6146103ee5780637ecebe00146103f657806389fb4c6614610324575f80fd5b80633644e5151461037857806342842e0e146103805780634d966072146103955780634f02c420146103a85780636352211e146103b1575f80fd5b806309674eb01161020757806309674eb01461030957806309f0ef651461031157806318160ddd1461032457806323b872dd1461032c578063313ce5671461033f575f80fd5b806301ffc9a71461024357806302519da31461026b57806306fdde03146102a1578063081812fc146102b6578063095ea7b3146102f6575b5f80fd5b610256610251366004611e27565b6105df565b60405190151581526020015b60405180910390f35b610293610279366004611e58565b6001600160a01b03165f9081526008602052604090205490565b604051908152602001610262565b6102a9610615565b6040516102629190611ebe565b6102de6102c4366004611ed0565b600a6020525f90815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610262565b610256610304366004611ee7565b6106a1565b6102936106d9565b61025661031f366004611e58565b610702565b600654610293565b61025661033a366004611f0f565b610732565b6103667f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff9091168152602001610262565b61029361076e565b61039361038e366004611f0f565b6107c3565b005b6102566103a3366004611ee7565b6107e2565b61029360075481565b6102de6103bf366004611ed0565b61086d565b610293600160ff1b81565b6102936103dd366004611e58565b60086020525f908152604090205481565b6103936108d6565b610293610404366004611e58565b600f6020525f908152604090205481565b610393610423366004611f57565b6108e9565b5f546001600160a01b03166102de565b6102a96108f6565b6102937f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b610393610475366004611f70565b610903565b610256610488366004611ee7565b610995565b6104a061049b366004611e58565b6109c8565b6040516102629190611fa1565b6102936104bb366004611e58565b6001600160a01b03165f908152600d602052604090205490565b6103936104e3366004611ff8565b610a31565b600754610293565b6103936104fe366004611f70565b610b1c565b6102a9610511366004611ed0565b610b32565b6103936105243660046120cd565b610b63565b610256610537366004611f0f565b610da0565b61029361054a36600461213a565b600960209081525f928352604080842090915290825290205481565b610393610574366004611f0f565b610e5c565b610393610587366004611ee7565b610fba565b61025661059a36600461213a565b600b60209081525f928352604080842090915290825290205460ff1681565b6103936105c7366004611e58565b61107c565b6104a06105da366004612162565b6110bb565b5f6001600160e01b0319821663caf91ff560e01b148061060f57506001600160e01b031982166301ffc9a760e01b145b92915050565b6003805461062290612182565b80601f016020809104026020016040519081016040528092919081815260200182805461064e90612182565b80156106995780601f1061067057610100808354040283529160200191610699565b820191905f5260205f20905b81548152906001019060200180831161067c57829003601f168201915b505050505081565b5f6106ab82611157565b156106bf576106ba8383610fba565b6106d0565b6106c983836107e2565b905061060f565b50600192915050565b5f6106fd6001546001600160801b03808216600160801b9092048116919091031690565b905090565b5f6001600160a01b038216158061060f5750506001600160a01b03165f908152600e602052604090205460ff1690565b5f61073c82611157565b156107515761074c848484610e5c565b610763565b61075c848484610da0565b9050610767565b5060015b9392505050565b5f7f0000000000000000000000000000000000000000000000000000000000000001461461079e576106fd61116e565b507f261bd93868b7269d3a3366f475344a9bc293cb1c6c6990a844b8f5b10fb489e390565b6107dd83838360405180602001604052805f815250610a31565b505050565b5f6001600160a01b03831661080a57604051635461585f60e01b815260040160405180910390fd5b335f8181526009602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350600192915050565b5f818152600c60205260409020546001600160a01b031661088d82611157565b6108aa576040516307ed98ed60e31b815260040160405180910390fd5b6001600160a01b0381166108d15760405163c5723b5160e01b815260040160405180910390fd5b919050565b6108de611207565b6108e75f611233565b565b6108f33382611282565b50565b6004805461062290612182565b6001600160a01b03821661092a5760405163ccea9e6f60e01b815260040160405180910390fd5b335f818152600b602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b5f6001600160a01b0383166109bd57604051634e46966960e11b815260040160405180910390fd5b6107673384846112f0565b6001600160a01b0381165f908152600d6020908152604091829020805483518184028101840190945280845260609392830182828015610a2557602002820191905f5260205f20905b815481526020019060010190808311610a11575b50505050509050919050565b610a3a82611157565b610a57576040516307ed98ed60e31b815260040160405180910390fd5b610a62848484610732565b506001600160a01b0383163b15801590610af85750604051630a85bd0160e11b808252906001600160a01b0385169063150b7a0290610aab9033908990889088906004016121ba565b6020604051808303815f875af1158015610ac7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610aeb91906121f6565b6001600160e01b03191614155b15610b1657604051633da6393160e01b815260040160405180910390fd5b50505050565b610b24611207565b610b2e8282611282565b5050565b6060610b3d82611656565b604051602001610b4d9190612211565b6040516020818303038152906040529050919050565b42841015610b84576040516305787bdf60e01b815260040160405180910390fd5b610b8d85611157565b15610bab576040516303e7c1bd60e31b815260040160405180910390fd5b6001600160a01b038616610bd257604051635461585f60e01b815260040160405180910390fd5b5f6001610bdd61076e565b6001600160a01b038a81165f818152600f602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f1981840301815282825280516020918201205f84529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610ce5573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b0381161580610d1a5750876001600160a01b0316816001600160a01b031614155b15610d3857604051632057875960e21b815260040160405180910390fd5b6001600160a01b039081165f9081526009602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b5f6001600160a01b038416610dc857604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b038316610def57604051634e46966960e11b815260040160405180910390fd5b6001600160a01b0384165f9081526009602090815260408083203384529091529020545f198114610e4857610e248382612282565b6001600160a01b0386165f9081526009602090815260408083203384529091529020555b610e538585856112f0565b95945050505050565b6001600160a01b038316610e8357604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b038216610eaa57604051634e46966960e11b815260040160405180910390fd5b5f818152600c60205260409020546001600160a01b03848116911614610ee2576040516282b42960e81b815260040160405180910390fd5b336001600160a01b03841614801590610f1e57506001600160a01b0383165f908152600b6020908152604080832033845290915290205460ff16155b8015610f4057505f818152600a60205260409020546001600160a01b03163314155b15610f5d576040516282b42960e81b815260040160405180910390fd5b610f6682610702565b15610f8457604051635ce7539760e01b815260040160405180910390fd5b610faf83837f0000000000000000000000000000000000000000000000000de0b6b3a76400006116e6565b6107dd83838361179f565b5f818152600c60205260409020546001600160a01b031633811480159061100457506001600160a01b0381165f908152600b6020908152604080832033845290915290205460ff16155b15611021576040516282b42960e81b815260040160405180910390fd5b5f828152600a602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b611084611207565b6001600160a01b0381166110b257604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6108f381611233565b60605f8267ffffffffffffffff8111156110d7576110d7611fe4565b604051908082528060200260200182016040528015611100578160200160208202803683370190505b509050835b61110f8486612295565b81101561114f5761112160018261196b565b8261112c8784612282565b8151811061113c5761113c6122a8565b6020908102919091010152600101611105565b509392505050565b5f600160ff1b8211801561060f5750505f19141590565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f600360405161119f91906122bc565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b5f546001600160a01b031633146108e75760405163118cdaa760e01b81523360048201526024016110a9565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0382166112a95760405163a41e3d3f60e01b815260040160405180910390fd5b80156112bd576112b8826119d4565b6112c6565b6112c682611a07565b6001600160a01b03919091165f908152600e60205260409020805460ff1916911515919091179055565b6001600160a01b038381165f908152600860205260408082205492851682528120549091906113208686866116e6565b5f61132a87610702565b90505f61133687610702565b90508180156113425750805b6116485781156113e8575f6113777f0000000000000000000000000000000000000000000000000de0b6b3a76400008561235a565b6001600160a01b0389165f908152600860205260409020546113ba907f0000000000000000000000000000000000000000000000000de0b6b3a76400009061235a565b6113c49190612282565b90505f5b818110156113e1576113d989611a91565b6001016113c8565b5050611648565b8015611482576001600160a01b0388165f90815260086020526040812054611431907f0000000000000000000000000000000000000000000000000de0b6b3a76400009061235a565b61145b7f0000000000000000000000000000000000000000000000000de0b6b3a76400008761235a565b6114659190612282565b90505f5b818110156113e15761147a8a611b76565b600101611469565b5f6114ad7f0000000000000000000000000000000000000000000000000de0b6b3a76400008861235a565b90505f5b8181101561152b576001600160a01b038a165f908152600d60205260408120546114dd90600190612282565b6001600160a01b038c165f908152600d60205260408120805492935090918390811061150b5761150b6122a8565b905f5260205f20015490506115218c8c8361179f565b50506001016114b1565b50807f0000000000000000000000000000000000000000000000000de0b6b3a764000061156c8b6001600160a01b03165f9081526008602052604090205490565b611576919061235a565b6115a07f0000000000000000000000000000000000000000000000000de0b6b3a76400008861235a565b6115aa9190612282565b11156115b9576115b989611b76565b806115e47f0000000000000000000000000000000000000000000000000de0b6b3a76400008661235a565b7f0000000000000000000000000000000000000000000000000de0b6b3a76400006116238b6001600160a01b03165f9081526008602052604090205490565b61162d919061235a565b6116379190612282565b11156116465761164688611a91565b505b506001979650505050505050565b60605f61166283611bf3565b60010190505f8167ffffffffffffffff81111561168157611681611fe4565b6040519080825280601f01601f1916602001820160405280156116ab576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846116b557509392505050565b6001600160a01b038316611710578060065f8282546117059190612295565b9091555061173d9050565b6001600160a01b0383165f9081526008602052604081208054839290611737908490612282565b90915550505b6001600160a01b038083165f81815260086020526040908190208054850190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906117929085815260200190565b60405180910390a3505050565b6001600160a01b038316156118a0575f818152600a6020908152604080832080546001600160a01b03191690556001600160a01b0386168352600d909152812080546117ed90600190612282565b815481106117fd576117fd6122a8565b905f5260205f2001549050818114611865575f828152600c602052604081205460a01c6001600160a01b0386165f908152600d60205260409020805491925083918390811061184e5761184e6122a8565b5f918252602090912001556118638282611cca565b505b6001600160a01b0384165f908152600d6020526040902080548061188b5761188b612379565b600190038181905f5260205f20015f90559055505b6001600160a01b03821615611916575f818152600c6020908152604080832080546001600160a01b0319166001600160a01b038716908101909155808452600d8352908320805460018181018355828652938520018590559252905461191191839161190c9190612282565b611cca565b611925565b5f818152600c60205260408120555b80826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b5f61198e83546001600160801b03808216600160801b9092048116919091031690565b82106119ad5760405163580821e760e01b815260040160405180910390fd5b5081546001600160801b039081168201165f90815260018301602052604090205492915050565b6001600160a01b0381165f908152600d6020526040812054905b818110156107dd576119ff83611b76565b6001016119ee565b6001600160a01b0381165f90815260086020526040812054611a4a907f0000000000000000000000000000000000000000000000000de0b6b3a76400009061235a565b90505f611a6b836001600160a01b03165f908152600d602052604090205490565b90505f5b611a798284612282565b811015610b1657611a8984611a91565b600101611a6f565b6001600160a01b038116611ab857604051634e46966960e11b815260040160405180910390fd5b5f611ad7600154600160801b81046001600160801b0390811691161490565b611aec57611ae56001611d34565b9050611b35565b60075f8154611afa9061238d565b90915550600754600101611b215760405163303b682f60e01b815260040160405180910390fd5b600754611b3290600160ff1b612295565b90505b5f818152600c60205260409020546001600160a01b03168015611b6b5760405163119b4fd360e11b815260040160405180910390fd5b6107dd81848461179f565b6001600160a01b038116611b9d57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381165f908152600d602052604081208054611bc290600190612282565b81548110611bd257611bd26122a8565b905f5260205f2001549050611be8825f8361179f565b610b2e600182611da1565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611c315772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611c5d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611c7b57662386f26fc10000830492506010015b6305f5e1008310611c93576305f5e100830492506008015b6127108310611ca757612710830492506004015b60648310611cb9576064830492506002015b600a831061060f5760010192915050565b5f828152600c60205260409020546bffffffffffffffffffffffff821115611d0557604051633f2cd0e360e21b815260040160405180910390fd5b5f928352600c60205260409092206001600160a01b039290921660a09190911b6001600160a01b031916019055565b80545f906001600160801b03600160801b8204811691168103611d6a576040516375e52f4f60e01b815260040160405180910390fd5b5f19016001600160801b039081165f818152600185016020526040812080549190558454909216600160801b909102179092555090565b81546001600160801b038082165f190191600160801b9004811690821603611ddc57604051638acb5f2760e01b815260040160405180910390fd5b6001600160801b03165f81815260018401602052604090209190915581546fffffffffffffffffffffffffffffffff1916179055565b6001600160e01b0319811681146108f3575f80fd5b5f60208284031215611e37575f80fd5b813561076781611e12565b80356001600160a01b03811681146108d1575f80fd5b5f60208284031215611e68575f80fd5b61076782611e42565b5f5b83811015611e8b578181015183820152602001611e73565b50505f910152565b5f8151808452611eaa816020860160208601611e71565b601f01601f19169290920160200192915050565b602081525f6107676020830184611e93565b5f60208284031215611ee0575f80fd5b5035919050565b5f8060408385031215611ef8575f80fd5b611f0183611e42565b946020939093013593505050565b5f805f60608486031215611f21575f80fd5b611f2a84611e42565b9250611f3860208501611e42565b9150604084013590509250925092565b803580151581146108d1575f80fd5b5f60208284031215611f67575f80fd5b61076782611f48565b5f8060408385031215611f81575f80fd5b611f8a83611e42565b9150611f9860208401611f48565b90509250929050565b602080825282518282018190525f9190848201906040850190845b81811015611fd857835183529284019291840191600101611fbc565b50909695505050505050565b634e487b7160e01b5f52604160045260245ffd5b5f805f806080858703121561200b575f80fd5b61201485611e42565b935061202260208601611e42565b925060408501359150606085013567ffffffffffffffff80821115612045575f80fd5b818701915087601f830112612058575f80fd5b81358181111561206a5761206a611fe4565b604051601f8201601f19908116603f0116810190838211818310171561209257612092611fe4565b816040528281528a60208487010111156120aa575f80fd5b826020860160208301375f60208483010152809550505050505092959194509250565b5f805f805f805f60e0888a0312156120e3575f80fd5b6120ec88611e42565b96506120fa60208901611e42565b95506040880135945060608801359350608088013560ff8116811461211d575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f806040838503121561214b575f80fd5b61215483611e42565b9150611f9860208401611e42565b5f8060408385031215612173575f80fd5b50508035926020909101359150565b600181811c9082168061219657607f821691505b6020821081036121b457634e487b7160e01b5f52602260045260245ffd5b50919050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906121ec90830184611e93565b9695505050505050565b5f60208284031215612206575f80fd5b815161076781611e12565b7f68747470733a2f2f746f6b656e732e65676f7261732e636f6d2f746f6b656e738152602f60f81b60208201525f8251612252816021850160208701611e71565b64173539b7b760d91b6021939091019283015250602601919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561060f5761060f61226e565b8082018082111561060f5761060f61226e565b634e487b7160e01b5f52603260045260245ffd5b5f8083545f60018260011c915060018316806122d957607f831692505b602080841082036122f857634e487b7160e01b5f52602260045260245ffd5b81801561230c57600181146123215761234c565b60ff198616895284151585028901965061234c565b5f8a8152602090205f5b868110156123445781548b82015290850190830161232b565b505084890196505b509498975050505050505050565b5f8261237457634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603160045260245ffd5b5f6001820161239e5761239e61226e565b506001019056fea26469706673582212207ac9c6d29640ff10720f4e5061023b5b8891f3d72ad4ffbfe584b73793e8fe4a64736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000003a980000000000000000000000006f24c8ade0fa9e348cf75d0ffe82a958d8ea859a000000000000000000000000de41bab358b663293179858a6e97c8b183979348000000000000000000000000000000000000000000000000000000000000000a45676f73746174696f6e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044553544100000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): Egostation
Arg [1] : symbol_ (string): ESTA
Arg [2] : decimals_ (uint8): 18
Arg [3] : maxTotalSupplyERC721_ (uint256): 15000
Arg [4] : initialOwner_ (address): 0x6f24c8AdE0fA9e348cF75D0ffE82A958D8ea859A
Arg [5] : initialMintRecipient_ (address): 0xDE41Bab358B663293179858A6e97c8b183979348
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [3] : 0000000000000000000000000000000000000000000000000000000000003a98
Arg [4] : 0000000000000000000000006f24c8ade0fa9e348cf75d0ffe82a958d8ea859a
Arg [5] : 000000000000000000000000de41bab358b663293179858a6e97c8b183979348
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 45676f73746174696f6e00000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [9] : 4553544100000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.