Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
191 FIEF
Holders
36
Total Transfers
-
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Fiefdoms
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT import "./Dependencies.sol"; import "./BaseTokenURI.sol"; import "./DefaultTokenURI.sol"; import "./FiefdomProxy.sol"; import "./FiefdomArchetype.sol"; pragma solidity ^0.8.17; /// @title Fiefdoms /// @author steviep.eth, julien.eth /// @notice ERC721 collection contract where ownership of a token grants the tooken holder ownership over a Fiefdom contract contract Fiefdoms is ERC721, Ownable { /// @notice License of Fiefdoms parent project - Does not pertain to the license of any tokens minted by Fiefdom contracts string public license = 'CC0'; /// @notice Address that is permissioned to mint new tokens address public minter; /// @notice Address of the default tokenURI contract used by fiefdoms for mint 0 address public fiefdomArchetype; /// @notice Address of the default tokenURI contract used by fiefdoms for mint 0 address public defaultTokenURIContract; /// @notice True when only operators on the allow list may be approved bool public useOperatorAllowList = true; /// @notice Max supply of collection uint256 public constant maxSupply = 721; /// @notice Mapping from vassal's token id to fiefdom address mapping(uint256 => address) public tokenIdToFiefdom; /// @notice Allow lise of all operators allowed t mapping(address => bool) public operatorAllowList; BaseTokenURI private _tokenURIContract; uint256 private _totalSupply = 1; address private _royaltyBeneficiary; uint16 private _royaltyBasisPoints = 1000; /// @notice Arbitrary event emitted by contract owner /// @param poster Address of initiator /// @param eventType Type of event /// @param content Content of event event ProjectEvent(address indexed poster, string indexed eventType, string content); /// @notice Arbitrary event related to a specific token emitted by contract owner or token holder /// @param poster Address of initiator /// @param tokenId ID of token /// @param eventType Type of event /// @param content Content of event event TokenEvent(address indexed poster, uint256 indexed tokenId, string indexed eventType, string content); /// @notice Emitted when a range of tokens has their metadata updated /// @param _fromTokenId The first ID of the token in the range /// @param _toTokenId The last ID of the token in the range /// @dev See EIP-4906: https://eips.ethereum.org/EIPS/eip-4906 event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); /// @notice Emitted when a token's metadata is updated /// @param _tokenId The ID of the updated token /// @dev See EIP-4906: https://eips.ethereum.org/EIPS/eip-4906 event MetadataUpdate(uint256 _tokenId); /// @notice Emitted when a fiefdom is first activated /// @param fiefdom The ID of the fiefdom being activated event Activation(uint256 fiefdom); // SETUP /// @dev Sets base variables, mints token #0 to the deployer, and publishes the FiefdomArchetype contract constructor() ERC721('Fiefdoms', 'FIEF') { minter = msg.sender; _royaltyBeneficiary = msg.sender; _tokenURIContract = new BaseTokenURI(); defaultTokenURIContract = address(new DefaultTokenURI()); // Publish an archetype contract. All proxy contracts will derive its functionality from this fiefdomArchetype = address(new FiefdomArchetype()); // Token 0 will use the archetype contract directly instead of a proxy _mint(msg.sender, 0); tokenIdToFiefdom[0] = fiefdomArchetype; } // BASE FUNCTIONALITY /// @notice Current total supply of collection /// @return Total supply function totalSupply() external view returns (uint256) { return _totalSupply; } /// @notice Checks if given token ID exists /// @param tokenId Token to run existence check on /// @return True if token exists function exists(uint256 tokenId) external view returns (bool) { return _exists(tokenId); } /// @notice Alias of Fiefdoms contract owner function overlord() external view returns (address) { return owner(); } /// @dev Override's the default _transfer function to also transfer ownership over the corresponding fiefdom function _transfer( address from, address to, uint256 tokenId ) internal virtual override { // When this token is transferred, also transfer ownership over its fiefdom FiefdomArchetype(tokenIdToFiefdom[tokenId]).transferOwnership(from, to); return super._transfer(from, to, tokenId); } /// @notice Emits Activation and MetadataUpdate events upon fiefdom activation /// @param tokenId Token Id of fiefdom being activated /// @dev This can only be called by the fiefdom upon its activation function activation(uint256 tokenId) external { require(tokenIdToFiefdom[tokenId] == msg.sender); emit MetadataUpdate(tokenId); emit Activation(tokenId); } // MINTING /// @notice Mints a new token /// @param to Address to receive new token function mint(address to) external { require(minter == msg.sender, 'Caller is not the minting address'); require(_totalSupply < maxSupply, 'Cannot create more fiefdoms'); _mint(to, _totalSupply); // Publish a new proxy contract for this token FiefdomProxy proxy = new FiefdomProxy(); tokenIdToFiefdom[_totalSupply] = address(proxy); _totalSupply += 1; } /// @notice Mints a batch of new tokens to a single address /// @param to Address to receive all new tokens /// @param amount Amount of tokens to mint function mintBatch(address to, uint256 amount) external { require(minter == msg.sender, 'Caller is not the minting address'); require(_totalSupply + amount <= maxSupply, 'Cannot create more fiefdoms'); for (uint256 i; i < amount; i++) { _mint(to, _totalSupply); FiefdomProxy proxy = new FiefdomProxy(); tokenIdToFiefdom[_totalSupply] = address(proxy); _totalSupply++; } } /// @notice Reassigns the minter permission /// @param newMinter Address of new minter function setMinter(address newMinter) external onlyOwner { minter = newMinter; } // ROYALTIES // Fiefdoms may collect their own royalties without restriction, but must follow the rules of the broader kingdom /// @notice Override the standard approve function to revert if approving an un-ALed operator /// @param to Address of operator /// @param tokenId Id of token to approve function approve(address to, uint256 tokenId) public virtual override { if (useOperatorAllowList) require(operatorAllowList[to], 'Operator must be on Allow List'); super.approve(to, tokenId); } /// @notice Override the standard setApprovalForAll function to revert if approving an un-ALed operator /// @param operator Address of operator /// @param approved Approval status of operator function setApprovalForAll(address operator, bool approved) public virtual override { if (useOperatorAllowList && approved) require(operatorAllowList[operator], 'Operator must be on Allow List'); super.setApprovalForAll(operator, approved); } /// @notice Override the standard getApproved function to return false for un-ALed operators /// @param tokenId Id of token function getApproved(uint256 tokenId) public view virtual override returns (address) { address operator = super.getApproved(tokenId); if (useOperatorAllowList) { return operatorAllowList[operator] ? operator : address(0); } else { return operator; } } /// @notice Override the standard isApprovedForAll function to return false for un-ALed operators /// @param owner Address of owner /// @param operator Address of operator function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { if (useOperatorAllowList && !operatorAllowList[operator]) { return false; } else { return super.isApprovedForAll(owner, operator); } } /// @notice Denotes whether an operator allow list should be used /// @param _useOperatorAllowList New useOperatorAllowList value function updateUseOperatorAllowList(bool _useOperatorAllowList) external onlyOwner { useOperatorAllowList = _useOperatorAllowList; } /// @notice Update the allow list status of a single operator /// @param operator Address of operator /// @param allowListStatus New allow list status function updateOperatorAllowList(address operator, bool allowListStatus) external onlyOwner { operatorAllowList[operator] = allowListStatus; } /// @notice Sets royalty info for the collection /// @param royaltyBeneficiary Address to receive royalties /// @param royaltyBasisPoints Basis points of royalty commission /// @dev See EIP-2981: https://eips.ethereum.org/EIPS/eip-2981 function setRoyaltyInfo( address royaltyBeneficiary, uint16 royaltyBasisPoints ) external onlyOwner { _royaltyBeneficiary = royaltyBeneficiary; _royaltyBasisPoints = royaltyBasisPoints; } /// @notice Called with the sale price to determine how much royalty is owed and to whom. /// @param (unused) /// @param _salePrice The sale price of the NFT asset specified by _tokenId /// @return receiver Address of who should be sent the royalty payment /// @return royaltyAmount The royalty payment amount for _salePrice /// @dev See EIP-2981: https://eips.ethereum.org/EIPS/eip-2981 function royaltyInfo(uint256, uint256 _salePrice) external view returns (address, uint256) { return (_royaltyBeneficiary, _salePrice * _royaltyBasisPoints / 10000); } /// @notice Query if a contract implements an interface /// @param interfaceId The interface identifier, as specified in ERC-165 /// @return `true` if the contract implements `interfaceId` and /// `interfaceId` is not 0xffffffff, `false` otherwise /// @dev Interface identification is specified in ERC-165. This function /// uses less than 30,000 gas. See: https://eips.ethereum.org/EIPS/eip-165 /// See EIP-2981: https://eips.ethereum.org/EIPS/eip-2981 /// See EIP-4906: https://eips.ethereum.org/EIPS/eip-4906 function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721) returns (bool) { // ERC2981 & ERC4906 return interfaceId == bytes4(0x2a55205a) || interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId); } // TOKEN URI /// @notice Token URI /// @param tokenId Token ID to look up URI of /// @return Token URI function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { return _tokenURIContract.tokenURI(tokenId); } /// @notice Set the Token URI contract for Vassal tokens /// @param _tokenURIAddress New address of Token URI contract function setTokenURIContract(address _tokenURIAddress) external onlyOwner { _tokenURIContract = BaseTokenURI(_tokenURIAddress); emit BatchMetadataUpdate(0, _totalSupply); } /// @notice Set the default Token URI contract for all Fiefdoms in the Kingdom /// @param newDefault Address of the new default Token URI contract function setDefaultTokenURIContract(address newDefault) external onlyOwner { defaultTokenURIContract = newDefault; } /// @notice Address of Token URI contract /// @return Address of the Token URI contract function tokenURIContract() external view returns (address) { return address(_tokenURIContract); } // EVENTS /// @notice Emit an arbitrary event related to a token /// @param tokenId ID of the token this event is related to /// @param eventType Type of event to emit /// @param content Text to be included in event /// @dev Can be called either by contract owner or token holder function emitTokenEvent(uint256 tokenId, string calldata eventType, string calldata content) external { require( owner() == msg.sender || ERC721.ownerOf(tokenId) == msg.sender, 'Only project or token owner can emit token event' ); emit TokenEvent(msg.sender, tokenId, eventType, content); } /// @notice Emit an arbitrary event related to the project /// @param eventType Type of event to emit /// @param content Text to be included in event /// @dev Can only be called either by contract owner function emitProjectEvent(string calldata eventType, string calldata content) external onlyOwner { emit ProjectEvent(msg.sender, eventType, content); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "./Dependencies.sol"; import "./Fiefdoms.sol"; import "./FiefdomArchetype.sol"; contract BaseTokenURI { using Strings for uint256; Fiefdoms private immutable fiefdoms; constructor() { fiefdoms = Fiefdoms(msg.sender); } function tokenURI(uint256 tokenId) external view returns (string memory) { bytes memory name = abi.encodePacked('Fiefdom Vassal #', tokenId.toString()); address fiefdomAddr = fiefdoms.tokenIdToFiefdom(tokenId); bool isActivated = FiefdomArchetype(fiefdomAddr).isActivated(); uint256 foundedAt = FiefdomArchetype(fiefdomAddr).foundedAt(); string memory pColor = isActivated ? '#fff' : '#000'; string memory sColor = isActivated ? '#000' : '#fff'; string memory state = isActivated ? 'Activated' : 'Unactivated'; bytes memory attributes = abi.encodePacked( '[{"trait_type": "Activated", "value":', isActivated ? '"true"' : '"false"', '},{"trait_type": "Fiefdom", "value": "0x', toString(fiefdomAddr), '"},{"trait_type": "Founded At", "value": "', foundedAt.toString(), '"}]' ); bytes memory background = abi.encodePacked( '<rect x="0" y="0" width="100%" height="100%" fill="', pColor,'"/>', '<rect x="23.78px" y="23.78px" width="1141.44" height="793.44px" fill="none" stroke="', sColor,'" stroke-width="2"/>' ); bytes memory textName = abi.encodePacked( '<text x="50%" y="47%" font-size="105px" fill="', sColor, '" dominant-baseline="middle" text-anchor="middle">', name, '</text>' ); bytes memory textAddr = abi.encodePacked( '<text x="50%" y="58%" font-size="42px" fill="', sColor,'" font-family="monospace" dominant-baseline="middle" text-anchor="middle">0x', toString(fiefdomAddr), '</text>' ); bytes memory encodedImage = abi.encodePacked( '"data:image/svg+xml;base64,', Base64.encode(abi.encodePacked( '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1189 841">', background, textName, textAddr, '</svg>' )), '",' ); bytes memory description = abi.encodePacked( '"', state, ' ', name, ' of 0x', toString(fiefdomAddr), '",' ); bytes memory json = abi.encodePacked( 'data:application/json;utf8,', '{"name": "', name,'",', '"description": ', description, '"external_url": "https://steviep.xyz/fiefdoms",' '"image": ', encodedImage, '"attributes":', attributes, '}' ); return string(json); } function toString(address x) internal pure returns (string memory) { bytes memory s = new bytes(40); for (uint i = 0; i < 20; i++) { bytes1 b = bytes1(uint8(uint(uint160(x)) / (2**(8*(19 - i))))); bytes1 hi = bytes1(uint8(b) / 16); bytes1 lo = bytes1(uint8(b) - 16 * uint8(hi)); s[2*i] = char(hi); s[2*i+1] = char(lo); } return string(s); } function char(bytes1 b) internal pure returns (bytes1 c) { if (uint8(b) < 10) return bytes1(uint8(b) + 0x30); else return bytes1(uint8(b) + 0x57); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "./Dependencies.sol"; import "./Fiefdoms.sol"; import "./FiefdomArchetype.sol"; contract DefaultTokenURI { using Strings for uint256; function tokenURI(uint256 tokenId) external view returns (string memory) { FiefdomArchetype fiefdom = FiefdomArchetype(msg.sender); bytes memory name = abi.encodePacked('Fiefdom ', fiefdom.fiefdomId().toString(), ', Token ', tokenId.toString()); bytes memory background = abi.encodePacked( '<rect x="0" y="0" width="100%" height="100%" fill="#000"/>', '<rect x="23.78px" y="23.78px" width="1141.44" height="793.44px" fill="none" stroke="#fff" stroke-width="5"/>' ); bytes memory textFiefdom = abi.encodePacked( '<text x="50%" y="38%" class="t">', 'Fiefdom ', fiefdom.fiefdomId().toString(), '</text>' ); bytes memory textToken = abi.encodePacked( '<text x="50%" y="62%" class="t">', 'Token ', tokenId.toString(), '</text>' ); bytes memory encodedImage = abi.encodePacked( '"data:image/svg+xml;base64,', Base64.encode(abi.encodePacked( '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1189 841"><style>.t{font-size:160px;font-family:sans-serif;fill:#fff;dominant-baseline:middle;text-anchor:middle;}</style>', background, textFiefdom, textToken, '</svg>' )), '"' ); bytes memory json = abi.encodePacked( 'data:application/json;utf8,', '{"name": "', name,'",', '"description": "The start of something new.",', '"image": ', encodedImage, '}' ); return string(json); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } /** * @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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /* * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @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; } } /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /* * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } } /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} } /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _burn(tokenId); } } 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); } // OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol) /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overridden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} } /// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes memory table = TABLE; assembly { let tablePtr := add(table, 1) let resultPtr := add(result, 32) for { let i := 0 } lt(i, len) { } { i := add(i, 3) let input := and(mload(add(data, i)), 0xffffff) let out := mload(add(tablePtr, and(shr(18, input), 0x3F))) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)) out := shl(224, out) mstore(resultPtr, out) resultPtr := add(resultPtr, 4) } switch mod(len, 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } mstore(result, encodedLen) } return string(result); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "./Dependencies.sol"; interface IERC721Hooks { function parent() external returns (address); function beforeTokenTransfer(address from, address to, uint256 tokenId) external; function beforeApprove(address to, uint256 tokenId) external; function beforeSetApprovalForAll(address operator, bool approved) external; } contract ERC721HooksBase is IERC721Hooks { address public parent; constructor(address _parent) { parent = _parent; } modifier onlyParent() { require(msg.sender == parent, "Only parent ERC721 can call hooks"); _; } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual {} function beforeTokenTransfer(address from, address to, uint256 tokenId) external onlyParent { _beforeTokenTransfer(from, to, tokenId); } function _beforeApprove(address to, uint256 tokenId) internal virtual {} function beforeApprove(address to, uint256 tokenId) external onlyParent { _beforeApprove(to, tokenId); } function _beforeSetApprovalForAll(address operator, bool approved) internal virtual {} function beforeSetApprovalForAll(address operator, bool approved) external onlyParent { _beforeSetApprovalForAll(operator, approved); } }
// SPDX-License-Identifier: MIT /* ________ _____ ________ ________ ______ ___ ____ ____ |_ __ ||_ _||_ __ ||_ __ ||_ _ `. .' `.|_ \ / _| | |_ \_| | | | |_ \_| | |_ \_| | | `. \/ .-. \ | \/ | | _| | | | _| _ | _| | | | || | | | | |\ /| | _| |_ _| |_ _| |__/ | _| |_ _| |_.' /\ `-' /_| |_\/_| |_ |_____| |_____||________||_____| |______.' `.___.'|_____||_____| _ _______ ______ ____ ____ ________ _________ ____ ____ _______ ________ / \ |_ __ \ .' ___ ||_ || _||_ __ || _ _ ||_ _||_ _||_ __ \|_ __ | / _ \ | |__) | / .' \_| | |__| | | |_ \_||_/ | | \_| \ \ / / | |__) | | |_ \_| / ___ \ | __ / | | | __ | | _| _ | | \ \/ / | ___/ | _| _ _/ / \ \_ _| | \ \_\ `.___.'\ _| | | |_ _| |__/ | _| |_ _| |_ _| |_ _| |__/ | |____| |____||____| |___|`.____ .'|____||____||________| |_____| |______| |_____| |________| by steviep.eth (2022) All Fiefdom Proxy contracts inherit the behavior of the Fiefdom Archetype. Upon publication, a fiefdom contract will set a placeholder name and symbol, record the timestamp of its founding at, and will mint token #0 to itself. Ownership over the Fiefdom will follow the owner of the corresponding Vassal token, which is manage by the Fiefdom Kingdom contract. At any point, the Vassal owner may choose to activate the Fiefdom. This will set the contract's name, symbol, license, max supply of tokens, tokenURI contract, and hooks contract. While name and symbol are fixed, maxSupply and tokenURIContract can be updated later. maxSupply and tokenURI can also be frozen by the Vassal owner. The passed hooks contract address allows for the Vassal owner to define extra behavior that runs before transfers and approvals. The Vassal owner will be the default minter of the contract, but can also set the minter to another address. In practice, the minter will be a separate minting contract. The minter can mint tokens using any of three methods: mint, mintBatch, and mintBatchTo. If set to 0x0, tokenURI logic will default to the default token URI contract set at the kingdom level. Otherwise, the Fiefdom may freely change its token URI contract. */ import "./DefaultTokenURI.sol"; import "./BaseTokenURI.sol"; import "./ERC721Hooks.sol"; import "./Dependencies.sol"; import "./Fiefdoms.sol"; pragma solidity ^0.8.17; interface ITokenURI { function tokenURI(uint256 tokenId) external view returns (string memory uri); } /// @title Fiefdom Archetype /// @author steviep.eth, julien.eth /// @notice ERC721 collection contract controlled by the vassal that holds its corresponding fiefdom token contract FiefdomArchetype is ERC721Burnable { using Strings for uint256; /// @notice Main Fiefdoms contract address Fiefdoms public kingdom; /// @notice Called when tokens are minted, transferred, burned, and when approvals are set /// @dev To use, extend the ERC721HooksBase contract, override the required virtual functions, deploy with this /// fiefdom contract's address set as its parent, and pass its address to activate() IERC721Hooks public erc721Hooks; /// @notice True after activate() has been called bool public isActivated; /// @notice True when token URI contract can no longer be changed bool public tokenURIFrozen; /// @notice True when max supply can no longer change bool public maxSupplyFrozen; /// @notice Address that is allowed to mint tokens address public minter; /// @notice ID of this fiefdom uint256 public fiefdomId; /// @notice License of project string public license; /// @notice Max supply of collection uint256 public maxSupply; /// @notice Timestamp when this contract was created uint256 public foundedAt; string private _name; string private _symbol; uint256 private _totalSupply; bool private _isInitialized; address private _royaltyBeneficiary; uint16 private _royaltyBasisPoints; address private _tokenURIContract; /// @notice Arbitrary event emitted by contract owner /// @param poster Address of initiator /// @param eventType Type of event /// @param content Content of event event ProjectEvent(address indexed poster, string indexed eventType, string content); /// @notice Arbitrary event related to a specific token emitted by contract owner or token holder /// @param poster Address of initiator /// @param tokenId ID of token /// @param eventType Type of event /// @param content Content of event event TokenEvent(address indexed poster, uint256 indexed tokenId, string indexed eventType, string content); /// @notice Emitted when a range of tokens has their metadata updated /// @param _fromTokenId The first ID of the token in the range /// @param _toTokenId The last ID of the token in the range /// @dev See EIP-4906: https://eips.ethereum.org/EIPS/eip-4906 event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); /// @notice Emitted when a token's metadata is updated /// @param _tokenId The ID of the updated token /// @dev See EIP-4906: https://eips.ethereum.org/EIPS/eip-4906 event MetadataUpdate(uint256 _tokenId); /// @dev This is only called when the first archetype contract is initially published constructor() ERC721('', '') { initialize(msg.sender, 0); } /// @notice Initializes contract by minting token 0 to itself and setting a default name and symbol /// @param _kingdom Address of the main Fiefdoms contract /// @param _fiefdomId Token ID of this fiefdom /// @dev Called by the proxy contract immediately after a copy of this contract is published function initialize(address _kingdom, uint256 _fiefdomId) public { require(!_isInitialized, "Can't initialize more than once"); _isInitialized = true; // Since constructor is not called (or called the first time with empty values) _name = string(abi.encodePacked('Fiefdom ', _fiefdomId.toString())); _symbol = string(abi.encodePacked('FIEF', _fiefdomId.toString())); kingdom = Fiefdoms(_kingdom); fiefdomId = _fiefdomId; foundedAt = block.timestamp; _totalSupply = 1; _mint(address(this), 0); } /// @notice Instantiates the collection beyond the 0th mint and sends the 0th token to the caller /// @param name_ Name to be set on collection /// @param symbol_ Symbol to be set on collection /// @param license_ License to be set on project /// @param maxSupply_ Max supply to be set on collection /// @param tokenURIContract_ Contract used to return metadata for each token (optional) /// @param erc721Hooks_ Contract called when tokens are minted, transferred, burned, and when approvals are set (optional) function activate( string memory name_, string memory symbol_, string memory license_, uint256 maxSupply_, address tokenURIContract_, address erc721Hooks_ ) public onlyOwner { // Require that it can only be called once require(!isActivated, "Fiefdom has already been activated"); // Set the name/symbol _name = name_; _symbol = symbol_; // Set the max token supply maxSupply = maxSupply_; // Set the defailt minter address + ERC2981 royalty beneficiary minter = msg.sender; _royaltyBeneficiary = msg.sender; _royaltyBasisPoints = 1000; // Set the tokenURI contract _tokenURIContract = tokenURIContract_; license = license_; isActivated = true; // Recover the 0th token _transfer(address(this), msg.sender, 0); emit MetadataUpdate(0); kingdom.activation(fiefdomId); // Set hooks if contract address provided if (address(erc721Hooks_) != address(0)) { erc721Hooks = IERC721Hooks(erc721Hooks_); require(erc721Hooks.parent() == address(this), "Passed ERC721Hooks contract is not configured for this Fiefdom"); } } // HOOKS /// @notice Register calls to erc721Hooks on transfers (including mints and burns) /// @param from Address of sender (zero when being minted) /// @param to Address of receiver (zero when burning) /// @param tokenId ID of token being transferred (or minted or burned) function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override { if (address(erc721Hooks) != address(0)) erc721Hooks.beforeTokenTransfer(from, to, tokenId); } /// @notice Register calls to erc721Hooks on token approvals /// @param to Address to be approved /// @param tokenId ID of token being approved of function approve(address to, uint256 tokenId) public virtual override { if (address(erc721Hooks) != address(0)) erc721Hooks.beforeApprove(to, tokenId); super.approve(to, tokenId); } /// @notice Register calls to erc721Hooks on operator approvals /// @param operator Address of operator /// @param approved True when operator is being approved, false when approval is being revoked function setApprovalForAll(address operator, bool approved) public virtual override { if (address(erc721Hooks) != address(0)) erc721Hooks.beforeSetApprovalForAll(operator, approved); super.setApprovalForAll(operator, approved); } // OWNERSHIP /// @notice Emitted when fiefdom token is transferred to a new owner /// @param previousOwner Previous owner of fiefdom token /// @param newOwner New owner of fiefdom token event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /// @notice Contract owner /// @dev The owner of this contract is the owner of the corresponding fiefdom token function owner() public view virtual returns (address) { return kingdom.ownerOf(fiefdomId); } modifier onlyOwner() { require(owner() == msg.sender, "Ownable: caller is not the owner"); _; } /// @notice Notes a transfer in contract ownership /// @param previousOwner Previous owner of fiefdom token /// @param newOwner New owner of fiefdom token /// @dev Called by Fiefdoms whenever the corresponding fiefdom token is traded function transferOwnership(address previousOwner, address newOwner) external { require(msg.sender == address(kingdom), 'Ownership can only be transferred by the kingdom'); emit OwnershipTransferred(previousOwner, newOwner); } // VARIABLES // BASE FUNCTIONALITY /// @notice Current total supply of collection /// @return Total supply function totalSupply() external view returns (uint256) { return _totalSupply; } /// @notice Checks if given token ID exists /// @param tokenId Token to run existence check on /// @return True if token exists function exists(uint256 tokenId) external view returns (bool) { return _exists(tokenId); } /// @notice Name of collection /// @return Name function name() public view virtual override(ERC721) returns (string memory) { return _name; } /// @notice Symbol of collection /// @return Symbol function symbol() public view virtual override(ERC721) returns (string memory) { return _symbol; } // MINTING /// @notice Mints a new token /// @param to Address to receive new token /// @param tokenId ID of new token function mint(address to, uint256 tokenId) external { require(minter == msg.sender, 'Caller is not the minting address'); require(_totalSupply < maxSupply, 'Cannot create more tokens'); _mint(to, tokenId); _totalSupply += 1; } /// @notice Mints one new token to each provided address /// @param to Addresses to each receive one new token /// @param tokenIdStart ID of first new token function mintBatch(address[] calldata to, uint256 tokenIdStart) external { require(minter == msg.sender, 'Caller is not the minting address'); uint256 amount = to.length; require(_totalSupply + amount <= maxSupply, 'Cannot create more tokens'); for (uint256 i; i < amount; i++) { _mint(to[i], tokenIdStart + i); _totalSupply++; } } /// @notice Mints a batch of new tokens to a single address /// @param to Address to receive all new tokens /// @param amount Amount of tokens to mint /// @param tokenIdStart ID of first new token function mintBatchTo(address to, uint256 amount, uint256 tokenIdStart) external { require(minter == msg.sender, 'Caller is not the minting address'); require(_totalSupply + amount <= maxSupply, 'Cannot create more tokens'); for (uint256 i; i < amount; i++) { _mint(to, tokenIdStart + i); _totalSupply++; } } /// @notice Token URI /// @param tokenId Token ID to look up URI of /// @return Token URI function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { return ITokenURI(tokenURIContract()).tokenURI(tokenId); } /// @notice Address of Token URI contract /// @return Address of custom Token URI contract if set, otherwise the Kingdom's default function tokenURIContract() public view returns (address) { return _tokenURIContract == address(0) ? kingdom.defaultTokenURIContract() : _tokenURIContract; } // Contract owner actions /// @notice Sets a custom Token URI contract /// @param tokenURIContract_ Address of Token URI contract to set function setTokenURIContract(address tokenURIContract_) external onlyOwner { require(!tokenURIFrozen, 'Token URI has been frozen'); _tokenURIContract = tokenURIContract_; emit BatchMetadataUpdate(0, _totalSupply); } /// @notice Disallow changes to Token URI contract address function freezeTokenURI() external onlyOwner { require(isActivated, 'Fiefdom must be activated'); tokenURIFrozen = true; } /// @notice Sets the max supply of the collection /// @param newMaxSupply Max supply to set function setMaxSupply(uint256 newMaxSupply) external onlyOwner { require(isActivated, 'Fiefdom must be activated'); require(newMaxSupply >= _totalSupply, 'maxSupply must be >= than totalSupply'); require(!maxSupplyFrozen, 'maxSupply has been frozen'); maxSupply = newMaxSupply; } /// @notice Disallow changes to max supply function freezeMaxSupply() external onlyOwner { require(isActivated, 'Fiefdom must be activated'); maxSupplyFrozen = true; } /// @notice Sets the license of the project /// @param newLicense License function setLicense(string calldata newLicense) external onlyOwner { license = newLicense; } /// @notice Sets minter address /// @param newMinter Minter address to set function setMinter(address newMinter) external onlyOwner { minter = newMinter; } /// @notice Sets royalty info for the collection /// @param royaltyBeneficiary Address to receive royalties /// @param royaltyBasisPoints Basis points of royalty commission /// @dev See EIP-2981: https://eips.ethereum.org/EIPS/eip-2981 function setRoyaltyInfo( address royaltyBeneficiary, uint16 royaltyBasisPoints ) external onlyOwner { _royaltyBeneficiary = royaltyBeneficiary; _royaltyBasisPoints = royaltyBasisPoints; } /// @notice Called with the sale price to determine how much royalty is owed and to whom. /// @param (unused) /// @param _salePrice The sale price of the NFT asset specified by _tokenId /// @return receiver Address of who should be sent the royalty payment /// @return royaltyAmount The royalty payment amount for _salePrice /// @dev See EIP-2981: https://eips.ethereum.org/EIPS/eip-2981 function royaltyInfo(uint256, uint256 _salePrice) external view returns (address, uint256) { return (_royaltyBeneficiary, _salePrice * _royaltyBasisPoints / 10000); } /// @notice Query if a contract implements an interface /// @param interfaceId The interface identifier, as specified in ERC-165 /// @return `true` if the contract implements `interfaceId` and /// `interfaceId` is not 0xffffffff, `false` otherwise /// @dev Interface identification is specified in ERC-165. This function /// uses less than 30,000 gas. See: https://eips.ethereum.org/EIPS/eip-165 /// See EIP-2981: https://eips.ethereum.org/EIPS/eip-2981 /// See EIP-4906: https://eips.ethereum.org/EIPS/eip-4906 function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721) returns (bool) { // ERC2981 & ERC4906 return interfaceId == bytes4(0x2a55205a) || interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId); } // Events /// @notice Emit an arbitrary event related to a token /// @param tokenId ID of the token this event is related to /// @param eventType Type of event to emit /// @param content Text to be included in event /// @dev Can be called either by contract owner or token holder function emitTokenEvent(uint256 tokenId, string calldata eventType, string calldata content) external { require( owner() == msg.sender || ERC721.ownerOf(tokenId) == msg.sender, 'Only project or token owner can emit token event' ); emit TokenEvent(msg.sender, tokenId, eventType, content); } /// @notice Emit an arbitrary event related to the project /// @param eventType Type of event to emit /// @param content Text to be included in event /// @dev Can only be called either by contract owner function emitProjectEvent(string calldata eventType, string calldata content) external onlyOwner { emit ProjectEvent(msg.sender, eventType, content); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "./Dependencies.sol"; import "./Fiefdoms.sol"; contract FiefdomProxy is Proxy { bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; struct AddressSlot { address value; } function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } function _implementation() internal override view returns (address) { return getAddressSlot(_IMPLEMENTATION_SLOT).value; } function implementation() public view returns (address) { return _implementation(); } // Defer all functionality to the given archetype contract constructor() { address fiefdomArchetype = Fiefdoms(msg.sender).fiefdomArchetype(); uint256 fiefdomId = Fiefdoms(msg.sender).totalSupply(); getAddressSlot(_IMPLEMENTATION_SLOT).value = fiefdomArchetype; // Invoke the preInitialize function on itself, as defined by the archetype contract Address.functionDelegateCall( fiefdomArchetype, abi.encodeWithSignature("initialize(address,uint256)", msg.sender, fiefdomId), "Address: low-level delegate call failed" ); } }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fiefdom","type":"uint256"}],"name":"Activation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","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":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","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":"poster","type":"address"},{"indexed":true,"internalType":"string","name":"eventType","type":"string"},{"indexed":false,"internalType":"string","name":"content","type":"string"}],"name":"ProjectEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"poster","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"string","name":"eventType","type":"string"},{"indexed":false,"internalType":"string","name":"content","type":"string"}],"name":"TokenEvent","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":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"activation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultTokenURIContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"eventType","type":"string"},{"internalType":"string","name":"content","type":"string"}],"name":"emitProjectEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"eventType","type":"string"},{"internalType":"string","name":"content","type":"string"}],"name":"emitTokenEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fiefdomArchetype","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"license","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"operatorAllowList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"overlord","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"tokenId","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":"tokenId","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":"newDefault","type":"address"}],"name":"setDefaultTokenURIContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newMinter","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"royaltyBeneficiary","type":"address"},{"internalType":"uint16","name":"royaltyBasisPoints","type":"uint16"}],"name":"setRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenURIAddress","type":"address"}],"name":"setTokenURIContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToFiefdom","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","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":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"allowListStatus","type":"bool"}],"name":"updateOperatorAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useOperatorAllowList","type":"bool"}],"name":"updateUseOperatorAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"useOperatorAllowList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c0604052600360809081526204343360ec1b60a052600790620000249082620004b4565b50600a805460ff60a01b1916600160a01b1790556001600e55600f8054607d60a31b61ffff60a01b199091161790553480156200006057600080fd5b506040518060400160405280600881526020016746696566646f6d7360c01b815250604051806040016040528060048152602001632324a2a360e11b8152508160009081620000b09190620004b4565b506001620000bf8282620004b4565b505050620000dc620000d66200023f60201b60201c565b62000243565b60088054336001600160a01b03199182168117909255600f805490911690911790556040516200010c90620003e6565b604051809103906000f08015801562000129573d6000803e3d6000fd5b50600d80546001600160a01b0319166001600160a01b03929092169190911790556040516200015890620003f4565b604051809103906000f08015801562000175573d6000803e3d6000fd5b50600a80546001600160a01b0319166001600160a01b0392909216919091179055604051620001a49062000402565b604051809103906000f080158015620001c1573d6000803e3d6000fd5b50600980546001600160a01b0319166001600160a01b0392909216919091179055620001ef33600062000295565b60095460008052600b6020527fdf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f7680546001600160a01b0319166001600160a01b03909216919091179055620005a8565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620002f15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064015b60405180910390fd5b6000818152600260205260409020546001600160a01b031615620003585760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401620002e8565b6001600160a01b03821660009081526003602052604081208054600192906200038390849062000580565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b505050565b6112e780620030e083390190565b610ae780620043c783390190565b6135d38062004eae83390190565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200043b57607f821691505b6020821081036200045c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003e157600081815260208120601f850160051c810160208610156200048b5750805b601f850160051c820191505b81811015620004ac5782815560010162000497565b505050505050565b81516001600160401b03811115620004d057620004d062000410565b620004e881620004e1845462000426565b8462000462565b602080601f831160018114620005205760008415620005075750858301515b600019600386901b1c1916600185901b178555620004ac565b600085815260208120601f198616915b82811015620005515788860151825594840194600190910190840162000530565b5085821015620005705787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620005a257634e487b7160e01b600052601160045260246000fd5b92915050565b612b2880620005b86000396000f3fe60806040523480156200001157600080fd5b5060043610620002795760003560e01c806372504a241162000155578063b9c6a7c311620000c7578063d82671c91162000086578063d82671c914620005b7578063e94bbd0a14620005c1578063e985e9c514620005ed578063f2fde38b1462000604578063fca3b5aa146200061b57600080fd5b8063b9c6a7c31462000553578063bb2d80721462000568578063c87b56dd146200057f578063d4434ab01462000596578063d5abeb0114620005ad57600080fd5b806395d89b41116200011457806395d89b4114620004e15780639f46313c14620004eb578063a22cb46514620004ff578063a2935ec31462000516578063b88d4fde146200053c57600080fd5b806372504a24146200047357806377b02a38146200048a57806382fc314714620004a15780638a9c55b814620004b85780638da5cb5b14620004cf57600080fd5b806342842e0e11620001ef578063698f87be11620001ae578063698f87be146200041f5780636a62784214620004315780636b87d24c146200044857806370a082311462000452578063715018a6146200046957600080fd5b806342842e0e14620003ac5780634f558e7914620003c357806352a6c8c914620003da5780636352211e14620003f15780636536c256146200040857600080fd5b806318160ddd116200023c57806318160ddd146200032057806323b872dd1462000333578063248b71fc146200034a5780632a55205a146200036157806334ed0595146200039857600080fd5b806301ffc9a7146200027e57806306fdde0314620002aa5780630754617214620002c3578063081812fc14620002f0578063095ea7b31462000307575b600080fd5b620002956200028f36600462001cf2565b62000632565b60405190151581526020015b60405180910390f35b620002b46200067c565b604051620002a1919062001d66565b600854620002d7906001600160a01b031681565b6040516001600160a01b039091168152602001620002a1565b620002d76200030136600462001d7b565b62000716565b6200031e6200031836600462001db2565b62000772565b005b600e545b604051908152602001620002a1565b6200031e6200034436600462001ddf565b62000803565b6200031e6200035b36600462001db2565b62000840565b620003786200037236600462001e20565b6200096f565b604080516001600160a01b039093168352602083019190915201620002a1565b600a54620002d7906001600160a01b031681565b6200031e620003bd36600462001ddf565b620009b5565b62000295620003d436600462001d7b565b620009d2565b6200031e620003eb36600462001e88565b620009f2565b620002d76200040236600462001d7b565b62000afc565b6200031e6200041936600462001f09565b62000b75565b600d546001600160a01b0316620002d7565b6200031e6200044236600462001f09565b62000bc4565b620002b462000ccb565b620003246200046336600462001f09565b62000d61565b6200031e62000dea565b6200031e6200048436600462001f27565b62000e25565b6200031e6200049b36600462001d7b565b62000e82565b6200031e620004b236600462001f09565b62000f10565b6200031e620004c936600462001f7a565b62000f94565b6006546001600160a01b0316620002d7565b620002b462000fdf565b600954620002d7906001600160a01b031681565b6200031e6200051036600462001f98565b62000ff0565b620002956200052736600462001f09565b600c6020526000908152604090205460ff1681565b6200031e6200054d36600462002045565b62001083565b600a546200029590600160a01b900460ff1681565b6200031e6200057936600462001f98565b620010c2565b620002b46200059036600462001d7b565b6200111a565b6200031e620005a7366004620020fc565b6200118f565b620003246102d181565b620002d762001221565b620002d7620005d236600462001d7b565b600b602052600090815260409020546001600160a01b031681565b62000295620005fe3660046200216f565b6200123b565b6200031e6200061536600462001f09565b620012af565b6200031e6200062c36600462001f09565b62001351565b60006001600160e01b0319821663152a902d60e11b14806200066457506001600160e01b03198216632483248360e11b145b806200067657506200067682620013a0565b92915050565b6060600080546200068d906200219e565b80601f0160208091040260200160405190810160405280929190818152602001828054620006bb906200219e565b80156200070c5780601f10620006e0576101008083540402835291602001916200070c565b820191906000526020600020905b815481529060010190602001808311620006ee57829003601f168201915b5050505050905090565b6000806200072483620013f3565b600a54909150600160a01b900460ff161562000763576001600160a01b0381166000908152600c602052604090205460ff166200076357600062000765565b805b9392505050565b50919050565b600a54600160a01b900460ff1615620007f3576001600160a01b0382166000908152600c602052604090205460ff16620007f35760405162461bcd60e51b815260206004820152601e60248201527f4f70657261746f72206d757374206265206f6e20416c6c6f77204c697374000060448201526064015b60405180910390fd5b620007ff82826200148a565b5050565b6200080f3382620015a5565b6200082e5760405162461bcd60e51b8152600401620007ea90620021d4565b6200083b83838362001686565b505050565b6008546001600160a01b031633146200086d5760405162461bcd60e51b8152600401620007ea9062002225565b6102d181600e546200088091906200227c565b1115620008d05760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f7420637265617465206d6f72652066696566646f6d7300000000006044820152606401620007ea565b60005b818110156200083b57620008ea83600e5462001709565b6000604051620008fa9062001ccd565b604051809103906000f08015801562000917573d6000803e3d6000fd5b50600e80546000908152600b6020526040812080546001600160a01b0319166001600160a01b0385161790558154929350620009538362002292565b9190505550508080620009669062002292565b915050620008d3565b600f5460009081906001600160a01b03811690612710906200099d90600160a01b900461ffff1686620022ae565b620009a99190620022c8565b915091505b9250929050565b6200083b8383836040518060200160405280600081525062001083565b6000818152600260205260408120546001600160a01b0316151562000676565b3362000a066006546001600160a01b031690565b6001600160a01b0316148062000a2e57503362000a238662000afc565b6001600160a01b0316145b62000a955760405162461bcd60e51b815260206004820152603060248201527f4f6e6c792070726f6a656374206f7220746f6b656e206f776e65722063616e2060448201526f195b5a5d081d1bdad95b88195d995b9d60821b6064820152608401620007ea565b838360405162000aa7929190620022eb565b604051809103902085336001600160a01b03167fad000c5a693465b4555f1044ddd1221ef0bfc49e5621ceb705b952ff97e2caac858560405162000aed929190620022fb565b60405180910390a45050505050565b6000818152600260205260408120546001600160a01b031680620007635760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401620007ea565b6006546001600160a01b0316331462000ba25760405162461bcd60e51b8152600401620007ea906200232a565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b0316331462000bf15760405162461bcd60e51b8152600401620007ea9062002225565b6102d1600e541062000c465760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f7420637265617465206d6f72652066696566646f6d7300000000006044820152606401620007ea565b62000c5481600e5462001709565b600060405162000c649062001ccd565b604051809103906000f08015801562000c81573d6000803e3d6000fd5b50600e80546000908152600b6020526040812080546001600160a01b0319166001600160a01b038516179055815492935060019262000cc29084906200227c565b90915550505050565b6007805462000cda906200219e565b80601f016020809104026020016040519081016040528092919081815260200182805462000d08906200219e565b801562000d595780601f1062000d2d5761010080835404028352916020019162000d59565b820191906000526020600020905b81548152906001019060200180831162000d3b57829003601f168201915b505050505081565b60006001600160a01b03821662000dce5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401620007ea565b506001600160a01b031660009081526003602052604090205490565b6006546001600160a01b0316331462000e175760405162461bcd60e51b8152600401620007ea906200232a565b62000e23600062001851565b565b6006546001600160a01b0316331462000e525760405162461bcd60e51b8152600401620007ea906200232a565b600f805461ffff909216600160a01b026001600160b01b03199092166001600160a01b0390931692909217179055565b6000818152600b60205260409020546001600160a01b0316331462000ea657600080fd5b6040518181527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a16040518181527f6279bf86ea3dc5d5b9bee1e698743c7316620585ddd8a6ff818bfb582978ae43906020015b60405180910390a150565b6006546001600160a01b0316331462000f3d5760405162461bcd60e51b8152600401620007ea906200232a565b600d80546001600160a01b0319166001600160a01b038316179055600e54604080516000815260208101929092527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910162000f05565b6006546001600160a01b0316331462000fc15760405162461bcd60e51b8152600401620007ea906200232a565b600a8054911515600160a01b0260ff60a01b19909216919091179055565b6060600180546200068d906200219e565b600a54600160a01b900460ff168015620010075750805b1562001077576001600160a01b0382166000908152600c602052604090205460ff16620010775760405162461bcd60e51b815260206004820152601e60248201527f4f70657261746f72206d757374206265206f6e20416c6c6f77204c69737400006044820152606401620007ea565b620007ff8282620018a3565b6200108f3383620015a5565b620010ae5760405162461bcd60e51b8152600401620007ea90620021d4565b620010bc8484848462001969565b50505050565b6006546001600160a01b03163314620010ef5760405162461bcd60e51b8152600401620007ea906200232a565b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b600d5460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa15801562001165573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200067691908101906200235f565b6006546001600160a01b03163314620011bc5760405162461bcd60e51b8152600401620007ea906200232a565b8383604051620011ce929190620022eb565b6040518091039020336001600160a01b03167f3d366eac52dec4372766dc4b15bba20b935b45d33171465a598eedabb5a5dff8848460405162001213929190620022fb565b60405180910390a350505050565b6000620012366006546001600160a01b031690565b905090565b600a54600090600160a01b900460ff1680156200127157506001600160a01b0382166000908152600c602052604090205460ff16155b15620012805750600062000676565b506001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6006546001600160a01b03163314620012dc5760405162461bcd60e51b8152600401620007ea906200232a565b6001600160a01b038116620013435760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620007ea565b6200134e8162001851565b50565b6006546001600160a01b031633146200137e5760405162461bcd60e51b8152600401620007ea906200232a565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b031982166380ac58cd60e01b1480620013d257506001600160e01b03198216635b5e139f60e01b145b806200067657506301ffc9a760e01b6001600160e01b031983161462000676565b6000818152600260205260408120546001600160a01b03166200146e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401620007ea565b506000908152600460205260409020546001600160a01b031690565b6000620014978262000afc565b9050806001600160a01b0316836001600160a01b031603620015065760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401620007ea565b336001600160a01b03821614806200152557506200152581336200123b565b620015995760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401620007ea565b6200083b8383620019a3565b6000818152600260205260408120546001600160a01b0316620016205760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401620007ea565b60006200162d8362000afc565b9050806001600160a01b0316846001600160a01b031614806200166b5750836001600160a01b0316620016608462000716565b6001600160a01b0316145b806200167e57506200167e81856200123b565b949350505050565b6000818152600b602052604090819020549051636d43542160e01b81526001600160a01b038581166004830152848116602483015290911690636d43542190604401600060405180830381600087803b158015620016e357600080fd5b505af1158015620016f8573d6000803e3d6000fd5b505050506200083b83838362001a13565b6001600160a01b038216620017615760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401620007ea565b6000818152600260205260409020546001600160a01b031615620017c85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401620007ea565b6001600160a01b0382166000908152600360205260408120805460019290620017f39084906200227c565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b336001600160a01b03831603620018fd5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401620007ea565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6200197684848462001686565b620019848484848462001bbf565b620010bc5760405162461bcd60e51b8152600401620007ea90620023df565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190620019da8262000afc565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b826001600160a01b031662001a288262000afc565b6001600160a01b03161462001a925760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401620007ea565b6001600160a01b03821662001af65760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401620007ea565b62001b03600082620019a3565b6001600160a01b038316600090815260036020526040812080546001929062001b2e90849062002431565b90915550506001600160a01b038216600090815260036020526040812080546001929062001b5e9084906200227c565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160a01b0384163b1562001cc257604051630a85bd0160e11b81526001600160a01b0385169063150b7a029062001c0690339089908890889060040162002447565b6020604051808303816000875af192505050801562001c44575060408051601f3d908101601f1916820190925262001c419181019062002486565b60015b62001ca7573d80801562001c75576040519150601f19603f3d011682016040523d82523d6000602084013e62001c7a565b606091505b50805160000362001c9f5760405162461bcd60e51b8152600401620007ea90620023df565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506200167e565b506001949350505050565b61064c80620024a783390190565b6001600160e01b0319811681146200134e57600080fd5b60006020828403121562001d0557600080fd5b8135620007658162001cdb565b60005b8381101562001d2f57818101518382015260200162001d15565b50506000910152565b6000815180845262001d5281602086016020860162001d12565b601f01601f19169290920160200192915050565b60208152600062000765602083018462001d38565b60006020828403121562001d8e57600080fd5b5035919050565b80356001600160a01b038116811462001dad57600080fd5b919050565b6000806040838503121562001dc657600080fd5b62001dd18362001d95565b946020939093013593505050565b60008060006060848603121562001df557600080fd5b62001e008462001d95565b925062001e106020850162001d95565b9150604084013590509250925092565b6000806040838503121562001e3457600080fd5b50508035926020909101359150565b60008083601f84011262001e5657600080fd5b50813567ffffffffffffffff81111562001e6f57600080fd5b602083019150836020828501011115620009ae57600080fd5b60008060008060006060868803121562001ea157600080fd5b85359450602086013567ffffffffffffffff8082111562001ec157600080fd5b62001ecf89838a0162001e43565b9096509450604088013591508082111562001ee957600080fd5b5062001ef88882890162001e43565b969995985093965092949392505050565b60006020828403121562001f1c57600080fd5b620007658262001d95565b6000806040838503121562001f3b57600080fd5b62001f468362001d95565b9150602083013561ffff8116811462001f5e57600080fd5b809150509250929050565b8035801515811462001dad57600080fd5b60006020828403121562001f8d57600080fd5b620007658262001f69565b6000806040838503121562001fac57600080fd5b62001fb78362001d95565b915062001fc76020840162001f69565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562002012576200201262001fd0565b604052919050565b600067ffffffffffffffff82111562002037576200203762001fd0565b50601f01601f191660200190565b600080600080608085870312156200205c57600080fd5b620020678562001d95565b9350620020776020860162001d95565b925060408501359150606085013567ffffffffffffffff8111156200209b57600080fd5b8501601f81018713620020ad57600080fd5b8035620020c4620020be826200201a565b62001fe6565b818152886020838501011115620020da57600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080600080604085870312156200211357600080fd5b843567ffffffffffffffff808211156200212c57600080fd5b6200213a8883890162001e43565b909650945060208701359150808211156200215457600080fd5b50620021638782880162001e43565b95989497509550505050565b600080604083850312156200218357600080fd5b6200218e8362001d95565b915062001fc76020840162001d95565b600181811c90821680620021b357607f821691505b6020821081036200076c57634e487b7160e01b600052602260045260246000fd5b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526021908201527f43616c6c6572206973206e6f7420746865206d696e74696e67206164647265736040820152607360f81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000676576200067662002266565b600060018201620022a757620022a762002266565b5060010190565b808202811582820484141762000676576200067662002266565b600082620022e657634e487b7160e01b600052601260045260246000fd5b500490565b8183823760009101908152919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156200237257600080fd5b815167ffffffffffffffff8111156200238a57600080fd5b8201601f810184136200239c57600080fd5b8051620023ad620020be826200201a565b818152856020838501011115620023c357600080fd5b620023d682602083016020860162001d12565b95945050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b8181038181111562000676576200067662002266565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906200247c9083018462001d38565b9695505050505050565b6000602082840312156200249957600080fd5b8151620007658162001cdb56fe608060405234801561001057600080fd5b506000336001600160a01b0316639f46313c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610051573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061007591906102a3565b90506000336001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100db91906102cc565b9050817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b03929092169190911790556040513360248201526044810182905261018690839060640160408051601f19818403018152918152602080830180516001600160e01b031663cd6dc68760e01b1790528151606081019092526027808352906106259083013961018e60201b6100dd1760201c565b505050610358565b6060833b6101f25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161020d9190610309565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b50909250905061025e82828661026a565b925050505b9392505050565b60608315610279575081610263565b8251156102895782518084602001fd5b8160405162461bcd60e51b81526004016101e99190610325565b6000602082840312156102b557600080fd5b81516001600160a01b038116811461026357600080fd5b6000602082840312156102de57600080fd5b5051919050565b60005b838110156103005781810151838201526020016102e8565b50506000910152565b6000825161031b8184602087016102e5565b9190910192915050565b60208152600082518060208401526103448160408501602087016102e5565b601f01601f19169190910160400192915050565b6102be806103676000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e6100a5565b6040516001600160a01b03909116815260200160405180910390f35b6100a361009e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6101b8565b565b60006100d87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b6060833b6101415760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161015c9190610239565b600060405180830381855af49150503d8060008114610197576040519150601f19603f3d011682016040523d82523d6000602084013e61019c565b606091505b50915091506101ac8282866101dc565b925050505b9392505050565b3660008037600080366000845af43d6000803e8080156101d7573d6000f35b3d6000fd5b606083156101eb5750816101b1565b8251156101fb5782518084602001fd5b8160405162461bcd60e51b81526004016101389190610255565b60005b83811015610230578181015183820152602001610218565b50506000910152565b6000825161024b818460208701610215565b9190910192915050565b6020815260008251806020840152610274816040850160208701610215565b601f01601f1916919091016040019291505056fea264697066735822122015f9799f1a7a034bec7586c408a509bb2a7dbe54dfea3afef32d2527d7f58d2464736f6c63430008110033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212208ce6cf3704e31c774960d4a033de2942cf13230c00bccc2d68e99ef7d41e213764736f6c6343000811003360a060405234801561001057600080fd5b50336080526080516112b861002f6000396000609f01526112b86000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c87b56dd14610030575b600080fd5b61004361003e366004610871565b610059565b60405161005091906108ae565b60405180910390f35b6060600061006683610481565b60405160200161007691906108fd565b60408051808303601f19018152908290526374a5de8560e11b82526004820185905291506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e94bbd0a90602401602060405180830381865afa1580156100ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101129190610935565b90506000816001600160a01b0316634a8c1fb46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610154573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101789190610965565b90506000826001600160a01b0316634f37a86d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101de9190610987565b905060008261020957604051806040016040528060048152602001630233030360e41b815250610227565b6040518060400160405280600481526020016311b3333360e11b8152505b9050600083610252576040518060400160405280600481526020016311b3333360e11b815250610270565b604051806040016040528060048152602001630233030360e41b8152505b90506000846102a2576040518060400160405280600b81526020016a155b9858dd1a5d985d195960aa1b8152506102c5565b604051806040016040528060098152602001681058dd1a5d985d195960ba1b8152505b90506000856102f35760405180604001604052806007815260200166113330b639b29160c91b815250610313565b60405180604001604052806006815260200165113a393ab29160d11b8152505b61031c8861058a565b61032587610481565b604051602001610337939291906109a0565b60405160208183030381529060405290506000848460405160200161035d929190610aa2565b60405160208183030381529060405290506000848a604051602001610383929190610baf565b60405160208183030381529060405290506000856103a08b61058a565b6040516020016103b1929190610c76565b604051602081830303815290604052905060006103f08484846040516020016103dc93929190610d5c565b6040516020818303038152906040526106d1565b6040516020016104009190610e07565b60405160208183030381529060405290506000868d61041e8e61058a565b60405160200161043093929190610e58565b604051602081830303815290604052905060008d82848960405160200161045a9493929190610ed9565b6040516020818303038152906040529050809e505050505050505050505050505050919050565b6060816000036104a85750506040805180820190915260018152600360fc1b602082015290565b8160005b81156104d257806104bc8161101c565b91506104cb9050600a8361104b565b91506104ac565b60008167ffffffffffffffff8111156104ed576104ed61105f565b6040519080825280601f01601f191660200182016040528015610517576020820181803683370190505b5090505b84156105825761052c600183611075565b9150610539600a8661108e565b6105449060306110a2565b60f81b818381518110610559576105596110b5565b60200101906001600160f81b031916908160001a90535061057b600a8661104b565b945061051b565b949350505050565b60408051602880825260608281019093526000919060208201818036833701905050905060005b60148110156106ca5760006105c7826013611075565b6105d29060086110cb565b6105dd9060026111c6565b6105f0906001600160a01b03871661104b565b60f81b9050600060108260f81c61060791906111d2565b60f81b905060008160f81c601061061e91906111f4565b8360f81c61062c9190611210565b60f81b905061063a8261083b565b856106468660026110cb565b81518110610656576106566110b5565b60200101906001600160f81b031916908160001a9053506106768161083b565b856106828660026110cb565b61068d9060016110a2565b8151811061069d5761069d6110b5565b60200101906001600160f81b031916908160001a90535050505080806106c29061101c565b9150506105b1565b5092915050565b805160609060008190036106f5575050604080516020810190915260008152919050565b600060036107048360026110a2565b61070e919061104b565b6107199060046110cb565b905060006107288260206110a2565b67ffffffffffffffff8111156107405761074061105f565b6040519080825280601f01601f19166020018201604052801561076a576020820181803683370190505b5090506000604051806060016040528060408152602001611243604091399050600181016020830160005b868110156107f6576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101610795565b50600386066001811461081057600281146108215761082d565b613d3d60f01b60011983015261082d565b603d60f81b6000198301525b505050918152949350505050565b6000600a60f883901c10156108625761085960f883901c6030611229565b60f81b92915050565b61085960f883901c6057611229565b60006020828403121561088357600080fd5b5035919050565b60005b838110156108a557818101518382015260200161088d565b50506000910152565b60208152600082518060208401526108cd81604085016020870161088a565b601f01601f19169190910160400192915050565b600081516108f381856020860161088a565b9290920192915050565b6f46696566646f6d2056617373616c202360801b81526000825161092881601085016020870161088a565b9190910160100192915050565b60006020828403121561094757600080fd5b81516001600160a01b038116811461095e57600080fd5b9392505050565b60006020828403121561097757600080fd5b8151801515811461095e57600080fd5b60006020828403121561099957600080fd5b5051919050565b7f5b7b2274726169745f74797065223a2022416374697661746564222c20227661815264363ab2911d60d91b6020820152600084516109e681602585016020890161088a565b7f7d2c7b2274726169745f74797065223a202246696566646f6d222c202276616c602591840191820152670eaca4474404460f60c31b60458201528451610a3481604d84016020890161088a565b7f227d2c7b2274726169745f74797065223a2022466f756e646564204174222c20604d929091019182015269113b30b63ab2911d101160b11b606d8201528351610a8581607784016020880161088a565b62227d5d60e81b60779290910191820152607a0195945050505050565b7f3c7265637420783d22302220793d2230222077696474683d223130302522206881527232b4b3b43a1e911898181291103334b6361e9160691b602082015260008351610af681603385016020880161088a565b6211179f60e91b6033918401918201527f3c7265637420783d2232332e373870782220793d2232332e373870782220776960368201527f6474683d22313134312e343422206865696768743d223739332e3434707822206056820152733334b6361e913737b732911039ba3937b5b29e9160611b60768201528351610b8281608a84016020880161088a565b73111039ba3937b5b296bbb4b23a341e911911179f60611b608a9290910191820152609e01949350505050565b7f3c7465787420783d223530252220793d223437252220666f6e742d73697a653d81526d1118981ab83c11103334b6361e9160911b602082015260008351610bfe81602e85016020880161088a565b7f2220646f6d696e616e742d626173656c696e653d226d6964646c652220746578602e91840191820152713a16b0b731b437b91e9136b4b2323632911f60711b604e8201528351610c5681606084016020880161088a565b661e17ba32bc3a1f60c91b60609290910191820152606701949350505050565b7f3c7465787420783d223530252220793d223538252220666f6e742d73697a653d81526c111a19383c11103334b6361e9160991b602082015260008351610cc481602d85016020880161088a565b7f2220666f6e742d66616d696c793d226d6f6e6f73706163652220646f6d696e61602d918401918201527f6e742d626173656c696e653d226d6964646c652220746578742d616e63686f72604d8201526b07a44dad2c8c8d8ca447c60f60a31b606d8201528351610d3c81607984016020880161088a565b661e17ba32bc3a1f60c91b60799290910191820152608001949350505050565b7f3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323081527f30302f737667222076696577426f783d22302030203131383920383431223e00602082015260008451610dba81603f85016020890161088a565b845190830190610dd181603f84016020890161088a565b8451910190610de781603f84016020880161088a565b651e17b9bb339f60d11b603f929091019182015260450195945050505050565b7f22646174613a696d6167652f7376672b786d6c3b6261736536342c0000000000815260008251610e3f81601b85016020870161088a565b61088b60f21b601b939091019283015250601d01919050565b601160f91b81528351600090610e7581600185016020890161088a565b600160fd1b6001918401918201528451610e9681600284016020890161088a565b65040decc4060f60d31b600292909101918201528351610ebd81600884016020880161088a565b61088b60f21b60089290910191820152600a0195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c00000000008152693d913730b6b2911d101160b11b601b8201528451600090610f25816025850160208a0161088a565b61088b60f21b6025918401918201526e0113232b9b1b934b83a34b7b7111d1608d1b60278201528551610f5f816036840160208a0161088a565b7f2265787465726e616c5f75726c223a202268747470733a2f2f73746576696570603692909101918201527f2e78797a2f66696566646f6d73222c22696d616765223a20000000000000000060568201528451610fc381606e84016020890161088a565b6c1130ba3a3934b13aba32b9911d60991b606e9290910191820152610ffb610fee607b8301866108e1565b607d60f81b815260010190565b979650505050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161102e5761102e611006565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261105a5761105a611035565b500490565b634e487b7160e01b600052604160045260246000fd5b8181038181111561108857611088611006565b92915050565b60008261109d5761109d611035565b500690565b8082018082111561108857611088611006565b634e487b7160e01b600052603260045260246000fd5b808202811582820484141761108857611088611006565b600181815b8085111561111d57816000190482111561110357611103611006565b8085161561111057918102915b93841c93908002906110e7565b509250929050565b60008261113457506001611088565b8161114157506000611088565b816001811461115757600281146111615761117d565b6001915050611088565b60ff84111561117257611172611006565b50506001821b611088565b5060208310610133831016604e8410600b84101617156111a0575081810a611088565b6111aa83836110e2565b80600019048211156111be576111be611006565b029392505050565b600061095e8383611125565b600060ff8316806111e5576111e5611035565b8060ff84160491505092915050565b60ff81811683821602908116908181146106ca576106ca611006565b60ff828116828216039081111561108857611088611006565b60ff81811683821601908111156110885761108861100656fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122066538ae73df73b334d7c592b3a80775a06c98ab03264d9b038ecb8fe7ac4b3c764736f6c63430008110033608060405234801561001057600080fd5b50610ac7806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c87b56dd14610030575b600080fd5b61004361003e36600461056e565b610059565b60405161005091906105ab565b60405180910390f35b6060600033905060006100cc826001600160a01b031663471c95fb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100c791906105de565b6102fb565b6100d5856102fb565b6040516020016100e69291906105f7565b604051602081830303815290604052905060006040516020016101d9907f3c7265637420783d22302220793d2230222077696474683d223130302522206881527f65696768743d2231303025222066696c6c3d2223303030222f3e00000000000060208201527f3c7265637420783d2232332e373870782220793d2232332e3738707822207769603a8201527f6474683d22313134312e343422206865696768743d223739332e343470782220605a8201527f66696c6c3d226e6f6e6522207374726f6b653d222366666622207374726f6b65607a8201526b16bbb4b23a341e911a91179f60a11b609a82015260a60190565b6040516020818303038152906040529050600061022d846001600160a01b031663471c95fb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100a3573d6000803e3d6000fd5b60405160200161023d919061064e565b60405160208183030381529060405290506000610259876102fb565b60405160200161026991906106b5565b604051602081830303815290604052905060006102a88484846040516020016102949392919061071a565b604051602081830303815290604052610404565b6040516020016102b8919061084f565b6040516020818303038152906040529050600085826040516020016102de92919061089f565b60408051601f198184030181529190529998505050505050505050565b6060816000036103225750506040805180820190915260018152600360fc1b602082015290565b8160005b811561034c57806103368161098b565b91506103459050600a836109ba565b9150610326565b60008167ffffffffffffffff811115610367576103676109ce565b6040519080825280601f01601f191660200182016040528015610391576020820181803683370190505b5090505b84156103fc576103a66001836109e4565b91506103b3600a866109fd565b6103be906030610a11565b60f81b8183815181106103d3576103d3610a24565b60200101906001600160f81b031916908160001a9053506103f5600a866109ba565b9450610395565b949350505050565b80516060906000819003610428575050604080516020810190915260008152919050565b60006003610437836002610a11565b61044191906109ba565b61044c906004610a3a565b9050600061045b826020610a11565b67ffffffffffffffff811115610473576104736109ce565b6040519080825280601f01601f19166020018201604052801561049d576020820181803683370190505b5090506000604051806060016040528060408152602001610a52604091399050600181016020830160005b86811015610529576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016104c8565b506003860660018114610543576002811461055457610560565b613d3d60f01b600119830152610560565b603d60f81b6000198301525b505050918152949350505050565b60006020828403121561058057600080fd5b5035919050565b60005b838110156105a257818101518382015260200161058a565b50506000910152565b60208152600082518060208401526105ca816040850160208701610587565b601f01601f19169190910160400192915050565b6000602082840312156105f057600080fd5b5051919050565b6702334b2b33237b6960c51b81526000835161061a816008850160208801610587565b67016102a37b5b2b7160c51b6008918401918201528351610642816010840160208801610587565b01601001949350505050565b7f3c7465787420783d223530252220793d223338252220636c6173733d2274223e81526702334b2b33237b6960c51b602082015260008251610697816028850160208701610587565b661e17ba32bc3a1f60c91b6028939091019283015250602f01919050565b7f3c7465787420783d223530252220793d223632252220636c6173733d2274223e81526502a37b5b2b7160d51b6020820152600082516106fc816026850160208701610587565b661e17ba32bc3a1f60c91b6026939091019283015250602d01919050565b7f3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323081527f30302f737667222076696577426f783d22302030203131383920383431223e3c60208201527f7374796c653e2e747b666f6e742d73697a653a31363070783b666f6e742d666160408201527f6d696c793a73616e732d73657269663b66696c6c3a236666663b646f6d696e6160608201527f6e742d626173656c696e653a6d6964646c653b746578742d616e63686f723a6d60808201526e34b23236329dbe9e17b9ba3cb6329f60891b60a0820152600084516108028160af850160208901610587565b8451908301906108198160af840160208901610587565b845191019061082f8160af840160208801610587565b651e17b9bb339f60d11b60af929091019182015260b50195945050505050565b7f22646174613a696d6167652f7376672b786d6c3b6261736536342c000000000081526000825161088781601b850160208701610587565b601160f91b601b939091019283015250601c01919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c00000000008152693d913730b6b2911d101160b11b601b82015282516000906108eb816025850160208801610587565b61088b60f21b6025918401918201527f226465736372697074696f6e223a2022546865207374617274206f6620736f6d60278201526c195d1a1a5b99c81b995dcb888b609a1b60478201526801134b6b0b3b2911d160bd1b6054820152835161095b81605d840160208801610587565b607d60f81b605d9290910191820152605e01949350505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161099d5761099d610975565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826109c9576109c96109a4565b500490565b634e487b7160e01b600052604160045260246000fd5b818103818111156109f7576109f7610975565b92915050565b600082610a0c57610a0c6109a4565b500690565b808201808211156109f7576109f7610975565b634e487b7160e01b600052603260045260246000fd5b80820281158282048414176109f7576109f761097556fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220b1759fe4579af80d73c23310c14bdd866bef876003a625c3e2df9860dc5c060a64736f6c6343000811003360806040523480156200001157600080fd5b5060408051602080820183526000808352835191820190935282815290916200003b83826200053b565b5060016200004a82826200053b565b505050620000603360006200006660201b60201c565b62000738565b60105460ff1615620000bf5760405162461bcd60e51b815260206004820152601f60248201527f43616e277420696e697469616c697a65206d6f7265207468616e206f6e63650060448201526064015b60405180910390fd5b60108054600160ff19909116179055620000e58162000199602090811b6200189917901c565b604051602001620000f7919062000639565b604051602081830303815290604052600d90816200011691906200053b565b506200012d816200019960201b620018991760201c565b6040516020016200013f91906200065f565b604051602081830303815290604052600e90816200015e91906200053b565b50600680546001600160a01b0319166001600160a01b038416179055600981905542600c556001600f5562000195306000620002b9565b5050565b606081600003620001c15750506040805180820190915260018152600360fc1b602082015290565b8160005b8115620001f15780620001d88162000690565b9150620001e99050600a83620006c2565b9150620001c5565b6000816001600160401b038111156200020e576200020e62000497565b6040519080825280601f01601f19166020018201604052801562000239576020820181803683370190505b5090505b8415620002b15762000251600183620006d9565b915062000260600a86620006f5565b6200026d9060306200070c565b60f81b81838151811062000285576200028562000722565b60200101906001600160f81b031916908160001a905350620002a9600a86620006c2565b94506200023d565b949350505050565b6001600160a01b038216620003115760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401620000b6565b6000818152600260205260409020546001600160a01b031615620003785760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401620000b6565b62000386600083836200040f565b6001600160a01b0382166000908152600360205260408120805460019290620003b19084906200070c565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6007546001600160a01b0316156200049257600754604051637cbab1c760e01b81526001600160a01b03858116600483015284811660248301526044820184905290911690637cbab1c790606401600060405180830381600087803b1580156200047857600080fd5b505af11580156200048d573d6000803e3d6000fd5b505050505b505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620004c257607f821691505b602082108103620004e357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200049257600081815260208120601f850160051c81016020861015620005125750805b601f850160051c820191505b8181101562000533578281556001016200051e565b505050505050565b81516001600160401b0381111562000557576200055762000497565b6200056f81620005688454620004ad565b84620004e9565b602080601f831160018114620005a757600084156200058e5750858301515b600019600386901b1c1916600185901b17855562000533565b600085815260208120601f198616915b82811015620005d857888601518255948401946001909101908401620005b7565b5085821015620005f75787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000815160005b818110156200062a57602081850181015186830152016200060e565b50600093019283525090919050565b6702334b2b33237b6960c51b8152600062000658600883018462000607565b9392505050565b632324a2a360e11b8152600062000658600483018462000607565b634e487b7160e01b600052601160045260246000fd5b600060018201620006a557620006a56200067a565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082620006d457620006d4620006ac565b500490565b81810381811115620006ef57620006ef6200067a565b92915050565b600082620007075762000707620006ac565b500690565b80820180821115620006ef57620006ef6200067a565b634e487b7160e01b600052603260045260246000fd5b612e8b80620007486000396000f3fe608060405234801561001057600080fd5b50600436106102745760003560e01c80636d43542111610151578063ba4695fd116100c3578063d5abeb0111610087578063d5abeb0114610546578063e985e9c51461054f578063ed7eb2a714610562578063f384702f14610575578063fca3b5aa14610589578063fd180a391461059c57600080fd5b8063ba4695fd146104f1578063c29de630146104f9578063c87b56dd1461050d578063cd6dc68714610520578063d4434ab01461053357600080fd5b806382fc31471161011557806382fc3147146104955780638da5cb5b146104a857806395d89b41146104b0578063a22cb465146104b8578063b6afc4dc146104cb578063b88d4fde146104de57600080fd5b80636d435421146104365780636f8b44b01461044957806370a082311461045c57806372504a241461046f57806375e7a1e61461048257600080fd5b806342842e0e116101ea5780634f558e79116101ae5780634f558e79146103da57806352a6c8c9146103ed5780635a3c7d26146104005780636352211e14610413578063698f87be146104265780636b87d24c1461042e57600080fd5b806342842e0e1461038e57806342966c68146103a1578063471c95fb146103b45780634a8c1fb4146103bd5780634f37a86d146103d157600080fd5b8063095ea7b31161023c578063095ea7b314610309578063167446071461031c57806318160ddd1461032457806323b872dd146103365780632a55205a1461034957806340c10f191461037b57600080fd5b806301cc425f1461027957806301ffc9a71461028e57806306fdde03146102b657806307546172146102cb578063081812fc146102f6575b600080fd5b61028c610287366004612341565b6105af565b005b6102a161029c36600461240e565b61089a565b60405190151581526020015b60405180910390f35b6102be6108e0565b6040516102ad919061247b565b6008546102de906001600160a01b031681565b6040516001600160a01b0390911681526020016102ad565b6102de61030436600461248e565b610972565b61028c6103173660046124a7565b610a07565b61028c610a8d565b600f545b6040519081526020016102ad565b61028c6103443660046124d3565b610afa565b61035c610357366004612514565b610b31565b604080516001600160a01b0390931683526020830191909152016102ad565b61028c6103893660046124a7565b610b77565b61028c61039c3660046124d3565b610bea565b61028c6103af36600461248e565b610c05565b61032860095481565b6007546102a190600160a01b900460ff1681565b610328600c5481565b6102a16103e836600461248e565b610c7c565b61028c6103fb366004612577565b610c9b565b61028c61040e3660046125f0565b610d91565b6102de61042136600461248e565b610dcd565b6102de610e44565b6102be610ee4565b61028c610444366004612631565b610f72565b61028c61045736600461248e565b611029565b61032861046a36600461266a565b611140565b61028c61047d366004612687565b6111c7565b6006546102de906001600160a01b031681565b61028c6104a336600461266a565b611239565b6102de61131e565b6102be61136c565b61028c6104c63660046126bc565b61137b565b61028c6104d93660046126ef565b6113fe565b61028c6104ec366004612769565b6114cd565b61028c611505565b6007546102a190600160a81b900460ff1681565b6102be61051b36600461248e565b611572565b61028c61052e3660046124a7565b6115ee565b61028c6105413660046127e8565b6116f0565b610328600b5481565b6102a161055d366004612631565b611780565b6007546102de906001600160a01b031681565b6007546102a190600160b01b900460ff1681565b61028c61059736600461266a565b6117ae565b61028c6105aa366004612853565b6117ff565b336105b861131e565b6001600160a01b0316146105e75760405162461bcd60e51b81526004016105de90612888565b60405180910390fd5b600754600160a01b900460ff161561064c5760405162461bcd60e51b815260206004820152602260248201527f46696566646f6d2068617320616c7265616479206265656e2061637469766174604482015261195960f21b60648201526084016105de565b600d610658878261293d565b50600e610665868261293d565b50600b83905560088054336001600160a01b0319918216811790925560108054610100600160b81b03191661010090930261ffff60a81b191692909217607d60ab1b17909155601180549091166001600160a01b038416179055600a6106cb858261293d565b506007805460ff60a01b1916600160a01b1790556106eb303360006119a1565b604051600081527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a1600654600954604051630ef6054760e31b81526001600160a01b03909216916377b02a38916107549160040190815260200190565b600060405180830381600087803b15801561076e57600080fd5b505af1158015610782573d6000803e3d6000fd5b505050506001600160a01b0381161561089257600780546001600160a01b0319166001600160a01b038316908117909155604080516360f96a8f60e01b815290513092916360f96a8f91600480830192602092919082900301816000875af11580156107f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081691906129fc565b6001600160a01b0316146108925760405162461bcd60e51b815260206004820152603e60248201527f50617373656420455243373231486f6f6b7320636f6e7472616374206973206e60448201527f6f7420636f6e6669677572656420666f7220746869732046696566646f6d000060648201526084016105de565b505050505050565b60006001600160e01b0319821663152a902d60e11b14806108cb57506001600160e01b03198216632483248360e11b145b806108da57506108da82611b4c565b92915050565b6060600d80546108ef906128bd565b80601f016020809104026020016040519081016040528092919081815260200182805461091b906128bd565b80156109685780601f1061093d57610100808354040283529160200191610968565b820191906000526020600020905b81548152906001019060200180831161094b57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166109eb5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105de565b506000908152600460205260409020546001600160a01b031690565b6007546001600160a01b031615610a7f57600754604051634a0ae59b60e11b81526001600160a01b0384811660048301526024820184905290911690639415cb3690604401600060405180830381600087803b158015610a6657600080fd5b505af1158015610a7a573d6000803e3d6000fd5b505050505b610a898282611b9c565b5050565b33610a9661131e565b6001600160a01b031614610abc5760405162461bcd60e51b81526004016105de90612888565b600754600160a01b900460ff16610ae55760405162461bcd60e51b81526004016105de90612a19565b6007805460ff60b01b1916600160b01b179055565b610b05335b82611cac565b610b215760405162461bcd60e51b81526004016105de90612a50565b610b2c8383836119a1565b505050565b601054600090819061010081046001600160a01b03169061271090610b6190600160a81b900461ffff1686612ab7565b610b6b9190612ae4565b915091505b9250929050565b6008546001600160a01b03163314610ba15760405162461bcd60e51b81526004016105de90612af8565b600b54600f5410610bc45760405162461bcd60e51b81526004016105de90612b39565b610bce8282611d7b565b6001600f6000828254610be19190612b70565b90915550505050565b610b2c838383604051806020016040528060008152506114cd565b610c0e33610aff565b610c705760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b60648201526084016105de565b610c7981611ec9565b50565b6000818152600260205260408120546001600160a01b031615156108da565b33610ca461131e565b6001600160a01b03161480610cc9575033610cbe86610dcd565b6001600160a01b0316145b610d2e5760405162461bcd60e51b815260206004820152603060248201527f4f6e6c792070726f6a656374206f7220746f6b656e206f776e65722063616e2060448201526f195b5a5d081d1bdad95b88195d995b9d60821b60648201526084016105de565b8383604051610d3e929190612b83565b604051809103902085336001600160a01b03167fad000c5a693465b4555f1044ddd1221ef0bfc49e5621ceb705b952ff97e2caac8585604051610d82929190612b93565b60405180910390a45050505050565b33610d9a61131e565b6001600160a01b031614610dc05760405162461bcd60e51b81526004016105de90612888565b600a610b2c828483612bc2565b6000818152600260205260408120546001600160a01b0316806108da5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016105de565b6011546000906001600160a01b031615610e6857506011546001600160a01b031690565b600660009054906101000a90046001600160a01b03166001600160a01b03166334ed05956040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ebb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edf91906129fc565b905090565b600a8054610ef1906128bd565b80601f0160208091040260200160405190810160405280929190818152602001828054610f1d906128bd565b8015610f6a5780601f10610f3f57610100808354040283529160200191610f6a565b820191906000526020600020905b815481529060010190602001808311610f4d57829003601f168201915b505050505081565b6006546001600160a01b03163314610fe55760405162461bcd60e51b815260206004820152603060248201527f4f776e6572736869702063616e206f6e6c79206265207472616e73666572726560448201526f6420627920746865206b696e67646f6d60801b60648201526084016105de565b806001600160a01b0316826001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b3361103261131e565b6001600160a01b0316146110585760405162461bcd60e51b81526004016105de90612888565b600754600160a01b900460ff166110815760405162461bcd60e51b81526004016105de90612a19565b600f548110156110e15760405162461bcd60e51b815260206004820152602560248201527f6d6178537570706c79206d757374206265203e3d207468616e20746f74616c536044820152647570706c7960d81b60648201526084016105de565b600754600160b01b900460ff161561113b5760405162461bcd60e51b815260206004820152601960248201527f6d6178537570706c7920686173206265656e2066726f7a656e0000000000000060448201526064016105de565b600b55565b60006001600160a01b0382166111ab5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016105de565b506001600160a01b031660009081526003602052604090205490565b336111d061131e565b6001600160a01b0316146111f65760405162461bcd60e51b81526004016105de90612888565b6010805461ffff909216600160a81b0261ffff60a81b196001600160a01b039094166101000293909316610100600160b81b031990921691909117919091179055565b3361124261131e565b6001600160a01b0316146112685760405162461bcd60e51b81526004016105de90612888565b600754600160a81b900460ff16156112c25760405162461bcd60e51b815260206004820152601960248201527f546f6b656e2055524920686173206265656e2066726f7a656e0000000000000060448201526064016105de565b601180546001600160a01b0319166001600160a01b038316179055600f54604080516000815260208101929092527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a150565b6006546009546040516331a9108f60e11b815260048101919091526000916001600160a01b031690636352211e90602401602060405180830381865afa158015610ebb573d6000803e3d6000fd5b6060600e80546108ef906128bd565b6007546001600160a01b0316156113f45760075460405163518b757560e01b81526001600160a01b03848116600483015283151560248301529091169063518b757590604401600060405180830381600087803b1580156113db57600080fd5b505af11580156113ef573d6000803e3d6000fd5b505050505b610a898282611f70565b6008546001600160a01b031633146114285760405162461bcd60e51b81526004016105de90612af8565b600b54600f5483919061143c908390612b70565b111561145a5760405162461bcd60e51b81526004016105de90612b39565b60005b818110156114c65761149e85858381811061147a5761147a612c81565b905060200201602081019061148f919061266a565b6114998386612b70565b611d7b565b600f80549060006114ae83612c97565b919050555080806114be90612c97565b91505061145d565b5050505050565b6114d73383611cac565b6114f35760405162461bcd60e51b81526004016105de90612a50565b6114ff84848484612034565b50505050565b3361150e61131e565b6001600160a01b0316146115345760405162461bcd60e51b81526004016105de90612888565b600754600160a01b900460ff1661155d5760405162461bcd60e51b81526004016105de90612a19565b6007805460ff60a81b1916600160a81b179055565b606061157c610e44565b6001600160a01b031663c87b56dd836040518263ffffffff1660e01b81526004016115a991815260200190565b600060405180830381865afa1580156115c6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108da9190810190612cb0565b60105460ff16156116415760405162461bcd60e51b815260206004820152601f60248201527f43616e277420696e697469616c697a65206d6f7265207468616e206f6e63650060448201526064016105de565b6010805460ff1916600117905561165781611899565b6040516020016116679190612d26565b604051602081830303815290604052600d9081611684919061293d565b5061168e81611899565b60405160200161169e9190612d56565b604051602081830303815290604052600e90816116bb919061293d565b50600680546001600160a01b0319166001600160a01b038416179055600981905542600c556001600f55610a89306000611d7b565b336116f961131e565b6001600160a01b03161461171f5760405162461bcd60e51b81526004016105de90612888565b838360405161172f929190612b83565b6040518091039020336001600160a01b03167f3d366eac52dec4372766dc4b15bba20b935b45d33171465a598eedabb5a5dff88484604051611772929190612b93565b60405180910390a350505050565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b336117b761131e565b6001600160a01b0316146117dd5760405162461bcd60e51b81526004016105de90612888565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b031633146118295760405162461bcd60e51b81526004016105de90612af8565b600b5482600f5461183a9190612b70565b11156118585760405162461bcd60e51b81526004016105de90612b39565b60005b828110156114ff57611871846114998385612b70565b600f805490600061188183612c97565b9190505550808061189190612c97565b91505061185b565b6060816000036118c05750506040805180820190915260018152600360fc1b602082015290565b8160005b81156118ea57806118d481612c97565b91506118e39050600a83612ae4565b91506118c4565b6000816001600160401b038111156119045761190461225a565b6040519080825280601f01601f19166020018201604052801561192e576020820181803683370190505b5090505b841561199957611943600183612d82565b9150611950600a86612d95565b61195b906030612b70565b60f81b81838151811061197057611970612c81565b60200101906001600160f81b031916908160001a905350611992600a86612ae4565b9450611932565b949350505050565b826001600160a01b03166119b482610dcd565b6001600160a01b031614611a1c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016105de565b6001600160a01b038216611a7e5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105de565b611a89838383612067565b611a946000826120eb565b6001600160a01b0383166000908152600360205260408120805460019290611abd908490612d82565b90915550506001600160a01b0382166000908152600360205260408120805460019290611aeb908490612b70565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160e01b031982166380ac58cd60e01b1480611b7d57506001600160e01b03198216635b5e139f60e01b145b806108da57506301ffc9a760e01b6001600160e01b03198316146108da565b6000611ba782610dcd565b9050806001600160a01b0316836001600160a01b031603611c145760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016105de565b336001600160a01b0382161480611c305750611c308133611780565b611ca25760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016105de565b610b2c83836120eb565b6000818152600260205260408120546001600160a01b0316611d255760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105de565b6000611d3083610dcd565b9050806001600160a01b0316846001600160a01b03161480611d6b5750836001600160a01b0316611d6084610972565b6001600160a01b0316145b8061199957506119998185611780565b6001600160a01b038216611dd15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105de565b6000818152600260205260409020546001600160a01b031615611e365760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105de565b611e4260008383612067565b6001600160a01b0382166000908152600360205260408120805460019290611e6b908490612b70565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000611ed482610dcd565b9050611ee281600084612067565b611eed6000836120eb565b6001600160a01b0381166000908152600360205260408120805460019290611f16908490612d82565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b336001600160a01b03831603611fc85760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105de565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61203f8484846119a1565b61204b84848484612159565b6114ff5760405162461bcd60e51b81526004016105de90612da9565b6007546001600160a01b031615610b2c57600754604051637cbab1c760e01b81526001600160a01b03858116600483015284811660248301526044820184905290911690637cbab1c790606401600060405180830381600087803b1580156120ce57600080fd5b505af11580156120e2573d6000803e3d6000fd5b50505050505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061212082610dcd565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006001600160a01b0384163b1561224f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061219d903390899088908890600401612dfb565b6020604051808303816000875af19250505080156121d8575060408051601f3d908101601f191682019092526121d591810190612e38565b60015b612235573d808015612206576040519150601f19603f3d011682016040523d82523d6000602084013e61220b565b606091505b50805160000361222d5760405162461bcd60e51b81526004016105de90612da9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611999565b506001949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156122985761229861225a565b604052919050565b60006001600160401b038211156122b9576122b961225a565b50601f01601f191660200190565b60006122da6122d5846122a0565b612270565b90508281528383830111156122ee57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261231657600080fd5b612325838335602085016122c7565b9392505050565b6001600160a01b0381168114610c7957600080fd5b60008060008060008060c0878903121561235a57600080fd5b86356001600160401b038082111561237157600080fd5b61237d8a838b01612305565b9750602089013591508082111561239357600080fd5b61239f8a838b01612305565b965060408901359150808211156123b557600080fd5b506123c289828a01612305565b9450506060870135925060808701356123da8161232c565b915060a08701356123ea8161232c565b809150509295509295509295565b6001600160e01b031981168114610c7957600080fd5b60006020828403121561242057600080fd5b8135612325816123f8565b60005b8381101561244657818101518382015260200161242e565b50506000910152565b6000815180845261246781602086016020860161242b565b601f01601f19169290920160200192915050565b602081526000612325602083018461244f565b6000602082840312156124a057600080fd5b5035919050565b600080604083850312156124ba57600080fd5b82356124c58161232c565b946020939093013593505050565b6000806000606084860312156124e857600080fd5b83356124f38161232c565b925060208401356125038161232c565b929592945050506040919091013590565b6000806040838503121561252757600080fd5b50508035926020909101359150565b60008083601f84011261254857600080fd5b5081356001600160401b0381111561255f57600080fd5b602083019150836020828501011115610b7057600080fd5b60008060008060006060868803121561258f57600080fd5b8535945060208601356001600160401b03808211156125ad57600080fd5b6125b989838a01612536565b909650945060408801359150808211156125d257600080fd5b506125df88828901612536565b969995985093965092949392505050565b6000806020838503121561260357600080fd5b82356001600160401b0381111561261957600080fd5b61262585828601612536565b90969095509350505050565b6000806040838503121561264457600080fd5b823561264f8161232c565b9150602083013561265f8161232c565b809150509250929050565b60006020828403121561267c57600080fd5b81356123258161232c565b6000806040838503121561269a57600080fd5b82356126a58161232c565b9150602083013561ffff8116811461265f57600080fd5b600080604083850312156126cf57600080fd5b82356126da8161232c565b91506020830135801515811461265f57600080fd5b60008060006040848603121561270457600080fd5b83356001600160401b038082111561271b57600080fd5b818601915086601f83011261272f57600080fd5b81358181111561273e57600080fd5b8760208260051b850101111561275357600080fd5b6020928301989097509590910135949350505050565b6000806000806080858703121561277f57600080fd5b843561278a8161232c565b9350602085013561279a8161232c565b92506040850135915060608501356001600160401b038111156127bc57600080fd5b8501601f810187136127cd57600080fd5b6127dc878235602084016122c7565b91505092959194509250565b600080600080604085870312156127fe57600080fd5b84356001600160401b038082111561281557600080fd5b61282188838901612536565b9096509450602087013591508082111561283a57600080fd5b5061284787828801612536565b95989497509550505050565b60008060006060848603121561286857600080fd5b83356128738161232c565b95602085013595506040909401359392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c908216806128d157607f821691505b6020821081036128f157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610b2c57600081815260208120601f850160051c8101602086101561291e5750805b601f850160051c820191505b818110156108925782815560010161292a565b81516001600160401b038111156129565761295661225a565b61296a8161296484546128bd565b846128f7565b602080601f83116001811461299f57600084156129875750858301515b600019600386901b1c1916600185901b178555610892565b600085815260208120601f198616915b828110156129ce578886015182559484019460019091019084016129af565b50858210156129ec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215612a0e57600080fd5b81516123258161232c565b60208082526019908201527f46696566646f6d206d7573742062652061637469766174656400000000000000604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176108da576108da612aa1565b634e487b7160e01b600052601260045260246000fd5b600082612af357612af3612ace565b500490565b60208082526021908201527f43616c6c6572206973206e6f7420746865206d696e74696e67206164647265736040820152607360f81b606082015260800190565b60208082526019908201527f43616e6e6f7420637265617465206d6f726520746f6b656e7300000000000000604082015260600190565b808201808211156108da576108da612aa1565b8183823760009101908152919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6001600160401b03831115612bd957612bd961225a565b612bed83612be783546128bd565b836128f7565b6000601f841160018114612c215760008515612c095750838201355b600019600387901b1c1916600186901b1783556114c6565b600083815260209020601f19861690835b82811015612c525786850135825560209485019460019092019101612c32565b5086821015612c6f5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201612ca957612ca9612aa1565b5060010190565b600060208284031215612cc257600080fd5b81516001600160401b03811115612cd857600080fd5b8201601f81018413612ce957600080fd5b8051612cf76122d5826122a0565b818152856020838501011115612d0c57600080fd5b612d1d82602083016020860161242b565b95945050505050565b6702334b2b33237b6960c51b815260008251612d4981600885016020870161242b565b9190910160080192915050565b632324a2a360e11b815260008251612d7581600485016020870161242b565b9190910160040192915050565b818103818111156108da576108da612aa1565b600082612da457612da4612ace565b500690565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612e2e9083018461244f565b9695505050505050565b600060208284031215612e4a57600080fd5b8151612325816123f856fea26469706673582212207e4390e1d75e298afb237353bcf98ccb38ac91c302d68df953ef5a9bc7e49cef64736f6c63430008110033
Deployed Bytecode
0x60806040523480156200001157600080fd5b5060043610620002795760003560e01c806372504a241162000155578063b9c6a7c311620000c7578063d82671c91162000086578063d82671c914620005b7578063e94bbd0a14620005c1578063e985e9c514620005ed578063f2fde38b1462000604578063fca3b5aa146200061b57600080fd5b8063b9c6a7c31462000553578063bb2d80721462000568578063c87b56dd146200057f578063d4434ab01462000596578063d5abeb0114620005ad57600080fd5b806395d89b41116200011457806395d89b4114620004e15780639f46313c14620004eb578063a22cb46514620004ff578063a2935ec31462000516578063b88d4fde146200053c57600080fd5b806372504a24146200047357806377b02a38146200048a57806382fc314714620004a15780638a9c55b814620004b85780638da5cb5b14620004cf57600080fd5b806342842e0e11620001ef578063698f87be11620001ae578063698f87be146200041f5780636a62784214620004315780636b87d24c146200044857806370a082311462000452578063715018a6146200046957600080fd5b806342842e0e14620003ac5780634f558e7914620003c357806352a6c8c914620003da5780636352211e14620003f15780636536c256146200040857600080fd5b806318160ddd116200023c57806318160ddd146200032057806323b872dd1462000333578063248b71fc146200034a5780632a55205a146200036157806334ed0595146200039857600080fd5b806301ffc9a7146200027e57806306fdde0314620002aa5780630754617214620002c3578063081812fc14620002f0578063095ea7b31462000307575b600080fd5b620002956200028f36600462001cf2565b62000632565b60405190151581526020015b60405180910390f35b620002b46200067c565b604051620002a1919062001d66565b600854620002d7906001600160a01b031681565b6040516001600160a01b039091168152602001620002a1565b620002d76200030136600462001d7b565b62000716565b6200031e6200031836600462001db2565b62000772565b005b600e545b604051908152602001620002a1565b6200031e6200034436600462001ddf565b62000803565b6200031e6200035b36600462001db2565b62000840565b620003786200037236600462001e20565b6200096f565b604080516001600160a01b039093168352602083019190915201620002a1565b600a54620002d7906001600160a01b031681565b6200031e620003bd36600462001ddf565b620009b5565b62000295620003d436600462001d7b565b620009d2565b6200031e620003eb36600462001e88565b620009f2565b620002d76200040236600462001d7b565b62000afc565b6200031e6200041936600462001f09565b62000b75565b600d546001600160a01b0316620002d7565b6200031e6200044236600462001f09565b62000bc4565b620002b462000ccb565b620003246200046336600462001f09565b62000d61565b6200031e62000dea565b6200031e6200048436600462001f27565b62000e25565b6200031e6200049b36600462001d7b565b62000e82565b6200031e620004b236600462001f09565b62000f10565b6200031e620004c936600462001f7a565b62000f94565b6006546001600160a01b0316620002d7565b620002b462000fdf565b600954620002d7906001600160a01b031681565b6200031e6200051036600462001f98565b62000ff0565b620002956200052736600462001f09565b600c6020526000908152604090205460ff1681565b6200031e6200054d36600462002045565b62001083565b600a546200029590600160a01b900460ff1681565b6200031e6200057936600462001f98565b620010c2565b620002b46200059036600462001d7b565b6200111a565b6200031e620005a7366004620020fc565b6200118f565b620003246102d181565b620002d762001221565b620002d7620005d236600462001d7b565b600b602052600090815260409020546001600160a01b031681565b62000295620005fe3660046200216f565b6200123b565b6200031e6200061536600462001f09565b620012af565b6200031e6200062c36600462001f09565b62001351565b60006001600160e01b0319821663152a902d60e11b14806200066457506001600160e01b03198216632483248360e11b145b806200067657506200067682620013a0565b92915050565b6060600080546200068d906200219e565b80601f0160208091040260200160405190810160405280929190818152602001828054620006bb906200219e565b80156200070c5780601f10620006e0576101008083540402835291602001916200070c565b820191906000526020600020905b815481529060010190602001808311620006ee57829003601f168201915b5050505050905090565b6000806200072483620013f3565b600a54909150600160a01b900460ff161562000763576001600160a01b0381166000908152600c602052604090205460ff166200076357600062000765565b805b9392505050565b50919050565b600a54600160a01b900460ff1615620007f3576001600160a01b0382166000908152600c602052604090205460ff16620007f35760405162461bcd60e51b815260206004820152601e60248201527f4f70657261746f72206d757374206265206f6e20416c6c6f77204c697374000060448201526064015b60405180910390fd5b620007ff82826200148a565b5050565b6200080f3382620015a5565b6200082e5760405162461bcd60e51b8152600401620007ea90620021d4565b6200083b83838362001686565b505050565b6008546001600160a01b031633146200086d5760405162461bcd60e51b8152600401620007ea9062002225565b6102d181600e546200088091906200227c565b1115620008d05760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f7420637265617465206d6f72652066696566646f6d7300000000006044820152606401620007ea565b60005b818110156200083b57620008ea83600e5462001709565b6000604051620008fa9062001ccd565b604051809103906000f08015801562000917573d6000803e3d6000fd5b50600e80546000908152600b6020526040812080546001600160a01b0319166001600160a01b0385161790558154929350620009538362002292565b9190505550508080620009669062002292565b915050620008d3565b600f5460009081906001600160a01b03811690612710906200099d90600160a01b900461ffff1686620022ae565b620009a99190620022c8565b915091505b9250929050565b6200083b8383836040518060200160405280600081525062001083565b6000818152600260205260408120546001600160a01b0316151562000676565b3362000a066006546001600160a01b031690565b6001600160a01b0316148062000a2e57503362000a238662000afc565b6001600160a01b0316145b62000a955760405162461bcd60e51b815260206004820152603060248201527f4f6e6c792070726f6a656374206f7220746f6b656e206f776e65722063616e2060448201526f195b5a5d081d1bdad95b88195d995b9d60821b6064820152608401620007ea565b838360405162000aa7929190620022eb565b604051809103902085336001600160a01b03167fad000c5a693465b4555f1044ddd1221ef0bfc49e5621ceb705b952ff97e2caac858560405162000aed929190620022fb565b60405180910390a45050505050565b6000818152600260205260408120546001600160a01b031680620007635760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401620007ea565b6006546001600160a01b0316331462000ba25760405162461bcd60e51b8152600401620007ea906200232a565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b0316331462000bf15760405162461bcd60e51b8152600401620007ea9062002225565b6102d1600e541062000c465760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f7420637265617465206d6f72652066696566646f6d7300000000006044820152606401620007ea565b62000c5481600e5462001709565b600060405162000c649062001ccd565b604051809103906000f08015801562000c81573d6000803e3d6000fd5b50600e80546000908152600b6020526040812080546001600160a01b0319166001600160a01b038516179055815492935060019262000cc29084906200227c565b90915550505050565b6007805462000cda906200219e565b80601f016020809104026020016040519081016040528092919081815260200182805462000d08906200219e565b801562000d595780601f1062000d2d5761010080835404028352916020019162000d59565b820191906000526020600020905b81548152906001019060200180831162000d3b57829003601f168201915b505050505081565b60006001600160a01b03821662000dce5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401620007ea565b506001600160a01b031660009081526003602052604090205490565b6006546001600160a01b0316331462000e175760405162461bcd60e51b8152600401620007ea906200232a565b62000e23600062001851565b565b6006546001600160a01b0316331462000e525760405162461bcd60e51b8152600401620007ea906200232a565b600f805461ffff909216600160a01b026001600160b01b03199092166001600160a01b0390931692909217179055565b6000818152600b60205260409020546001600160a01b0316331462000ea657600080fd5b6040518181527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a16040518181527f6279bf86ea3dc5d5b9bee1e698743c7316620585ddd8a6ff818bfb582978ae43906020015b60405180910390a150565b6006546001600160a01b0316331462000f3d5760405162461bcd60e51b8152600401620007ea906200232a565b600d80546001600160a01b0319166001600160a01b038316179055600e54604080516000815260208101929092527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910162000f05565b6006546001600160a01b0316331462000fc15760405162461bcd60e51b8152600401620007ea906200232a565b600a8054911515600160a01b0260ff60a01b19909216919091179055565b6060600180546200068d906200219e565b600a54600160a01b900460ff168015620010075750805b1562001077576001600160a01b0382166000908152600c602052604090205460ff16620010775760405162461bcd60e51b815260206004820152601e60248201527f4f70657261746f72206d757374206265206f6e20416c6c6f77204c69737400006044820152606401620007ea565b620007ff8282620018a3565b6200108f3383620015a5565b620010ae5760405162461bcd60e51b8152600401620007ea90620021d4565b620010bc8484848462001969565b50505050565b6006546001600160a01b03163314620010ef5760405162461bcd60e51b8152600401620007ea906200232a565b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b600d5460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa15801562001165573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200067691908101906200235f565b6006546001600160a01b03163314620011bc5760405162461bcd60e51b8152600401620007ea906200232a565b8383604051620011ce929190620022eb565b6040518091039020336001600160a01b03167f3d366eac52dec4372766dc4b15bba20b935b45d33171465a598eedabb5a5dff8848460405162001213929190620022fb565b60405180910390a350505050565b6000620012366006546001600160a01b031690565b905090565b600a54600090600160a01b900460ff1680156200127157506001600160a01b0382166000908152600c602052604090205460ff16155b15620012805750600062000676565b506001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6006546001600160a01b03163314620012dc5760405162461bcd60e51b8152600401620007ea906200232a565b6001600160a01b038116620013435760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620007ea565b6200134e8162001851565b50565b6006546001600160a01b031633146200137e5760405162461bcd60e51b8152600401620007ea906200232a565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b031982166380ac58cd60e01b1480620013d257506001600160e01b03198216635b5e139f60e01b145b806200067657506301ffc9a760e01b6001600160e01b031983161462000676565b6000818152600260205260408120546001600160a01b03166200146e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401620007ea565b506000908152600460205260409020546001600160a01b031690565b6000620014978262000afc565b9050806001600160a01b0316836001600160a01b031603620015065760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401620007ea565b336001600160a01b03821614806200152557506200152581336200123b565b620015995760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401620007ea565b6200083b8383620019a3565b6000818152600260205260408120546001600160a01b0316620016205760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401620007ea565b60006200162d8362000afc565b9050806001600160a01b0316846001600160a01b031614806200166b5750836001600160a01b0316620016608462000716565b6001600160a01b0316145b806200167e57506200167e81856200123b565b949350505050565b6000818152600b602052604090819020549051636d43542160e01b81526001600160a01b038581166004830152848116602483015290911690636d43542190604401600060405180830381600087803b158015620016e357600080fd5b505af1158015620016f8573d6000803e3d6000fd5b505050506200083b83838362001a13565b6001600160a01b038216620017615760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401620007ea565b6000818152600260205260409020546001600160a01b031615620017c85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401620007ea565b6001600160a01b0382166000908152600360205260408120805460019290620017f39084906200227c565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b336001600160a01b03831603620018fd5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401620007ea565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6200197684848462001686565b620019848484848462001bbf565b620010bc5760405162461bcd60e51b8152600401620007ea90620023df565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190620019da8262000afc565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b826001600160a01b031662001a288262000afc565b6001600160a01b03161462001a925760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401620007ea565b6001600160a01b03821662001af65760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401620007ea565b62001b03600082620019a3565b6001600160a01b038316600090815260036020526040812080546001929062001b2e90849062002431565b90915550506001600160a01b038216600090815260036020526040812080546001929062001b5e9084906200227c565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160a01b0384163b1562001cc257604051630a85bd0160e11b81526001600160a01b0385169063150b7a029062001c0690339089908890889060040162002447565b6020604051808303816000875af192505050801562001c44575060408051601f3d908101601f1916820190925262001c419181019062002486565b60015b62001ca7573d80801562001c75576040519150601f19603f3d011682016040523d82523d6000602084013e62001c7a565b606091505b50805160000362001c9f5760405162461bcd60e51b8152600401620007ea90620023df565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506200167e565b506001949350505050565b61064c80620024a783390190565b6001600160e01b0319811681146200134e57600080fd5b60006020828403121562001d0557600080fd5b8135620007658162001cdb565b60005b8381101562001d2f57818101518382015260200162001d15565b50506000910152565b6000815180845262001d5281602086016020860162001d12565b601f01601f19169290920160200192915050565b60208152600062000765602083018462001d38565b60006020828403121562001d8e57600080fd5b5035919050565b80356001600160a01b038116811462001dad57600080fd5b919050565b6000806040838503121562001dc657600080fd5b62001dd18362001d95565b946020939093013593505050565b60008060006060848603121562001df557600080fd5b62001e008462001d95565b925062001e106020850162001d95565b9150604084013590509250925092565b6000806040838503121562001e3457600080fd5b50508035926020909101359150565b60008083601f84011262001e5657600080fd5b50813567ffffffffffffffff81111562001e6f57600080fd5b602083019150836020828501011115620009ae57600080fd5b60008060008060006060868803121562001ea157600080fd5b85359450602086013567ffffffffffffffff8082111562001ec157600080fd5b62001ecf89838a0162001e43565b9096509450604088013591508082111562001ee957600080fd5b5062001ef88882890162001e43565b969995985093965092949392505050565b60006020828403121562001f1c57600080fd5b620007658262001d95565b6000806040838503121562001f3b57600080fd5b62001f468362001d95565b9150602083013561ffff8116811462001f5e57600080fd5b809150509250929050565b8035801515811462001dad57600080fd5b60006020828403121562001f8d57600080fd5b620007658262001f69565b6000806040838503121562001fac57600080fd5b62001fb78362001d95565b915062001fc76020840162001f69565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562002012576200201262001fd0565b604052919050565b600067ffffffffffffffff82111562002037576200203762001fd0565b50601f01601f191660200190565b600080600080608085870312156200205c57600080fd5b620020678562001d95565b9350620020776020860162001d95565b925060408501359150606085013567ffffffffffffffff8111156200209b57600080fd5b8501601f81018713620020ad57600080fd5b8035620020c4620020be826200201a565b62001fe6565b818152886020838501011115620020da57600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080600080604085870312156200211357600080fd5b843567ffffffffffffffff808211156200212c57600080fd5b6200213a8883890162001e43565b909650945060208701359150808211156200215457600080fd5b50620021638782880162001e43565b95989497509550505050565b600080604083850312156200218357600080fd5b6200218e8362001d95565b915062001fc76020840162001d95565b600181811c90821680620021b357607f821691505b6020821081036200076c57634e487b7160e01b600052602260045260246000fd5b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526021908201527f43616c6c6572206973206e6f7420746865206d696e74696e67206164647265736040820152607360f81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000676576200067662002266565b600060018201620022a757620022a762002266565b5060010190565b808202811582820484141762000676576200067662002266565b600082620022e657634e487b7160e01b600052601260045260246000fd5b500490565b8183823760009101908152919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156200237257600080fd5b815167ffffffffffffffff8111156200238a57600080fd5b8201601f810184136200239c57600080fd5b8051620023ad620020be826200201a565b818152856020838501011115620023c357600080fd5b620023d682602083016020860162001d12565b95945050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b8181038181111562000676576200067662002266565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906200247c9083018462001d38565b9695505050505050565b6000602082840312156200249957600080fd5b8151620007658162001cdb56fe608060405234801561001057600080fd5b506000336001600160a01b0316639f46313c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610051573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061007591906102a3565b90506000336001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100db91906102cc565b9050817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b03929092169190911790556040513360248201526044810182905261018690839060640160408051601f19818403018152918152602080830180516001600160e01b031663cd6dc68760e01b1790528151606081019092526027808352906106259083013961018e60201b6100dd1760201c565b505050610358565b6060833b6101f25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161020d9190610309565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b50909250905061025e82828661026a565b925050505b9392505050565b60608315610279575081610263565b8251156102895782518084602001fd5b8160405162461bcd60e51b81526004016101e99190610325565b6000602082840312156102b557600080fd5b81516001600160a01b038116811461026357600080fd5b6000602082840312156102de57600080fd5b5051919050565b60005b838110156103005781810151838201526020016102e8565b50506000910152565b6000825161031b8184602087016102e5565b9190910192915050565b60208152600082518060208401526103448160408501602087016102e5565b601f01601f19169190910160400192915050565b6102be806103676000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e6100a5565b6040516001600160a01b03909116815260200160405180910390f35b6100a361009e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6101b8565b565b60006100d87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b6060833b6101415760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161015c9190610239565b600060405180830381855af49150503d8060008114610197576040519150601f19603f3d011682016040523d82523d6000602084013e61019c565b606091505b50915091506101ac8282866101dc565b925050505b9392505050565b3660008037600080366000845af43d6000803e8080156101d7573d6000f35b3d6000fd5b606083156101eb5750816101b1565b8251156101fb5782518084602001fd5b8160405162461bcd60e51b81526004016101389190610255565b60005b83811015610230578181015183820152602001610218565b50506000910152565b6000825161024b818460208701610215565b9190910192915050565b6020815260008251806020840152610274816040850160208701610215565b601f01601f1916919091016040019291505056fea264697066735822122015f9799f1a7a034bec7586c408a509bb2a7dbe54dfea3afef32d2527d7f58d2464736f6c63430008110033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212208ce6cf3704e31c774960d4a033de2942cf13230c00bccc2d68e99ef7d41e213764736f6c63430008110033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.