Overview
TokenID
5945
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
ERC5D
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* A collection of 10,000 Replicants on ERC5D: optimized ERC4D with lower fees, Uniswap V3, and fixed tokenURI for NFTs. Telegram: https://t.me/mementobuild Twitter: https://x.com/mementobuild Website: https://memento.build */ //SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {ERC4D} from "./libs/ERC4D.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ERC6551Registry} from "./libs/ERC6551Registry.sol"; import {ERC6551Account} from "./libs/ERC6551Account.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; /** * @title ERC5D * @author https://github.com/impredmet * @notice Optimized ERC4D with lower fees, Uniswap V3, and fixed tokenURI for NFTs. */ contract ERC5D is Ownable, ERC4D { string public dataURI; bool public launched; uint256 public maxWallet; constructor( string memory name_, // Name for ERC-20 representation string memory symbol_, // Symbol for ERC-20 representation uint8 decimals_, // Decimals for ERC-20 representation uint256 supply721_, // Supply of ERC721s to mint (eg. 10000) ERC6551Registry registry_, // Registry for 6551 accounts ERC6551Account implementation_, // Implementation for 6551 accounts bytes32 salt_ // Salt for 6551 accounts (eg. keccak256("ERC5D")) ) ERC4D(name_, symbol_, decimals_) Ownable(_msgSender()) { _setERC721TransferExempt(address(this), true); _setERC721TransferExempt(_msgSender(), true); setup.push(dddd_setup({implementation: implementation_, registry: registry_, salt: salt_})); _mintERC20(_msgSender(), supply721_ * units); maxWallet = erc20TotalSupply() / 100; } function tokenURI(uint256 id) public view override returns (string memory) { uint8 seed = uint8(bytes1(keccak256(abi.encodePacked(id)))); string memory image; string memory color; if (seed <= 100) { image = "1.jpg"; color = "Pink"; } else if (seed <= 160) { image = "2.jpg"; color = "Gray"; } else if (seed <= 210) { image = "3.jpg"; color = "Green"; } else if (seed <= 240) { image = "4.jpg"; color = "Yellow"; } else if (seed <= 255) { image = "5.jpg"; color = "Orange"; } string memory jsonPreImage = string.concat( string.concat( string.concat('{"name": "Memento #', Strings.toString(id)), '","description":"A collection of 10,000 Replicants on ERC5D: optimized ERC4D with lower fees, Uniswap V3, and fixed tokenURI for NFTs.","external_url":"https://memento.build","image":"' ), string.concat(dataURI, image) ); string memory jsonPostImage = string.concat('","attributes":[{"trait_type":"Color","value":"', color); string memory jsonPostTraits = '"}]}'; return string.concat( "data:application/json;utf8,", string.concat(string.concat(jsonPreImage, jsonPostImage), jsonPostTraits) ); } function updateURI(string memory uri) external onlyOwner { dataURI = uri; } function setERC721TransferExempt(address account_, bool value_) external onlyOwner { _setERC721TransferExempt(account_, value_); } function upgrade6551Setup(uint256 setupId_, uint256 tokenId_) external { if (_msgSender() != _getOwnerOf(tokenId_)) { revert Unauthorized(); } require(setupId_ < setup.length, "Invalid setup"); nft_setup_set[tokenId_] = setupId_; _createAccount(setupId_, tokenId_); } function launch() external onlyOwner { launched = true; } function _transferERC20WithERC721(address from_, address to_, uint256 value_) internal override returns (bool) { if ((_erc721TransferExempt[_msgSender()] || _erc721TransferExempt[from_]) && !launched) { return super._transferERC20WithERC721(from_, to_, value_); } require(launched, "Not launched yet"); uint256 bal = erc20BalanceOf(to_); require(bal + value_ <= maxWallet, "Max wallet limit exceeded"); return super._transferERC20WithERC721(from_, to_, value_); } function setSelfERC721TransferExempt(bool state_) public override { require(launched, "Not launched yet"); super.setSelfERC721TransferExempt(state_); } function removeLimits() external onlyOwner { maxWallet = erc20TotalSupply(); } }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT import {IERC404} from "../interfaces/IERC404.sol"; import {PackedDoubleEndedQueue} from "./PackedDoubleEndedQueue.sol"; import {ERC6551Account} from "./ERC6551Account.sol"; import {ERC6551Registry} from "./ERC6551Registry.sol"; import {ERC721Events} from "./ERC721Events.sol"; import {ERC20Events} from "./ERC20Events.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; abstract contract ERC4D is IERC404 { using PackedDoubleEndedQueue for PackedDoubleEndedQueue.Uint16Deque; /// @dev The queue of ERC-721 tokens stored in the contract. PackedDoubleEndedQueue.Uint16Deque 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 supply in ERC-20 representation uint256 public 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 => uint16[]) 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; /// @dev struct for changeable 6551 setups struct dddd_setup { ERC6551Account implementation; ERC6551Registry registry; bytes32 salt; } /// @dev storage for each 6551 setup dddd_setup[] public setup; /// @dev 6551 setup set for each NFT mapping(uint256 => uint256) public nft_setup_set; constructor(string memory name_, string memory symbol_, uint8 decimals_) { name = name_; symbol = symbol_; if (decimals_ < 18) { revert DecimalsTooLow(); } decimals = decimals_; units = 10 ** decimals; // EIP-2612 initialization _INITIAL_CHAIN_ID = block.chainid; _INITIAL_DOMAIN_SEPARATOR = _computeDomainSeparator(); } function account(uint256 id_) public view returns (address) { dddd_setup memory s = setup[nft_setup_set[id_]]; return s.registry.account(address(s.implementation), s.salt, block.chainid, address(this), id_); } function execute(uint256 id_, address to, uint256 value, bytes calldata data, uint8 operation) external payable returns (bytes memory result) { return ERC6551Account(payable(account(id_))).execute(to, value, data, operation); } /// @notice Function to find owner of a given ERC-721 token function ownerOf(uint256 id_) public view virtual returns (address erc721Owner) { id_ += ID_ENCODING_PREFIX; erc721Owner = _getOwnerOf(id_); if (!_isValidTokenId(id_)) { revert InvalidTokenId(); } if (erc721Owner == address(0)) { revert NotFound(); } } function owned(address owner_) public view virtual returns (uint256[] memory) { uint256[] memory ownedAsU256 = new uint256[](_owned[owner_].length); for (uint256 i = 0; i < _owned[owner_].length;) { ownedAsU256[i] = _owned[owner_][i]; unchecked { ++i; } } return ownedAsU256; } 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 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 less than the minted count. 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) { // The ERC-721 tokens are 1-indexed, so 0 is not a valid id and indicates that // operator is attempting to set the ERC-20 allowance to 0. if (valueOrId_ >= ID_ENCODING_PREFIX) { return erc20Approve(spender_, valueOrId_); } if (_isValidTokenId(valueOrId_ + ID_ENCODING_PREFIX)) { bool auth = erc721Approve(spender_, valueOrId_); // If ERC-721 exists but sender is not authorised then default to ERC-20 if (!auth) return erc20Approve(spender_, valueOrId_); } else { return erc20Approve(spender_, valueOrId_); } return true; } function erc721Approve(address spender_, uint256 id_) public virtual returns (bool) { // Intention is to approve as ERC-721 token (id). id_ += ID_ENCODING_PREFIX; address erc721Owner = _getOwnerOf(id_); if (msg.sender != erc721Owner && !isApprovedForAll[erc721Owner][msg.sender]) { return false; } getApproved[id_] = spender_; emit ERC721Events.Approval(erc721Owner, spender_, id_ - ID_ENCODING_PREFIX); return true; } /// @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(); } // Intention is to approve as ERC-20 token (value). 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 less than or equal to current max id. function transferFrom(address from_, address to_, uint256 valueOrId_) public virtual returns (bool) { if (_isValidTokenId(valueOrId_ + ID_ENCODING_PREFIX)) { if (from_ != _getOwnerOf(valueOrId_ + ID_ENCODING_PREFIX)) { return erc20TransferFrom(from_, to_, valueOrId_); } else { 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 { id_ += ID_ENCODING_PREFIX; // Prevent transferring 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(); } 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 transferring tokens from 0x0. if (from_ == address(0)) { revert InvalidSender(); } // Prevent burning tokens to 0x0. if (to_ == address(0)) { revert InvalidRecipient(); } // Intention is to transfer as ERC-20 token (value). 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 _transfer 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 small 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 _transfer 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_ + ID_ENCODING_PREFIX)) { 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 /// @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(); } 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 = ID_ENCODING_PREFIX + _owned[from_][_owned[from_].length - 1]; if (updatedId != id_) { uint256 updatedIndex = _getOwnedIndex(id_); // update _owned for sender _owned[from_][updatedIndex] = uint16(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(uint16(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_ - ID_ENCODING_PREFIX); } /// @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 = ID_ENCODING_PREFIX + _owned[from_][indexOfLastToken]; _transferERC721(from_, to_, tokenId); unchecked { ++i; } } // If the sender's transaction changes their holding from a fractional to a non-fractional // amount (or vice versa), adjust ERC-721s. // // 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. if (erc20BalanceOfSenderBefore / units - erc20BalanceOf(from_) / units > nftsToTransfer) { _withdrawAndStoreERC721(from_); } 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 = ID_ENCODING_PREFIX + _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; // Create 6551 account for new minted NFT using the latest setup data uint256 sl = setup.length - 1; nft_setup_set[minted] = sl; _createAccount(sl, 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 = ID_ENCODING_PREFIX + _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(uint16(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; } function _createAccount(uint256 setupId_, uint256 tokenId_) internal virtual { dddd_setup memory s = setup[setupId_]; try s.registry.createAccount(address(s.implementation), s.salt, block.chainid, address(this), tokenId_) {} catch {} } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * 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); } }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT import {IERC6551Registry} from "../interfaces/IERC6551Registry.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; contract ERC6551Registry is IERC6551Registry, Ownable(msg.sender) { function createAccount( address implementation, bytes32 salt, uint256 chainId, address tokenContract, uint256 tokenId ) external onlyOwner returns (address) { assembly { // Memory Layout: // ---- // 0x00 0xff (1 byte) // 0x01 registry (address) (20 bytes) // 0x15 salt (bytes32) (32 bytes) // 0x35 Bytecode Hash (bytes32) (32 bytes) // ---- // 0x55 ERC-1167 Constructor + Header (20 bytes) // 0x69 implementation (address) (20 bytes) // 0x5D ERC-1167 Footer (15 bytes) // 0x8C salt (uint256) (32 bytes) // 0xAC chainId (uint256) (32 bytes) // 0xCC tokenContract (address) (32 bytes) // 0xEC tokenId (uint256) (32 bytes) // Silence unused variable warnings pop(chainId) // Copy bytecode + constant data to memory calldatacopy(0x8c, 0x24, 0x80) // salt, chainId, tokenContract, tokenId mstore(0x6c, 0x5af43d82803e903d91602b57fd5bf3) // ERC-1167 footer mstore(0x5d, implementation) // implementation mstore(0x49, 0x3d60ad80600a3d3981f3363d3d373d3d3d363d73) // ERC-1167 constructor + header // Copy create2 computation data to memory mstore8(0x00, 0xff) // 0xFF mstore(0x35, keccak256(0x55, 0xb7)) // keccak256(bytecode) mstore(0x01, shl(96, address())) // registry address mstore(0x15, salt) // salt // Compute account address let computed := keccak256(0x00, 0x55) // If the account has not yet been deployed if iszero(extcodesize(computed)) { // Deploy account contract let deployed := create2(0, 0x55, 0xb7, salt) // Revert if the deployment fails if iszero(deployed) { mstore(0x00, 0x20188a59) // `AccountCreationFailed()` revert(0x1c, 0x04) } // Store account address in memory before salt and chainId mstore(0x6c, deployed) // Emit the ERC6551AccountCreated event log4( 0x6c, 0x60, // `ERC6551AccountCreated(address,address,bytes32,uint256,address,uint256)` 0x79f19b3655ee38b1ce526556b7731a20c8f218fbda4a3990b6cc4172fdf88722, implementation, tokenContract, tokenId ) // Return the account address return(0x6c, 0x20) } // Otherwise, return the computed account address mstore(0x00, shr(96, shl(96, computed))) return(0x00, 0x20) } } function cid() external view returns (uint256) { return block.chainid; } function account(address implementation, bytes32 salt, uint256 chainId, address tokenContract, uint256 tokenId) external view returns (address) { assembly { // Silence unused variable warnings pop(chainId) pop(tokenContract) pop(tokenId) // Copy bytecode + constant data to memory calldatacopy(0x8c, 0x24, 0x80) // salt, chainId, tokenContract, tokenId mstore(0x6c, 0x5af43d82803e903d91602b57fd5bf3) // ERC-1167 footer mstore(0x5d, implementation) // implementation mstore(0x49, 0x3d60ad80600a3d3981f3363d3d373d3d3d363d73) // ERC-1167 constructor + header // Copy create2 computation data to memory mstore8(0x00, 0xff) // 0xFF mstore(0x35, keccak256(0x55, 0xb7)) // keccak256(bytecode) mstore(0x01, shl(96, address())) // registry address mstore(0x15, salt) // salt // Store computed account address in memory mstore(0x00, shr(96, shl(96, keccak256(0x00, 0x55)))) // Return computed account address return(0x00, 0x20) } } }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import {IERC6551Account} from "../interfaces/IERC6551Account.sol"; import {IERC6551Executable} from "../interfaces/IERC6551Executable.sol"; import {IERC404} from "../interfaces/IERC404.sol"; import {ERC6551AccountLib} from "./ERC6551AccountLib.sol"; import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; contract ERC6551Account is IERC165, IERC1271, IERC6551Account, IERC6551Executable, IERC721Receiver, IERC1155Receiver { uint256 public state; receive() external payable {} function execute(address to, uint256 value, bytes calldata data, uint8 operation) external payable virtual returns (bytes memory result) { require(_isValidSigner(msg.sender), "Invalid signer"); require(operation == 0, "Only call operations are supported"); ++state; bool success; (success, result) = to.call{value: value}(data); if (!success) { assembly { revert(add(result, 32), mload(result)) } } } function isValidSigner(address signer, bytes calldata) external view virtual returns (bytes4) { if (_isValidSigner(signer)) { return IERC6551Account.isValidSigner.selector; } return bytes4(0); } function isValidSignature(bytes32 hash, bytes memory signature) external view virtual returns (bytes4 magicValue) { bool isValid = SignatureChecker.isValidSignatureNow(owner(), hash, signature); if (isValid) { return IERC1271.isValidSignature.selector; } return bytes4(0); } function onERC721Received(address, address, uint256 receivedTokenId, bytes memory) external view virtual returns (bytes4) { _revertIfOwnershipCycle(msg.sender, receivedTokenId); return IERC721Receiver.onERC721Received.selector; } function onERC1155Received(address, address, uint256, uint256, bytes memory) external view virtual returns (bytes4) { return IERC1155Receiver.onERC1155Received.selector; } function onERC1155BatchReceived(address, address, uint256[] memory, uint256[] memory, bytes memory) external pure virtual returns (bytes4) { return IERC1155Receiver.onERC1155BatchReceived.selector; } function supportsInterface(bytes4 interfaceId) public pure virtual returns (bool) { return ( interfaceId == type(IERC6551Account).interfaceId || interfaceId == type(IERC6551Executable).interfaceId || interfaceId == type(IERC1155Receiver).interfaceId || interfaceId == type(IERC721Receiver).interfaceId || interfaceId == type(IERC165).interfaceId ); } function token() public view virtual override returns (uint256, address, uint256) { return ERC6551AccountLib.token(); } function owner() public view virtual returns (address) { (uint256 chainId, address contractAddress, uint256 tokenId) = token(); if (chainId != block.chainid) return address(0); return IERC404(contractAddress).ownerOf(tokenId); } function _isValidSigner(address signer) internal view virtual returns (bool) { return signer == owner(); } /** * @dev Helper method to check if a received token is in the ownership chain of the wallet. * @param receivedTokenAddress The address of the token being received. * @param receivedTokenId The ID of the token being received. */ function _revertIfOwnershipCycle(address receivedTokenAddress, uint256 receivedTokenId) internal view virtual { (uint256 _chainId, address _contractAddress, uint256 _tokenId) = token(); require( _chainId != block.chainid || receivedTokenAddress != _contractAddress || receivedTokenId != _tokenId, "Cannot own yourself" ); address currentOwner = owner(); require(currentOwner != address(this), "Token in ownership chain"); uint256 depth = 0; while (currentOwner.code.length > 0) { try IERC6551Account(payable(currentOwner)).token() returns ( uint256 chainId, address contractAddress, uint256 tokenId ) { require( chainId != block.chainid || contractAddress != receivedTokenAddress || tokenId != receivedTokenId, "Token in ownership chain" ); // Advance up the ownership chain currentOwner = IERC404(contractAddress).ownerOf(tokenId); require(currentOwner != address(this), "Token in ownership chain"); } catch { break; } unchecked { ++depth; } if (depth == 5) revert("Ownership chain too deep"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @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)); } }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; 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 returns (bool); 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; }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT library PackedDoubleEndedQueue { uint128 constant SLOT_MASK = (1 << 64) - 1; uint128 constant INDEX_MASK = SLOT_MASK << 64; uint256 constant SLOT_DATA_MASK = (1 << 16) - 1; /** * @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 Invalid slot. */ error InvalidSlot(); /** * @dev Indices and slots are 64 bits to fit within a single storage slot. * * 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 Uint16Deque { uint64 _beginIndex; uint64 _beginSlot; uint64 _endIndex; uint64 _endSlot; mapping(uint64 index => uint256) _data; } /** * @dev Removes the item at the end of the queue and returns it. * * Reverts with {QueueEmpty} if the queue is empty. */ function popBack(Uint16Deque storage deque) internal returns (uint16 value) { unchecked { uint64 backIndex = deque._endIndex; uint64 backSlot = deque._endSlot; if (backIndex == deque._beginIndex && backSlot == deque._beginSlot) { revert QueueEmpty(); } if (backSlot == 0) { --backIndex; backSlot = 15; } else { --backSlot; } uint256 data = deque._data[backIndex]; value = _getEntry(data, backSlot); deque._data[backIndex] = _setData(data, backSlot, 0); deque._endIndex = backIndex; deque._endSlot = backSlot; } } /** * @dev Inserts an item at the beginning of the queue. * * Reverts with {QueueFull} if the queue is full. */ function pushFront(Uint16Deque storage deque, uint16 value_) internal { unchecked { uint64 frontIndex = deque._beginIndex; uint64 frontSlot = deque._beginSlot; if (frontSlot == 0) { --frontIndex; frontSlot = 15; } else { --frontSlot; } if (frontIndex == deque._endIndex && frontSlot == deque._endSlot) { revert QueueFull(); } deque._data[frontIndex] = _setData(deque._data[frontIndex], frontSlot, value_); deque._beginIndex = frontIndex; deque._beginSlot = frontSlot; } } /** * @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(Uint16Deque storage deque, uint256 index_) internal view returns (uint16 value) { if (index_ >= length(deque) * 16) revert QueueOutOfBounds(); unchecked { return _getEntry( deque._data[deque._beginIndex + uint64(deque._beginSlot + (index_ % 16)) / 16 + uint64(index_ / 16)], uint64(((deque._beginSlot + index_) % 16)) ); } } /** * @dev Returns the number of items in the queue. */ function length(Uint16Deque storage deque) internal view returns (uint256) { unchecked { return (16 - deque._beginSlot) + deque._endSlot + deque._endIndex * 16 - deque._beginIndex * 16 - 16; } } /** * @dev Returns true if the queue is empty. */ function empty(Uint16Deque storage deque) internal view returns (bool) { return deque._endSlot == deque._beginSlot && deque._endIndex == deque._beginIndex; } function _setData(uint256 data_, uint64 slot_, uint16 value) private pure returns (uint256) { return (data_ & (~_getSlotMask(slot_))) + (uint256(value) << (16 * slot_)); } function _getEntry(uint256 data, uint64 slot_) private pure returns (uint16) { return uint16((data & _getSlotMask(slot_)) >> (16 * slot_)); } function _getSlotMask(uint64 slot_) private pure returns (uint256) { return SLOT_DATA_MASK << (slot_ * 16); } }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT 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); }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT library ERC20Events { event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 amount); }
// SPDX-License-Identifier: MIT // 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // 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; } }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT interface IERC6551Registry { /** * @dev The registry MUST emit the ERC6551AccountCreated event upon successful account creation. */ event ERC6551AccountCreated( address account, address indexed implementation, bytes32 salt, uint256 chainId, address indexed tokenContract, uint256 indexed tokenId ); /** * @dev The registry MUST revert with AccountCreationFailed error if the create2 operation fails. */ error AccountCreationFailed(); /** * @dev Creates a token bound account for a non-fungible token. * * If account has already been created, returns the account address without calling create2. * * Emits ERC6551AccountCreated event. * * @return account The address of the token bound account */ function createAccount( address implementation, bytes32 salt, uint256 chainId, address tokenContract, uint256 tokenId ) external returns (address account); /** * @dev Returns the computed token bound account address for a non-fungible token. * * @return account The address of the token bound account */ function account(address implementation, bytes32 salt, uint256 chainId, address tokenContract, uint256 tokenId) external view returns (address account); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Interface that must be implemented by smart contracts in order to receive * ERC-1155 token transfers. */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT interface IERC6551Account { receive() external payable; function token() external view returns (uint256 chainId, address tokenContract, uint256 tokenId); function state() external view returns (uint256); function isValidSigner(address signer, bytes calldata context) external view returns (bytes4 magicValue); }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT interface IERC6551Executable { function execute(address to, uint256 value, bytes calldata data, uint8 operation) external payable returns (bytes memory); }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT import {ERC6551BytecodeLib} from "./ERC6551BytecodeLib.sol"; import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; library ERC6551AccountLib { function computeAddress( address registry, address _implementation, bytes32 _salt, uint256 chainId, address tokenContract, uint256 tokenId ) internal pure returns (address) { bytes32 bytecodeHash = keccak256(ERC6551BytecodeLib.getCreationCode(_implementation, _salt, chainId, tokenContract, tokenId)); return Create2.computeAddress(_salt, bytecodeHash, registry); } function isERC6551Account(address account, address expectedImplementation, address registry) internal view returns (bool) { // invalid bytecode size if (account.code.length != 0xAD) return false; address _implementation = implementation(account); // implementation does not exist if (_implementation.code.length == 0) return false; // invalid implementation if (_implementation != expectedImplementation) return false; (bytes32 _salt, uint256 chainId, address tokenContract, uint256 tokenId) = context(account); return account == computeAddress(registry, _implementation, _salt, chainId, tokenContract, tokenId); } function implementation(address account) internal view returns (address _implementation) { assembly { // copy proxy implementation (0x14 bytes) extcodecopy(account, 0xC, 0xA, 0x14) _implementation := mload(0x00) } } function implementation() internal view returns (address _implementation) { return implementation(address(this)); } function token(address account) internal view returns (uint256, address, uint256) { bytes memory encodedData = new bytes(0x60); assembly { // copy 0x60 bytes from end of context extcodecopy(account, add(encodedData, 0x20), 0x4d, 0x60) } return abi.decode(encodedData, (uint256, address, uint256)); } function token() internal view returns (uint256, address, uint256) { return token(address(this)); } function salt(address account) internal view returns (bytes32) { bytes memory encodedData = new bytes(0x20); assembly { // copy 0x20 bytes from beginning of context extcodecopy(account, add(encodedData, 0x20), 0x2d, 0x20) } return abi.decode(encodedData, (bytes32)); } function salt() internal view returns (bytes32) { return salt(address(this)); } function context(address account) internal view returns (bytes32, uint256, address, uint256) { bytes memory encodedData = new bytes(0x80); assembly { // copy full context (0x80 bytes) extcodecopy(account, add(encodedData, 0x20), 0x2D, 0x80) } return abi.decode(encodedData, (bytes32, uint256, address, uint256)); } function context() internal view returns (bytes32, uint256, address, uint256) { return context(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/SignatureChecker.sol) pragma solidity ^0.8.20; import {ECDSA} from "./ECDSA.sol"; import {IERC1271} from "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like * Argent and Safe Wallet (previously Gnosis Safe). */ library SignatureChecker { /** * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) { (address recovered, ECDSA.RecoverError error, ) = ECDSA.tryRecover(hash, signature); return (error == ECDSA.RecoverError.NoError && recovered == signer) || isValidERC1271SignatureNow(signer, hash, signature); } /** * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated * against the signer smart contract using ERC1271. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidERC1271SignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { (bool success, bytes memory result) = signer.staticcall( abi.encodeCall(IERC1271.isValidSignature, (hash, signature)) ); return (success && result.length >= 32 && abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector)); } }
// SPDX-License-Identifier: MIT // 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; } }
// SPDX-License-Identifier: MIT // 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); } } }
// SPDX-License-Identifier: MIT // 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); }
pragma solidity ^0.8.26; // SPDX-License-Identifier: MIT library ERC6551BytecodeLib { /** * @dev Returns the creation code of the token bound account for a non-fungible token. * * @return result The creation code of the token bound account */ function getCreationCode( address implementation, bytes32 salt, uint256 chainId, address tokenContract, uint256 tokenId ) internal pure returns (bytes memory result) { assembly { result := mload(0x40) // Grab the free memory pointer // Layout the variables and bytecode backwards mstore(add(result, 0xb7), tokenId) mstore(add(result, 0x97), shr(96, shl(96, tokenContract))) mstore(add(result, 0x77), chainId) mstore(add(result, 0x57), salt) mstore(add(result, 0x37), 0x5af43d82803e903d91602b57fd5bf3) mstore(add(result, 0x28), implementation) mstore(add(result, 0x14), 0x3d60ad80600a3d3981f3363d3d373d3d3d363d73) mstore(result, 0xb7) // Store the length mstore(0x40, add(result, 0xd7)) // Allocate the memory } } /** * @dev Returns the create2 address computed from `salt`, `bytecodeHash`, `deployer`. * * @return result The create2 address computed from `salt`, `bytecodeHash`, `deployer` */ function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address result) { assembly { result := mload(0x40) // Grab the free memory pointer mstore8(result, 0xff) mstore(add(result, 0x35), bytecodeHash) mstore(add(result, 0x01), shl(96, deployer)) mstore(add(result, 0x15), salt) result := keccak256(result, 0x55) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Create2.sol) pragma solidity ^0.8.20; /** * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer. * `CREATE2` can be used to compute in advance the address where a smart * contract will be deployed, which allows for interesting new mechanisms known * as 'counterfactual interactions'. * * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more * information. */ library Create2 { /** * @dev Not enough balance for performing a CREATE2 deploy. */ error Create2InsufficientBalance(uint256 balance, uint256 needed); /** * @dev There's no code to deploy. */ error Create2EmptyBytecode(); /** * @dev The deployment failed. */ error Create2FailedDeployment(); /** * @dev Deploys a contract using `CREATE2`. The address where the contract * will be deployed can be known in advance via {computeAddress}. * * The bytecode for a contract can be obtained from Solidity with * `type(contractName).creationCode`. * * Requirements: * * - `bytecode` must not be empty. * - `salt` must have not been used for `bytecode` already. * - the factory must have a balance of at least `amount`. * - if `amount` is non-zero, `bytecode` must have a `payable` constructor. */ function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) { if (address(this).balance < amount) { revert Create2InsufficientBalance(address(this).balance, amount); } if (bytecode.length == 0) { revert Create2EmptyBytecode(); } /// @solidity memory-safe-assembly assembly { addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt) } if (addr == address(0)) { revert Create2FailedDeployment(); } } /** * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the * `bytecodeHash` or `salt` will result in a new destination address. */ function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) { return computeAddress(salt, bytecodeHash, address(this)); } /** * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}. */ function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) // Get free memory pointer // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... | // |-------------------|---------------------------------------------------------------------------| // | bytecodeHash | CCCCCCCCCCCCC...CC | // | salt | BBBBBBBBBBBBB...BB | // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA | // | 0xFF | FF | // |-------------------|---------------------------------------------------------------------------| // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC | // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ | mstore(add(ptr, 0x40), bytecodeHash) mstore(add(ptr, 0x20), salt) mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff mstore8(start, 0xff) addr := keccak256(start, 85) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.20; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS } /** * @dev The signature derives the `address(0)`. */ error ECDSAInvalidSignature(); /** * @dev The signature has an invalid length. */ error ECDSAInvalidSignatureLength(uint256 length); /** * @dev The signature has an S value that is in the upper half order. */ error ECDSAInvalidSignatureS(bytes32 s); /** * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not * return address(0) without also returning an error description. Errors are documented using an enum (error type) * and a bytes32 providing additional information about the error. * * If no error is returned, then the address can be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length)); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) { unchecked { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); // We do not check for an overflow here since the shift operation results in 0 or 1. uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError, bytes32) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS, s); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature, bytes32(0)); } return (signer, RecoverError.NoError, bytes32(0)); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s); _throwError(error, errorArg); return recovered; } /** * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided. */ function _throwError(RecoverError error, bytes32 errorArg) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert ECDSAInvalidSignature(); } else if (error == RecoverError.InvalidSignatureLength) { revert ECDSAInvalidSignatureLength(uint256(errorArg)); } else if (error == RecoverError.InvalidSignatureS) { revert ECDSAInvalidSignatureS(errorArg); } } }
{ "remappings": [ "@openzeppelin/=lib/openzeppelin-contracts/", "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false, "libraries": {} }
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":"supply721_","type":"uint256"},{"internalType":"contract ERC6551Registry","name":"registry_","type":"address"},{"internalType":"contract ERC6551Account","name":"implementation_","type":"address"},{"internalType":"bytes32","name":"salt_","type":"bytes32"}],"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":"uint256","name":"id_","type":"uint256"}],"name":"account","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"dataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[{"internalType":"bool","name":"","type":"bool"}],"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":"id_","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint8","name":"operation","type":"uint8"}],"name":"execute","outputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"stateMutability":"payable","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":"launch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"launched","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"uint256","name":"","type":"uint256"}],"name":"nft_setup_set","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"removeLimits","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":"uint256","name":"","type":"uint256"}],"name":"setup","outputs":[{"internalType":"contract ERC6551Account","name":"implementation","type":"address"},{"internalType":"contract ERC6551Registry","name":"registry","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"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":"view","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"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"updateURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"setupId_","type":"uint256"},{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"upgrade6551Setup","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61010060405234801561001157600080fd5b5060405161513b38038061513b83398101604081905261003091611229565b868686338061005a57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610063816101f3565b506003610070848261136e565b50600461007d838261136e565b5060128160ff1610156100a3576040516398790fd560e01b815260040160405180910390fd5b60ff811660808190526100b790600a611529565b60a0524660c0526100c6610243565b60e052506100d9915030905060016102dd565b6100e43360016102dd565b604080516060810182526001600160a01b03808516825285811660208301908152928201848152600f8054600181018255600091909152925160039093027f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802810180549484166001600160a01b031995861617905593517f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80385018054919093169316929092179055517f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac804909101556101ce6101bc3390565b60a0516101c99087611538565b61034c565b60646101d960055490565b6101e3919061154f565b6013555061169795505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60036040516102759190611571565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6001600160a01b0382166103045760405163a41e3d3f60e01b815260040160405180910390fd5b801561031857610313826103b6565b610321565b610321826103ea565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b6001600160a01b03821661037357604051634e46966960e11b815260040160405180910390fd5b600160ff1b8160055461038691906115e6565b11156103a55760405163303b682f60e01b815260040160405180910390fd5b6103b160008383610469565b505050565b6001600160a01b0381166000908152600c6020526040812054905b818110156103b1576103e283610594565b6001016103d1565b60a05160009061040f836001600160a01b031660009081526007602052604090205490565b610419919061154f565b9050600061043c836001600160a01b03166000908152600c602052604090205490565b905060005b61044b82846115f9565b8110156104635761045b8461063c565b600101610441565b50505050565b336000908152600d602052604081205460ff168061049f57506001600160a01b0384166000908152600d602052604090205460ff165b80156104ae575060125460ff16155b156104c5576104be84848461075a565b905061058d565b60125460ff1661050a5760405162461bcd60e51b815260206004820152601060248201526f139bdd081b185d5b98da1959081e595d60821b6044820152606401610051565b6001600160a01b03831660009081526007602052604090205460135461053084836115e6565b111561057e5760405162461bcd60e51b815260206004820152601960248201527f4d61782077616c6c6574206c696d6974206578636565646564000000000000006044820152606401610051565b61058985858561075a565b9150505b9392505050565b6001600160a01b0381166105bb57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381166000908152600c6020526040812080546105e1906001906115f9565b815481106105f1576105f161160c565b6000918252602090912060108204015461061f91600f166002026101000a900461ffff16600160ff1b6115e6565b905061062d826000836109e9565b610638600182610c4d565b5050565b6001600160a01b03811661066357604051634e46966960e11b815260040160405180910390fd5b600061066f6001610d3e565b6106965761067d6001610d89565b61068f9061ffff16600160ff1b6115e6565b9050610718565b6006600081546106a590611622565b909155506006546001016106cc5760405163303b682f60e01b815260040160405180910390fd5b6006546106dd90600160ff1b6115e6565b600f549091506000906106f2906001906115f9565b60068054600090815260106020526040902082905554909150610716908290610e99565b505b6000818152600b60205260409020546001600160a01b0316801561074f5760405163119b4fd360e11b815260040160405180910390fd5b6103b18184846109e9565b6001600160a01b0383811660009081526007602052604080822054928516825281205490919061078b868686610f77565b600061079687611021565b905060006107a387611021565b90508180156107af5750805b6109db57811561081e57600060a051846107c9919061154f565b60a0516001600160a01b038a166000908152600760205260409020546107ef919061154f565b6107f991906115f9565b905060005b818110156108175761080f8961063c565b6001016107fe565b50506109db565b80156108805760a0516001600160a01b038916600090815260076020526040812054909161084b9161154f565b60a051610858908761154f565b61086291906115f9565b905060005b81811015610817576108788a610594565b600101610867565b600060a05187610890919061154f565b905060005b81811015610936576001600160a01b038a166000908152600c60205260408120546108c2906001906115f9565b6001600160a01b038c166000908152600c6020526040812080549293509091839081106108f1576108f161160c565b6000918252602090912060108204015461091f91600f166002026101000a900461ffff16600160ff1b6115e6565b905061092c8c8c836109e9565b5050600101610895565b5060a051819061095b8b6001600160a01b031660009081526007602052604090205490565b610965919061154f565b60a051610972908861154f565b61097c91906115f9565b111561098b5761098b89610594565b8060a0518561099a919061154f565b60a0516001600160a01b038b166000908152600760205260409020546109c0919061154f565b6109ca91906115f9565b11156109d9576109d98861063c565b505b506001979650505050505050565b6001600160a01b03831615610b5657600081815260096020908152604080832080546001600160a01b03191690556001600160a01b0386168352600c90915281208054610a38906001906115f9565b81548110610a4857610a4861160c565b60009182526020909120601082040154610a7691600f166002026101000a900461ffff16600160ff1b6115e6565b9050818114610b01576000828152600b602052604081205460a01c6001600160a01b0386166000908152600c602052604090208054919250839183908110610ac057610ac061160c565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff160217905550610aff828261105360201b60201c565b505b6001600160a01b0384166000908152600c60205260409020805480610b2857610b2861163b565b600082815260209020601060001990920191820401805461ffff6002600f8516026101000a02191690559055505b6001600160a01b03821615610bfc576000818152600b6020526040902080546001600160a01b0319166001600160a01b0384160190556001600160a01b0382166000818152600c60209081526040822080546001808201835582855292842060108204018054600f9092166002026101000a61ffff8181021990931692881602919091179055929091529054610bf7918391610bf291906115f9565b611053565b610c0c565b6000818152600b60205260408120555b610c1a600160ff1b826115f9565b826001600160a01b0316846001600160a01b031660008051602061511b83398151915260405160405180910390a4505050565b81546001600160401b0380821691680100000000000000009004166000819003610c7d575060001901600f610c82565b600019015b83546001600160401b03838116600160801b90920416148015610cb8575083546001600160401b03828116600160c01b90920416145b15610cd657604051638acb5f2760e01b815260040160405180910390fd5b6001600160401b0382166000908152600185016020526040902054610cfc9082856110ba565b6001600160401b03928316600081815260018701602052604090209190915584546001600160801b031916176801000000000000000091909216021790915550565b8054600090600160c01b81046001600160401b039081166801000000000000000090920416148015610d8357508154600160801b81046001600160401b039081169116145b92915050565b80546000906001600160401b03600160801b8204811691600160c01b81048216911682148015610dd1575083546001600160401b038281166801000000000000000090920416145b15610def576040516375e52f4f60e01b815260040160405180910390fd5b806001600160401b0316600003610e0c575060001901600f610e11565b600019015b6001600160401b0382166000908152600185016020526040902054610e3681836110fb565b9350610e44818360006110ba565b6001600160401b03938416600081815260018801602052604090209190915585546001600160801b0316600160801b9091026001600160c01b031617600160c01b929093169190910291909117909255919050565b6000600f8381548110610eae57610eae61160c565b60009182526020918290206040805160608101825260039390930290910180546001600160a01b0390811680855260018301549091169484018590526002909101548383018190529151638a54c52f60e01b81526004810191909152602481019190915246604482015230606482015260848101859052909250638a54c52f9060a4016020604051808303816000875af1925050508015610f6c575060408051601f3d908101601f19168201909252610f6991810190611651565b60015b156103b15750505050565b6001600160a01b038316610fa2578060056000828254610f9791906115e6565b90915550610fd09050565b6001600160a01b03831660009081526007602052604081208054839290610fca9084906115f9565b90915550505b6001600160a01b038083166000818152600760205260409081902080548501905551909185169060008051602061511b833981519152906110149085815260200190565b60405180910390a3505050565b60006001600160a01b0382161580610d835750506001600160a01b03166000908152600d602052604090205460ff1690565b6000828152600b60205260409020546001600160601b0382111561108a57604051633f2cd0e360e21b815260040160405180910390fd5b6000928352600b60205260409092206001600160a01b039290921660a09190911b6001600160a01b031916019055565b60006110c783601061166e565b6001600160401b03168261ffff16901b6110e68461112660201b60201c565b1985166110f391906115e6565b949350505050565b600061110882601061166e565b6001600160401b031661111a83611126565b8416901c905092915050565b600061113382601061166e565b6001600160401b031661ffff901b9050919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261116f57600080fd5b81516001600160401b0381111561118857611188611148565b604051601f8201601f19908116603f011681016001600160401b03811182821017156111b6576111b6611148565b6040528181528382016020018510156111ce57600080fd5b60005b828110156111ed576020818601810151838301820152016111d1565b506000918101602001919091529392505050565b6001600160a01b038116811461121657600080fd5b50565b805161122481611201565b919050565b600080600080600080600060e0888a03121561124457600080fd5b87516001600160401b0381111561125a57600080fd5b6112668a828b0161115e565b60208a015190985090506001600160401b0381111561128457600080fd5b6112908a828b0161115e565b965050604088015160ff811681146112a757600080fd5b606089015190955093506112bd60808901611219565b92506112cb60a08901611219565b9150600060c089015190508091505092959891949750929550565b600181811c908216806112fa57607f821691505b60208210810361131a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156103b157806000526020600020601f840160051c810160208510156113475750805b601f840160051c820191505b818110156113675760008155600101611353565b5050505050565b81516001600160401b0381111561138757611387611148565b61139b8161139584546112e6565b84611320565b6020601f8211600181146113cf57600083156113b75750848201515b600019600385901b1c1916600184901b178455611367565b600084815260208120601f198516915b828110156113ff57878501518255602094850194600190920191016113df565b508482101561141d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b6001815b600184111561147d578085048111156114615761146161142c565b600184161561146f57908102905b60019390931c928002611446565b935093915050565b60008261149457506001610d83565b816114a157506000610d83565b81600181146114b757600281146114c1576114dd565b6001915050610d83565b60ff8411156114d2576114d261142c565b50506001821b610d83565b5060208310610133831016604e8410600b8410161715611500575081810a610d83565b61150d6000198484611442565b80600019048211156115215761152161142c565b029392505050565b600061058d60ff841683611485565b8082028115828204841417610d8357610d8361142c565b60008261156c57634e487b7160e01b600052601260045260246000fd5b500490565b600080835461157f816112e6565b60018216801561159657600181146115ab576115db565b60ff19831686528115158202860193506115db565b86600052602060002060005b838110156115d3578154888201526001909101906020016115b7565b505081860193505b509195945050505050565b80820180821115610d8357610d8361142c565b81810381811115610d8357610d8361142c565b634e487b7160e01b600052603260045260246000fd5b6000600182016116345761163461142c565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60006020828403121561166357600080fd5b815161058d81611201565b6001600160401b0381811683821602908116908181146116905761169061142c565b5092915050565b60805160a05160c05160e0516139fe61171d6000396000610dd101526000610da101526000818161072801528181611a950152818161253c01528181612580015281816125f90152818161262301528181612677015281816127460152818161277d015281816127c1015281816127e8015261287b015260006104a601526139fe6000f3fe6080604052600436106102e35760003560e01c80637ecebe0011610190578063c5ab3ba6116100dc578063dd63769911610095578063f28ca1dd1161006f578063f28ca1dd14610975578063f2fde38b1461098a578063f780bc1a146109aa578063f8b45b05146109ca57600080fd5b8063dd637699146108fa578063dfabc0331461091a578063e985e9c51461093a57600080fd5b8063c5ab3ba61461082d578063c6e672b914610842578063c87b56dd14610862578063d505accf14610882578063d96ca0b9146108a2578063dd62ed3e146108c257600080fd5b8063976a843511610149578063b1ab931711610123578063b1ab93171461078a578063b3f9ea34146107b7578063b88d4fde146107ed578063c30f4a5a1461080d57600080fd5b8063976a843514610716578063a22cb4651461074a578063a9059cbb1461076a57600080fd5b80637ecebe00146106675780638091f3bf1461069457806389fb4c66146106ae5780638a696e50146106c35780638da5cb5b146106e357806395d89b411461070157600080fd5b8063313ce5671161024f5780636352211e1161020857806370a08231116101e257806370a08231146105f0578063715018a61461061d578063744140cb14610632578063751039fc1461065257600080fd5b80636352211e1461058b57806368e8fe6d146105ab5780636e8f624b146105d857600080fd5b8063313ce567146104945780633644e515146104da57806342842e0e146104ef5780634313b9e51461050f5780634d966072146105555780634f02c4201461057557600080fd5b8063095ea7b3116102a1578063095ea7b3146103e957806309674eb01461040957806309f0ef651461041e57806318160ddd1461043e57806323b872dd146104545780632dd7c6581461047457600080fd5b8062773040146102e857806301339c211461031157806301ffc9a71461032857806302519da31461035857806306fdde0314610386578063081812fc1461039b575b600080fd5b6102fb6102f6366004612ef1565b6109e0565b6040516103089190612fe9565b60405180910390f35b34801561031d57600080fd5b50610326610a70565b005b34801561033457600080fd5b50610348610343366004613012565b610a87565b6040519015158152602001610308565b34801561036457600080fd5b5061037861037336600461302f565b610abe565b604051908152602001610308565b34801561039257600080fd5b506102fb610ad9565b3480156103a757600080fd5b506103d16103b636600461304c565b6009602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610308565b3480156103f557600080fd5b50610348610404366004613065565b610b67565b34801561041557600080fd5b50610378610bde565b34801561042a57600080fd5b5061034861043936600461302f565b610bef565b34801561044a57600080fd5b5061037860055481565b34801561046057600080fd5b5061034861046f366004613091565b610c21565b34801561048057600080fd5b506103d161048f36600461304c565b610cb5565b3480156104a057600080fd5b506104c87f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610308565b3480156104e657600080fd5b50610378610d9d565b3480156104fb57600080fd5b5061032661050a366004613091565b610df3565b34801561051b57600080fd5b5061052f61052a36600461304c565b610e13565b604080516001600160a01b03948516815293909216602084015290820152606001610308565b34801561056157600080fd5b50610348610570366004613065565b610e53565b34801561058157600080fd5b5061037860065481565b34801561059757600080fd5b506103d16105a636600461304c565b610ee0565b3480156105b757600080fd5b506103786105c636600461304c565b60106020526000908152604090205481565b3480156105e457600080fd5b50610378600160ff1b81565b3480156105fc57600080fd5b5061037861060b36600461302f565b60076020526000908152604090205481565b34801561062957600080fd5b50610326610f5f565b34801561063e57600080fd5b5061032661064d3660046130d2565b610f73565b34801561065e57600080fd5b5061032661100e565b34801561067357600080fd5b5061037861068236600461302f565b600e6020526000908152604090205481565b3480156106a057600080fd5b506012546103489060ff1681565b3480156106ba57600080fd5b50600554610378565b3480156106cf57600080fd5b506103266106de366004613104565b61101e565b3480156106ef57600080fd5b506000546001600160a01b03166103d1565b34801561070d57600080fd5b506102fb61106f565b34801561072257600080fd5b506103787f000000000000000000000000000000000000000000000000000000000000000081565b34801561075657600080fd5b5061032661076536600461311f565b61107c565b34801561077657600080fd5b50610348610785366004613065565b61110f565b34801561079657600080fd5b506107aa6107a536600461302f565b611143565b6040516103089190613154565b3480156107c357600080fd5b506103786107d236600461302f565b6001600160a01b03166000908152600c602052604090205490565b3480156107f957600080fd5b50610326610808366004613242565b611244565b34801561081957600080fd5b506103266108283660046132c1565b61133a565b34801561083957600080fd5b50600654610378565b34801561084e57600080fd5b5061032661085d36600461311f565b61134e565b34801561086e57600080fd5b506102fb61087d36600461304c565b611360565b34801561088e57600080fd5b5061032661089d366004613309565b611650565b3480156108ae57600080fd5b506103486108bd366004613091565b611893565b3480156108ce57600080fd5b506103786108dd366004613378565b600860209081526000928352604080842090915290825290205481565b34801561090657600080fd5b50610326610915366004613091565b611953565b34801561092657600080fd5b50610348610935366004613065565b611ac4565b34801561094657600080fd5b50610348610955366004613378565b600a60209081526000928352604080842090915290825290205460ff1681565b34801561098157600080fd5b506102fb611bb1565b34801561099657600080fd5b506103266109a536600461302f565b611bbe565b3480156109b657600080fd5b506107aa6109c53660046130d2565b611bf9565b3480156109d657600080fd5b5061037860135481565b60606109eb87610cb5565b6001600160a01b0316635194544787878787876040518663ffffffff1660e01b8152600401610a1e9594939291906133b1565b6000604051808303816000875af1158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a659190810190613406565b979650505050505050565b610a78611c99565b6012805460ff19166001179055565b60006001600160e01b0319821663caf91ff560e01b1480610ab857506001600160e01b031982166301ffc9a760e01b145b92915050565b6001600160a01b031660009081526007602052604090205490565b60038054610ae690613473565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1290613473565b8015610b5f5780601f10610b3457610100808354040283529160200191610b5f565b820191906000526020600020905b815481529060010190602001808311610b4257829003601f168201915b505050505081565b6000600160ff1b8210610b8557610b7e8383610e53565b9050610ab8565b610b9b610b96600160ff1b846134c3565b611cc6565b15610bcb576000610bac8484611ac4565b905080610bc557610bbd8484610e53565b915050610ab8565b50610bd5565b610b7e8383610e53565b50600192915050565b6000610bea6001611cdf565b905090565b60006001600160a01b0382161580610ab85750506001600160a01b03166000908152600d602052604090205460ff1690565b6000610c34610b96600160ff1b846134c3565b15610c9f57610c65610c4a600160ff1b846134c3565b6000908152600b60205260409020546001600160a01b031690565b6001600160a01b0316846001600160a01b031614610c8f57610c88848484611893565b9050610cae565b610c9a848484611953565b610caa565b610c88848484611893565b5060015b9392505050565b600081815260106020526040812054600f80548392908110610cd957610cd96134d6565b60009182526020918290206040805160608101825260039390930290910180546001600160a01b039081168085526001830154909116948401859052600290910154838301819052915163246a002160e01b8152600481019190915260248101919091524660448201523060648201526084810186905290925063246a00219060a401602060405180830381865afa158015610d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cae91906134ec565b60007f00000000000000000000000000000000000000000000000000000000000000004614610dce57610bea611d22565b507f000000000000000000000000000000000000000000000000000000000000000090565b610e0e83838360405180602001604052806000815250611244565b505050565b600f8181548110610e2357600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03918216935091169083565b60006001600160a01b038316610e7c57604051635461585f60e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350600192915050565b6000610ef0600160ff1b836134c3565b6000818152600b60205260409020549092506001600160a01b03169050610f1682611cc6565b610f33576040516307ed98ed60e31b815260040160405180910390fd5b6001600160a01b038116610f5a5760405163c5723b5160e01b815260040160405180910390fd5b919050565b610f67611c99565b610f716000611dbc565b565b6000818152600b60205260409020546001600160a01b03163314610fa9576040516282b42960e81b815260040160405180910390fd5b600f548210610fef5760405162461bcd60e51b815260206004820152600d60248201526c0496e76616c696420736574757609c1b60448201526064015b60405180910390fd5b600081815260106020526040902082905561100a8282611e0c565b5050565b611016611c99565b600554601355565b60125460ff166110635760405162461bcd60e51b815260206004820152601060248201526f139bdd081b185d5b98da1959081e595d60821b6044820152606401610fe6565b61106c81611eea565b50565b60048054610ae690613473565b6001600160a01b0382166110a35760405163ccea9e6f60e01b815260040160405180910390fd5b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60006001600160a01b03831661113857604051634e46966960e11b815260040160405180910390fd5b610cae338484611ef4565b6001600160a01b0381166000908152600c6020526040812054606091906001600160401b0381111561117757611177613197565b6040519080825280602002602001820160405280156111a0578160200160208202803683370190505b50905060005b6001600160a01b0384166000908152600c602052604090205481101561123d576001600160a01b0384166000908152600c602052604090208054829081106111f0576111f06134d6565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff1682828151811061122a5761122a6134d6565b60209081029190910101526001016111a6565b5092915050565b611255610b96600160ff1b846134c3565b611272576040516307ed98ed60e31b815260040160405180910390fd5b61127d848484610c21565b506001600160a01b0383163b158015906113165750604051630a85bd0160e11b808252906001600160a01b0385169063150b7a02906112c6903390899088908890600401613509565b6020604051808303816000875af11580156112e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113099190613546565b6001600160e01b03191614155b1561133457604051633da6393160e01b815260040160405180910390fd5b50505050565b611342611c99565b601161100a82826135b1565b611356611c99565b61100a8282612002565b606060008260405160200161137791815260200190565b6040516020818303038152906040528051906020012060f81c905060608060648360ff16116113e45760405180604001604052806005815260200164312e6a706760d81b81525091506040518060400160405280600481526020016350696e6b60e01b8152509050611521565b60a08360ff16116114335760405180604001604052806005815260200164322e6a706760d81b8152509150604051806040016040528060048152602001634772617960e01b8152509050611521565b60d28360ff16116114835760405180604001604052806005815260200164332e6a706760d81b81525091506040518060400160405280600581526020016423b932b2b760d91b8152509050611521565b60f08360ff16116114d45760405180604001604052806005815260200164342e6a706760d81b81525091506040518060400160405280600681526020016559656c6c6f7760d01b8152509050611521565b60ff8360ff16116115215760405180604001604052806005815260200164352e6a706760d81b8152509150604051806040016040528060068152602001654f72616e676560d01b81525090505b600061152c86612071565b60405160200161153c919061366f565b60408051601f1981840301815290829052611559916020016136ab565b60405160208183030381529060405260118460405160200161157c92919061381c565b60408051601f198184030181529082905261159a9291602001613841565b60405160208183030381529060405290506000826040516020016115be9190613867565b60408051601f1981840301815282820182526004835263227d5d7d60e01b60208481019190915291519093506115f8918591859101613841565b60408051601f1981840301815290829052611617918390602001613841565b60408051601f1981840301815290829052611634916020016138c4565b6040516020818303038152906040529650505050505050919050565b42841015611671576040516305787bdf60e01b815260040160405180910390fd5b61167a85611cc6565b15611698576040516303e7c1bd60e31b815260040160405180910390fd5b6001600160a01b0386166116bf57604051635461585f60e01b815260040160405180910390fd5b600060016116cb610d9d565b6001600160a01b038a81166000818152600e602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156117d7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158061180c5750876001600160a01b0316816001600160a01b031614155b1561182a57604051632057875960e21b815260040160405180910390fd5b6001600160a01b0390811660009081526008602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60006001600160a01b0384166118bc57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0383166118e357604051634e46966960e11b815260040160405180910390fd5b6001600160a01b0384166000908152600860209081526040808320338452909152902054600019811461193f5761191a8382613909565b6001600160a01b03861660009081526008602090815260408083203384529091529020555b61194a858585611ef4565b95945050505050565b611961600160ff1b826134c3565b90506001600160a01b03831661198a57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0382166119b157604051634e46966960e11b815260040160405180910390fd5b6000818152600b60205260409020546001600160a01b038481169116146119ea576040516282b42960e81b815260040160405180910390fd5b336001600160a01b03841614801590611a2757506001600160a01b0383166000908152600a6020908152604080832033845290915290205460ff16155b8015611a4a57506000818152600960205260409020546001600160a01b03163314155b15611a67576040516282b42960e81b815260040160405180910390fd5b611a7082610bef565b15611a8e57604051635ce7539760e01b815260040160405180910390fd5b611ab983837f0000000000000000000000000000000000000000000000000000000000000000612103565b610e0e8383836121bf565b6000611ad4600160ff1b836134c3565b6000818152600b60205260409020549092506001600160a01b0316338114801590611b2357506001600160a01b0381166000908152600a6020908152604080832033845290915290205460ff16155b15611b32576000915050610ab8565b600083815260096020526040902080546001600160a01b0319166001600160a01b038616179055611b67600160ff1b84613909565b846001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45060019392505050565b60118054610ae690613473565b611bc6611c99565b6001600160a01b038116611bf057604051631e4fbdf760e01b815260006004820152602401610fe6565b61106c81611dbc565b60606000826001600160401b03811115611c1557611c15613197565b604051908082528060200260200182016040528015611c3e578160200160208202803683370190505b509050835b611c4d84866134c3565b811015611c9157611c5f60018261242f565b61ffff1682611c6e8784613909565b81518110611c7e57611c7e6134d6565b6020908102919091010152600101611c43565b509392505050565b6000546001600160a01b03163314610f715760405163118cdaa760e01b8152336004820152602401610fe6565b6000600160ff1b82118015610ab8575050600019141590565b54600f196001600160401b038083166010908102600160401b850483168203600160c01b8604841601600160801b90950483169091029390930192909203011690565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6003604051611d54919061391c565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000600f8381548110611e2157611e216134d6565b60009182526020918290206040805160608101825260039390930290910180546001600160a01b0390811680855260018301549091169484018590526002909101548383018190529151638a54c52f60e01b81526004810191909152602481019190915246604482015230606482015260848101859052909250638a54c52f9060a4016020604051808303816000875af1925050508015611edf575060408051601f3d908101601f19168201909252611edc918101906134ec565b60015b15610e0e5750505050565b61106c3382612002565b336000908152600d602052604081205460ff1680611f2a57506001600160a01b0384166000908152600d602052604090205460ff165b8015611f39575060125460ff16155b15611f4957610c888484846124e1565b60125460ff16611f8e5760405162461bcd60e51b815260206004820152601060248201526f139bdd081b185d5b98da1959081e595d60821b6044820152606401610fe6565b6000611f9984610abe565b601354909150611fa984836134c3565b1115611ff75760405162461bcd60e51b815260206004820152601960248201527f4d61782077616c6c6574206c696d6974206578636565646564000000000000006044820152606401610fe6565b61194a8585856124e1565b6001600160a01b0382166120295760405163a41e3d3f60e01b815260040160405180910390fd5b801561203d5761203882612843565b612046565b61204682612877565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b6060600061207e836128f7565b60010190506000816001600160401b0381111561209d5761209d613197565b6040519080825280601f01601f1916602001820160405280156120c7576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846120d157509392505050565b6001600160a01b03831661212e57806005600082825461212391906134c3565b9091555061215c9050565b6001600160a01b03831660009081526007602052604081208054839290612156908490613909565b90915550505b6001600160a01b03808316600081815260076020526040908190208054850190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906121b29085815260200190565b60405180910390a3505050565b6001600160a01b0383161561232657600081815260096020908152604080832080546001600160a01b03191690556001600160a01b0386168352600c9091528120805461220e90600190613909565b8154811061221e5761221e6134d6565b6000918252602090912060108204015461224c91600f166002026101000a900461ffff16600160ff1b6134c3565b90508181146122d1576000828152600b602052604081205460a01c6001600160a01b0386166000908152600c602052604090208054919250839183908110612296576122966134d6565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff1602179055506122cf82826129cf565b505b6001600160a01b0384166000908152600c602052604090208054806122f8576122f861393e565b600082815260209020601060001990920191820401805461ffff6002600f8516026101000a02191690559055505b6001600160a01b038216156123cc576000818152600b6020526040902080546001600160a01b0319166001600160a01b0384160190556001600160a01b0382166000818152600c60209081526040822080546001808201835582855292842060108204018054600f9092166002026101000a61ffff81810219909316928816029190911790559290915290546123c79183916123c29190613909565b6129cf565b6123dc565b6000818152600b60205260408120555b6123ea600160ff1b82613909565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b600061243a83611cdf565b612445906010613954565b82106124645760405163580821e760e01b815260040160405180910390fd5b610cae600184016000601085046010808789546001600160401b03600160401b90910481169290910691909101168161249f5761249f613928565b88549190046001600160401b03808316919091019290920182168352602083019390935260409091016000205491601091600160401b90910416850106612a3b565b6000806124ed85610abe565b905060006124fa85610abe565b9050612507868686612103565b600061251287610bef565b9050600061251f87610bef565b905081801561252b5750805b6128355781156125d45760006125617f00000000000000000000000000000000000000000000000000000000000000008561396b565b6001600160a01b0389166000908152600760205260409020546125a5907f00000000000000000000000000000000000000000000000000000000000000009061396b565b6125af9190613909565b905060005b818110156125cd576125c589612a66565b6001016125b4565b5050612835565b8015612670576001600160a01b03881660009081526007602052604081205461261e907f00000000000000000000000000000000000000000000000000000000000000009061396b565b6126487f00000000000000000000000000000000000000000000000000000000000000008761396b565b6126529190613909565b905060005b818110156125cd576126688a612b84565b600101612657565b600061269c7f00000000000000000000000000000000000000000000000000000000000000008861396b565b905060005b81811015612742576001600160a01b038a166000908152600c60205260408120546126ce90600190613909565b6001600160a01b038c166000908152600c6020526040812080549293509091839081106126fd576126fd6134d6565b6000918252602090912060108204015461272b91600f166002026101000a900461ffff16600160ff1b6134c3565b90506127388c8c836121bf565b50506001016126a1565b50807f000000000000000000000000000000000000000000000000000000000000000061276e8b610abe565b612778919061396b565b6127a27f00000000000000000000000000000000000000000000000000000000000000008861396b565b6127ac9190613909565b11156127bb576127bb89612b84565b806127e67f00000000000000000000000000000000000000000000000000000000000000008661396b565b7f00000000000000000000000000000000000000000000000000000000000000006128108b610abe565b61281a919061396b565b6128249190613909565b11156128335761283388612a66565b505b506001979650505050505050565b6001600160a01b0381166000908152600c6020526040812054905b81811015610e0e5761286f83612b84565b60010161285e565b60007f00000000000000000000000000000000000000000000000000000000000000006128a383610abe565b6128ad919061396b565b905060006128d0836001600160a01b03166000908152600c602052604090205490565b905060005b6128df8284613909565b811015611334576128ef84612a66565b6001016128d5565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106129365772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612962576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061298057662386f26fc10000830492506010015b6305f5e1008310612998576305f5e100830492506008015b61271083106129ac57612710830492506004015b606483106129be576064830492506002015b600a8310610ab85760010192915050565b6000828152600b60205260409020546bffffffffffffffffffffffff821115612a0b57604051633f2cd0e360e21b815260040160405180910390fd5b6000928352600b60205260409092206001600160a01b039290921660a09190911b6001600160a01b031916019055565b6000612a4882601061398d565b6001600160401b0316612a5a83612c28565b8416901c905092915050565b6001600160a01b038116612a8d57604051634e46966960e11b815260040160405180910390fd5b6000612a996001612c4a565b612ac057612aa76001612c8c565b612ab99061ffff16600160ff1b6134c3565b9050612b42565b600660008154612acf906139af565b90915550600654600101612af65760405163303b682f60e01b815260040160405180910390fd5b600654612b0790600160ff1b6134c3565b600f54909150600090612b1c90600190613909565b60068054600090815260106020526040902082905554909150612b40908290611e0c565b505b6000818152600b60205260409020546001600160a01b03168015612b795760405163119b4fd360e11b815260040160405180910390fd5b610e0e8184846121bf565b6001600160a01b038116612bab57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381166000908152600c602052604081208054612bd190600190613909565b81548110612be157612be16134d6565b60009182526020909120601082040154612c0f91600f166002026101000a900461ffff16600160ff1b6134c3565b9050612c1d826000836121bf565b61100a600182612da0565b6000612c3582601061398d565b6001600160401b031661ffff901b9050919050565b8054600090600160c01b81046001600160401b03908116600160401b90920416148015610ab8575050546001600160401b03808216600160801b909204161490565b80546000906001600160401b03600160801b8204811691600160c01b81048216911682148015612ccf575083546001600160401b03828116600160401b90920416145b15612ced576040516375e52f4f60e01b815260040160405180910390fd5b806001600160401b0316600003612d0a575060001901600f612d0f565b600019015b6001600160401b0382166000908152600185016020526040902054612d348183612a3b565b9350612d4281836000612e90565b6001600160401b03938416600081815260018801602052604090209190915585546fffffffffffffffffffffffffffffffff16600160801b9091026001600160c01b031617600160c01b929093169190910291909117909255919050565b81546001600160401b0380821691600160401b9004166000819003612dcb575060001901600f612dd0565b600019015b83546001600160401b03838116600160801b90920416148015612e06575083546001600160401b03828116600160c01b90920416145b15612e2457604051638acb5f2760e01b815260040160405180910390fd5b6001600160401b0382166000908152600185016020526040902054612e4a908285612e90565b6001600160401b03928316600081815260018701602052604090209190915584546fffffffffffffffffffffffffffffffff191617600160401b91909216021790915550565b6000612e9d83601061398d565b6001600160401b03168261ffff16901b612eb684612c28565b198516612ec391906134c3565b949350505050565b6001600160a01b038116811461106c57600080fd5b803560ff81168114610f5a57600080fd5b60008060008060008060a08789031215612f0a57600080fd5b863595506020870135612f1c81612ecb565b94506040870135935060608701356001600160401b03811115612f3e57600080fd5b8701601f81018913612f4f57600080fd5b80356001600160401b03811115612f6557600080fd5b896020828401011115612f7757600080fd5b60209190910193509150612f8d60808801612ee0565b90509295509295509295565b60005b83811015612fb4578181015183820152602001612f9c565b50506000910152565b60008151808452612fd5816020860160208601612f99565b601f01601f19169290920160200192915050565b602081526000610cae6020830184612fbd565b6001600160e01b03198116811461106c57600080fd5b60006020828403121561302457600080fd5b8135610cae81612ffc565b60006020828403121561304157600080fd5b8135610cae81612ecb565b60006020828403121561305e57600080fd5b5035919050565b6000806040838503121561307857600080fd5b823561308381612ecb565b946020939093013593505050565b6000806000606084860312156130a657600080fd5b83356130b181612ecb565b925060208401356130c181612ecb565b929592945050506040919091013590565b600080604083850312156130e557600080fd5b50508035926020909101359150565b80358015158114610f5a57600080fd5b60006020828403121561311657600080fd5b610cae826130f4565b6000806040838503121561313257600080fd5b823561313d81612ecb565b915061314b602084016130f4565b90509250929050565b602080825282518282018190526000918401906040840190835b8181101561318c57835183526020938401939092019160010161316e565b509095945050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156131d5576131d5613197565b604052919050565b60006001600160401b038211156131f6576131f6613197565b50601f01601f191660200190565b6000613217613212846131dd565b6131ad565b905082815283838301111561322b57600080fd5b828260208301376000602084830101529392505050565b6000806000806080858703121561325857600080fd5b843561326381612ecb565b9350602085013561327381612ecb565b92506040850135915060608501356001600160401b0381111561329557600080fd5b8501601f810187136132a657600080fd5b6132b587823560208401613204565b91505092959194509250565b6000602082840312156132d357600080fd5b81356001600160401b038111156132e957600080fd5b8201601f810184136132fa57600080fd5b612ec384823560208401613204565b600080600080600080600060e0888a03121561332457600080fd5b873561332f81612ecb565b9650602088013561333f81612ecb565b9550604088013594506060880135935061335b60808901612ee0565b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561338b57600080fd5b823561339681612ecb565b915060208301356133a681612ecb565b809150509250929050565b6001600160a01b0386168152602081018590526080604082018190528101839052828460a0830137600060a08483010152600060a0601f19601f860116830101905060ff831660608301529695505050505050565b60006020828403121561341857600080fd5b81516001600160401b0381111561342e57600080fd5b8201601f8101841361343f57600080fd5b805161344d613212826131dd565b81815285602083850101111561346257600080fd5b61194a826020830160208601612f99565b600181811c9082168061348757607f821691505b6020821081036134a757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610ab857610ab86134ad565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156134fe57600080fd5b8151610cae81612ecb565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061353c90830184612fbd565b9695505050505050565b60006020828403121561355857600080fd5b8151610cae81612ffc565b601f821115610e0e57806000526020600020601f840160051c8101602085101561358a5750805b601f840160051c820191505b818110156135aa5760008155600101613596565b5050505050565b81516001600160401b038111156135ca576135ca613197565b6135de816135d88454613473565b84613563565b6020601f82116001811461361257600083156135fa5750848201515b600019600385901b1c1916600184901b1784556135aa565b600084815260208120601f198516915b828110156136425787850151825560209485019460019092019101613622565b50848210156136605786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b727b226e616d65223a20224d656d656e746f202360681b8152815160009061369e816013850160208701612f99565b9190910160130192915050565b600082516136bd818460208701612f99565b7f222c226465736372697074696f6e223a224120636f6c6c656374696f6e206f669201918252507f2031302c303030205265706c6963616e7473206f6e2045524335443a206f707460208201527f696d697a65642045524334442077697468206c6f77657220666565732c20556e60408201527f69737761702056332c20616e6420666978656420746f6b656e55524920666f7260608201527f204e4654732e222c2265787465726e616c5f75726c223a2268747470733a2f2f60808201527f6d656d656e746f2e6275696c64222c22696d616765223a22000000000000000060a082015260b801919050565b600081546137b781613473565b6001821680156137ce57600181146137e357613813565b60ff1983168652811515820286019350613813565b84600052602060002060005b8381101561380b578154888201526001909101906020016137ef565b505081860193505b50505092915050565b600061382882856137aa565b8351613838818360208801612f99565b01949350505050565b60008351613853818460208801612f99565b835190830190613838818360208801612f99565b7f222c2261747472696275746573223a5b7b2274726169745f74797065223a224381526e37b637b91116113b30b63ab2911d1160891b6020820152600082516138b781602f850160208701612f99565b91909101602f0192915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c00000000008152600082516138fc81601b850160208701612f99565b91909101601b0192915050565b81810381811115610ab857610ab86134ad565b6000610cae82846137aa565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b8082028115828204841417610ab857610ab86134ad565b60008261398857634e487b7160e01b600052601260045260246000fd5b500490565b6001600160401b03818116838216029081169081811461123d5761123d6134ad565b6000600182016139c1576139c16134ad565b506001019056fea2646970667358221220746c147ec86ff6350d9be7f9dc9766b97f64d11253afd51f16f489eef53007e764736f6c634300081a0033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000002710000000000000000000000000d0382e59eddb1b12d59c05458ba27b960b7895790000000000000000000000005572bfb57e990f8101b76d81a12d241ac3ac6dc0ac94c34e307a1c1e9353ef528dbe2d0474bde592e91d86605a7b8554b3188bf400000000000000000000000000000000000000000000000000000000000000074d656d656e746f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054d454e544f000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106102e35760003560e01c80637ecebe0011610190578063c5ab3ba6116100dc578063dd63769911610095578063f28ca1dd1161006f578063f28ca1dd14610975578063f2fde38b1461098a578063f780bc1a146109aa578063f8b45b05146109ca57600080fd5b8063dd637699146108fa578063dfabc0331461091a578063e985e9c51461093a57600080fd5b8063c5ab3ba61461082d578063c6e672b914610842578063c87b56dd14610862578063d505accf14610882578063d96ca0b9146108a2578063dd62ed3e146108c257600080fd5b8063976a843511610149578063b1ab931711610123578063b1ab93171461078a578063b3f9ea34146107b7578063b88d4fde146107ed578063c30f4a5a1461080d57600080fd5b8063976a843514610716578063a22cb4651461074a578063a9059cbb1461076a57600080fd5b80637ecebe00146106675780638091f3bf1461069457806389fb4c66146106ae5780638a696e50146106c35780638da5cb5b146106e357806395d89b411461070157600080fd5b8063313ce5671161024f5780636352211e1161020857806370a08231116101e257806370a08231146105f0578063715018a61461061d578063744140cb14610632578063751039fc1461065257600080fd5b80636352211e1461058b57806368e8fe6d146105ab5780636e8f624b146105d857600080fd5b8063313ce567146104945780633644e515146104da57806342842e0e146104ef5780634313b9e51461050f5780634d966072146105555780634f02c4201461057557600080fd5b8063095ea7b3116102a1578063095ea7b3146103e957806309674eb01461040957806309f0ef651461041e57806318160ddd1461043e57806323b872dd146104545780632dd7c6581461047457600080fd5b8062773040146102e857806301339c211461031157806301ffc9a71461032857806302519da31461035857806306fdde0314610386578063081812fc1461039b575b600080fd5b6102fb6102f6366004612ef1565b6109e0565b6040516103089190612fe9565b60405180910390f35b34801561031d57600080fd5b50610326610a70565b005b34801561033457600080fd5b50610348610343366004613012565b610a87565b6040519015158152602001610308565b34801561036457600080fd5b5061037861037336600461302f565b610abe565b604051908152602001610308565b34801561039257600080fd5b506102fb610ad9565b3480156103a757600080fd5b506103d16103b636600461304c565b6009602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610308565b3480156103f557600080fd5b50610348610404366004613065565b610b67565b34801561041557600080fd5b50610378610bde565b34801561042a57600080fd5b5061034861043936600461302f565b610bef565b34801561044a57600080fd5b5061037860055481565b34801561046057600080fd5b5061034861046f366004613091565b610c21565b34801561048057600080fd5b506103d161048f36600461304c565b610cb5565b3480156104a057600080fd5b506104c87f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff9091168152602001610308565b3480156104e657600080fd5b50610378610d9d565b3480156104fb57600080fd5b5061032661050a366004613091565b610df3565b34801561051b57600080fd5b5061052f61052a36600461304c565b610e13565b604080516001600160a01b03948516815293909216602084015290820152606001610308565b34801561056157600080fd5b50610348610570366004613065565b610e53565b34801561058157600080fd5b5061037860065481565b34801561059757600080fd5b506103d16105a636600461304c565b610ee0565b3480156105b757600080fd5b506103786105c636600461304c565b60106020526000908152604090205481565b3480156105e457600080fd5b50610378600160ff1b81565b3480156105fc57600080fd5b5061037861060b36600461302f565b60076020526000908152604090205481565b34801561062957600080fd5b50610326610f5f565b34801561063e57600080fd5b5061032661064d3660046130d2565b610f73565b34801561065e57600080fd5b5061032661100e565b34801561067357600080fd5b5061037861068236600461302f565b600e6020526000908152604090205481565b3480156106a057600080fd5b506012546103489060ff1681565b3480156106ba57600080fd5b50600554610378565b3480156106cf57600080fd5b506103266106de366004613104565b61101e565b3480156106ef57600080fd5b506000546001600160a01b03166103d1565b34801561070d57600080fd5b506102fb61106f565b34801561072257600080fd5b506103787f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b34801561075657600080fd5b5061032661076536600461311f565b61107c565b34801561077657600080fd5b50610348610785366004613065565b61110f565b34801561079657600080fd5b506107aa6107a536600461302f565b611143565b6040516103089190613154565b3480156107c357600080fd5b506103786107d236600461302f565b6001600160a01b03166000908152600c602052604090205490565b3480156107f957600080fd5b50610326610808366004613242565b611244565b34801561081957600080fd5b506103266108283660046132c1565b61133a565b34801561083957600080fd5b50600654610378565b34801561084e57600080fd5b5061032661085d36600461311f565b61134e565b34801561086e57600080fd5b506102fb61087d36600461304c565b611360565b34801561088e57600080fd5b5061032661089d366004613309565b611650565b3480156108ae57600080fd5b506103486108bd366004613091565b611893565b3480156108ce57600080fd5b506103786108dd366004613378565b600860209081526000928352604080842090915290825290205481565b34801561090657600080fd5b50610326610915366004613091565b611953565b34801561092657600080fd5b50610348610935366004613065565b611ac4565b34801561094657600080fd5b50610348610955366004613378565b600a60209081526000928352604080842090915290825290205460ff1681565b34801561098157600080fd5b506102fb611bb1565b34801561099657600080fd5b506103266109a536600461302f565b611bbe565b3480156109b657600080fd5b506107aa6109c53660046130d2565b611bf9565b3480156109d657600080fd5b5061037860135481565b60606109eb87610cb5565b6001600160a01b0316635194544787878787876040518663ffffffff1660e01b8152600401610a1e9594939291906133b1565b6000604051808303816000875af1158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a659190810190613406565b979650505050505050565b610a78611c99565b6012805460ff19166001179055565b60006001600160e01b0319821663caf91ff560e01b1480610ab857506001600160e01b031982166301ffc9a760e01b145b92915050565b6001600160a01b031660009081526007602052604090205490565b60038054610ae690613473565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1290613473565b8015610b5f5780601f10610b3457610100808354040283529160200191610b5f565b820191906000526020600020905b815481529060010190602001808311610b4257829003601f168201915b505050505081565b6000600160ff1b8210610b8557610b7e8383610e53565b9050610ab8565b610b9b610b96600160ff1b846134c3565b611cc6565b15610bcb576000610bac8484611ac4565b905080610bc557610bbd8484610e53565b915050610ab8565b50610bd5565b610b7e8383610e53565b50600192915050565b6000610bea6001611cdf565b905090565b60006001600160a01b0382161580610ab85750506001600160a01b03166000908152600d602052604090205460ff1690565b6000610c34610b96600160ff1b846134c3565b15610c9f57610c65610c4a600160ff1b846134c3565b6000908152600b60205260409020546001600160a01b031690565b6001600160a01b0316846001600160a01b031614610c8f57610c88848484611893565b9050610cae565b610c9a848484611953565b610caa565b610c88848484611893565b5060015b9392505050565b600081815260106020526040812054600f80548392908110610cd957610cd96134d6565b60009182526020918290206040805160608101825260039390930290910180546001600160a01b039081168085526001830154909116948401859052600290910154838301819052915163246a002160e01b8152600481019190915260248101919091524660448201523060648201526084810186905290925063246a00219060a401602060405180830381865afa158015610d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cae91906134ec565b60007f00000000000000000000000000000000000000000000000000000000000000014614610dce57610bea611d22565b507f7eb0ba116699ed2fe1a93cccaafebcfb1cb9ba02fbc7bbcefd5c53436b6231a490565b610e0e83838360405180602001604052806000815250611244565b505050565b600f8181548110610e2357600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03918216935091169083565b60006001600160a01b038316610e7c57604051635461585f60e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350600192915050565b6000610ef0600160ff1b836134c3565b6000818152600b60205260409020549092506001600160a01b03169050610f1682611cc6565b610f33576040516307ed98ed60e31b815260040160405180910390fd5b6001600160a01b038116610f5a5760405163c5723b5160e01b815260040160405180910390fd5b919050565b610f67611c99565b610f716000611dbc565b565b6000818152600b60205260409020546001600160a01b03163314610fa9576040516282b42960e81b815260040160405180910390fd5b600f548210610fef5760405162461bcd60e51b815260206004820152600d60248201526c0496e76616c696420736574757609c1b60448201526064015b60405180910390fd5b600081815260106020526040902082905561100a8282611e0c565b5050565b611016611c99565b600554601355565b60125460ff166110635760405162461bcd60e51b815260206004820152601060248201526f139bdd081b185d5b98da1959081e595d60821b6044820152606401610fe6565b61106c81611eea565b50565b60048054610ae690613473565b6001600160a01b0382166110a35760405163ccea9e6f60e01b815260040160405180910390fd5b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60006001600160a01b03831661113857604051634e46966960e11b815260040160405180910390fd5b610cae338484611ef4565b6001600160a01b0381166000908152600c6020526040812054606091906001600160401b0381111561117757611177613197565b6040519080825280602002602001820160405280156111a0578160200160208202803683370190505b50905060005b6001600160a01b0384166000908152600c602052604090205481101561123d576001600160a01b0384166000908152600c602052604090208054829081106111f0576111f06134d6565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff1682828151811061122a5761122a6134d6565b60209081029190910101526001016111a6565b5092915050565b611255610b96600160ff1b846134c3565b611272576040516307ed98ed60e31b815260040160405180910390fd5b61127d848484610c21565b506001600160a01b0383163b158015906113165750604051630a85bd0160e11b808252906001600160a01b0385169063150b7a02906112c6903390899088908890600401613509565b6020604051808303816000875af11580156112e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113099190613546565b6001600160e01b03191614155b1561133457604051633da6393160e01b815260040160405180910390fd5b50505050565b611342611c99565b601161100a82826135b1565b611356611c99565b61100a8282612002565b606060008260405160200161137791815260200190565b6040516020818303038152906040528051906020012060f81c905060608060648360ff16116113e45760405180604001604052806005815260200164312e6a706760d81b81525091506040518060400160405280600481526020016350696e6b60e01b8152509050611521565b60a08360ff16116114335760405180604001604052806005815260200164322e6a706760d81b8152509150604051806040016040528060048152602001634772617960e01b8152509050611521565b60d28360ff16116114835760405180604001604052806005815260200164332e6a706760d81b81525091506040518060400160405280600581526020016423b932b2b760d91b8152509050611521565b60f08360ff16116114d45760405180604001604052806005815260200164342e6a706760d81b81525091506040518060400160405280600681526020016559656c6c6f7760d01b8152509050611521565b60ff8360ff16116115215760405180604001604052806005815260200164352e6a706760d81b8152509150604051806040016040528060068152602001654f72616e676560d01b81525090505b600061152c86612071565b60405160200161153c919061366f565b60408051601f1981840301815290829052611559916020016136ab565b60405160208183030381529060405260118460405160200161157c92919061381c565b60408051601f198184030181529082905261159a9291602001613841565b60405160208183030381529060405290506000826040516020016115be9190613867565b60408051601f1981840301815282820182526004835263227d5d7d60e01b60208481019190915291519093506115f8918591859101613841565b60408051601f1981840301815290829052611617918390602001613841565b60408051601f1981840301815290829052611634916020016138c4565b6040516020818303038152906040529650505050505050919050565b42841015611671576040516305787bdf60e01b815260040160405180910390fd5b61167a85611cc6565b15611698576040516303e7c1bd60e31b815260040160405180910390fd5b6001600160a01b0386166116bf57604051635461585f60e01b815260040160405180910390fd5b600060016116cb610d9d565b6001600160a01b038a81166000818152600e602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156117d7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158061180c5750876001600160a01b0316816001600160a01b031614155b1561182a57604051632057875960e21b815260040160405180910390fd5b6001600160a01b0390811660009081526008602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60006001600160a01b0384166118bc57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0383166118e357604051634e46966960e11b815260040160405180910390fd5b6001600160a01b0384166000908152600860209081526040808320338452909152902054600019811461193f5761191a8382613909565b6001600160a01b03861660009081526008602090815260408083203384529091529020555b61194a858585611ef4565b95945050505050565b611961600160ff1b826134c3565b90506001600160a01b03831661198a57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0382166119b157604051634e46966960e11b815260040160405180910390fd5b6000818152600b60205260409020546001600160a01b038481169116146119ea576040516282b42960e81b815260040160405180910390fd5b336001600160a01b03841614801590611a2757506001600160a01b0383166000908152600a6020908152604080832033845290915290205460ff16155b8015611a4a57506000818152600960205260409020546001600160a01b03163314155b15611a67576040516282b42960e81b815260040160405180910390fd5b611a7082610bef565b15611a8e57604051635ce7539760e01b815260040160405180910390fd5b611ab983837f0000000000000000000000000000000000000000000000000de0b6b3a7640000612103565b610e0e8383836121bf565b6000611ad4600160ff1b836134c3565b6000818152600b60205260409020549092506001600160a01b0316338114801590611b2357506001600160a01b0381166000908152600a6020908152604080832033845290915290205460ff16155b15611b32576000915050610ab8565b600083815260096020526040902080546001600160a01b0319166001600160a01b038616179055611b67600160ff1b84613909565b846001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45060019392505050565b60118054610ae690613473565b611bc6611c99565b6001600160a01b038116611bf057604051631e4fbdf760e01b815260006004820152602401610fe6565b61106c81611dbc565b60606000826001600160401b03811115611c1557611c15613197565b604051908082528060200260200182016040528015611c3e578160200160208202803683370190505b509050835b611c4d84866134c3565b811015611c9157611c5f60018261242f565b61ffff1682611c6e8784613909565b81518110611c7e57611c7e6134d6565b6020908102919091010152600101611c43565b509392505050565b6000546001600160a01b03163314610f715760405163118cdaa760e01b8152336004820152602401610fe6565b6000600160ff1b82118015610ab8575050600019141590565b54600f196001600160401b038083166010908102600160401b850483168203600160c01b8604841601600160801b90950483169091029390930192909203011690565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6003604051611d54919061391c565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000600f8381548110611e2157611e216134d6565b60009182526020918290206040805160608101825260039390930290910180546001600160a01b0390811680855260018301549091169484018590526002909101548383018190529151638a54c52f60e01b81526004810191909152602481019190915246604482015230606482015260848101859052909250638a54c52f9060a4016020604051808303816000875af1925050508015611edf575060408051601f3d908101601f19168201909252611edc918101906134ec565b60015b15610e0e5750505050565b61106c3382612002565b336000908152600d602052604081205460ff1680611f2a57506001600160a01b0384166000908152600d602052604090205460ff165b8015611f39575060125460ff16155b15611f4957610c888484846124e1565b60125460ff16611f8e5760405162461bcd60e51b815260206004820152601060248201526f139bdd081b185d5b98da1959081e595d60821b6044820152606401610fe6565b6000611f9984610abe565b601354909150611fa984836134c3565b1115611ff75760405162461bcd60e51b815260206004820152601960248201527f4d61782077616c6c6574206c696d6974206578636565646564000000000000006044820152606401610fe6565b61194a8585856124e1565b6001600160a01b0382166120295760405163a41e3d3f60e01b815260040160405180910390fd5b801561203d5761203882612843565b612046565b61204682612877565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b6060600061207e836128f7565b60010190506000816001600160401b0381111561209d5761209d613197565b6040519080825280601f01601f1916602001820160405280156120c7576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846120d157509392505050565b6001600160a01b03831661212e57806005600082825461212391906134c3565b9091555061215c9050565b6001600160a01b03831660009081526007602052604081208054839290612156908490613909565b90915550505b6001600160a01b03808316600081815260076020526040908190208054850190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906121b29085815260200190565b60405180910390a3505050565b6001600160a01b0383161561232657600081815260096020908152604080832080546001600160a01b03191690556001600160a01b0386168352600c9091528120805461220e90600190613909565b8154811061221e5761221e6134d6565b6000918252602090912060108204015461224c91600f166002026101000a900461ffff16600160ff1b6134c3565b90508181146122d1576000828152600b602052604081205460a01c6001600160a01b0386166000908152600c602052604090208054919250839183908110612296576122966134d6565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff1602179055506122cf82826129cf565b505b6001600160a01b0384166000908152600c602052604090208054806122f8576122f861393e565b600082815260209020601060001990920191820401805461ffff6002600f8516026101000a02191690559055505b6001600160a01b038216156123cc576000818152600b6020526040902080546001600160a01b0319166001600160a01b0384160190556001600160a01b0382166000818152600c60209081526040822080546001808201835582855292842060108204018054600f9092166002026101000a61ffff81810219909316928816029190911790559290915290546123c79183916123c29190613909565b6129cf565b6123dc565b6000818152600b60205260408120555b6123ea600160ff1b82613909565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b600061243a83611cdf565b612445906010613954565b82106124645760405163580821e760e01b815260040160405180910390fd5b610cae600184016000601085046010808789546001600160401b03600160401b90910481169290910691909101168161249f5761249f613928565b88549190046001600160401b03808316919091019290920182168352602083019390935260409091016000205491601091600160401b90910416850106612a3b565b6000806124ed85610abe565b905060006124fa85610abe565b9050612507868686612103565b600061251287610bef565b9050600061251f87610bef565b905081801561252b5750805b6128355781156125d45760006125617f0000000000000000000000000000000000000000000000000de0b6b3a76400008561396b565b6001600160a01b0389166000908152600760205260409020546125a5907f0000000000000000000000000000000000000000000000000de0b6b3a76400009061396b565b6125af9190613909565b905060005b818110156125cd576125c589612a66565b6001016125b4565b5050612835565b8015612670576001600160a01b03881660009081526007602052604081205461261e907f0000000000000000000000000000000000000000000000000de0b6b3a76400009061396b565b6126487f0000000000000000000000000000000000000000000000000de0b6b3a76400008761396b565b6126529190613909565b905060005b818110156125cd576126688a612b84565b600101612657565b600061269c7f0000000000000000000000000000000000000000000000000de0b6b3a76400008861396b565b905060005b81811015612742576001600160a01b038a166000908152600c60205260408120546126ce90600190613909565b6001600160a01b038c166000908152600c6020526040812080549293509091839081106126fd576126fd6134d6565b6000918252602090912060108204015461272b91600f166002026101000a900461ffff16600160ff1b6134c3565b90506127388c8c836121bf565b50506001016126a1565b50807f0000000000000000000000000000000000000000000000000de0b6b3a764000061276e8b610abe565b612778919061396b565b6127a27f0000000000000000000000000000000000000000000000000de0b6b3a76400008861396b565b6127ac9190613909565b11156127bb576127bb89612b84565b806127e67f0000000000000000000000000000000000000000000000000de0b6b3a76400008661396b565b7f0000000000000000000000000000000000000000000000000de0b6b3a76400006128108b610abe565b61281a919061396b565b6128249190613909565b11156128335761283388612a66565b505b506001979650505050505050565b6001600160a01b0381166000908152600c6020526040812054905b81811015610e0e5761286f83612b84565b60010161285e565b60007f0000000000000000000000000000000000000000000000000de0b6b3a76400006128a383610abe565b6128ad919061396b565b905060006128d0836001600160a01b03166000908152600c602052604090205490565b905060005b6128df8284613909565b811015611334576128ef84612a66565b6001016128d5565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106129365772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612962576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061298057662386f26fc10000830492506010015b6305f5e1008310612998576305f5e100830492506008015b61271083106129ac57612710830492506004015b606483106129be576064830492506002015b600a8310610ab85760010192915050565b6000828152600b60205260409020546bffffffffffffffffffffffff821115612a0b57604051633f2cd0e360e21b815260040160405180910390fd5b6000928352600b60205260409092206001600160a01b039290921660a09190911b6001600160a01b031916019055565b6000612a4882601061398d565b6001600160401b0316612a5a83612c28565b8416901c905092915050565b6001600160a01b038116612a8d57604051634e46966960e11b815260040160405180910390fd5b6000612a996001612c4a565b612ac057612aa76001612c8c565b612ab99061ffff16600160ff1b6134c3565b9050612b42565b600660008154612acf906139af565b90915550600654600101612af65760405163303b682f60e01b815260040160405180910390fd5b600654612b0790600160ff1b6134c3565b600f54909150600090612b1c90600190613909565b60068054600090815260106020526040902082905554909150612b40908290611e0c565b505b6000818152600b60205260409020546001600160a01b03168015612b795760405163119b4fd360e11b815260040160405180910390fd5b610e0e8184846121bf565b6001600160a01b038116612bab57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381166000908152600c602052604081208054612bd190600190613909565b81548110612be157612be16134d6565b60009182526020909120601082040154612c0f91600f166002026101000a900461ffff16600160ff1b6134c3565b9050612c1d826000836121bf565b61100a600182612da0565b6000612c3582601061398d565b6001600160401b031661ffff901b9050919050565b8054600090600160c01b81046001600160401b03908116600160401b90920416148015610ab8575050546001600160401b03808216600160801b909204161490565b80546000906001600160401b03600160801b8204811691600160c01b81048216911682148015612ccf575083546001600160401b03828116600160401b90920416145b15612ced576040516375e52f4f60e01b815260040160405180910390fd5b806001600160401b0316600003612d0a575060001901600f612d0f565b600019015b6001600160401b0382166000908152600185016020526040902054612d348183612a3b565b9350612d4281836000612e90565b6001600160401b03938416600081815260018801602052604090209190915585546fffffffffffffffffffffffffffffffff16600160801b9091026001600160c01b031617600160c01b929093169190910291909117909255919050565b81546001600160401b0380821691600160401b9004166000819003612dcb575060001901600f612dd0565b600019015b83546001600160401b03838116600160801b90920416148015612e06575083546001600160401b03828116600160c01b90920416145b15612e2457604051638acb5f2760e01b815260040160405180910390fd5b6001600160401b0382166000908152600185016020526040902054612e4a908285612e90565b6001600160401b03928316600081815260018701602052604090209190915584546fffffffffffffffffffffffffffffffff191617600160401b91909216021790915550565b6000612e9d83601061398d565b6001600160401b03168261ffff16901b612eb684612c28565b198516612ec391906134c3565b949350505050565b6001600160a01b038116811461106c57600080fd5b803560ff81168114610f5a57600080fd5b60008060008060008060a08789031215612f0a57600080fd5b863595506020870135612f1c81612ecb565b94506040870135935060608701356001600160401b03811115612f3e57600080fd5b8701601f81018913612f4f57600080fd5b80356001600160401b03811115612f6557600080fd5b896020828401011115612f7757600080fd5b60209190910193509150612f8d60808801612ee0565b90509295509295509295565b60005b83811015612fb4578181015183820152602001612f9c565b50506000910152565b60008151808452612fd5816020860160208601612f99565b601f01601f19169290920160200192915050565b602081526000610cae6020830184612fbd565b6001600160e01b03198116811461106c57600080fd5b60006020828403121561302457600080fd5b8135610cae81612ffc565b60006020828403121561304157600080fd5b8135610cae81612ecb565b60006020828403121561305e57600080fd5b5035919050565b6000806040838503121561307857600080fd5b823561308381612ecb565b946020939093013593505050565b6000806000606084860312156130a657600080fd5b83356130b181612ecb565b925060208401356130c181612ecb565b929592945050506040919091013590565b600080604083850312156130e557600080fd5b50508035926020909101359150565b80358015158114610f5a57600080fd5b60006020828403121561311657600080fd5b610cae826130f4565b6000806040838503121561313257600080fd5b823561313d81612ecb565b915061314b602084016130f4565b90509250929050565b602080825282518282018190526000918401906040840190835b8181101561318c57835183526020938401939092019160010161316e565b509095945050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156131d5576131d5613197565b604052919050565b60006001600160401b038211156131f6576131f6613197565b50601f01601f191660200190565b6000613217613212846131dd565b6131ad565b905082815283838301111561322b57600080fd5b828260208301376000602084830101529392505050565b6000806000806080858703121561325857600080fd5b843561326381612ecb565b9350602085013561327381612ecb565b92506040850135915060608501356001600160401b0381111561329557600080fd5b8501601f810187136132a657600080fd5b6132b587823560208401613204565b91505092959194509250565b6000602082840312156132d357600080fd5b81356001600160401b038111156132e957600080fd5b8201601f810184136132fa57600080fd5b612ec384823560208401613204565b600080600080600080600060e0888a03121561332457600080fd5b873561332f81612ecb565b9650602088013561333f81612ecb565b9550604088013594506060880135935061335b60808901612ee0565b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561338b57600080fd5b823561339681612ecb565b915060208301356133a681612ecb565b809150509250929050565b6001600160a01b0386168152602081018590526080604082018190528101839052828460a0830137600060a08483010152600060a0601f19601f860116830101905060ff831660608301529695505050505050565b60006020828403121561341857600080fd5b81516001600160401b0381111561342e57600080fd5b8201601f8101841361343f57600080fd5b805161344d613212826131dd565b81815285602083850101111561346257600080fd5b61194a826020830160208601612f99565b600181811c9082168061348757607f821691505b6020821081036134a757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610ab857610ab86134ad565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156134fe57600080fd5b8151610cae81612ecb565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061353c90830184612fbd565b9695505050505050565b60006020828403121561355857600080fd5b8151610cae81612ffc565b601f821115610e0e57806000526020600020601f840160051c8101602085101561358a5750805b601f840160051c820191505b818110156135aa5760008155600101613596565b5050505050565b81516001600160401b038111156135ca576135ca613197565b6135de816135d88454613473565b84613563565b6020601f82116001811461361257600083156135fa5750848201515b600019600385901b1c1916600184901b1784556135aa565b600084815260208120601f198516915b828110156136425787850151825560209485019460019092019101613622565b50848210156136605786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b727b226e616d65223a20224d656d656e746f202360681b8152815160009061369e816013850160208701612f99565b9190910160130192915050565b600082516136bd818460208701612f99565b7f222c226465736372697074696f6e223a224120636f6c6c656374696f6e206f669201918252507f2031302c303030205265706c6963616e7473206f6e2045524335443a206f707460208201527f696d697a65642045524334442077697468206c6f77657220666565732c20556e60408201527f69737761702056332c20616e6420666978656420746f6b656e55524920666f7260608201527f204e4654732e222c2265787465726e616c5f75726c223a2268747470733a2f2f60808201527f6d656d656e746f2e6275696c64222c22696d616765223a22000000000000000060a082015260b801919050565b600081546137b781613473565b6001821680156137ce57600181146137e357613813565b60ff1983168652811515820286019350613813565b84600052602060002060005b8381101561380b578154888201526001909101906020016137ef565b505081860193505b50505092915050565b600061382882856137aa565b8351613838818360208801612f99565b01949350505050565b60008351613853818460208801612f99565b835190830190613838818360208801612f99565b7f222c2261747472696275746573223a5b7b2274726169745f74797065223a224381526e37b637b91116113b30b63ab2911d1160891b6020820152600082516138b781602f850160208701612f99565b91909101602f0192915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c00000000008152600082516138fc81601b850160208701612f99565b91909101601b0192915050565b81810381811115610ab857610ab86134ad565b6000610cae82846137aa565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b8082028115828204841417610ab857610ab86134ad565b60008261398857634e487b7160e01b600052601260045260246000fd5b500490565b6001600160401b03818116838216029081169081811461123d5761123d6134ad565b6000600182016139c1576139c16134ad565b506001019056fea2646970667358221220746c147ec86ff6350d9be7f9dc9766b97f64d11253afd51f16f489eef53007e764736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000002710000000000000000000000000d0382e59eddb1b12d59c05458ba27b960b7895790000000000000000000000005572bfb57e990f8101b76d81a12d241ac3ac6dc0ac94c34e307a1c1e9353ef528dbe2d0474bde592e91d86605a7b8554b3188bf400000000000000000000000000000000000000000000000000000000000000074d656d656e746f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054d454e544f000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): Memento
Arg [1] : symbol_ (string): MENTO
Arg [2] : decimals_ (uint8): 18
Arg [3] : supply721_ (uint256): 10000
Arg [4] : registry_ (address): 0xD0382E59eddb1B12d59c05458Ba27B960b789579
Arg [5] : implementation_ (address): 0x5572BfB57e990F8101b76D81a12D241ac3ac6dC0
Arg [6] : salt_ (bytes32): 0xac94c34e307a1c1e9353ef528dbe2d0474bde592e91d86605a7b8554b3188bf4
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [3] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [4] : 000000000000000000000000d0382e59eddb1b12d59c05458ba27b960b789579
Arg [5] : 0000000000000000000000005572bfb57e990f8101b76d81a12d241ac3ac6dc0
Arg [6] : ac94c34e307a1c1e9353ef528dbe2d0474bde592e91d86605a7b8554b3188bf4
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [8] : 4d656d656e746f00000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [10] : 4d454e544f000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.