Contract Overview
Balance:
0.318 ETH
Token:
My Name Tag:
Not Available
TokenTracker:
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
FarmlandCharacters
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 9999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/FarmlandCollectible.sol"; contract FarmlandCharacters is FarmlandCollectible { constructor () ERC721("Farmland Characters", "CHARACTERS") { isPaused(true); // Start the contract in paused model } function storeTraits(uint256 id) internal override { require( !_exists(id), "Traits can be generated only once"); CollectibleTraits storage collectibleTrait = collectibleTraits[id]; // Shortcut accessor to store Collectible traits on chain collectibleTrait.trait1 = random(80, msg.sender) + 20; // stamina collectibleTrait.trait2 = random(80, msg.sender) + 20; // strength collectibleTrait.trait3 = random(80, msg.sender) + 20; // speed collectibleTrait.trait4 = random(80, msg.sender) + 20; // courage collectibleTrait.trait5 = random(80, msg.sender) + 20; // intelligence } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; //import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; struct CollectibleTraits {uint256 expiryDate; uint256 trait1; uint256 trait2; uint256 trait3; uint256 trait4; uint256 trait5;} struct CollectibleSegments {uint256 segment1; uint256 segment2; uint256 segment3; uint256 segment4; uint256 segment5; uint256 segment6; uint256 segment7; uint256 segment8;} struct CollectibleSlots {uint256 slot1; uint256 slot2; uint256 slot3; uint256 slot4; uint256 slot5; uint256 slot6; uint256 slot7; uint256 slot8;} abstract contract FarmlandCollectible is ERC721, ERC721Enumerable, ERC721Pausable, Ownable, ReentrancyGuard, Initializable { using Strings for string; // using SafeERC20 for IERC20; // MODIFIERS /** * @dev To limit this action to the contract designed for modifying the slots */ modifier onlySlotModifier() { require(slotContractAddress == _msgSender(), "You don't have permission to set this collectibles slot"); _; } /** * @dev This is the Collectibles reserved for giveaways and promotions */ uint256 private reserved; /** * @dev This is the Collectibles total supply */ uint256 public maxSupply; /** * @dev This is the Collectible price */ uint256 public price; /** * @dev This is determines how many trait boosts are allowed */ uint256 public maxTraitBoosts = 10; /** * @dev This is the price for trait boosts */ uint256 public traitBoostPrice; /** * @dev This is the contract used to pay for trait boosts */ IERC20 public traitPaymentContract; /** * @dev This is the contract used to update Collectible slots */ address slotContractAddress; /** * @dev Initialise the nonce used to generate pseudo random numbers */ uint256 private randomNonce; /** * @dev This stores the base URI used to generat the token ID */ string public baseURI; /** * @dev PUBLIC: Stores the key traits for Farmland Collectibles */ mapping(uint256 => CollectibleTraits) public collectibleTraits; /** * @dev PUBLIC: Stores the number trait boosts used by Farmland Collectibles */ mapping(uint256 => uint256) public collectibleTraitBoostTracker; /** * @dev PUBLIC: Stores segments for Farmland Collectibles, can be used by the owners to group or stamp collectibles */ mapping(uint256 => CollectibleSegments) public collectibleSegments; /** * @dev PUBLIC: Stores slots for Farmland Collectibles, can be used to store various items / awards for collectibles */ mapping(uint256 => CollectibleSlots) public collectibleSlots; // EVENTS event CharacterBoosted(address booster, uint256 id, uint256 trait, uint256 boost, uint256 pricePaid); event CharacterSegmented(address segmenter, uint256 id, uint256 segmentIndex, uint256 segment); event CharacterSlotSet(address slotSetter, uint256 id, uint256 slotIndex, uint256 slot); event ContractAddressChanged(address updatedBy, string addressType, address newAddress); function mintCollectible(uint256 numTokens) external virtual payable nonReentrant whenNotPaused { uint256 supply = totalSupply(); require( numTokens < 21, "You can mint a maximum of 20" ); require( supply + numTokens < maxSupply - reserved, "Exceeds maximum supply" ); require( msg.value >= price * numTokens, "Ether sent is not correct" ); for(uint256 i = 0; i < numTokens; i++){ uint256 id = supply++; // Increment Token id storeTraits(id); // Store Collectible traits on chain _safeMint(_msgSender(), id); // Mint the Collectible } } function boostTrait(uint256 id, uint256 trait, uint256 boost) external virtual nonReentrant whenNotPaused { require( boost <= maxTraitBoosts, "This will exceed the maximum character boost" ); require( ownerOf(id) == _msgSender(), "Only the owner can boost this characters traits" ); require( traitPaymentContract.balanceOf(_msgSender()) >= traitBoostPrice * boost, "Balance too low to pay for character boost" ); uint256 newTraitBoost = collectibleTraitBoostTracker[id] + boost; // Calculate the new trait tracker value after the boost require( newTraitBoost <= maxTraitBoosts, "This will exceed the remaining character boost"); CollectibleTraits storage collectibleTrait = collectibleTraits[id]; // Create accessor shortcut uint256 newTrait; // Initialise a local variable if (trait == 1 ) { // For trait 1 newTrait = collectibleTrait.trait1 + boost; // Calculate the new trait 1 value after the boost require ( newTrait < 100, "This will exceed the maximum trait boost"); // Revert if the new trait exceeds 99 collectibleTrait.trait1 = newTrait; // Update trait 1 value to the new trait value } else if (trait == 2 ) { newTrait = collectibleTrait.trait2 + boost; require ( newTrait < 100, "This will exceed the maximum trait boost"); collectibleTrait.trait2 = newTrait; } else if (trait == 3 ) { newTrait = collectibleTrait.trait3 + boost; require ( newTrait < 100, "This will exceed the maximum trait boost"); collectibleTrait.trait3 = newTrait; } else if (trait == 4 ) { newTrait = collectibleTrait.trait4 + boost; require ( newTrait < 100, "This will exceed the maximum trait boost"); collectibleTrait.trait4 = newTrait; } else if (trait == 5 ) { newTrait = collectibleTrait.trait5 + boost; require ( newTrait < 100, "This will exceed the maximum trait boost"); collectibleTrait.trait5 = newTrait; } collectibleTraitBoostTracker[id] = newTraitBoost; // Update the trait tracker value after the boost emit CharacterBoosted(_msgSender(), id, trait, boost, traitBoostPrice * boost); // Write an event //traitPaymentContract.safeTransferFrom(_msgSender(), address(this), traitBoostPrice * boost); // Take the payment for the boost require(traitPaymentContract.transferFrom(_msgSender(), address(this), traitBoostPrice * boost),"Boost payment failed"); // Take the payment for the boost } function setCollectibleSegment(uint256 id, uint256 segmentIndex, uint256 segment) external virtual nonReentrant whenNotPaused { require( _exists(id), "This Collectible hasn't been minted"); require( ownerOf(id) == _msgSender() , "Only the owner of this Collectible can set the segment" ); CollectibleSegments storage segments = collectibleSegments[id]; // Create accessor shortcut if (segmentIndex == 1 ) { // For segment 1 segments.segment1 = segment; // Update segment 1 based on input } else if (segmentIndex == 2 ) { segments.segment2 = segment; } else if (segmentIndex == 3 ) { segments.segment3 = segment; } else if (segmentIndex == 4 ) { segments.segment4 = segment; } else if (segmentIndex == 5 ) { segments.segment5 = segment; } else if (segmentIndex == 6 ) { segments.segment6 = segment; } else if (segmentIndex == 7 ) { segments.segment7 = segment; } else if (segmentIndex == 8 ) { segments.segment8 = segment; } emit CharacterSegmented(_msgSender(), id, segmentIndex, segment); // Write an event } function setCollectibleSlot(uint256 id, uint256 slotIndex, uint256 slot) external virtual nonReentrant whenNotPaused onlySlotModifier { require( _exists(id), "This collectible hasn't been minted"); CollectibleSlots storage slots = collectibleSlots[id]; // Create accessor shortcut if (slotIndex == 1 ) { // For slot 1 slots.slot1 = slot; // Update slot 1 based on input } else if (slotIndex == 2 ) { slots.slot2 = slot; } else if (slotIndex == 3 ) { slots.slot3 = slot; } else if (slotIndex == 4 ) { slots.slot4 = slot; } else if (slotIndex == 5 ) { slots.slot5 = slot; } else if (slotIndex == 6 ) { slots.slot6 = slot; } else if (slotIndex == 7 ) { slots.slot7 = slot; } else if (slotIndex == 8 ) { slots.slot8 = slot; } emit CharacterSlotSet(_msgSender(), id, slotIndex, slot); // Write an event } function random(uint256 max, address account) internal returns (uint256 randomNumber) { randomNonce++; return uint256(keccak256(abi.encodePacked(block.timestamp, account, randomNonce))) % max; } function storeTraits(uint256 id) internal virtual {} function _baseURI() internal view override(ERC721) returns (string memory) { return baseURI; } function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) { string memory uri = super.tokenURI(tokenId); return string(abi.encodePacked(uri,".json")); } function walletOfOwner(address account) external view returns(uint256[] memory tokenIds) { uint256 _tokenCount = balanceOf(account); uint256[] memory _tokensId = new uint256[](_tokenCount); if (_tokenCount == 0) { // Return an empty array return new uint256[](0); } else { for(uint256 i = 0; i < _tokenCount; i++){ _tokensId[i] = tokenOfOwnerByIndex(account, i); } } return _tokensId; } // ADMIN FUNCTIONS // Enable the team to giveaway to supportive community memebers function giveAway(address to, uint256 amount) external nonReentrant onlyOwner { require( amount <= reserved, "Exceeds reserved supply" ); reserved -= amount; uint256 supply = totalSupply(); for(uint256 i = 0; i < amount; i++){ uint256 id = supply++; // Increment id storeTraits(id); // Store Collectible traits on chain _safeMint (to, id); } } // Initialise the contract function initialize(string memory uri, uint256 reservedSupply, uint256 maximumSupply, uint256 characterPrice, uint256 boostPrice, address traitPaymentContractAddress, address slotModifierAddress) external onlyOwner initializer { require(traitPaymentContractAddress != address(0), "Trait Payment Contract address cannot be 0x0"); require(slotModifierAddress != address(0), "Slot Modifier Contract address cannot be 0x0"); baseURI = uri; reserved = reservedSupply; maxSupply = maximumSupply; price = characterPrice; traitBoostPrice = boostPrice; traitPaymentContract = IERC20(traitPaymentContractAddress); emit ContractAddressChanged(_msgSender(), "TraitPayment", traitPaymentContractAddress); slotContractAddress = slotModifierAddress; emit ContractAddressChanged(_msgSender(), "SlotModifier", slotModifierAddress); } // Allow change in the sale price function setPrice(uint256 characterPrice, uint256 boostPrice) external onlyOwner { price = characterPrice; // In ETH traitBoostPrice = boostPrice; // In ERC20 } // If the metadata needs to be moved function setBaseURI(string memory uri) external onlyOwner { baseURI = uri; } // If the amount of boosts needs to be updated function setMaxTraitBoost(uint256 maxBoost) external onlyOwner { maxTraitBoosts = maxBoost; } // Start or pause the sale function isPaused(bool value) public onlyOwner { if ( !value ) { _unpause(); } else { _pause(); } } // Enable changes to key contract address function setContractAddress( address traitPaymentContractAddress, address slotModifierAddress ) external onlyOwner { if ( traitPaymentContractAddress != address(0) && traitPaymentContractAddress != address(IERC20(traitPaymentContract)) ) { traitPaymentContract = IERC20(traitPaymentContractAddress); emit ContractAddressChanged(_msgSender(), "TraitPayment", traitPaymentContractAddress); } if ( slotModifierAddress != address(0) && slotModifierAddress != slotContractAddress ) { slotContractAddress = slotModifierAddress; emit ContractAddressChanged(_msgSender(), "SlotModifier", slotModifierAddress); } } // Withdraw sale proceeds function withdrawAll() external payable onlyOwner { payable(owner()).transfer(address(this).balance); uint256 amount = traitPaymentContract.balanceOf(address(this)); //traitPaymentContract.safeTransfer(owner(), amount); require(traitPaymentContract.transfer(owner(), amount),"Boost payment withdrawal failed"); } fallback() external payable { } receive() external payable { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721Pausable, ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) pragma solidity ^0.8.0; /** * @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); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/ERC721Pausable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../security/Pausable.sol"; /** * @dev ERC721 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. */ abstract contract ERC721Pausable is ERC721, Pausable { /** * @dev See {ERC721-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); require(!paused(), "ERC721Pausable: token transfer while paused"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @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` cannot be the zero address. * - `to` cannot be the zero address. * * 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 override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @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 { _setApprovalForAll(_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 Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @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.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 {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * 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() { _transferOwnership(_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 { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 9999 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":"address","name":"booster","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"trait","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"boost","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pricePaid","type":"uint256"}],"name":"CharacterBoosted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"segmenter","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"segmentIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"segment","type":"uint256"}],"name":"CharacterSegmented","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"slotSetter","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"slotIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"slot","type":"uint256"}],"name":"CharacterSlotSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"updatedBy","type":"address"},{"indexed":false,"internalType":"string","name":"addressType","type":"string"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"ContractAddressChanged","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"stateMutability":"payable","type":"fallback"},{"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":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"trait","type":"uint256"},{"internalType":"uint256","name":"boost","type":"uint256"}],"name":"boostTrait","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collectibleSegments","outputs":[{"internalType":"uint256","name":"segment1","type":"uint256"},{"internalType":"uint256","name":"segment2","type":"uint256"},{"internalType":"uint256","name":"segment3","type":"uint256"},{"internalType":"uint256","name":"segment4","type":"uint256"},{"internalType":"uint256","name":"segment5","type":"uint256"},{"internalType":"uint256","name":"segment6","type":"uint256"},{"internalType":"uint256","name":"segment7","type":"uint256"},{"internalType":"uint256","name":"segment8","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collectibleSlots","outputs":[{"internalType":"uint256","name":"slot1","type":"uint256"},{"internalType":"uint256","name":"slot2","type":"uint256"},{"internalType":"uint256","name":"slot3","type":"uint256"},{"internalType":"uint256","name":"slot4","type":"uint256"},{"internalType":"uint256","name":"slot5","type":"uint256"},{"internalType":"uint256","name":"slot6","type":"uint256"},{"internalType":"uint256","name":"slot7","type":"uint256"},{"internalType":"uint256","name":"slot8","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collectibleTraitBoostTracker","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collectibleTraits","outputs":[{"internalType":"uint256","name":"expiryDate","type":"uint256"},{"internalType":"uint256","name":"trait1","type":"uint256"},{"internalType":"uint256","name":"trait2","type":"uint256"},{"internalType":"uint256","name":"trait3","type":"uint256"},{"internalType":"uint256","name":"trait4","type":"uint256"},{"internalType":"uint256","name":"trait5","type":"uint256"}],"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":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"giveAway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"reservedSupply","type":"uint256"},{"internalType":"uint256","name":"maximumSupply","type":"uint256"},{"internalType":"uint256","name":"characterPrice","type":"uint256"},{"internalType":"uint256","name":"boostPrice","type":"uint256"},{"internalType":"address","name":"traitPaymentContractAddress","type":"address"},{"internalType":"address","name":"slotModifierAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"bool","name":"value","type":"bool"}],"name":"isPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTraitBoosts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numTokens","type":"uint256"}],"name":"mintCollectible","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"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":"string","name":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"segmentIndex","type":"uint256"},{"internalType":"uint256","name":"segment","type":"uint256"}],"name":"setCollectibleSegment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"slotIndex","type":"uint256"},{"internalType":"uint256","name":"slot","type":"uint256"}],"name":"setCollectibleSlot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"traitPaymentContractAddress","type":"address"},{"internalType":"address","name":"slotModifierAddress","type":"address"}],"name":"setContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxBoost","type":"uint256"}],"name":"setMaxTraitBoost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"characterPrice","type":"uint256"},{"internalType":"uint256","name":"boostPrice","type":"uint256"}],"name":"setPrice","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":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"traitBoostPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"traitPaymentContract","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"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":"account","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052600a6010553480156200001657600080fd5b50604080518082018252601381527f4661726d6c616e6420436861726163746572730000000000000000000000000060208083019182528351808501909452600a8452694348415241435445525360b01b9084015281519192916200007e91600091620002bd565b50805162000094906001906020840190620002bd565b5050600a805460ff1916905550620000ac33620000c4565b6001600b819055620000be906200011e565b620003a0565b600a80546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600a546001600160a01b03610100909104163314620001845760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b80620001975762000194620001a1565b50565b620001946200023f565b600a5460ff16620001f55760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016200017b565b600a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600a5460ff1615620002875760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016200017b565b600a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258620002223390565b828054620002cb9062000363565b90600052602060002090601f016020900481019282620002ef57600085556200033a565b82601f106200030a57805160ff19168380011785556200033a565b828001600101855582156200033a579182015b828111156200033a5782518255916020019190600101906200031d565b50620003489291506200034c565b5090565b5b808211156200034857600081556001016200034d565b600181811c908216806200037857607f821691505b602082108114156200039a57634e487b7160e01b600052602260045260246000fd5b50919050565b6147e680620003b06000396000f3fe6080604052600436106102b05760003560e01c8063715018a61161016c578063b8f08e1d116100ca578063d5abeb0111610084578063f2fde38b11610061578063f2fde38b146108d9578063f5f2f697146108f9578063f7d975771461090f57005b8063d5abeb011461085a578063e3fa23d414610870578063e985e9c51461089057005b8063ca800144116100b2578063ca800144146107bc578063cae9ed07146107dc578063d32cdca61461083a57005b8063b8f08e1d1461076f578063c87b56dd1461079c57005b8063a035b1fe11610126578063a947c57411610103578063a947c5741461070f578063b38c4e751461072f578063b88d4fde1461074f57005b8063a035b1fe14610640578063a22cb46514610656578063a482bf3e1461067657005b80638da5cb5b116101545780638da5cb5b1461058b578063939f1eb6146105ae57806395d89b411461062b57005b8063715018a61461056e578063853828b61461058357005b80632f3983701161021957806354c2d523116101d35780636352211e116101b05780636352211e146105195780636c0360eb1461053957806370a082311461054e57005b806354c2d523146104ce57806355f804b3146104e15780635c975abb1461050157005b806342842e0e1161020157806342842e0e14610461578063438b6300146104815780634f6ccce7146104ae57005b80632f398370146104215780632f745c591461044157005b806317698c191161026a57806320f1dbbc1161025257806320f1dbbc146103c157806323626df7146103e157806323b872dd1461040157005b806317698c191461038857806318160ddd146103ac57005b8063081812fc11610298578063081812fc14610310578063095ea7b3146103485780630c12d9231461036857005b806301ffc9a7146102b957806306fdde03146102ee57005b366102b757005b005b3480156102c557600080fd5b506102d96102d4366004614347565b61092f565b60405190151581526020015b60405180910390f35b3480156102fa57600080fd5b50610303610940565b6040516102e591906145eb565b34801561031c57600080fd5b5061033061032b366004614435565b6109d2565b6040516001600160a01b0390911681526020016102e5565b34801561035457600080fd5b506102b76103633660046142e6565b610a7d565b34801561037457600080fd5b50601254610330906001600160a01b031681565b34801561039457600080fd5b5061039e60105481565b6040519081526020016102e5565b3480156103b857600080fd5b5060085461039e565b3480156103cd57600080fd5b506102b76103dc36600461430f565b610baf565b3480156103ed57600080fd5b506102b76103fc3660046141ca565b610c27565b34801561040d57600080fd5b506102b761041c3660046141fc565b610e3d565b34801561042d57600080fd5b506102b761043c366004614486565b610ec4565b34801561044d57600080fd5b5061039e61045c3660046142e6565b611184565b34801561046d57600080fd5b506102b761047c3660046141fc565b61122c565b34801561048d57600080fd5b506104a161049c3660046141b0565b611247565b6040516102e591906145a7565b3480156104ba57600080fd5b5061039e6104c9366004614435565b611321565b6102b76104dc366004614435565b6113d3565b3480156104ed57600080fd5b506102b76104fc36600461437f565b6115ea565b34801561050d57600080fd5b50600a5460ff166102d9565b34801561052557600080fd5b50610330610534366004614435565b61165d565b34801561054557600080fd5b506103036116e8565b34801561055a57600080fd5b5061039e6105693660046141b0565b611776565b34801561057a57600080fd5b506102b7611810565b6102b761187c565b34801561059757600080fd5b50600a5461010090046001600160a01b0316610330565b3480156105ba57600080fd5b506105fe6105c9366004614435565b601660205260009081526040902080546001820154600283015460038401546004850154600590950154939492939192909186565b604080519687526020870195909552938501929092526060840152608083015260a082015260c0016102e5565b34801561063757600080fd5b50610303611ac2565b34801561064c57600080fd5b5061039e600f5481565b34801561066257600080fd5b506102b76106713660046142b0565b611ad1565b34801561068257600080fd5b506106d4610691366004614435565b6019602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460079097015495969495939492939192909188565b604080519889526020890197909752958701949094526060860192909252608085015260a084015260c083015260e0820152610100016102e5565b34801561071b57600080fd5b506102b761072a3660046143b2565b611adc565b34801561073b57600080fd5b506102b761074a366004614486565b611eb9565b34801561075b57600080fd5b506102b761076a366004614237565b6126c7565b34801561077b57600080fd5b5061039e61078a366004614435565b60176020526000908152604090205481565b3480156107a857600080fd5b506103036107b7366004614435565b612755565b3480156107c857600080fd5b506102b76107d73660046142e6565b61278c565b3480156107e857600080fd5b506106d46107f7366004614435565b6018602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460079097015495969495939492939192909188565b34801561084657600080fd5b506102b7610855366004614435565b6128fc565b34801561086657600080fd5b5061039e600e5481565b34801561087c57600080fd5b506102b761088b366004614486565b612961565b34801561089c57600080fd5b506102d96108ab3660046141ca565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156108e557600080fd5b506102b76108f43660046141b0565b612bf1565b34801561090557600080fd5b5061039e60115481565b34801561091b57600080fd5b506102b761092a366004614465565b612cd6565b600061093a82612d41565b92915050565b60606000805461094f906146aa565b80601f016020809104026020016040519081016040528092919081815260200182805461097b906146aa565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610a615760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610a888261165d565b9050806001600160a01b0316836001600160a01b03161415610b125760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610a58565b336001600160a01b0382161480610b2e5750610b2e81336108ab565b610ba05760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610a58565b610baa8383612d97565b505050565b600a546001600160a01b03610100909104163314610c0f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b80610c1f57610c1c612e1d565b50565b610c1c612ed7565b600a546001600160a01b03610100909104163314610c875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b6001600160a01b03821615801590610cad57506012546001600160a01b03838116911614155b15610d6057601280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384161790557faf21a35748f3364e882e31110ebb5508ff8d81347619175f3892e873da14d69633604080516001600160a01b039283168152606060208201819052600c908201527f54726169745061796d656e74000000000000000000000000000000000000000060808201529185169082015260a00160405180910390a15b6001600160a01b03811615801590610d8657506013546001600160a01b03828116911614155b15610e3957601380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383161790557faf21a35748f3364e882e31110ebb5508ff8d81347619175f3892e873da14d69633604080516001600160a01b039283168152606060208201819052600c908201527f536c6f744d6f646966696572000000000000000000000000000000000000000060808201529184169082015260a00160405180910390a15b5050565b610e473382612f7d565b610eb95760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610a58565b610baa838383613085565b6002600b541415610f175760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a58565b6002600b55600a5460ff1615610f6f5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a58565b6013546001600160a01b03163314610fef5760405162461bcd60e51b815260206004820152603760248201527f596f7520646f6e27742068617665207065726d697373696f6e20746f2073657460448201527f207468697320636f6c6c65637469626c657320736c6f740000000000000000006064820152608401610a58565b6000838152600260205260409020546001600160a01b03166110795760405162461bcd60e51b815260206004820152602360248201527f5468697320636f6c6c65637469626c65206861736e2774206265656e206d696e60448201527f74656400000000000000000000000000000000000000000000000000000000006064820152608401610a58565b6000838152601960205260409020600183141561109857818155611127565b82600214156110ad5760018101829055611127565b82600314156110c25760028101829055611127565b82600414156110d75760038101829055611127565b82600514156110ec5760048101829055611127565b82600614156111015760058101829055611127565b82600714156111165760068101829055611127565b826008141561112757600781018290555b7fdce4af162ead343748f8d5154834944147083ad9ce2d1a2f40b518bf31077ba2335b604080516001600160a01b0390921682526020820187905281018590526060810184905260800160405180910390a150506001600b555050565b600061118f83611776565b82106112035760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610a58565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610baa838383604051806020016040528060008152506126c7565b6060600061125483611776565b905060008167ffffffffffffffff81111561127f57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156112a8578160200160208202803683370190505b509050816112c757505060408051600081526020810190915292915050565b60005b82811015611319576112dc8582611184565b8282815181106112fc57634e487b7160e01b600052603260045260246000fd5b602090810291909101015280611311816146e5565b9150506112ca565b509392505050565b600061132c60085490565b82106113a05760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610a58565b600882815481106113c157634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b6002600b5414156114265760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a58565b6002600b55600a5460ff161561147e5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a58565b600061148960085490565b9050601582106114db5760405162461bcd60e51b815260206004820152601c60248201527f596f752063616e206d696e742061206d6178696d756d206f66203230000000006044820152606401610a58565b600d54600e546114eb9190614667565b6114f583836145fe565b106115425760405162461bcd60e51b815260206004820152601660248201527f45786365656473206d6178696d756d20737570706c79000000000000000000006044820152606401610a58565b81600f54611550919061462a565b34101561159f5760405162461bcd60e51b815260206004820152601960248201527f45746865722073656e74206973206e6f7420636f7272656374000000000000006044820152606401610a58565b60005b828110156115e0576000826115b6816146e5565b935090506115c381613275565b6115cd3382613399565b50806115d8816146e5565b9150506115a2565b50506001600b5550565b600a546001600160a01b0361010090910416331461164a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b8051610e39906015906020840190614048565b6000818152600260205260408120546001600160a01b03168061093a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610a58565b601580546116f5906146aa565b80601f0160208091040260200160405190810160405280929190818152602001828054611721906146aa565b801561176e5780601f106117435761010080835404028352916020019161176e565b820191906000526020600020905b81548152906001019060200180831161175157829003601f168201915b505050505081565b60006001600160a01b0382166117f45760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610a58565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b036101009091041633146118705760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b61187a60006133b3565b565b600a546001600160a01b036101009091041633146118dc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b600a546040516001600160a01b0361010090920491909116904780156108fc02916000818181858888f1935050505015801561191c573d6000803e3d6000fd5b506012546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561197a57600080fd5b505afa15801561198e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b2919061444d565b6012549091506001600160a01b031663a9059cbb6119de600a546001600160a01b036101009091041690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b158015611a3e57600080fd5b505af1158015611a52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a76919061432b565b610c1c5760405162461bcd60e51b815260206004820152601f60248201527f426f6f7374207061796d656e74207769746864726177616c206661696c6564006044820152606401610a58565b60606001805461094f906146aa565b610e39338383613424565b600a546001600160a01b03610100909104163314611b3c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b600c54610100900460ff1680611b555750600c5460ff16155b611bc75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a58565b600c54610100900460ff16158015611c0657600c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6001600160a01b038316611c825760405162461bcd60e51b815260206004820152602c60248201527f5472616974205061796d656e7420436f6e74726163742061646472657373206360448201527f616e6e6f742062652030783000000000000000000000000000000000000000006064820152608401610a58565b6001600160a01b038216611cfe5760405162461bcd60e51b815260206004820152602c60248201527f536c6f74204d6f64696669657220436f6e74726163742061646472657373206360448201527f616e6e6f742062652030783000000000000000000000000000000000000000006064820152608401610a58565b8751611d119060159060208b0190614048565b50600d879055600e869055600f8590556011849055601280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0385161790557faf21a35748f3364e882e31110ebb5508ff8d81347619175f3892e873da14d69633604080516001600160a01b039283168152606060208201819052600c908201527f54726169745061796d656e74000000000000000000000000000000000000000060808201529186169082015260a00160405180910390a1601380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384161790557faf21a35748f3364e882e31110ebb5508ff8d81347619175f3892e873da14d69633604080516001600160a01b039283168152606060208201819052600c908201527f536c6f744d6f646966696572000000000000000000000000000000000000000060808201529185169082015260a00160405180910390a18015611eaf57600c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b5050505050505050565b6002600b541415611f0c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a58565b6002600b55600a5460ff1615611f645760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a58565b601054811115611fdc5760405162461bcd60e51b815260206004820152602c60248201527f546869732077696c6c2065786365656420746865206d6178696d756d2063686160448201527f72616374657220626f6f737400000000000000000000000000000000000000006064820152608401610a58565b33611fe68461165d565b6001600160a01b0316146120625760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c7920746865206f776e65722063616e20626f6f7374207468697320636860448201527f61726163746572732074726169747300000000000000000000000000000000006064820152608401610a58565b80601154612070919061462a565b6012546001600160a01b03166370a08231336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b1580156120d957600080fd5b505afa1580156120ed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612111919061444d565b10156121855760405162461bcd60e51b815260206004820152602a60248201527f42616c616e636520746f6f206c6f7720746f2070617920666f7220636861726160448201527f6374657220626f6f7374000000000000000000000000000000000000000000006064820152608401610a58565b60008381526017602052604081205461219f9083906145fe565b90506010548111156122195760405162461bcd60e51b815260206004820152602e60248201527f546869732077696c6c20657863656564207468652072656d61696e696e67206360448201527f686172616374657220626f6f73740000000000000000000000000000000000006064820152608401610a58565b60008481526016602052604081209060018514156122c55783826001015461224191906145fe565b9050606481106122b95760405162461bcd60e51b815260206004820152602860248201527f546869732077696c6c2065786365656420746865206d6178696d756d2074726160448201527f697420626f6f73740000000000000000000000000000000000000000000000006064820152608401610a58565b60018201819055612535565b8460021415612362578382600201546122de91906145fe565b9050606481106123565760405162461bcd60e51b815260206004820152602860248201527f546869732077696c6c2065786365656420746865206d6178696d756d2074726160448201527f697420626f6f73740000000000000000000000000000000000000000000000006064820152608401610a58565b60028201819055612535565b84600314156123ff5783826003015461237b91906145fe565b9050606481106123f35760405162461bcd60e51b815260206004820152602860248201527f546869732077696c6c2065786365656420746865206d6178696d756d2074726160448201527f697420626f6f73740000000000000000000000000000000000000000000000006064820152608401610a58565b60038201819055612535565b846004141561249c5783826004015461241891906145fe565b9050606481106124905760405162461bcd60e51b815260206004820152602860248201527f546869732077696c6c2065786365656420746865206d6178696d756d2074726160448201527f697420626f6f73740000000000000000000000000000000000000000000000006064820152608401610a58565b60048201819055612535565b8460051415612535578382600501546124b591906145fe565b90506064811061252d5760405162461bcd60e51b815260206004820152602860248201527f546869732077696c6c2065786365656420746865206d6178696d756d2074726160448201527f697420626f6f73740000000000000000000000000000000000000000000000006064820152608401610a58565b600582018190555b60008681526017602052604090208390557f4c6441e90f72e3ab51e73b999e05eff1162c5b0061bf752159c3ccdc1bd61fff3387878788601154612579919061462a565b604080516001600160a01b0390961686526020860194909452928401919091526060830152608082015260a00160405180910390a16012546001600160a01b03166323b872dd3330876011546125cf919061462a565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b15801561263657600080fd5b505af115801561264a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266e919061432b565b6126ba5760405162461bcd60e51b815260206004820152601460248201527f426f6f7374207061796d656e74206661696c65640000000000000000000000006044820152606401610a58565b50506001600b5550505050565b6126d13383612f7d565b6127435760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610a58565b61274f84848484613511565b50505050565b606060006127628361359a565b905080604051602001612775919061452a565b604051602081830303815290604052915050919050565b6002600b5414156127df5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a58565b6002600b55600a546001600160a01b036101009091041633146128445760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b600d548111156128965760405162461bcd60e51b815260206004820152601760248201527f4578636565647320726573657276656420737570706c790000000000000000006044820152606401610a58565b80600d60008282546128a89190614667565b909155505060085460005b828110156128f1576000826128c7816146e5565b935090506128d481613275565b6128de8582613399565b50806128e9816146e5565b9150506128b3565b50506001600b555050565b600a546001600160a01b0361010090910416331461295c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b601055565b6002600b5414156129b45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a58565b6002600b55600a5460ff1615612a0c5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a58565b6000838152600260205260409020546001600160a01b0316612a965760405162461bcd60e51b815260206004820152602360248201527f5468697320436f6c6c65637469626c65206861736e2774206265656e206d696e60448201527f74656400000000000000000000000000000000000000000000000000000000006064820152608401610a58565b33612aa08461165d565b6001600160a01b031614612b1c5760405162461bcd60e51b815260206004820152603660248201527f4f6e6c7920746865206f776e6572206f66207468697320436f6c6c656374696260448201527f6c652063616e2073657420746865207365676d656e74000000000000000000006064820152608401610a58565b60008381526018602052604090206001831415612b3b57818155612bca565b8260021415612b505760018101829055612bca565b8260031415612b655760028101829055612bca565b8260041415612b7a5760038101829055612bca565b8260051415612b8f5760048101829055612bca565b8260061415612ba45760058101829055612bca565b8260071415612bb95760068101829055612bca565b8260081415612bca57600781018290555b7fb107788adf9bc5dbb6c91dcf3fb122cb4da04025251ca2785055dfe6ef7f44f13361114a565b600a546001600160a01b03610100909104163314612c515760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b6001600160a01b038116612ccd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a58565b610c1c816133b3565b600a546001600160a01b03610100909104163314612d365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a58565b600f91909155601155565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000148061093a575061093a82613673565b600081815260046020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091558190612de48261165d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600a5460ff16612e6f5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610a58565b600a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600a5460ff1615612f2a5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a58565b600a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612eba3390565b6000818152600260205260408120546001600160a01b03166130075760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610a58565b60006130128361165d565b9050806001600160a01b0316846001600160a01b0316148061304d5750836001600160a01b0316613042846109d2565b6001600160a01b0316145b8061307d57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166130988261165d565b6001600160a01b0316146131145760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610a58565b6001600160a01b03821661318f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a58565b61319a838383613756565b6131a5600082612d97565b6001600160a01b03831660009081526003602052604081208054600192906131ce908490614667565b90915550506001600160a01b03821660009081526003602052604081208054600192906131fc9084906145fe565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000818152600260205260409020546001600160a01b0316156133005760405162461bcd60e51b815260206004820152602160248201527f5472616974732063616e2062652067656e657261746564206f6e6c79206f6e6360448201527f65000000000000000000000000000000000000000000000000000000000000006064820152608401610a58565b60008181526016602052604090206133196050336137b4565b6133249060146145fe565b60018201556133346050336137b4565b61333f9060146145fe565b600282015561334f6050336137b4565b61335a9060146145fe565b600382015561336a6050336137b4565b6133759060146145fe565b60048201556133856050336137b4565b6133909060146145fe565b60059091015550565b610e3982826040518060200160405280600081525061383b565b600a80546001600160a01b038381166101008181027fffffffffffffffffffffff0000000000000000000000000000000000000000ff85161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156134865760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a58565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61351c848484613085565b613528848484846138c4565b61274f5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a58565b6000818152600260205260409020546060906001600160a01b03166136275760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610a58565b6000613631613a8f565b90506000815111613651576040518060200160405280600081525061366c565b8061365b84613a9e565b6040516020016127759291906144fb565b9392505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061370657507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061093a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461093a565b600a5460ff16156137a95760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a58565b610baa838383613bec565b60148054600091826137c5836146e5565b91905055508242836014546040516020016138189392919092835260609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166020830152603482015260540190565b6040516020818303038152906040528051906020012060001c61366c919061471e565b6138458383613c70565b61385260008484846138c4565b610baa5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a58565b60006001600160a01b0384163b15613a84576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a029061392190339089908890889060040161456b565b602060405180830381600087803b15801561393b57600080fd5b505af1925050508015613989575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261398691810190614363565b60015b613a39573d8080156139b7576040519150601f19603f3d011682016040523d82523d6000602084013e6139bc565b606091505b508051613a315760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a58565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a020000000000000000000000000000000000000000000000000000000014905061307d565b506001949350505050565b60606015805461094f906146aa565b606081613ade57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613b085780613af2816146e5565b9150613b019050600a83614616565b9150613ae2565b60008167ffffffffffffffff811115613b3157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613b5b576020820181803683370190505b5090505b841561307d57613b70600183614667565b9150613b7d600a8661471e565b613b889060306145fe565b60f81b818381518110613bab57634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613be5600a86614616565b9450613b5f565b613bf7838383613dd6565b600a5460ff1615610baa5760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201527f68696c65207061757365640000000000000000000000000000000000000000006064820152608401610a58565b6001600160a01b038216613cc65760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a58565b6000818152600260205260409020546001600160a01b031615613d2b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a58565b613d3760008383613756565b6001600160a01b0382166000908152600360205260408120805460019290613d609084906145fe565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b038316613e3157613e2c81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613e54565b816001600160a01b0316836001600160a01b031614613e5457613e548382613e8e565b6001600160a01b038216613e6b57610baa81613f2b565b826001600160a01b0316826001600160a01b031614610baa57610baa8282614004565b60006001613e9b84611776565b613ea59190614667565b600083815260076020526040902054909150808214613ef8576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090613f3d90600190614667565b60008381526009602052604081205460088054939450909284908110613f7357634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508060088381548110613fa257634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480613fe857634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061400f83611776565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b828054614054906146aa565b90600052602060002090601f01602090048101928261407657600085556140bc565b82601f1061408f57805160ff19168380011785556140bc565b828001600101855582156140bc579182015b828111156140bc5782518255916020019190600101906140a1565b506140c89291506140cc565b5090565b5b808211156140c857600081556001016140cd565b600067ffffffffffffffff808411156140fc576140fc61475e565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156141425761414261475e565b8160405280935085815286868601111561415b57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461418c57600080fd5b919050565b600082601f8301126141a1578081fd5b61366c838335602085016140e1565b6000602082840312156141c1578081fd5b61366c82614175565b600080604083850312156141dc578081fd5b6141e583614175565b91506141f360208401614175565b90509250929050565b600080600060608486031215614210578081fd5b61421984614175565b925061422760208501614175565b9150604084013590509250925092565b6000806000806080858703121561424c578081fd5b61425585614175565b935061426360208601614175565b925060408501359150606085013567ffffffffffffffff811115614285578182fd5b8501601f81018713614295578182fd5b6142a4878235602084016140e1565b91505092959194509250565b600080604083850312156142c2578182fd5b6142cb83614175565b915060208301356142db81614774565b809150509250929050565b600080604083850312156142f8578182fd5b61430183614175565b946020939093013593505050565b600060208284031215614320578081fd5b813561366c81614774565b60006020828403121561433c578081fd5b815161366c81614774565b600060208284031215614358578081fd5b813561366c81614782565b600060208284031215614374578081fd5b815161366c81614782565b600060208284031215614390578081fd5b813567ffffffffffffffff8111156143a6578182fd5b61307d84828501614191565b600080600080600080600060e0888a0312156143cc578283fd5b873567ffffffffffffffff8111156143e2578384fd5b6143ee8a828b01614191565b9750506020880135955060408801359450606088013593506080880135925061441960a08901614175565b915061442760c08901614175565b905092959891949750929550565b600060208284031215614446578081fd5b5035919050565b60006020828403121561445e578081fd5b5051919050565b60008060408385031215614477578182fd5b50508035926020909101359150565b60008060006060848603121561449a578081fd5b505081359360208301359350604090920135919050565b600081518084526144c981602086016020860161467e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000835161450d81846020880161467e565b83519083019061452181836020880161467e565b01949350505050565b6000825161453c81846020870161467e565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000920191825250600501919050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261459d60808301846144b1565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156145df578351835292840192918401916001016145c3565b50909695505050505050565b60208152600061366c60208301846144b1565b6000821982111561461157614611614732565b500190565b60008261462557614625614748565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561466257614662614732565b500290565b60008282101561467957614679614732565b500390565b60005b83811015614699578181015183820152602001614681565b8381111561274f5750506000910152565b600181811c908216806146be57607f821691505b602082108114156146df57634e487b7160e01b600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561471757614717614732565b5060010190565b60008261472d5761472d614748565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610c1c57600080fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610c1c57600080fdfea26469706673582212208099778beb0e41cf58383b30473d0daf2e164f28f3369b5dcb49a2de384e1c2d64736f6c63430008040033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|