ERC-721
Overview
Max Total Supply
1,320 DNA
Holders
308
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
7 DNALoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
DNAChip
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "./AnonymiceLibrary.sol"; import "./RedactedLibrary.sol"; import "./Interfaces.sol"; contract DNAChip is ERC721Enumerable, Ownable { using Counters for Counters.Counter; using AnonymiceLibrary for uint8; uint256 public constant MAX_SUPPLY = 2000; uint8 public constant BASE_INDEX = 0; uint8 public constant EARRINGS_INDEX = 1; uint8 public constant EYES_INDEX = 2; uint8 public constant HATS_INDEX = 3; uint8 public constant MOUTHS_INDEX = 4; uint8 public constant NECKS_INDEX = 5; uint8 public constant NOSES_INDEX = 6; uint8 public constant WHISKERS_INDEX = 7; struct Traits { uint8 base; uint8 earrings; uint8 eyes; uint8 hats; uint8 mouths; uint8 necks; uint8 noses; uint8 whiskers; } uint16[] public BASE; mapping(uint8 => uint16[][8]) private _traitsByBase; address public breedingAddress; address public podFragmentAddress; address public cheethAddress; address public descriptorAddress; uint256 public seedNonce = 0; uint256 public dnaRolls; bool public isMintEnabled; mapping(uint256 => bool) public usedEvolutionPods; mapping(uint256 => bool) public isEvolutionPod; mapping(uint256 => uint256) public breedingIdToEvolutionPod; mapping(uint256 => uint256) public evolutionPodToBreedingId; mapping(uint256 => uint256) public tokenIdToTraits; Counters.Counter private _tokenIdCounter; constructor() ERC721("DNAChip", "DNA") { // Freak, Robot, Druid, Skele, Alien BASE = [387, 387, 100, 100, 26]; _traitsByBase[0][BASE_INDEX] = [387, 387, 100, 100, 26]; _traitsByBase[1][BASE_INDEX] = [387, 387, 100, 100, 26]; _traitsByBase[2][BASE_INDEX] = [387, 387, 100, 100, 26]; _traitsByBase[3][BASE_INDEX] = [387, 387, 100, 100, 26]; _traitsByBase[4][BASE_INDEX] = [387, 387, 100, 100, 26]; _traitsByBase[0][EARRINGS_INDEX] = [900, 80, 20]; _traitsByBase[1][EARRINGS_INDEX] = [900, 80, 20]; _traitsByBase[2][EARRINGS_INDEX] = [750, 200, 50]; _traitsByBase[3][EARRINGS_INDEX] = [750, 200, 50]; _traitsByBase[4][EARRINGS_INDEX] = [600, 300, 100]; _traitsByBase[0][EYES_INDEX] = [320, 320, 100, 70, 70, 50, 50, 20]; _traitsByBase[1][EYES_INDEX] = [320, 320, 100, 70, 70, 50, 50, 20]; _traitsByBase[2][EYES_INDEX] = [255, 255, 120, 90, 90, 70, 70, 50]; _traitsByBase[3][EYES_INDEX] = [255, 255, 120, 90, 90, 70, 70, 50]; _traitsByBase[4][EYES_INDEX] = [170, 170, 140, 120, 120, 100, 100, 80]; _traitsByBase[0][HATS_INDEX] = [320, 125, 125, 110, 110, 65, 65, 40, 25, 15]; _traitsByBase[1][HATS_INDEX] = [320, 125, 125, 110, 110, 65, 65, 40, 25, 15]; _traitsByBase[2][HATS_INDEX] = [260, 140, 140, 100, 100, 60, 60, 50, 50, 40]; _traitsByBase[3][HATS_INDEX] = [260, 140, 140, 100, 100, 60, 60, 50, 50, 40]; _traitsByBase[4][HATS_INDEX] = [175, 110, 110, 100, 100, 90, 90, 90, 75, 60]; _traitsByBase[0][MOUTHS_INDEX] = [150, 150, 150, 150, 150, 150, 100]; _traitsByBase[1][MOUTHS_INDEX] = [150, 150, 150, 150, 150, 150, 100]; _traitsByBase[2][MOUTHS_INDEX] = [150, 150, 150, 150, 150, 150, 100]; _traitsByBase[3][MOUTHS_INDEX] = [150, 150, 150, 150, 150, 150, 100]; _traitsByBase[4][MOUTHS_INDEX] = [150, 150, 150, 150, 150, 150, 100]; _traitsByBase[0][NECKS_INDEX] = [720, 200, 80]; _traitsByBase[1][NECKS_INDEX] = [720, 200, 80]; _traitsByBase[2][NECKS_INDEX] = [630, 250, 120]; _traitsByBase[3][NECKS_INDEX] = [630, 250, 120]; _traitsByBase[4][NECKS_INDEX] = [550, 300, 150]; _traitsByBase[0][NOSES_INDEX] = [200, 200, 200, 200, 200]; _traitsByBase[1][NOSES_INDEX] = [200, 200, 200, 200, 200]; _traitsByBase[2][NOSES_INDEX] = [200, 200, 200, 200, 200]; _traitsByBase[3][NOSES_INDEX] = [200, 200, 200, 200, 200]; _traitsByBase[4][NOSES_INDEX] = [200, 200, 200, 200, 200]; _traitsByBase[0][WHISKERS_INDEX] = [220, 220, 220, 220, 120]; _traitsByBase[1][WHISKERS_INDEX] = [220, 220, 220, 220, 120]; _traitsByBase[2][WHISKERS_INDEX] = [220, 220, 220, 220, 120]; _traitsByBase[3][WHISKERS_INDEX] = [220, 220, 220, 220, 120]; _traitsByBase[4][WHISKERS_INDEX] = [220, 220, 220, 220, 120]; } function mint() external { require(!AnonymiceLibrary.isContract(msg.sender), "no cheaters"); require(isMintEnabled, "mint not enabled"); require(dnaRolls < MAX_SUPPLY, "max supply"); ERC20Burnable(cheethAddress).transferFrom(msg.sender, address(this), getPrice()); _tokenIdCounter.increment(); uint256 tokenId = _tokenIdCounter.current(); _randomizeChip(tokenId); _safeMint(msg.sender, tokenId); } function reroll(uint256 tokenId) external { require(!AnonymiceLibrary.isContract(msg.sender), "no cheaters"); require(dnaRolls < MAX_SUPPLY, "max supply"); require(msg.sender == ownerOf(tokenId), "not allowed"); _randomizeChip(tokenId); } function assembleEvolutionPod(uint256 tokenId) external { require(!AnonymiceLibrary.isContract(msg.sender), "no cheaters"); require(msg.sender == ownerOf(tokenId), "not allowed"); require(!isEvolutionPod[tokenId], "already assembled"); isEvolutionPod[tokenId] = true; ERC1155Burnable(podFragmentAddress).burn(msg.sender, 1, 3); } function evolveBreedingMouse(uint256 tokenId, uint256 breedingMouseId) external { require(!AnonymiceLibrary.isContract(msg.sender), "no cheaters"); require(isEvolutionPod[tokenId], "not assembled"); require(!usedEvolutionPods[tokenId], "already used"); require(msg.sender == ownerOf(tokenId), "not allowed"); require(IERC721Enumerable(breedingAddress).ownerOf(breedingMouseId) == msg.sender, "not allowed"); breedingIdToEvolutionPod[breedingMouseId] = tokenId; evolutionPodToBreedingId[tokenId] = breedingMouseId; usedEvolutionPods[tokenId] = true; _burn(tokenId); } // GETTERS function getPrice() public pure returns (uint256) { return 1000 ether; } function tokenURI(uint256 _tokenId) public view override returns (string memory) { return IDescriptor(descriptorAddress).tokenURI(_tokenId); } function getTraitsRepresentation(uint256 _tokenId) public view returns (uint256) { return tokenIdToTraits[_tokenId]; } function getTraits(uint256 _tokenId) public view returns (RedactedLibrary.Traits memory) { return RedactedLibrary.representationToTraits(tokenIdToTraits[_tokenId]); } function getTraitsArray(uint256 _tokenId) public view returns (uint8[8] memory) { return RedactedLibrary.representationToTraitsArray(tokenIdToTraits[_tokenId]); } // OWNER FUNCTIONS function setAddresses( address _podFragmentAddress, address _breedingAddress, address _cheethAddress, address _descriptorAddress ) external onlyOwner { podFragmentAddress = _podFragmentAddress; breedingAddress = _breedingAddress; cheethAddress = _cheethAddress; descriptorAddress = _descriptorAddress; } function withdraw(address to) external onlyOwner { ERC20Burnable(cheethAddress).transfer(to, ERC20Burnable(cheethAddress).balanceOf(address(this))); } function setIsMintEnabled(bool value) external onlyOwner { isMintEnabled = value; } // PRIVATE FUNCTIONS function _randomizeChip(uint256 tokenId) internal { require(!isEvolutionPod[tokenId], "already assembled"); dnaRolls++; tokenIdToTraits[tokenId] = RedactedLibrary.traitsToRepresentation(_generateTraits(tokenId)); } function _rarityGen(uint256 _randinput, uint16[] memory _percentages) internal pure returns (uint8) { uint16 currentLowerBound = 0; for (uint8 i = 0; i < _percentages.length; i++) { uint16 thisPercentage = _percentages[i]; if (_randinput >= currentLowerBound && _randinput < currentLowerBound + thisPercentage) return i; currentLowerBound = currentLowerBound + thisPercentage; } revert("rarity gen failed"); } function _getRandomNumber(uint256 _tokenId, uint256 limit) internal returns (uint256) { seedNonce++; return uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty, _tokenId, msg.sender, seedNonce))) % limit; } function _generateTraits(uint256 tokenId) internal returns (RedactedLibrary.Traits memory traits) { uint8 base = _rarityGen(_getRandomNumber(tokenId, 1000), BASE); uint16[][8] memory traitProbabilites = _traitsByBase[base]; traits.base = base; traits.earrings = _rarityGen(_getRandomNumber(tokenId, 1000), traitProbabilites[EARRINGS_INDEX]); traits.eyes = _rarityGen(_getRandomNumber(tokenId, 1000), traitProbabilites[EYES_INDEX]); traits.hats = _rarityGen(_getRandomNumber(tokenId, 1000), traitProbabilites[HATS_INDEX]); traits.mouths = _rarityGen(_getRandomNumber(tokenId, 1000), traitProbabilites[MOUTHS_INDEX]); traits.necks = _rarityGen(_getRandomNumber(tokenId, 1000), traitProbabilites[NECKS_INDEX]); traits.noses = _rarityGen(_getRandomNumber(tokenId, 1000), traitProbabilites[NOSES_INDEX]); traits.whiskers = _rarityGen(_getRandomNumber(tokenId, 1000), traitProbabilites[WHISKERS_INDEX]); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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.1 (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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155Burnable is ERC1155 { function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burnBatch(account, ids, values); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/ERC20Burnable.sol) pragma solidity ^0.8.0; import "../ERC20.sol"; import "../../../utils/Context.sol"; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { uint256 currentAllowance = allowance(account, _msgSender()); require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance"); unchecked { _approve(account, _msgSender(), currentAllowance - amount); } _burn(account, amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library AnonymiceLibrary { string internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; function encode(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ""; // load the table into memory string memory table = TABLE; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((data.length + 2) / 3); // add some extra buffer at the end required for the writing string memory result = new string(encodedLen + 32); assembly { // set the actual output length mstore(result, encodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 3 bytes at a time for { } lt(dataPtr, endPtr) { } { dataPtr := add(dataPtr, 3) // read 3 bytes let input := mload(dataPtr) // write 4 characters mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(6, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(input, 0x3F)))) ) resultPtr := add(resultPtr, 1) } // padding with '=' switch mod(mload(data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { 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); } function parseInt(string memory _a) internal pure returns (uint8 _parsedInt) { bytes memory bresult = bytes(_a); uint8 mint = 0; for (uint8 i = 0; i < bresult.length; i++) { if ( (uint8(uint8(bresult[i])) >= 48) && (uint8(uint8(bresult[i])) <= 57) ) { mint *= 10; mint += uint8(bresult[i]) - 48; } } return mint; } function substring( string memory str, uint256 startIndex, uint256 endIndex ) internal pure returns (string memory) { bytes memory strBytes = bytes(str); bytes memory result = new bytes(endIndex - startIndex); for (uint256 i = startIndex; i < endIndex; i++) { result[i - startIndex] = strBytes[i]; } return string(result); } 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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; library RedactedLibrary { struct Traits { uint256 base; uint256 earrings; uint256 eyes; uint256 hats; uint256 mouths; uint256 necks; uint256 noses; uint256 whiskers; } struct TightTraits { uint8 base; uint8 earrings; uint8 eyes; uint8 hats; uint8 mouths; uint8 necks; uint8 noses; uint8 whiskers; } function traitsToRepresentation(Traits memory traits) internal pure returns (uint256) { uint256 representation = uint256(traits.base); representation |= traits.earrings << 8; representation |= traits.eyes << 16; representation |= traits.hats << 24; representation |= traits.mouths << 32; representation |= traits.necks << 40; representation |= traits.noses << 48; representation |= traits.whiskers << 56; return representation; } function representationToTraits(uint256 representation) internal pure returns (Traits memory traits) { traits.base = uint8(representation); traits.earrings = uint8(representation >> 8); traits.eyes = uint8(representation >> 16); traits.hats = uint8(representation >> 24); traits.mouths = uint8(representation >> 32); traits.necks = uint8(representation >> 40); traits.noses = uint8(representation >> 48); traits.whiskers = uint8(representation >> 56); } function representationToTraitsArray(uint256 representation) internal pure returns (uint8[8] memory traitsArray) { traitsArray[0] = uint8(representation); // base traitsArray[1] = uint8(representation >> 8); // earrings traitsArray[2] = uint8(representation >> 16); // eyes traitsArray[3] = uint8(representation >> 24); // hats traitsArray[4] = uint8(representation >> 32); // mouths traitsArray[5] = uint8(representation >> 40); // necks traitsArray[6] = uint8(representation >> 48); // noses traitsArray[7] = uint8(representation >> 56); // whiskers } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; interface RewardLike { function mintMany(address to, uint256 amount) external; } interface IDNAChip is RewardLike { function tokenIdToTraits(uint256 tokenId) external view returns (uint256); function isEvolutionPod(uint256 tokenId) external view returns (bool); function breedingIdToEvolutionPod(uint256 tokenId) external view returns (uint256); } interface IDescriptor { function tokenURI(uint256 _tokenId) external view returns (string memory); function tokenBreedingURI(uint256 _tokenId, uint256 _breedingId) external view returns (string memory); } interface IEvolutionTraits { function getDNAChipSVG(uint256 base) external view returns (string memory); function getEvolutionPodImageTag(uint256 base) external view returns (string memory); function getTraitsImageTags(uint8[8] memory traits) external view returns (string memory); function getMetadata(uint8[8] memory traits) external view returns (string memory); } interface IERC721Like { function transferFrom( address from, address to, uint256 id ) external; function transfer(address to, uint256 id) external; function ownerOf(uint256 id) external returns (address owner); function mint(address to, uint256 tokenid) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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.1 (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.1 (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.1 (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.1 (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.1 (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.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); } /** * @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, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector). @param operator The address which initiated the transfer (i.e. msg.sender) @param from The address which previously owned the token @param id The ID of the token being transferred @param value The amount of tokens being transferred @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector). @param operator The address which initiated the batch transfer (i.e. msg.sender) @param from The address which previously owned the token @param ids An array containing ids of each token being transferred (order and length must match values array) @param values An array containing amounts of each token being transferred (order and length must match ids array) @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens 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 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"BASE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BASE_INDEX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EARRINGS_INDEX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EYES_INDEX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HATS_INDEX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MOUTHS_INDEX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NECKS_INDEX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NOSES_INDEX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHISKERS_INDEX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"assembleEvolutionPod","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":"breedingAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"breedingIdToEvolutionPod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cheethAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"descriptorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dnaRolls","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"evolutionPodToBreedingId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"breedingMouseId","type":"uint256"}],"name":"evolveBreedingMouse","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTraits","outputs":[{"components":[{"internalType":"uint256","name":"base","type":"uint256"},{"internalType":"uint256","name":"earrings","type":"uint256"},{"internalType":"uint256","name":"eyes","type":"uint256"},{"internalType":"uint256","name":"hats","type":"uint256"},{"internalType":"uint256","name":"mouths","type":"uint256"},{"internalType":"uint256","name":"necks","type":"uint256"},{"internalType":"uint256","name":"noses","type":"uint256"},{"internalType":"uint256","name":"whiskers","type":"uint256"}],"internalType":"struct RedactedLibrary.Traits","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTraitsArray","outputs":[{"internalType":"uint8[8]","name":"","type":"uint8[8]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTraitsRepresentation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isEvolutionPod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMintEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"nonpayable","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":"podFragmentAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"reroll","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":[],"name":"seedNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_podFragmentAddress","type":"address"},{"internalType":"address","name":"_breedingAddress","type":"address"},{"internalType":"address","name":"_cheethAddress","type":"address"},{"internalType":"address","name":"_descriptorAddress","type":"address"}],"name":"setAddresses","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":"bool","name":"value","type":"bool"}],"name":"setIsMintEnabled","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":"uint256","name":"","type":"uint256"}],"name":"tokenIdToTraits","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":[{"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":"uint256","name":"","type":"uint256"}],"name":"usedEvolutionPods","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405260006011553480156200001657600080fd5b5060408051808201825260078152660444e41436869760cc1b602080830191825283518085019094526003845262444e4160e81b90840152815191929162000061916000916200121f565b508051620000779060019060208401906200121f565b505050620000946200008e620011c960201b60201c565b620011cd565b6040805160a081018252610183808252602082015260649181018290526060810191909152601a6080820152620000d090600b906005620012ae565b506040805160a08101825261018380825260208083019190915260649282018390526060820192909252601a608082015260008052600c90915262000139907f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116e8906005620012ae565b506040805160a08101825261018380825260208083019190915260649282018390526060820192909252601a60808201526001600052600c909152620001a3907fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b5c906005620012ae565b506040805160a08101825261018380825260208083019190915260649282018390526060820192909252601a60808201526002600052600c9091526200020d907f5d6016397a73f5e079297ac5a36fef17b4d9c3831618e63ab105738020ddd720906005620012ae565b506040805160a08101825261018380825260208083019190915260649282018390526060820192909252601a60808201526003600052600c90915262000277907fc0da782485e77ae272268ae0a3ff44c1552ecb60b3743924de17a815e0a3cfd7906005620012ae565b506040805160a08101825261018380825260208083019190915260649282018390526060820192909252601a60808201526004600052600c909152620002e1907f5b84bb9e0f5aa9cc45a8bb66468db5d4816d1e75ff86b5e1f1dd8d144dab8097906005620012ae565b50604080516060810182526103848152605060208083019190915260149282019290925260008052600c9091526200033d907f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116e9906003620012ae565b5060408051606081018252610384815260506020808301919091526014928201929092526001600052600c9091526200039a907fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b5d906003620012ae565b50604080516060810182526102ee815260c86020808301919091526032928201929092526002600052600c909152620003f7907f5d6016397a73f5e079297ac5a36fef17b4d9c3831618e63ab105738020ddd721906003620012ae565b50604080516060810182526102ee815260c860208083019190915260329282019290925260036000819052600c90925262000455917fc0da782485e77ae272268ae0a3ff44c1552ecb60b3743924de17a815e0a3cfd89190620012ae565b5060408051606081018252610258815261012c6020808301919091526064928201929092526004600052600c909152620004b3907f5b84bb9e0f5aa9cc45a8bb66468db5d4816d1e75ff86b5e1f1dd8d144dab8098906003620012ae565b5060408051610100810182526101408082526020808301919091526064928201929092526046606082018190526080820152603260a0820181905260c0820152601460e082015260008052600c90915262000532907f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116ea906008620012ae565b5060408051610100810182526101408082526020808301919091526064928201929092526046606082018190526080820152603260a0820181905260c0820152601460e08201526001600052600c909152620005b2907fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b5e906008620012ae565b50604080516101008101825260ff808252602080830191909152607892820192909252605a606082018190526080820152604660a0820181905260c0820152603260e08201526002600052600c90915262000631907f5d6016397a73f5e079297ac5a36fef17b4d9c3831618e63ab105738020ddd72290600862001359565b50604080516101008101825260ff808252602080830191909152607892820192909252605a606082018190526080820152604660a0820181905260c0820152603260e08201526003600052600c909152620006b0907fc0da782485e77ae272268ae0a3ff44c1552ecb60b3743924de17a815e0a3cfd990600862001359565b50604080516101008101825260aa808252602080830191909152608c928201929092526078606082018190526080820152606460a0820181905260c0820152605060e08201526004600052600c9091526200072f907f5b84bb9e0f5aa9cc45a8bb66468db5d4816d1e75ff86b5e1f1dd8d144dab809990600862001359565b506040805161014080820183528152607d602080830182905292820152606e606082018190526080820152604160a0820181905260c0820152602860e08201526019610100820152600f61012082015260008052600c909152620007b7907f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116eb90600a620012ae565b506040805161014080820183528152607d602080830182905292820152606e606082018190526080820152604160a0820181905260c0820152602860e08201526019610100820152600f6101208201526001600052600c90915262000840907fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b5f90600a620012ae565b5060408051610140810182526101048152608c6020808301829052928201526064606082018190526080820152603c60a0820181905260c0820152603260e0820181905261010082015260286101208201526002600052600c909152620008cb907f5d6016397a73f5e079297ac5a36fef17b4d9c3831618e63ab105738020ddd72390600a620012ae565b5060408051610140810182526101048152608c6020808301829052928201526064606082018190526080820152603c60a0820181905260c0820152603260e0820181905261010082015260286101208201526003600052600c90915262000956907fc0da782485e77ae272268ae0a3ff44c1552ecb60b3743924de17a815e0a3cfda90600a620012ae565b50604080516101408101825260af8152606e6020808301829052928201526064606082018190526080820152605a60a0820181905260c0820181905260e0820152604b610100820152603c6101208201526004600052600c909152620009e0907f5b84bb9e0f5aa9cc45a8bb66468db5d4816d1e75ff86b5e1f1dd8d144dab809a90600a62001359565b506040805160e08101825260968082526020808301829052928201819052606082018190526080820181905260a0820152606460c082015260008052600c90915262000a50907f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116ec90600762001359565b506040805160e08101825260968082526020808301829052928201819052606082018190526080820181905260a0820152606460c08201526001600052600c90915262000ac1907fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b6090600762001359565b506040805160e08101825260968082526020808301829052928201819052606082018190526080820181905260a0820152606460c08201526002600052600c90915262000b32907f5d6016397a73f5e079297ac5a36fef17b4d9c3831618e63ab105738020ddd72490600762001359565b506040805160e08101825260968082526020808301829052928201819052606082018190526080820181905260a0820152606460c08201526003600052600c90915262000ba3907fc0da782485e77ae272268ae0a3ff44c1552ecb60b3743924de17a815e0a3cfdb90600762001359565b506040805160e08101825260968082526020808301829052928201819052606082018190526080820181905260a0820152606460c08201526004600052600c90915262000c14907f5b84bb9e0f5aa9cc45a8bb66468db5d4816d1e75ff86b5e1f1dd8d144dab809b90600762001359565b50604080516060810182526102d0815260c860208083019190915260509282019290925260008052600c90915262000c70907f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116ed906003620012ae565b50604080516060810182526102d0815260c86020808301919091526050928201929092526001600052600c90915262000ccd907fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b61906003620012ae565b5060408051606081018252610276815260fa6020808301919091526078928201929092526002600052600c90915262000d2a907f5d6016397a73f5e079297ac5a36fef17b4d9c3831618e63ab105738020ddd725906003620012ae565b5060408051606081018252610276815260fa60208083019190915260789282019290925260036000819052600c90925262000d88917fc0da782485e77ae272268ae0a3ff44c1552ecb60b3743924de17a815e0a3cfdc9190620012ae565b5060408051606081018252610226815261012c6020808301919091526096928201929092526004600052600c90915262000de6907f5b84bb9e0f5aa9cc45a8bb66468db5d4816d1e75ff86b5e1f1dd8d144dab809c906003620012ae565b506040805160a08101825260c8808252602080830182905292820181905260608201819052608082015260008052600c90915262000e48907f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116ee90600562001359565b506040805160a08101825260c880825260208083018290529282018190526060820181905260808201526001600052600c90915262000eab907fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b6290600562001359565b506040805160a08101825260c880825260208083018290529282018190526060820181905260808201526002600052600c90915262000f0e907f5d6016397a73f5e079297ac5a36fef17b4d9c3831618e63ab105738020ddd72690600562001359565b506040805160a08101825260c880825260208083018290529282018190526060820181905260808201526003600052600c90915262000f71907fc0da782485e77ae272268ae0a3ff44c1552ecb60b3743924de17a815e0a3cfdd90600562001359565b506040805160a08101825260c880825260208083018290529282018190526060820181905260808201526004600052600c90915262000fd4907f5b84bb9e0f5aa9cc45a8bb66468db5d4816d1e75ff86b5e1f1dd8d144dab809d90600562001359565b506040805160a08101825260dc808252602080830182905292820181905260608201526078608082015260008052600c90915262001036907f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116ef90600562001359565b506040805160a08101825260dc80825260208083018290529282018190526060820152607860808201526001600052600c90915262001099907fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b6390600562001359565b506040805160a08101825260dc80825260208083018290529282018190526060820152607860808201526002600052600c909152620010fc907f5d6016397a73f5e079297ac5a36fef17b4d9c3831618e63ab105738020ddd72790600562001359565b506040805160a08101825260dc80825260208083018290529282018190526060820152607860808201526003600052600c9091526200115f907fc0da782485e77ae272268ae0a3ff44c1552ecb60b3743924de17a815e0a3cfde90600562001359565b506040805160a08101825260dc80825260208083018290529282018190526060820152607860808201526004600052600c909152620011c2907f5b84bb9e0f5aa9cc45a8bb66468db5d4816d1e75ff86b5e1f1dd8d144dab809e90600562001359565b5062001418565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200122d90620013db565b90600052602060002090601f0160209004810192826200125157600085556200129c565b82601f106200126c57805160ff19168380011785556200129c565b828001600101855582156200129c579182015b828111156200129c5782518255916020019190600101906200127f565b50620012aa929150620013c4565b5090565b82805482825590600052602060002090600f016010900481019282156200129c5791602002820160005b838211156200131a57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302620012d8565b80156200134a5782816101000a81549061ffff02191690556002016020816001010492830192600103026200131a565b5050620012aa929150620013c4565b82805482825590600052602060002090600f016010900481019282156200129c5791602002820160005b838211156200131a57835183826101000a81548161ffff021916908360ff160217905550926020019260020160208160010104928301926001030262001383565b5b80821115620012aa5760008155600101620013c5565b600181811c90821680620013f057607f821691505b602082108114156200141257634e487b7160e01b600052602260045260246000fd5b50919050565b612c7980620014286000396000f3fe608060405234801561001057600080fd5b506004361061030c5760003560e01c8063664810621161019d578063bcb9bb1c116100e9578063cd89e4be116100a2578063e81896171161007c578063e8189617146106f5578063e985e9c51461071b578063f2fde38b14610757578063f3c86ff51461076a57600080fd5b8063cd89e4be14610666578063dd97596d14610679578063e1dc07611461068157600080fd5b8063bcb9bb1c146105f0578063c648b0c814610603578063c6b00cba14610623578063c729f54714610643578063c87229271461064b578063c87b56dd1461065357600080fd5b806395d89b41116101565780639ff2c0c7116101305780639ff2c0c7146105af578063a22cb465146105c2578063ab76a6a8146105d5578063b88d4fde146105dd57600080fd5b806395d89b411461059057806398d5fdca146105985780639c4d696e146105a757600080fd5b8063664810621461051957806370a0823114610539578063715018a61461054c57806388f20783146105545780638da5cb5b1461055c57806391efcf111461056d57600080fd5b80633074471b1161025c5780634de8bcfb1161021557806351cff8d9116101ef57806351cff8d9146104d85780635ae1a2f5146104eb5780635c1f2f7a146104fe5780636352211e1461050657600080fd5b80634de8bcfb146104925780634f6ccce7146104a5578063517124db146104b857600080fd5b80633074471b14610433578063329e79b91461043c57806332cb6b0c14610456578063346de50a1461045f57806342842e0e1461046c5780634a945f8d1461047f57600080fd5b80631249c58b116102c95780631e1d0692116102a35780631e1d0692146103f157806323b872dd146103fa5780632e2a46901461040d5780632f745c591461042057600080fd5b80631249c58b146103c457806318160ddd146103cc5780631c19c215146103de57600080fd5b806301ffc9a71461031157806306fdde0314610339578063081812fc1461034e578063090d1abf14610379578063095ea7b31461038e578063101d5917146103a1575b600080fd5b61032461031f366004612768565b61078a565b60405190151581526020015b60405180910390f35b6103416107b5565b604051610330919061290b565b61036161035c366004612819565b610847565b6040516001600160a01b039091168152602001610330565b61038c61038736600461284b565b6108e1565b005b61038c61039c366004612702565b610ab7565b6103246103af366004612819565b60156020526000908152604090205460ff1681565b61038c610bcd565b6008545b604051908152602001610330565b61038c6103ec366004612819565b610d47565b6103d060115481565b61038c6104083660046125e4565b610de8565b601054610361906001600160a01b031681565b6103d061042e366004612702565b610e19565b6103d060125481565b610444600481565b60405160ff9091168152602001610330565b6103d06107d081565b6013546103249060ff1681565b61038c61047a3660046125e4565b610eaf565b61038c61048d366004612588565b610eca565b61038c6104a036600461272e565b610f44565b6103d06104b3366004612819565b610f81565b6103d06104c6366004612819565b60176020526000908152604090205481565b61038c6104e6366004612515565b611014565b600d54610361906001600160a01b031681565b610444600581565b610361610514366004612819565b611141565b6103d0610527366004612819565b60009081526018602052604090205490565b6103d0610547366004612515565b6111b8565b61038c61123f565b610444600381565b600a546001600160a01b0316610361565b61032461057b366004612819565b60146020526000908152604090205460ff1681565b610341611275565b683635c9adc5dea000006103d0565b610444600081565b600f54610361906001600160a01b031681565b61038c6105d03660046126d4565b611284565b610444600181565b61038c6105eb366004612625565b61128f565b61038c6105fe366004612819565b6112c7565b610616610611366004612819565b6113fe565b60405161033091906128d6565b6103d0610631366004612819565b60166020526000908152604090205481565b610444600781565b610444600281565b610341610661366004612819565b61141e565b600e54610361906001600160a01b031681565b610444600681565b61069461068f366004612819565b61149f565b6040516103309190600061010082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015292915050565b610708610703366004612819565b6114bf565b60405161ffff9091168152602001610330565b61032461072936600461254f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61038c610765366004612515565b6114f7565b6103d0610778366004612819565b60186020526000908152604090205481565b60006001600160e01b0319821663780e9d6360e01b14806107af57506107af8261158f565b92915050565b6060600080546107c490612b1a565b80601f01602080910402602001604051908101604052809291908181526020018280546107f090612b1a565b801561083d5780601f106108125761010080835404028352916020019161083d565b820191906000526020600020905b81548152906001019060200180831161082057829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166108c55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b333b156109005760405162461bcd60e51b81526004016108bc906129ca565b60008281526015602052604090205460ff1661094e5760405162461bcd60e51b815260206004820152600d60248201526c1b9bdd08185cdcd95b589b1959609a1b60448201526064016108bc565b60008281526014602052604090205460ff161561099c5760405162461bcd60e51b815260206004820152600c60248201526b185b1c9958591e481d5cd95960a21b60448201526064016108bc565b6109a582611141565b6001600160a01b0316336001600160a01b0316146109d55760405162461bcd60e51b81526004016108bc90612970565b600d546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e9060240160206040518083038186803b158015610a1957600080fd5b505afa158015610a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a519190612532565b6001600160a01b031614610a775760405162461bcd60e51b81526004016108bc90612970565b60008181526016602090815260408083208590558483526017825280832084905560149091529020805460ff19166001179055610ab3826115df565b5050565b6000610ac282611141565b9050806001600160a01b0316836001600160a01b03161415610b305760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016108bc565b336001600160a01b0382161480610b4c5750610b4c8133610729565b610bbe5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108bc565b610bc88383611686565b505050565b333b15610bec5760405162461bcd60e51b81526004016108bc906129ca565b60135460ff16610c315760405162461bcd60e51b815260206004820152601060248201526f1b5a5b9d081b9bdd08195b98589b195960821b60448201526064016108bc565b6107d060125410610c715760405162461bcd60e51b815260206004820152600a6024820152696d617820737570706c7960b01b60448201526064016108bc565b600f546001600160a01b03166323b872dd3330683635c9adc5dea000006040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b158015610cdd57600080fd5b505af1158015610cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d15919061274b565b50610d24601980546001019055565b6000610d2f60195490565b9050610d3a816116f4565b610d4433826117d8565b50565b333b15610d665760405162461bcd60e51b81526004016108bc906129ca565b6107d060125410610da65760405162461bcd60e51b815260206004820152600a6024820152696d617820737570706c7960b01b60448201526064016108bc565b610daf81611141565b6001600160a01b0316336001600160a01b031614610ddf5760405162461bcd60e51b81526004016108bc90612970565b610d44816116f4565b610df233826117f2565b610e0e5760405162461bcd60e51b81526004016108bc906129ef565b610bc88383836118e9565b6000610e24836111b8565b8210610e865760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016108bc565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610bc88383836040518060200160405280600081525061128f565b600a546001600160a01b03163314610ef45760405162461bcd60e51b81526004016108bc90612995565b600e80546001600160a01b039586166001600160a01b031991821617909155600d805494861694821694909417909355600f80549285169284169290921790915560108054919093169116179055565b600a546001600160a01b03163314610f6e5760405162461bcd60e51b81526004016108bc90612995565b6013805460ff1916911515919091179055565b6000610f8c60085490565b8210610fef5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016108bc565b6008828154811061100257611002612bde565b90600052602060002001549050919050565b600a546001600160a01b0316331461103e5760405162461bcd60e51b81526004016108bc90612995565b600f546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90839083906370a082319060240160206040518083038186803b15801561108b57600080fd5b505afa15801561109f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c39190612832565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561110957600080fd5b505af115801561111d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab3919061274b565b6000818152600260205260408120546001600160a01b0316806107af5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016108bc565b60006001600160a01b0382166112235760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016108bc565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b031633146112695760405162461bcd60e51b81526004016108bc90612995565b6112736000611a94565b565b6060600180546107c490612b1a565b610ab3338383611ae6565b61129933836117f2565b6112b55760405162461bcd60e51b81526004016108bc906129ef565b6112c184848484611bb5565b50505050565b333b156112e65760405162461bcd60e51b81526004016108bc906129ca565b6112ef81611141565b6001600160a01b0316336001600160a01b03161461131f5760405162461bcd60e51b81526004016108bc90612970565b60008181526015602052604090205460ff16156113725760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e48185cdcd95b589b1959607a1b60448201526064016108bc565b60008181526015602052604090819020805460ff19166001908117909155600e549151637a94c56560e11b81523360048201526024810191909152600360448201526001600160a01b039091169063f5298aca90606401600060405180830381600087803b1580156113e357600080fd5b505af11580156113f7573d6000803e3d6000fd5b5050505050565b6114066124b1565b6000828152601860205260409020546107af90611be8565b60105460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd9060240160006040518083038186803b15801561146357600080fd5b505afa158015611477573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107af91908101906127a2565b6114a76124d0565b6000828152601860205260409020546107af90611c52565b600b81815481106114cf57600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b600a546001600160a01b031633146115215760405162461bcd60e51b81526004016108bc90612995565b6001600160a01b0381166115865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108bc565b610d4481611a94565b60006001600160e01b031982166380ac58cd60e01b14806115c057506001600160e01b03198216635b5e139f60e01b145b806107af57506301ffc9a760e01b6001600160e01b03198316146107af565b60006115ea82611141565b90506115f881600084611c5a565b611603600083611686565b6001600160a01b038116600090815260036020526040812080546001929061162c908490612ad7565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906116bb82611141565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008181526015602052604090205460ff16156117475760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e48185cdcd95b589b1959607a1b60448201526064016108bc565b6012805490600061175783612b55565b91905055506117c661176882611d12565b805160208083015160408401516060850151608086015160a087015160c088015160e09098015160381b60309890981b60289190911b9190951b60189290921b60109390931b60089490941b90951792909217171791909117171790565b60009182526018602052604090912055565b610ab3828260405180602001604052806000815250611f54565b6000818152600260205260408120546001600160a01b031661186b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108bc565b600061187683611141565b9050806001600160a01b0316846001600160a01b031614806118b15750836001600160a01b03166118a684610847565b6001600160a01b0316145b806118e157506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166118fc82611141565b6001600160a01b0316146119645760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016108bc565b6001600160a01b0382166119c65760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108bc565b6119d1838383611c5a565b6119dc600082611686565b6001600160a01b0383166000908152600360205260408120805460019290611a05908490612ad7565b90915550506001600160a01b0382166000908152600360205260408120805460019290611a33908490612abf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611b485760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108bc565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611bc08484846118e9565b611bcc84848484611f87565b6112c15760405162461bcd60e51b81526004016108bc9061291e565b611bf06124b1565b60ff8083168252600883901c8116602080840191909152601084901c82166040840152601884901c8216606084015283901c81166080830152602883901c811660a0830152603083901c811660c083015260389290921c90911660e082015290565b611bf06124d0565b6001600160a01b038316611cb557611cb081600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611cd8565b816001600160a01b0316836001600160a01b031614611cd857611cd88382612094565b6001600160a01b038216611cef57610bc881612131565b826001600160a01b0316826001600160a01b031614610bc857610bc882826121e0565b611d1a6124d0565b6000611da9611d2b846103e8612224565b600b805480602002602001604051908101604052809291908181526020018280548015611d9f57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411611d665790505b50505050506122a5565b60ff81166000908152600c6020526040808220815161010081019092529293509091600883835b82821015611e6157838201805480602002602001604051908101604052809291908181526020018280548015611e4d57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411611e145790505b505050505081526020019060010190611dd0565b50505060ff84168552509050611e8a611e7c856103e8612224565b8260015b60200201516122a5565b60ff166020840152611ea9611ea1856103e8612224565b826002611e80565b60ff166040840152611ec8611ec0856103e8612224565b826003611e80565b60ff166060840152611ee7611edf856103e8612224565b826004611e80565b60ff166080840152611f06611efe856103e8612224565b826005611e80565b60ff1660a0840152611f25611f1d856103e8612224565b826006611e80565b60ff1660c0840152611f44611f3c856103e8612224565b826007611e80565b60ff1660e0840152509092915050565b611f5e8383612363565b611f6b6000848484611f87565b610bc85760405162461bcd60e51b81526004016108bc9061291e565b60006001600160a01b0384163b1561208957604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611fcb903390899088908890600401612899565b602060405180830381600087803b158015611fe557600080fd5b505af1925050508015612015575060408051601f3d908101601f1916820190925261201291810190612785565b60015b61206f573d808015612043576040519150601f19603f3d011682016040523d82523d6000602084013e612048565b606091505b5080516120675760405162461bcd60e51b81526004016108bc9061291e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506118e1565b506001949350505050565b600060016120a1846111b8565b6120ab9190612ad7565b6000838152600760205260409020549091508082146120fe576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061214390600190612ad7565b6000838152600960205260408120546008805493945090928490811061216b5761216b612bde565b90600052602060002001549050806008838154811061218c5761218c612bde565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806121c4576121c4612bc8565b6001900381819060005260206000200160009055905550505050565b60006121eb836111b8565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b601180546000918261223583612b55565b9091555050601154604080514260208201524491810191909152606080820186905233901b6bffffffffffffffffffffffff191660808201526094810191909152829060b4016040516020818303038152906040528051906020012060001c61229e9190612b90565b9392505050565b600080805b83518160ff161015612326576000848260ff16815181106122cd576122cd612bde565b602002602001015190508261ffff1686101580156122f757506122f08184612a99565b61ffff1686105b15612306575091506107af9050565b6123108184612a99565b925050808061231e90612b70565b9150506122aa565b5060405162461bcd60e51b81526020600482015260116024820152701c985c9a5d1e4819d95b8819985a5b1959607a1b60448201526064016108bc565b6001600160a01b0382166123b95760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108bc565b6000818152600260205260409020546001600160a01b03161561241e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108bc565b61242a60008383611c5a565b6001600160a01b0382166000908152600360205260408120805460019290612453908490612abf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6040518061010001604052806008906020820280368337509192915050565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60006020828403121561252757600080fd5b813561229e81612c0a565b60006020828403121561254457600080fd5b815161229e81612c0a565b6000806040838503121561256257600080fd5b823561256d81612c0a565b9150602083013561257d81612c0a565b809150509250929050565b6000806000806080858703121561259e57600080fd5b84356125a981612c0a565b935060208501356125b981612c0a565b925060408501356125c981612c0a565b915060608501356125d981612c0a565b939692955090935050565b6000806000606084860312156125f957600080fd5b833561260481612c0a565b9250602084013561261481612c0a565b929592945050506040919091013590565b6000806000806080858703121561263b57600080fd5b843561264681612c0a565b9350602085013561265681612c0a565b925060408501359150606085013567ffffffffffffffff81111561267957600080fd5b8501601f8101871361268a57600080fd5b803561269d61269882612a71565b612a40565b8181528860208385010111156126b257600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080604083850312156126e757600080fd5b82356126f281612c0a565b9150602083013561257d81612c1f565b6000806040838503121561271557600080fd5b823561272081612c0a565b946020939093013593505050565b60006020828403121561274057600080fd5b813561229e81612c1f565b60006020828403121561275d57600080fd5b815161229e81612c1f565b60006020828403121561277a57600080fd5b813561229e81612c2d565b60006020828403121561279757600080fd5b815161229e81612c2d565b6000602082840312156127b457600080fd5b815167ffffffffffffffff8111156127cb57600080fd5b8201601f810184136127dc57600080fd5b80516127ea61269882612a71565b8181528560208385010111156127ff57600080fd5b612810826020830160208601612aee565b95945050505050565b60006020828403121561282b57600080fd5b5035919050565b60006020828403121561284457600080fd5b5051919050565b6000806040838503121561285e57600080fd5b50508035926020909101359150565b60008151808452612885816020860160208601612aee565b601f01601f19169290920160200192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906128cc9083018461286d565b9695505050505050565b6101008101818360005b600881101561290257815160ff168352602092830192909101906001016128e0565b50505092915050565b60208152600061229e602083018461286d565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252600b908201526a1b9bdd08185b1b1bddd95960aa1b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600b908201526a6e6f20636865617465727360a81b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff81118282101715612a6957612a69612bf4565b604052919050565b600067ffffffffffffffff821115612a8b57612a8b612bf4565b50601f01601f191660200190565b600061ffff808316818516808303821115612ab657612ab6612bb2565b01949350505050565b60008219821115612ad257612ad2612bb2565b500190565b600082821015612ae957612ae9612bb2565b500390565b60005b83811015612b09578181015183820152602001612af1565b838111156112c15750506000910152565b600181811c90821680612b2e57607f821691505b60208210811415612b4f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612b6957612b69612bb2565b5060010190565b600060ff821660ff811415612b8757612b87612bb2565b60010192915050565b600082612bad57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610d4457600080fd5b8015158114610d4457600080fd5b6001600160e01b031981168114610d4457600080fdfea26469706673582212209076d2d646040b7a5c130bed652dea01b8fdf39c5b13915c3c70517ecf54b78564736f6c63430008070033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061030c5760003560e01c8063664810621161019d578063bcb9bb1c116100e9578063cd89e4be116100a2578063e81896171161007c578063e8189617146106f5578063e985e9c51461071b578063f2fde38b14610757578063f3c86ff51461076a57600080fd5b8063cd89e4be14610666578063dd97596d14610679578063e1dc07611461068157600080fd5b8063bcb9bb1c146105f0578063c648b0c814610603578063c6b00cba14610623578063c729f54714610643578063c87229271461064b578063c87b56dd1461065357600080fd5b806395d89b41116101565780639ff2c0c7116101305780639ff2c0c7146105af578063a22cb465146105c2578063ab76a6a8146105d5578063b88d4fde146105dd57600080fd5b806395d89b411461059057806398d5fdca146105985780639c4d696e146105a757600080fd5b8063664810621461051957806370a0823114610539578063715018a61461054c57806388f20783146105545780638da5cb5b1461055c57806391efcf111461056d57600080fd5b80633074471b1161025c5780634de8bcfb1161021557806351cff8d9116101ef57806351cff8d9146104d85780635ae1a2f5146104eb5780635c1f2f7a146104fe5780636352211e1461050657600080fd5b80634de8bcfb146104925780634f6ccce7146104a5578063517124db146104b857600080fd5b80633074471b14610433578063329e79b91461043c57806332cb6b0c14610456578063346de50a1461045f57806342842e0e1461046c5780634a945f8d1461047f57600080fd5b80631249c58b116102c95780631e1d0692116102a35780631e1d0692146103f157806323b872dd146103fa5780632e2a46901461040d5780632f745c591461042057600080fd5b80631249c58b146103c457806318160ddd146103cc5780631c19c215146103de57600080fd5b806301ffc9a71461031157806306fdde0314610339578063081812fc1461034e578063090d1abf14610379578063095ea7b31461038e578063101d5917146103a1575b600080fd5b61032461031f366004612768565b61078a565b60405190151581526020015b60405180910390f35b6103416107b5565b604051610330919061290b565b61036161035c366004612819565b610847565b6040516001600160a01b039091168152602001610330565b61038c61038736600461284b565b6108e1565b005b61038c61039c366004612702565b610ab7565b6103246103af366004612819565b60156020526000908152604090205460ff1681565b61038c610bcd565b6008545b604051908152602001610330565b61038c6103ec366004612819565b610d47565b6103d060115481565b61038c6104083660046125e4565b610de8565b601054610361906001600160a01b031681565b6103d061042e366004612702565b610e19565b6103d060125481565b610444600481565b60405160ff9091168152602001610330565b6103d06107d081565b6013546103249060ff1681565b61038c61047a3660046125e4565b610eaf565b61038c61048d366004612588565b610eca565b61038c6104a036600461272e565b610f44565b6103d06104b3366004612819565b610f81565b6103d06104c6366004612819565b60176020526000908152604090205481565b61038c6104e6366004612515565b611014565b600d54610361906001600160a01b031681565b610444600581565b610361610514366004612819565b611141565b6103d0610527366004612819565b60009081526018602052604090205490565b6103d0610547366004612515565b6111b8565b61038c61123f565b610444600381565b600a546001600160a01b0316610361565b61032461057b366004612819565b60146020526000908152604090205460ff1681565b610341611275565b683635c9adc5dea000006103d0565b610444600081565b600f54610361906001600160a01b031681565b61038c6105d03660046126d4565b611284565b610444600181565b61038c6105eb366004612625565b61128f565b61038c6105fe366004612819565b6112c7565b610616610611366004612819565b6113fe565b60405161033091906128d6565b6103d0610631366004612819565b60166020526000908152604090205481565b610444600781565b610444600281565b610341610661366004612819565b61141e565b600e54610361906001600160a01b031681565b610444600681565b61069461068f366004612819565b61149f565b6040516103309190600061010082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015292915050565b610708610703366004612819565b6114bf565b60405161ffff9091168152602001610330565b61032461072936600461254f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61038c610765366004612515565b6114f7565b6103d0610778366004612819565b60186020526000908152604090205481565b60006001600160e01b0319821663780e9d6360e01b14806107af57506107af8261158f565b92915050565b6060600080546107c490612b1a565b80601f01602080910402602001604051908101604052809291908181526020018280546107f090612b1a565b801561083d5780601f106108125761010080835404028352916020019161083d565b820191906000526020600020905b81548152906001019060200180831161082057829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166108c55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b333b156109005760405162461bcd60e51b81526004016108bc906129ca565b60008281526015602052604090205460ff1661094e5760405162461bcd60e51b815260206004820152600d60248201526c1b9bdd08185cdcd95b589b1959609a1b60448201526064016108bc565b60008281526014602052604090205460ff161561099c5760405162461bcd60e51b815260206004820152600c60248201526b185b1c9958591e481d5cd95960a21b60448201526064016108bc565b6109a582611141565b6001600160a01b0316336001600160a01b0316146109d55760405162461bcd60e51b81526004016108bc90612970565b600d546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e9060240160206040518083038186803b158015610a1957600080fd5b505afa158015610a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a519190612532565b6001600160a01b031614610a775760405162461bcd60e51b81526004016108bc90612970565b60008181526016602090815260408083208590558483526017825280832084905560149091529020805460ff19166001179055610ab3826115df565b5050565b6000610ac282611141565b9050806001600160a01b0316836001600160a01b03161415610b305760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016108bc565b336001600160a01b0382161480610b4c5750610b4c8133610729565b610bbe5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108bc565b610bc88383611686565b505050565b333b15610bec5760405162461bcd60e51b81526004016108bc906129ca565b60135460ff16610c315760405162461bcd60e51b815260206004820152601060248201526f1b5a5b9d081b9bdd08195b98589b195960821b60448201526064016108bc565b6107d060125410610c715760405162461bcd60e51b815260206004820152600a6024820152696d617820737570706c7960b01b60448201526064016108bc565b600f546001600160a01b03166323b872dd3330683635c9adc5dea000006040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b158015610cdd57600080fd5b505af1158015610cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d15919061274b565b50610d24601980546001019055565b6000610d2f60195490565b9050610d3a816116f4565b610d4433826117d8565b50565b333b15610d665760405162461bcd60e51b81526004016108bc906129ca565b6107d060125410610da65760405162461bcd60e51b815260206004820152600a6024820152696d617820737570706c7960b01b60448201526064016108bc565b610daf81611141565b6001600160a01b0316336001600160a01b031614610ddf5760405162461bcd60e51b81526004016108bc90612970565b610d44816116f4565b610df233826117f2565b610e0e5760405162461bcd60e51b81526004016108bc906129ef565b610bc88383836118e9565b6000610e24836111b8565b8210610e865760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016108bc565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610bc88383836040518060200160405280600081525061128f565b600a546001600160a01b03163314610ef45760405162461bcd60e51b81526004016108bc90612995565b600e80546001600160a01b039586166001600160a01b031991821617909155600d805494861694821694909417909355600f80549285169284169290921790915560108054919093169116179055565b600a546001600160a01b03163314610f6e5760405162461bcd60e51b81526004016108bc90612995565b6013805460ff1916911515919091179055565b6000610f8c60085490565b8210610fef5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016108bc565b6008828154811061100257611002612bde565b90600052602060002001549050919050565b600a546001600160a01b0316331461103e5760405162461bcd60e51b81526004016108bc90612995565b600f546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90839083906370a082319060240160206040518083038186803b15801561108b57600080fd5b505afa15801561109f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c39190612832565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561110957600080fd5b505af115801561111d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab3919061274b565b6000818152600260205260408120546001600160a01b0316806107af5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016108bc565b60006001600160a01b0382166112235760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016108bc565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b031633146112695760405162461bcd60e51b81526004016108bc90612995565b6112736000611a94565b565b6060600180546107c490612b1a565b610ab3338383611ae6565b61129933836117f2565b6112b55760405162461bcd60e51b81526004016108bc906129ef565b6112c184848484611bb5565b50505050565b333b156112e65760405162461bcd60e51b81526004016108bc906129ca565b6112ef81611141565b6001600160a01b0316336001600160a01b03161461131f5760405162461bcd60e51b81526004016108bc90612970565b60008181526015602052604090205460ff16156113725760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e48185cdcd95b589b1959607a1b60448201526064016108bc565b60008181526015602052604090819020805460ff19166001908117909155600e549151637a94c56560e11b81523360048201526024810191909152600360448201526001600160a01b039091169063f5298aca90606401600060405180830381600087803b1580156113e357600080fd5b505af11580156113f7573d6000803e3d6000fd5b5050505050565b6114066124b1565b6000828152601860205260409020546107af90611be8565b60105460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd9060240160006040518083038186803b15801561146357600080fd5b505afa158015611477573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107af91908101906127a2565b6114a76124d0565b6000828152601860205260409020546107af90611c52565b600b81815481106114cf57600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b600a546001600160a01b031633146115215760405162461bcd60e51b81526004016108bc90612995565b6001600160a01b0381166115865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108bc565b610d4481611a94565b60006001600160e01b031982166380ac58cd60e01b14806115c057506001600160e01b03198216635b5e139f60e01b145b806107af57506301ffc9a760e01b6001600160e01b03198316146107af565b60006115ea82611141565b90506115f881600084611c5a565b611603600083611686565b6001600160a01b038116600090815260036020526040812080546001929061162c908490612ad7565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906116bb82611141565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008181526015602052604090205460ff16156117475760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e48185cdcd95b589b1959607a1b60448201526064016108bc565b6012805490600061175783612b55565b91905055506117c661176882611d12565b805160208083015160408401516060850151608086015160a087015160c088015160e09098015160381b60309890981b60289190911b9190951b60189290921b60109390931b60089490941b90951792909217171791909117171790565b60009182526018602052604090912055565b610ab3828260405180602001604052806000815250611f54565b6000818152600260205260408120546001600160a01b031661186b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108bc565b600061187683611141565b9050806001600160a01b0316846001600160a01b031614806118b15750836001600160a01b03166118a684610847565b6001600160a01b0316145b806118e157506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166118fc82611141565b6001600160a01b0316146119645760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016108bc565b6001600160a01b0382166119c65760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108bc565b6119d1838383611c5a565b6119dc600082611686565b6001600160a01b0383166000908152600360205260408120805460019290611a05908490612ad7565b90915550506001600160a01b0382166000908152600360205260408120805460019290611a33908490612abf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611b485760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108bc565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611bc08484846118e9565b611bcc84848484611f87565b6112c15760405162461bcd60e51b81526004016108bc9061291e565b611bf06124b1565b60ff8083168252600883901c8116602080840191909152601084901c82166040840152601884901c8216606084015283901c81166080830152602883901c811660a0830152603083901c811660c083015260389290921c90911660e082015290565b611bf06124d0565b6001600160a01b038316611cb557611cb081600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611cd8565b816001600160a01b0316836001600160a01b031614611cd857611cd88382612094565b6001600160a01b038216611cef57610bc881612131565b826001600160a01b0316826001600160a01b031614610bc857610bc882826121e0565b611d1a6124d0565b6000611da9611d2b846103e8612224565b600b805480602002602001604051908101604052809291908181526020018280548015611d9f57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411611d665790505b50505050506122a5565b60ff81166000908152600c6020526040808220815161010081019092529293509091600883835b82821015611e6157838201805480602002602001604051908101604052809291908181526020018280548015611e4d57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411611e145790505b505050505081526020019060010190611dd0565b50505060ff84168552509050611e8a611e7c856103e8612224565b8260015b60200201516122a5565b60ff166020840152611ea9611ea1856103e8612224565b826002611e80565b60ff166040840152611ec8611ec0856103e8612224565b826003611e80565b60ff166060840152611ee7611edf856103e8612224565b826004611e80565b60ff166080840152611f06611efe856103e8612224565b826005611e80565b60ff1660a0840152611f25611f1d856103e8612224565b826006611e80565b60ff1660c0840152611f44611f3c856103e8612224565b826007611e80565b60ff1660e0840152509092915050565b611f5e8383612363565b611f6b6000848484611f87565b610bc85760405162461bcd60e51b81526004016108bc9061291e565b60006001600160a01b0384163b1561208957604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611fcb903390899088908890600401612899565b602060405180830381600087803b158015611fe557600080fd5b505af1925050508015612015575060408051601f3d908101601f1916820190925261201291810190612785565b60015b61206f573d808015612043576040519150601f19603f3d011682016040523d82523d6000602084013e612048565b606091505b5080516120675760405162461bcd60e51b81526004016108bc9061291e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506118e1565b506001949350505050565b600060016120a1846111b8565b6120ab9190612ad7565b6000838152600760205260409020549091508082146120fe576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061214390600190612ad7565b6000838152600960205260408120546008805493945090928490811061216b5761216b612bde565b90600052602060002001549050806008838154811061218c5761218c612bde565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806121c4576121c4612bc8565b6001900381819060005260206000200160009055905550505050565b60006121eb836111b8565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b601180546000918261223583612b55565b9091555050601154604080514260208201524491810191909152606080820186905233901b6bffffffffffffffffffffffff191660808201526094810191909152829060b4016040516020818303038152906040528051906020012060001c61229e9190612b90565b9392505050565b600080805b83518160ff161015612326576000848260ff16815181106122cd576122cd612bde565b602002602001015190508261ffff1686101580156122f757506122f08184612a99565b61ffff1686105b15612306575091506107af9050565b6123108184612a99565b925050808061231e90612b70565b9150506122aa565b5060405162461bcd60e51b81526020600482015260116024820152701c985c9a5d1e4819d95b8819985a5b1959607a1b60448201526064016108bc565b6001600160a01b0382166123b95760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108bc565b6000818152600260205260409020546001600160a01b03161561241e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108bc565b61242a60008383611c5a565b6001600160a01b0382166000908152600360205260408120805460019290612453908490612abf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6040518061010001604052806008906020820280368337509192915050565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60006020828403121561252757600080fd5b813561229e81612c0a565b60006020828403121561254457600080fd5b815161229e81612c0a565b6000806040838503121561256257600080fd5b823561256d81612c0a565b9150602083013561257d81612c0a565b809150509250929050565b6000806000806080858703121561259e57600080fd5b84356125a981612c0a565b935060208501356125b981612c0a565b925060408501356125c981612c0a565b915060608501356125d981612c0a565b939692955090935050565b6000806000606084860312156125f957600080fd5b833561260481612c0a565b9250602084013561261481612c0a565b929592945050506040919091013590565b6000806000806080858703121561263b57600080fd5b843561264681612c0a565b9350602085013561265681612c0a565b925060408501359150606085013567ffffffffffffffff81111561267957600080fd5b8501601f8101871361268a57600080fd5b803561269d61269882612a71565b612a40565b8181528860208385010111156126b257600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080604083850312156126e757600080fd5b82356126f281612c0a565b9150602083013561257d81612c1f565b6000806040838503121561271557600080fd5b823561272081612c0a565b946020939093013593505050565b60006020828403121561274057600080fd5b813561229e81612c1f565b60006020828403121561275d57600080fd5b815161229e81612c1f565b60006020828403121561277a57600080fd5b813561229e81612c2d565b60006020828403121561279757600080fd5b815161229e81612c2d565b6000602082840312156127b457600080fd5b815167ffffffffffffffff8111156127cb57600080fd5b8201601f810184136127dc57600080fd5b80516127ea61269882612a71565b8181528560208385010111156127ff57600080fd5b612810826020830160208601612aee565b95945050505050565b60006020828403121561282b57600080fd5b5035919050565b60006020828403121561284457600080fd5b5051919050565b6000806040838503121561285e57600080fd5b50508035926020909101359150565b60008151808452612885816020860160208601612aee565b601f01601f19169290920160200192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906128cc9083018461286d565b9695505050505050565b6101008101818360005b600881101561290257815160ff168352602092830192909101906001016128e0565b50505092915050565b60208152600061229e602083018461286d565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252600b908201526a1b9bdd08185b1b1bddd95960aa1b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600b908201526a6e6f20636865617465727360a81b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff81118282101715612a6957612a69612bf4565b604052919050565b600067ffffffffffffffff821115612a8b57612a8b612bf4565b50601f01601f191660200190565b600061ffff808316818516808303821115612ab657612ab6612bb2565b01949350505050565b60008219821115612ad257612ad2612bb2565b500190565b600082821015612ae957612ae9612bb2565b500390565b60005b83811015612b09578181015183820152602001612af1565b838111156112c15750506000910152565b600181811c90821680612b2e57607f821691505b60208210811415612b4f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612b6957612b69612bb2565b5060010190565b600060ff821660ff811415612b8757612b87612bb2565b60010192915050565b600082612bad57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610d4457600080fd5b8015158114610d4457600080fd5b6001600160e01b031981168114610d4457600080fdfea26469706673582212209076d2d646040b7a5c130bed652dea01b8fdf39c5b13915c3c70517ecf54b78564736f6c63430008070033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.