Overview
TokenID
11082
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
Woolf
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "./Ownable.sol"; import "./Pausable.sol"; import "./ERC721Enumerable.sol"; import "./IWoolf.sol"; import "./IBarn.sol"; import "./ITraits.sol"; import "./WOOL.sol"; contract Woolf is IWoolf, ERC721Enumerable, Ownable, Pausable { // mint price uint256 public MINT_PRICE = 36 ether; // max number of tokens that can be minted - 50000 in production uint256 public immutable MAX_TOKENS; // number of tokens that can be claimed for free - 20% of MAX_TOKENS uint256 public PAID_TOKENS; // number of tokens have been minted so far uint16 public minted; address public feeWallet = 0x588dd1F57a93e555B7cD4358cb8442f5Cac71FfC; // mapping from tokenId to a struct containing the token's traits mapping(uint256 => SheepWolf) public tokenTraits; // mapping from hashed(tokenTrait) to the tokenId it's associated with // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; // list of probabilities for each trait type // 0 - 9 are associated with Sheep, 10 - 18 are associated with Wolves uint8[][18] public rarities; // list of aliases for Walker's Alias algorithm // 0 - 9 are associated with Sheep, 10 - 18 are associated with Wolves uint8[][18] public aliases; // reference to the Barn for choosing random Wolf thieves IBarn public barn; // reference to $WOOL for burning on mint WOOL public wool; // reference to Traits ITraits public traits; /** * instantiates contract and rarity tables */ constructor( address _wool, address _traits, uint256 _maxTokens ) ERC721("Wolf Game", "WGAME") { wool = WOOL(_wool); traits = ITraits(_traits); MAX_TOKENS = _maxTokens; PAID_TOKENS = _maxTokens / 5; // I know this looks weird but it saves users gas by making lookup O(1) // A.J. Walker's Alias Algorithm // sheep // fur rarities[0] = [15, 50, 200, 250, 255]; aliases[0] = [4, 4, 4, 4, 4]; // head rarities[1] = [ 190, 215, 240, 100, 110, 135, 160, 185, 80, 210, 235, 240, 80, 80, 100, 100, 100, 245, 250, 255 ]; aliases[1] = [ 1, 2, 4, 0, 5, 6, 7, 9, 0, 10, 11, 17, 0, 0, 0, 0, 4, 18, 19, 19 ]; // ears rarities[2] = [255, 30, 60, 60, 150, 156]; aliases[2] = [0, 0, 0, 0, 0, 0]; // eyes rarities[3] = [ 221, 100, 181, 140, 224, 147, 84, 228, 140, 224, 250, 160, 241, 207, 173, 84, 254, 220, 196, 140, 168, 252, 140, 183, 236, 252, 224, 255 ]; aliases[3] = [ 1, 2, 5, 0, 1, 7, 1, 10, 5, 10, 11, 12, 13, 14, 16, 11, 17, 23, 13, 14, 17, 23, 23, 24, 27, 27, 27, 27 ]; // nose rarities[4] = [175, 100, 40, 250, 115, 100, 185, 175, 180, 255]; aliases[4] = [3, 0, 4, 6, 6, 7, 8, 8, 9, 9]; // mouth rarities[5] = [ 80, 225, 227, 228, 112, 240, 64, 160, 167, 217, 171, 64, 240, 126, 80, 255 ]; aliases[5] = [1, 2, 3, 8, 2, 8, 8, 9, 9, 10, 13, 10, 13, 15, 13, 15]; // neck rarities[6] = [255]; aliases[6] = [0]; // feet rarities[7] = [ 243, 189, 133, 133, 57, 95, 152, 135, 133, 57, 222, 168, 57, 57, 38, 114, 114, 114, 255 ]; aliases[7] = [ 1, 7, 0, 0, 0, 0, 0, 10, 0, 0, 11, 18, 0, 0, 0, 1, 7, 11, 18 ]; // alphaIndex rarities[8] = [255]; aliases[8] = [0]; // wolves // fur rarities[9] = [210, 90, 9, 9, 9, 150, 9, 255, 9]; aliases[9] = [5, 0, 0, 5, 5, 7, 5, 7, 5]; // head rarities[10] = [255]; aliases[10] = [0]; // ears rarities[11] = [255]; aliases[11] = [0]; // eyes rarities[12] = [ 135, 177, 219, 141, 183, 225, 147, 189, 231, 135, 135, 135, 135, 246, 150, 150, 156, 165, 171, 180, 186, 195, 201, 210, 243, 252, 255 ]; aliases[12] = [ 1, 2, 3, 4, 5, 6, 7, 8, 13, 3, 6, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 26 ]; // nose rarities[13] = [255]; aliases[13] = [0]; // mouth rarities[14] = [ 239, 244, 249, 234, 234, 234, 234, 234, 234, 234, 130, 255, 247 ]; aliases[14] = [1, 2, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11]; // neck rarities[15] = [ 75, 180, 165, 120, 60, 150, 105, 195, 45, 225, 75, 45, 195, 120, 255 ]; aliases[15] = [1, 9, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 14, 12, 14]; // feet rarities[16] = [255]; aliases[16] = [0]; // alphaIndex rarities[17] = [8, 160, 73, 255]; aliases[17] = [2, 3, 3, 3]; } /** EXTERNAL */ /** * mint a token - 90% Sheep, 10% Wolves * The first 20% are free to claim, the remaining cost $WOOL */ function mint(uint256 amount, bool stake) external payable whenNotPaused { require(tx.origin == _msgSender(), "Only EOA"); require(minted + amount <= MAX_TOKENS, "All tokens minted"); require(amount > 0 && amount <= 10, "Invalid mint amount"); if (minted < PAID_TOKENS) { require( minted + amount <= PAID_TOKENS, "All tokens on-sale already sold" ); require(amount * MINT_PRICE == msg.value, "Invalid payment amount"); } else { require(msg.value == 0); } uint256 totalWoolCost = 0; uint16[] memory tokenIds = stake ? new uint16[](amount) : new uint16[](0); uint256 seed; for (uint256 i = 0; i < amount; i++) { minted++; seed = random(minted + block.timestamp); generate(minted, seed); address recipient = selectRecipient(seed); if (!stake || recipient != _msgSender()) { _safeMint(recipient, minted); } else { _safeMint(address(barn), minted); tokenIds[i] = minted; } totalWoolCost += mintCost(minted); } if (totalWoolCost > 0) wool.burn(_msgSender(), totalWoolCost); if (stake) barn.addManyToBarnAndPack(_msgSender(), tokenIds); } /** * the first 20% are paid in ETH * the next 20% are 20000 $WOOL * the next 40% are 40000 $WOOL * the final 20% are 80000 $WOOL * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public view returns (uint256) { if (tokenId <= PAID_TOKENS) return 0; if (tokenId <= (MAX_TOKENS * 2) / 5) return 20000 ether; if (tokenId <= (MAX_TOKENS * 4) / 5) return 40000 ether; return 80000 ether; } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { // Hardcode the Barn's approval so that users don't have to waste gas approving if (_msgSender() != address(barn)) require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _transfer(from, to, tokenId); } /** INTERNAL */ /** * generates traits for a specific token, checking to make sure it's unique * @param tokenId the id of the token to generate traits for * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 tokenId, uint256 seed) internal returns (SheepWolf memory t) { t = selectTraits(seed); if (existingCombinations[structToHash(t)] == 0) { tokenTraits[tokenId] = t; existingCombinations[structToHash(t)] = tokenId; return t; } return generate(tokenId, random(seed)); } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { uint8 trait = uint8(seed) % uint8(rarities[traitType].length); if (seed >> 8 < rarities[traitType][trait]) return trait; return aliases[traitType][trait]; } /** * the first 20% (ETH purchases) go to the minter * the remaining 80% have a 10% chance to be given to a random staked wolf * @param seed a random value to select a recipient from * @return the address of the recipient (either the minter or the Wolf thief's owner) */ function selectRecipient(uint256 seed) internal view returns (address) { if (minted <= PAID_TOKENS || ((seed >> 245) % 10) != 0) return _msgSender(); // top 10 bits haven't been used address thief = barn.randomWolfOwner(seed >> 144); // 144 bits reserved for trait selection if (thief == address(0x0)) return _msgSender(); return thief; } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (SheepWolf memory t) { t.isSheep = (seed & 0xFFFF) % 10 != 0; uint8 shift = t.isSheep ? 0 : 9; seed >>= 16; t.fur = selectTrait(uint16(seed & 0xFFFF), 0 + shift); seed >>= 16; t.head = selectTrait(uint16(seed & 0xFFFF), 1 + shift); seed >>= 16; t.ears = selectTrait(uint16(seed & 0xFFFF), 2 + shift); seed >>= 16; t.eyes = selectTrait(uint16(seed & 0xFFFF), 3 + shift); seed >>= 16; t.nose = selectTrait(uint16(seed & 0xFFFF), 4 + shift); seed >>= 16; t.mouth = selectTrait(uint16(seed & 0xFFFF), 5 + shift); seed >>= 16; t.neck = selectTrait(uint16(seed & 0xFFFF), 6 + shift); seed >>= 16; t.feet = selectTrait(uint16(seed & 0xFFFF), 7 + shift); seed >>= 16; t.alphaIndex = selectTrait(uint16(seed & 0xFFFF), 8 + shift); } /** * converts a struct to a 256 bit hash to check for uniqueness * @param s the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(SheepWolf memory s) internal pure returns (uint256) { return uint256( keccak256( abi.encodePacked( s.isSheep, s.fur, s.head, s.eyes, s.mouth, s.neck, s.ears, s.feet, s.alphaIndex ) ) ); } /** * generates a pseudorandom number * @param seed a value ensure different outcomes for different sources in the same block * @return a pseudorandom value */ function random(uint256 seed) internal view returns (uint256) { return uint256( keccak256( abi.encodePacked( tx.origin, blockhash(block.number - 1), block.timestamp, seed ) ) ); } /** READ */ function getTokenTraits(uint256 tokenId) external view override returns (SheepWolf memory) { return tokenTraits[tokenId]; } function getPaidTokens() external view override returns (uint256) { return PAID_TOKENS; } /** ADMIN */ /** * called after deployment so that the contract can get random wolf thieves * @param _barn the address of the Barn */ function setBarn(address _barn) external onlyOwner { barn = IBarn(_barn); } /** * allows owner to withdraw funds from minting */ function withdraw() external onlyOwner { payable(feeWallet).transfer(address(this).balance); } function setFeeWallet(address _feeWallet) external onlyOwner { feeWallet = _feeWallet; } /** * updates the number of tokens for sale */ function setPaidTokens(uint256 _paidTokens) external onlyOwner { PAID_TOKENS = _paidTokens; } /** * enables owner to pause / unpause minting */ function setPaused(bool _paused) external onlyOwner { if (_paused) _pause(); else _unpause(); } /** RENDER */ function setMintPrice(uint256 _price) external onlyOwner { MINT_PRICE = _price; } function tokenURI(uint256 tokenId) public view override returns (string memory) { require( _exists(tokenId), "ERC721Metadata: URI query for nonexistent token" ); return traits.tokenURI(tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./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() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT 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 LICENSE pragma solidity ^0.8.0; interface IWoolf { // struct to store each token's traits struct SheepWolf { bool isSheep; uint8 fur; uint8 head; uint8 ears; uint8 eyes; uint8 nose; uint8 mouth; uint8 neck; uint8 feet; uint8 alphaIndex; } function getPaidTokens() external view returns (uint256); function getTokenTraits(uint256 tokenId) external view returns (SheepWolf memory); }
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; interface IBarn { function addManyToBarnAndPack(address account, uint16[] calldata tokenIds) external; function randomWolfOwner(uint256 seed) external view returns (address); }
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; interface ITraits { function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "./ERC20.sol"; import "./Ownable.sol"; contract WOOL is ERC20, Ownable { // a mapping from an address to whether or not it can mint / burn mapping(address => bool) controllers; constructor() ERC20("WOOL", "WOOL") { } /** * mints $WOOL to a recipient * @param to the recipient of the $WOOL * @param amount the amount of $WOOL to mint */ function mint(address to, uint256 amount) external { require(controllers[msg.sender], "Only controllers can mint"); _mint(to, amount); } /** * burns $WOOL from a holder * @param from the holder of the $WOOL * @param amount the amount of $WOOL to burn */ function burn(address from, uint256 amount) external { require(controllers[msg.sender], "Only controllers can burn"); _burn(from, amount); } /** * enables an address to mint / burn * @param controller the address to enable */ function addController(address controller) external onlyOwner { controllers[controller] = true; } /** * disables an address from minting / burning * @param controller the address to disbale */ function removeController(address controller) external onlyOwner { controllers[controller] = false; } }
// SPDX-License-Identifier: MIT 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 pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./IERC721Metadata.sol"; import "./Address.sol"; import "./Context.sol"; import "./Strings.sol"; import "./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 { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.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 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 pragma solidity ^0.8.0; import "./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 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 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 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 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 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 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 pragma solidity ^0.8.0; import "./IERC20.sol"; import "./IERC20Metadata.sol"; import "./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 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 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":[{"internalType":"address","name":"_wool","type":"address"},{"internalType":"address","name":"_traits","type":"address"},{"internalType":"uint256","name":"_maxTokens","type":"uint256"}],"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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAID_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"aliases","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":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"barn","outputs":[{"internalType":"contract IBarn","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"existingCombinations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPaidTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenTraits","outputs":[{"components":[{"internalType":"bool","name":"isSheep","type":"bool"},{"internalType":"uint8","name":"fur","type":"uint8"},{"internalType":"uint8","name":"head","type":"uint8"},{"internalType":"uint8","name":"ears","type":"uint8"},{"internalType":"uint8","name":"eyes","type":"uint8"},{"internalType":"uint8","name":"nose","type":"uint8"},{"internalType":"uint8","name":"mouth","type":"uint8"},{"internalType":"uint8","name":"neck","type":"uint8"},{"internalType":"uint8","name":"feet","type":"uint8"},{"internalType":"uint8","name":"alphaIndex","type":"uint8"}],"internalType":"struct IWoolf.SheepWolf","name":"","type":"tuple"}],"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":"amount","type":"uint256"},{"internalType":"bool","name":"stake","type":"bool"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minted","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"rarities","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_barn","type":"address"}],"name":"setBarn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeWallet","type":"address"}],"name":"setFeeWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_paidTokens","type":"uint256"}],"name":"setPaidTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenTraits","outputs":[{"internalType":"bool","name":"isSheep","type":"bool"},{"internalType":"uint8","name":"fur","type":"uint8"},{"internalType":"uint8","name":"head","type":"uint8"},{"internalType":"uint8","name":"ears","type":"uint8"},{"internalType":"uint8","name":"eyes","type":"uint8"},{"internalType":"uint8","name":"nose","type":"uint8"},{"internalType":"uint8","name":"mouth","type":"uint8"},{"internalType":"uint8","name":"neck","type":"uint8"},{"internalType":"uint8","name":"feet","type":"uint8"},{"internalType":"uint8","name":"alphaIndex","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"traits","outputs":[{"internalType":"contract ITraits","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wool","outputs":[{"internalType":"contract WOOL","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a06040526801f399b1438a100000600b55600d805462010000600160b01b03191675588dd1f57a93e555b7cd4358cb8442f5cac71ffc00001790553480156200004857600080fd5b5060405162004611380380620046118339810160408190526200006b9162001165565b6040805180820182526009815268576f6c662047616d6560b81b6020808301918252835180850190945260058452645747414d4560d81b908401528151919291620000b99160009162000fff565b508051620000cf90600190602084019062000fff565b505050620000ec620000e662000fa960201b60201c565b62000fad565b600a805460ff60a01b19169055603580546001600160a01b038086166001600160a01b031992831617909255603680549285169290911691909117905560808190526200013b600582620011a5565b600c556040805160a081018252600f81526032602082015260c89181019190915260fa606082015260ff60808201526200017a9060109060056200108e565b506040805160a081018252600480825260208201819052918101829052606081018290526080810191909152620001b69060229060056200108e565b50604080516102808101825260be815260d7602082015260f0918101829052606460608201819052606e6080830152608760a08084019190915260c083015260b960e08301526050610100830181905260d261012084015260eb61014084015261016083019390935261018082018390526101a08201929092526101c081018290526101e0810182905261020081019190915260f561022082015260fa61024082015260ff610260820152620002719060119060146200108e565b5060408051610280810182526001815260026020820152600491810182905260006060820181905260056080830152600660a0830152600760c0830152600960e08301526101008201819052600a610120830152600b610140830152601161016083015261018082018190526101a082018190526101c082018190526101e0820152610200810191909152601261022082015260136102408201819052610260820152620003249060239060146200108e565b506040805160c08101825260ff8152601e6020820152603c918101829052606081019190915260966080820152609c60a0820152620003689060129060066200108e565b506040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152620003ab9060249060066200108e565b50604080516103808101825260dd81526064602082015260b591810191909152608c6060820181905260e060808301819052609360a080850191909152605460c0850181905260e4838601526101008501849052610120850183905260fa61014086015261016085019190915260f161018085015260cf6101a085015260ad6101c08501526101e084015260fe61020084015260dc61022084015260c4610240840152610260830182905260a861028084015260fc6102a084018190526102c084019290925260b76102e084015260ec61030084015261032083019190915261034082015260ff610360820152620004a890601390601c6200108e565b50604080516103808101825260018082526002602083015260059282018390526000606083015260808201819052600760a083015260c0820152600a60e08201819052610100820192909252610120810191909152600b6101408201819052600c610160830152600d6101808301819052600e6101a0840181905260106101c08501526101e084019290925260116102008401819052601761022085018190526102408501929092526102608401929092526102808301919091526102a082018190526102c082015260186102e0820152601b610300820181905261032082018190526103408201819052610360820152620005a990602590601c6200108e565b50604080516101408101825260af80825260646020830181905260289383019390935260fa60608301526073608083015260a082019290925260b960c082015260e081019190915260b461010082015260ff6101208201526200061190601490600a6200108e565b50604080516101408101825260038152600060208201526004918101919091526006606082018190526080820152600760a0820152600860c0820181905260e0820152600961010082018190526101208201526200067490602690600a6200108e565b506040805161020081018252605080825260e1602083015260e38284015260e460608301526070608083015260f060a080840182905260c0840185905260e084015260a761010084015260d961012084015260ab610140840152610160830193909352610180820192909252607e6101a08201526101c081019190915260ff6101e0820152620007099060159060106200108e565b50604080516102008101825260018152600260208201819052600392820192909252600860608201819052608082019290925260a0810182905260c0810191909152600960e08201819052610100820152600a6101208201819052600d61014083018190526101608301919091526101808201819052600f6101a083018190526101c08301919091526101e0820152620007a89060279060106200108e565b50604080516020810190915260ff8152620007c89060169060016200108e565b50604080516020810190915260008152620007e89060289060016200108e565b50604080516102608101825260f3815260bd6020820152608591810182905260608101829052603960808201819052605f60a0830152609860c0830152608760e0830152610100820192909252610120810182905260de61014082015260a861016082015261018081018290526101a081019190915260266101c082015260726101e08201819052610200820181905261022082015260ff610240820152620008969060179060136200108e565b50604080516102608101825260018082526007602083018190526000938301849052606083018490526080830184905260a0830184905260c08301849052600a60e084015261010083018490526101208301849052600b61014084018190526012610160850181905261018085018690526101a085018690526101c08501959095526101e0840192909252610200830152610220820152610240810191909152620009469060299060136200108e565b50604080516020810190915260ff8152620009669060189060016200108e565b506040805160208101909152600081526200098690602a9060016200108e565b50604080516101208101825260d28152605a602082015260099181018290526060810182905260808101829052609660a082015260c0810182905260ff60e08201526101008101829052620009df91601991906200108e565b5060408051610120810182526005808252600060208301819052928201929092526060810182905260808101829052600760a0820181905260c0820183905260e082015261010081019190915262000a3c90602b9060096200108e565b50604080516020810190915260ff815262000a5c90601a9060016200108e565b5060408051602081019091526000815262000a7c90602c9060016200108e565b50604080516020810190915260ff815262000a9c90601b9060016200108e565b5060408051602081019091526000815262000abc90602d9060016200108e565b506040805161036081018252608780825260b1602083015260db92820192909252608d606082015260b7608082015260e160a0820152609360c082015260bd60e082015260e761010082015261012081018290526101408101829052610160810182905261018081019190915260f66101a082015260966101c082018190526101e0820152609c61020082015260a561022082015260ab61024082015260b461026082015260ba61028082015260c36102a082015260c96102c082015260d26102e082015260f361030082015260fc61032082015260ff61034082015262000ba990601c90601b6200108e565b506040805161036081018252600181526002602082015260039181018290526004606082015260056080820152600660a08201819052600760c0830152600860e0830152600d610100830152610120820192909252610140810191909152600e610160820152600f61018082015260106101a082018190526101c082015260116101e08201526012610200820152601361022082015260146102408201526015610260820152601661028082015260176102a082015260186102c082015260196102e0820152601a6103008201819052610320820181905261034082015262000c9790602e90601b6200108e565b50604080516020810190915260ff815262000cb790601d9060016200108e565b5060408051602081019091526000815262000cd790602f9060016200108e565b50604080516101a08101825260ef815260f4602082015260f99181019190915260ea606082018190526080820181905260a0820181905260c0820181905260e082018190526101008201819052610120820152608261014082015260ff61016082015260f761018082015262000d5290601e90600d6200108e565b50604080516101a0810182526001815260026020820152600b918101829052600060608201526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081019190915262000dcd90603090600d6200108e565b50604080516101e081018252604b80825260b4602083015260a592820192909252607860608201819052603c6080830152609660a0830152606960c083015260c360e08301819052602d610100840181905260e16101208501526101408401949094526101608301939093526101808201929092526101a081019190915260ff6101c082015262000e6390601f90600f6200108e565b50604080516101e08101825260018152600960208201526000918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052600c61012082018190526101408201839052610160820192909252600e61018082018190526101a08201929092526101c081019190915262000ef490603190600f6200108e565b5060408051602080820190925260ff815262000f13919060016200108e565b5060408051602081019091526000815262000f339060329060016200108e565b50604080516080810182526008815260a0602082015260499181019190915260ff606082015262000f699060219060046200108e565b506040805160808101825260028152600360208201819052918101829052606081019190915262000f9f9060339060046200108e565b5050505062001203565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200100d90620011c6565b90600052602060002090601f0160209004810192826200103157600085556200107c565b82601f106200104c57805160ff19168380011785556200107c565b828001600101855582156200107c579182015b828111156200107c5782518255916020019190600101906200105f565b506200108a92915062001131565b5090565b82805482825590600052602060002090601f016020900481019282156200107c5791602002820160005b83821115620010f857835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302620010b8565b8015620011275782816101000a81549060ff0219169055600101602081600001049283019260010302620010f8565b50506200108a9291505b5b808211156200108a576000815560010162001132565b80516001600160a01b03811681146200116057600080fd5b919050565b6000806000606084860312156200117a578283fd5b620011858462001148565b9250620011956020850162001148565b9150604084015190509250925092565b600082620011c157634e487b7160e01b81526012600452602481fd5b500490565b600281046001821680620011db57607f821691505b60208210811415620011fd57634e487b7160e01b600052602260045260246000fd5b50919050565b6080516133dd62001234600039600081816109de01528181610a2c01528181610d81015261160701526133dd6000f3fe6080604052600436106102515760003560e01c806367f68fac11610139578063b88d4fde116100b6578063e1fc334f1161007a578063e1fc334f146106b6578063e985e9c5146106cb578063f25f4b56146106eb578063f2fde38b14610700578063f47c84c514610720578063f4a0a5281461073557610251565b8063b88d4fde14610616578063c002d23d14610636578063c084f5401461064b578063c87b56dd14610660578063e05c57bf1461068057610251565b806390d49b9d116100fd57806390d49b9d1461057457806394e568471461059457806395d89b41146105c1578063a1b8f374146105d6578063a22cb465146105f657610251565b806367f68fac1461050257806370a0823114610515578063715018a6146105355780638da5cb5b1461054a5780638fbb5fa71461055f57610251565b806333df4b2c116101d25780634018b1f8116101965780634018b1f81461045657806342842e0e1461046b5780634f02c4201461048b5780634f6ccce7146104ad5780635c975abb146104cd5780636352211e146104e257610251565b806333df4b2c146103b45780633431a753146103e157806336838391146104015780633b342a85146104215780633ccfd60b1461044157610251565b806318160ddd1161021957806318160ddd1461031d578063194f480e1461033f57806323b872dd1461035457806327de8f27146103745780632f745c591461039457610251565b806301ffc9a71461025657806306fdde031461028c578063081812fc146102ae578063095ea7b3146102db57806316c38b3c146102fd575b600080fd5b34801561026257600080fd5b50610276610271366004612735565b610755565b60405161028391906129f1565b60405180910390f35b34801561029857600080fd5b506102a1610782565b6040516102839190612a4f565b3480156102ba57600080fd5b506102ce6102c93660046127e0565b610814565b604051610283919061292d565b3480156102e757600080fd5b506102fb6102f63660046126f0565b610860565b005b34801561030957600080fd5b506102fb61031836600461271b565b6108f8565b34801561032957600080fd5b50610332610955565b6040516102839190613170565b34801561034b57600080fd5b506102ce61095b565b34801561036057600080fd5b506102fb61036f3660046125d5565b61096a565b34801561038057600080fd5b5061033261038f3660046127e0565b6109c4565b3480156103a057600080fd5b506103326103af3660046126f0565b610a84565b3480156103c057600080fd5b506103d46103cf36600461281a565b610ad9565b6040516102839190613179565b3480156103ed57600080fd5b506102fb6103fc3660046127e0565b610b1f565b34801561040d57600080fd5b506103d461041c36600461281a565b610b63565b34801561042d57600080fd5b506102fb61043c366004612565565b610b73565b34801561044d57600080fd5b506102fb610bd4565b34801561046257600080fd5b50610332610c54565b34801561047757600080fd5b506102fb6104863660046125d5565b610c5a565b34801561049757600080fd5b506104a0610c75565b6040516102839190613161565b3480156104b957600080fd5b506103326104c83660046127e0565b610c7f565b3480156104d957600080fd5b50610276610cda565b3480156104ee57600080fd5b506102ce6104fd3660046127e0565b610cea565b6102fb6105103660046127f8565b610d1f565b34801561052157600080fd5b50610332610530366004612565565b61111a565b34801561054157600080fd5b506102fb61115e565b34801561055657600080fd5b506102ce6111a9565b34801561056b57600080fd5b506102ce6111b8565b34801561058057600080fd5b506102fb61058f366004612565565b6111c7565b3480156105a057600080fd5b506105b46105af3660046127e0565b611230565b6040516102839190613098565b3480156105cd57600080fd5b506102a16112ed565b3480156105e257600080fd5b506103326105f13660046127e0565b6112fc565b34801561060257600080fd5b506102fb6106113660046126bc565b61130e565b34801561062257600080fd5b506102fb610631366004612615565b6113dc565b34801561064257600080fd5b5061033261141b565b34801561065757600080fd5b50610332611421565b34801561066c57600080fd5b506102a161067b3660046127e0565b611427565b34801561068c57600080fd5b506106a061069b3660046127e0565b6114d2565b6040516102839a999897969594939291906129fc565b3480156106c257600080fd5b506102ce611545565b3480156106d757600080fd5b506102766106e636600461259d565b611554565b3480156106f757600080fd5b506102ce611582565b34801561070c57600080fd5b506102fb61071b366004612565565b611597565b34801561072c57600080fd5b50610332611605565b34801561074157600080fd5b506102fb6107503660046127e0565b611629565b60006001600160e01b0319821663780e9d6360e01b148061077a575061077a8261166d565b90505b919050565b6060600080546107919061328c565b80601f01602080910402602001604051908101604052809291908181526020018280546107bd9061328c565b801561080a5780601f106107df5761010080835404028352916020019161080a565b820191906000526020600020905b8154815290600101906020018083116107ed57829003601f168201915b5050505050905090565b600061081f826116ad565b6108445760405162461bcd60e51b815260040161083b90612e74565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061086b82610cea565b9050806001600160a01b0316836001600160a01b0316141561089f5760405162461bcd60e51b815260040161083b90612f8d565b806001600160a01b03166108b16116ca565b6001600160a01b031614806108cd57506108cd816106e66116ca565b6108e95760405162461bcd60e51b815260040161083b90612d4f565b6108f383836116ce565b505050565b6109006116ca565b6001600160a01b03166109116111a9565b6001600160a01b0316146109375760405162461bcd60e51b815260040161083b90612ec0565b801561094a5761094561173c565b610952565b6109526117b4565b50565b60085490565b6034546001600160a01b031681565b6034546001600160a01b031661097e6116ca565b6001600160a01b0316146109b95761099d6109976116ca565b8261180e565b6109b95760405162461bcd60e51b815260040161083b90612fce565b6108f3838383611893565b6000600c5482116109d75750600061077d565b6005610a047f0000000000000000000000000000000000000000000000000000000000000000600261322a565b610a0e9190613216565b8211610a25575069043c33c193756480000061077d565b6005610a527f0000000000000000000000000000000000000000000000000000000000000000600461322a565b610a5c9190613216565b8211610a735750690878678326eac900000061077d565b506910f0cf064dd592000000919050565b6000610a8f8361111a565b8210610aad5760405162461bcd60e51b815260040161083b90612a90565b506001600160a01b03821660009081526006602090815260408083208484529091529020545b92915050565b60108260128110610ae957600080fd5b018181548110610af857600080fd5b9060005260206000209060209182820401919006915091509054906101000a900460ff1681565b610b276116ca565b6001600160a01b0316610b386111a9565b6001600160a01b031614610b5e5760405162461bcd60e51b815260040161083b90612ec0565b600c55565b60228260128110610ae957600080fd5b610b7b6116ca565b6001600160a01b0316610b8c6111a9565b6001600160a01b031614610bb25760405162461bcd60e51b815260040161083b90612ec0565b603480546001600160a01b0319166001600160a01b0392909216919091179055565b610bdc6116ca565b6001600160a01b0316610bed6111a9565b6001600160a01b031614610c135760405162461bcd60e51b815260040161083b90612ec0565b600d546040516001600160a01b036201000090920491909116904780156108fc02916000818181858888f19350505050158015610952573d6000803e3d6000fd5b600c5490565b6108f3838383604051806020016040528060008152506113dc565b600d5461ffff1681565b6000610c89610955565b8210610ca75760405162461bcd60e51b815260040161083b9061304c565b60088281548110610cc857634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b600a54600160a01b900460ff1690565b6000818152600260205260408120546001600160a01b03168061077a5760405162461bcd60e51b815260040161083b90612df6565b610d27610cda565b15610d445760405162461bcd60e51b815260040161083b90612d25565b610d4c6116ca565b6001600160a01b0316326001600160a01b031614610d7c5760405162461bcd60e51b815260040161083b90612c05565b600d547f000000000000000000000000000000000000000000000000000000000000000090610db090849061ffff166131d9565b1115610dce5760405162461bcd60e51b815260040161083b90612b73565b600082118015610ddf5750600a8211155b610dfb5760405162461bcd60e51b815260040161083b9061301f565b600c54600d5461ffff161015610e6f57600c54600d54610e2090849061ffff166131d9565b1115610e3e5760405162461bcd60e51b815260040161083b90612cee565b34600b5483610e4d919061322a565b14610e6a5760405162461bcd60e51b815260040161083b90612bd5565b610e7a565b3415610e7a57600080fd5b60008082610e9657604080516000815260208101909152610ee8565b8367ffffffffffffffff811115610ebd57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610ee6578160200160208202803683370190505b505b90506000805b8581101561103257600d805461ffff16906000610f0a836132c7565b82546101009290920a61ffff818102199093169183160217909155600d54610f3e9250610f39914291166131d9565b6119c0565b600d54909250610f529061ffff1683611a02565b506000610f5e83611bd8565b9050851580610f865750610f706116ca565b6001600160a01b0316816001600160a01b031614155b15610fa257600d54610f9d90829061ffff16611cba565b611002565b603454600d54610fbf916001600160a01b03169061ffff16611cba565b600d54845161ffff90911690859084908110610feb57634e487b7160e01b600052603260045260246000fd5b602002602001019061ffff16908161ffff16815250505b600d546110129061ffff166109c4565b61101c90866131d9565b945050808061102a906132e9565b915050610eee565b5082156110a3576035546001600160a01b0316639dc29fac6110526116ca565b856040518363ffffffff1660e01b81526004016110709291906129d8565b600060405180830381600087803b15801561108a57600080fd5b505af115801561109e573d6000803e3d6000fd5b505050505b8315611113576034546001600160a01b03166381d449c16110c26116ca565b846040518363ffffffff1660e01b81526004016110e092919061297e565b600060405180830381600087803b1580156110fa57600080fd5b505af115801561110e573d6000803e3d6000fd5b505050505b5050505050565b60006001600160a01b0382166111425760405162461bcd60e51b815260040161083b90612dac565b506001600160a01b031660009081526003602052604090205490565b6111666116ca565b6001600160a01b03166111776111a9565b6001600160a01b03161461119d5760405162461bcd60e51b815260040161083b90612ec0565b6111a76000611cd8565b565b600a546001600160a01b031690565b6035546001600160a01b031681565b6111cf6116ca565b6001600160a01b03166111e06111a9565b6001600160a01b0316146112065760405162461bcd60e51b815260040161083b90612ec0565b600d80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b611238612501565b506000908152600e6020908152604091829020825161014081018452905460ff808216151583526101008083048216948401949094526201000082048116948301949094526301000000810484166060830152640100000000810484166080830152650100000000008104841660a083015266010000000000008104841660c0830152600160381b8104841660e0830152600160401b8104841692820192909252600160481b90910490911661012082015290565b6060600180546107919061328c565b600f6020526000908152604090205481565b6113166116ca565b6001600160a01b0316826001600160a01b031614156113475760405162461bcd60e51b815260040161083b90612c6b565b80600560006113546116ca565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556113986116ca565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516113d091906129f1565b60405180910390a35050565b6113ed6113e76116ca565b8361180e565b6114095760405162461bcd60e51b815260040161083b90612fce565b61141584848484611d2a565b50505050565b600b5481565b600c5481565b6060611432826116ad565b61144e5760405162461bcd60e51b815260040161083b90612f3e565b60365460405163c87b56dd60e01b81526001600160a01b039091169063c87b56dd9061147e908590600401613170565b60006040518083038186803b15801561149657600080fd5b505afa1580156114aa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261077a919081019061276d565b600e6020526000908152604090205460ff80821691610100810482169162010000820481169163010000008104821691640100000000820481169165010000000000810482169166010000000000008204811691600160381b8104821691600160401b8204811691600160481b9004168a565b6036546001600160a01b031681565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600d546201000090046001600160a01b031681565b61159f6116ca565b6001600160a01b03166115b06111a9565b6001600160a01b0316146115d65760405162461bcd60e51b815260040161083b90612ec0565b6001600160a01b0381166115fc5760405162461bcd60e51b815260040161083b90612b2d565b61095281611cd8565b7f000000000000000000000000000000000000000000000000000000000000000081565b6116316116ca565b6001600160a01b03166116426111a9565b6001600160a01b0316146116685760405162461bcd60e51b815260040161083b90612ec0565b600b55565b60006001600160e01b031982166380ac58cd60e01b148061169e57506001600160e01b03198216635b5e139f60e01b145b8061077a575061077a82611d5d565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061170382610cea565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611744610cda565b156117615760405162461bcd60e51b815260040161083b90612d25565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861179d6116ca565b6040516117aa919061292d565b60405180910390a1565b6117bc610cda565b6117d85760405162461bcd60e51b815260040161083b90612a62565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61179d6116ca565b6000611819826116ad565b6118355760405162461bcd60e51b815260040161083b90612ca2565b600061184083610cea565b9050806001600160a01b0316846001600160a01b0316148061187b5750836001600160a01b031661187084610814565b6001600160a01b0316145b8061188b575061188b8185611554565b949350505050565b826001600160a01b03166118a682610cea565b6001600160a01b0316146118cc5760405162461bcd60e51b815260040161083b90612ef5565b6001600160a01b0382166118f25760405162461bcd60e51b815260040161083b90612c27565b6118fd838383611d76565b6119086000826116ce565b6001600160a01b0383166000908152600360205260408120805460019290611931908490613249565b90915550506001600160a01b038216600090815260036020526040812080546001929061195f9084906131d9565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000326119ce600143613249565b4042846040516020016119e49493929190612885565b60408051601f19818403018152919052805160209091012092915050565b611a0a612501565b611a1382611dff565b9050600f6000611a2283611f6d565b81526020019081526020016000205460001415611bbf5780600e600085815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff1602179055506101208201518160000160096101000a81548160ff021916908360ff16021790555090505082600f6000611ba984611f6d565b8152602081019190915260400160002055610ad3565b611bd183611bcc846119c0565b611a02565b9392505050565b600c54600d5460009161ffff909116111580611c015750611bfe600a60f584901c613304565b15155b15611c1557611c0e6116ca565b905061077d565b603454604051631e4c4f3560e11b81526000916001600160a01b031690633c989e6a90611c4a90609087901c90600401613170565b60206040518083038186803b158015611c6257600080fd5b505afa158015611c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9a9190612581565b90506001600160a01b03811661077a57611cb26116ca565b91505061077d565b611cd4828260405180602001604052806000815250611fae565b5050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611d35848484611893565b611d4184848484611fe1565b6114155760405162461bcd60e51b815260040161083b90612adb565b6001600160e01b031981166301ffc9a760e01b14919050565b611d818383836108f3565b6001600160a01b038316611d9d57611d98816120fc565b611dc0565b816001600160a01b0316836001600160a01b031614611dc057611dc08382612140565b6001600160a01b038216611ddc57611dd7816121dd565b6108f3565b826001600160a01b0316826001600160a01b0316146108f3576108f382826122b6565b611e07612501565b611e16600a61ffff8416613304565b1515808252600090611e29576009611e2c565b60005b60109390931c929050611e4d61ffff8416611e488360006131f1565b6122fa565b60ff16602083015260109290921c91611e6f61ffff8416611e488360016131f1565b60ff16604083015260109290921c91611e9161ffff8416611e488360026131f1565b60ff16606083015260109290921c91611eb361ffff8416611e488360036131f1565b60ff16608083015260109290921c91611ed561ffff8416611e488360046131f1565b60ff1660a083015260109290921c91611ef761ffff8416611e488360056131f1565b60ff1660c083015260109290921c91611f1961ffff8416611e488360066131f1565b60ff1660e083015260109290921c91611f3b61ffff8416611e488360076131f1565b60ff1661010083015260109290921c91611f5e61ffff8416611e488360086131f1565b60ff1661012083015250919050565b8051602080830151604080850151608086015160c087015160e088015160608901516101008a01516101208b0151965160009a6119e49a90999891016128b4565b611fb8838361241c565b611fc56000848484611fe1565b6108f35760405162461bcd60e51b815260040161083b90612adb565b6000611ff5846001600160a01b03166124fb565b156120f157836001600160a01b031663150b7a026120116116ca565b8786866040518563ffffffff1660e01b81526004016120339493929190612941565b602060405180830381600087803b15801561204d57600080fd5b505af192505050801561207d575060408051601f3d908101601f1916820190925261207a91810190612751565b60015b6120d7573d8080156120ab576040519150601f19603f3d011682016040523d82523d6000602084013e6120b0565b606091505b5080516120cf5760405162461bcd60e51b815260040161083b90612adb565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061188b565b506001949350505050565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6000600161214d8461111a565b6121579190613249565b6000838152600760205260409020549091508082146121aa576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906121ef90600190613249565b6000838152600960205260408120546008805493945090928490811061222557634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061225457634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061229a57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006122c18361111a565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60008060108360ff166012811061232157634e487b7160e01b600052603260045260246000fd5b015461232d9085613318565b905060108360ff166012811061235357634e487b7160e01b600052603260045260246000fd5b018160ff168154811061237657634e487b7160e01b600052603260045260246000fd5b60009182526020918290209181049091015460ff601f9092166101000a90048116600886901c90911610156123ac579050610ad3565b60228360ff16601281106123d057634e487b7160e01b600052603260045260246000fd5b018160ff16815481106123f357634e487b7160e01b600052603260045260246000fd5b90600052602060002090602091828204019190069054906101000a900460ff1691505092915050565b6001600160a01b0382166124425760405162461bcd60e51b815260040161083b90612e3f565b61244b816116ad565b156124685760405162461bcd60e51b815260040161083b90612b9e565b61247460008383611d76565b6001600160a01b038216600090815260036020526040812080546001929061249d9084906131d9565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b3b151590565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081019190915290565b8035801515811461077d57600080fd5b600060208284031215612576578081fd5b8135611bd18161337c565b600060208284031215612592578081fd5b8151611bd18161337c565b600080604083850312156125af578081fd5b82356125ba8161337c565b915060208301356125ca8161337c565b809150509250929050565b6000806000606084860312156125e9578081fd5b83356125f48161337c565b925060208401356126048161337c565b929592945050506040919091013590565b6000806000806080858703121561262a578081fd5b84356126358161337c565b935060208501356126458161337c565b925060408501359150606085013567ffffffffffffffff811115612667578182fd5b8501601f81018713612677578182fd5b803561268a612685826131b1565b613187565b81815288602083850101111561269e578384fd5b81602084016020830137908101602001929092525092959194509250565b600080604083850312156126ce578182fd5b82356126d98161337c565b91506126e760208401612555565b90509250929050565b60008060408385031215612702578182fd5b823561270d8161337c565b946020939093013593505050565b60006020828403121561272c578081fd5b611bd182612555565b600060208284031215612746578081fd5b8135611bd181613391565b600060208284031215612762578081fd5b8151611bd181613391565b60006020828403121561277e578081fd5b815167ffffffffffffffff811115612794578182fd5b8201601f810184136127a4578182fd5b80516127b2612685826131b1565b8181528560208385010111156127c6578384fd5b6127d7826020830160208601613260565b95945050505050565b6000602082840312156127f1578081fd5b5035919050565b6000806040838503121561280a578182fd5b823591506126e760208401612555565b6000806040838503121561282c578182fd5b50508035926020909101359150565b15159052565b60008151808452612859816020860160208601613260565b601f01601f19169290920160200192915050565b60ff169052565b60f81b6001600160f81b0319169052565b60609490941b6bffffffffffffffffffffffff1916845260148401929092526034830152605482015260740190565b89151560f890811b82526001600160f81b03198a821b8116600184015289821b8116600284015288821b8116600384015287821b8116600484015286821b8116600584015285821b811660068401529084901b166007820152600061291c6008830184612874565b506009019998505050505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061297490830184612841565b9695505050505050565b6001600160a01b038316815260406020808301829052835191830182905260009184820191906060850190845b818110156129cb57845161ffff16835293830193918301916001016129ab565b5090979650505050505050565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b9915158a5260ff98891660208b015296881660408a01529487166060890152928616608088015290851660a0870152841660c0860152831660e08501528216610100840152166101208201526101400190565b600060208252611bd16020830184612841565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b602080825260119082015270105b1b081d1bdad95b9cc81b5a5b9d1959607a1b604082015260600190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b602080825260169082015275125b9d985b1a59081c185e5b595b9d08185b5bdd5b9d60521b604082015260600190565b6020808252600890820152674f6e6c7920454f4160c01b604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252601f908201527f416c6c20746f6b656e73206f6e2d73616c6520616c726561647920736f6c6400604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b602080825260139082015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b604082015260600190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b6000610140820190506130ac82845161283b565b60208301516130be602084018261286d565b5060408301516130d1604084018261286d565b5060608301516130e4606084018261286d565b5060808301516130f7608084018261286d565b5060a083015161310a60a084018261286d565b5060c083015161311d60c084018261286d565b5060e083015161313060e084018261286d565b50610100808401516131448285018261286d565b5050610120808401516131598285018261286d565b505092915050565b61ffff91909116815260200190565b90815260200190565b60ff91909116815260200190565b60405181810167ffffffffffffffff811182821017156131a9576131a9613366565b604052919050565b600067ffffffffffffffff8211156131cb576131cb613366565b50601f01601f191660200190565b600082198211156131ec576131ec61333a565b500190565b600060ff821660ff84168060ff0382111561320e5761320e61333a565b019392505050565b60008261322557613225613350565b500490565b60008160001904831182151516156132445761324461333a565b500290565b60008282101561325b5761325b61333a565b500390565b60005b8381101561327b578181015183820152602001613263565b838111156114155750506000910152565b6002810460018216806132a057607f821691505b602082108114156132c157634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff808316818114156132df576132df61333a565b6001019392505050565b60006000198214156132fd576132fd61333a565b5060010190565b60008261331357613313613350565b500690565b600060ff83168061332b5761332b613350565b8060ff84160691505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461095257600080fd5b6001600160e01b03198116811461095257600080fdfea2646970667358221220add03aa082c7a88d5158c577974453d45a2fdd796c7a7e3a4ae8de19b89fbe6964736f6c634300080000330000000000000000000000002e4bf93bded3236d0719aa3ceb43932f279efe1f000000000000000000000000773e7ca9c70707313cc7b09ab8e38a44fd8aae10000000000000000000000000000000000000000000000000000000000000c350
Deployed Bytecode
0x6080604052600436106102515760003560e01c806367f68fac11610139578063b88d4fde116100b6578063e1fc334f1161007a578063e1fc334f146106b6578063e985e9c5146106cb578063f25f4b56146106eb578063f2fde38b14610700578063f47c84c514610720578063f4a0a5281461073557610251565b8063b88d4fde14610616578063c002d23d14610636578063c084f5401461064b578063c87b56dd14610660578063e05c57bf1461068057610251565b806390d49b9d116100fd57806390d49b9d1461057457806394e568471461059457806395d89b41146105c1578063a1b8f374146105d6578063a22cb465146105f657610251565b806367f68fac1461050257806370a0823114610515578063715018a6146105355780638da5cb5b1461054a5780638fbb5fa71461055f57610251565b806333df4b2c116101d25780634018b1f8116101965780634018b1f81461045657806342842e0e1461046b5780634f02c4201461048b5780634f6ccce7146104ad5780635c975abb146104cd5780636352211e146104e257610251565b806333df4b2c146103b45780633431a753146103e157806336838391146104015780633b342a85146104215780633ccfd60b1461044157610251565b806318160ddd1161021957806318160ddd1461031d578063194f480e1461033f57806323b872dd1461035457806327de8f27146103745780632f745c591461039457610251565b806301ffc9a71461025657806306fdde031461028c578063081812fc146102ae578063095ea7b3146102db57806316c38b3c146102fd575b600080fd5b34801561026257600080fd5b50610276610271366004612735565b610755565b60405161028391906129f1565b60405180910390f35b34801561029857600080fd5b506102a1610782565b6040516102839190612a4f565b3480156102ba57600080fd5b506102ce6102c93660046127e0565b610814565b604051610283919061292d565b3480156102e757600080fd5b506102fb6102f63660046126f0565b610860565b005b34801561030957600080fd5b506102fb61031836600461271b565b6108f8565b34801561032957600080fd5b50610332610955565b6040516102839190613170565b34801561034b57600080fd5b506102ce61095b565b34801561036057600080fd5b506102fb61036f3660046125d5565b61096a565b34801561038057600080fd5b5061033261038f3660046127e0565b6109c4565b3480156103a057600080fd5b506103326103af3660046126f0565b610a84565b3480156103c057600080fd5b506103d46103cf36600461281a565b610ad9565b6040516102839190613179565b3480156103ed57600080fd5b506102fb6103fc3660046127e0565b610b1f565b34801561040d57600080fd5b506103d461041c36600461281a565b610b63565b34801561042d57600080fd5b506102fb61043c366004612565565b610b73565b34801561044d57600080fd5b506102fb610bd4565b34801561046257600080fd5b50610332610c54565b34801561047757600080fd5b506102fb6104863660046125d5565b610c5a565b34801561049757600080fd5b506104a0610c75565b6040516102839190613161565b3480156104b957600080fd5b506103326104c83660046127e0565b610c7f565b3480156104d957600080fd5b50610276610cda565b3480156104ee57600080fd5b506102ce6104fd3660046127e0565b610cea565b6102fb6105103660046127f8565b610d1f565b34801561052157600080fd5b50610332610530366004612565565b61111a565b34801561054157600080fd5b506102fb61115e565b34801561055657600080fd5b506102ce6111a9565b34801561056b57600080fd5b506102ce6111b8565b34801561058057600080fd5b506102fb61058f366004612565565b6111c7565b3480156105a057600080fd5b506105b46105af3660046127e0565b611230565b6040516102839190613098565b3480156105cd57600080fd5b506102a16112ed565b3480156105e257600080fd5b506103326105f13660046127e0565b6112fc565b34801561060257600080fd5b506102fb6106113660046126bc565b61130e565b34801561062257600080fd5b506102fb610631366004612615565b6113dc565b34801561064257600080fd5b5061033261141b565b34801561065757600080fd5b50610332611421565b34801561066c57600080fd5b506102a161067b3660046127e0565b611427565b34801561068c57600080fd5b506106a061069b3660046127e0565b6114d2565b6040516102839a999897969594939291906129fc565b3480156106c257600080fd5b506102ce611545565b3480156106d757600080fd5b506102766106e636600461259d565b611554565b3480156106f757600080fd5b506102ce611582565b34801561070c57600080fd5b506102fb61071b366004612565565b611597565b34801561072c57600080fd5b50610332611605565b34801561074157600080fd5b506102fb6107503660046127e0565b611629565b60006001600160e01b0319821663780e9d6360e01b148061077a575061077a8261166d565b90505b919050565b6060600080546107919061328c565b80601f01602080910402602001604051908101604052809291908181526020018280546107bd9061328c565b801561080a5780601f106107df5761010080835404028352916020019161080a565b820191906000526020600020905b8154815290600101906020018083116107ed57829003601f168201915b5050505050905090565b600061081f826116ad565b6108445760405162461bcd60e51b815260040161083b90612e74565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061086b82610cea565b9050806001600160a01b0316836001600160a01b0316141561089f5760405162461bcd60e51b815260040161083b90612f8d565b806001600160a01b03166108b16116ca565b6001600160a01b031614806108cd57506108cd816106e66116ca565b6108e95760405162461bcd60e51b815260040161083b90612d4f565b6108f383836116ce565b505050565b6109006116ca565b6001600160a01b03166109116111a9565b6001600160a01b0316146109375760405162461bcd60e51b815260040161083b90612ec0565b801561094a5761094561173c565b610952565b6109526117b4565b50565b60085490565b6034546001600160a01b031681565b6034546001600160a01b031661097e6116ca565b6001600160a01b0316146109b95761099d6109976116ca565b8261180e565b6109b95760405162461bcd60e51b815260040161083b90612fce565b6108f3838383611893565b6000600c5482116109d75750600061077d565b6005610a047f000000000000000000000000000000000000000000000000000000000000c350600261322a565b610a0e9190613216565b8211610a25575069043c33c193756480000061077d565b6005610a527f000000000000000000000000000000000000000000000000000000000000c350600461322a565b610a5c9190613216565b8211610a735750690878678326eac900000061077d565b506910f0cf064dd592000000919050565b6000610a8f8361111a565b8210610aad5760405162461bcd60e51b815260040161083b90612a90565b506001600160a01b03821660009081526006602090815260408083208484529091529020545b92915050565b60108260128110610ae957600080fd5b018181548110610af857600080fd5b9060005260206000209060209182820401919006915091509054906101000a900460ff1681565b610b276116ca565b6001600160a01b0316610b386111a9565b6001600160a01b031614610b5e5760405162461bcd60e51b815260040161083b90612ec0565b600c55565b60228260128110610ae957600080fd5b610b7b6116ca565b6001600160a01b0316610b8c6111a9565b6001600160a01b031614610bb25760405162461bcd60e51b815260040161083b90612ec0565b603480546001600160a01b0319166001600160a01b0392909216919091179055565b610bdc6116ca565b6001600160a01b0316610bed6111a9565b6001600160a01b031614610c135760405162461bcd60e51b815260040161083b90612ec0565b600d546040516001600160a01b036201000090920491909116904780156108fc02916000818181858888f19350505050158015610952573d6000803e3d6000fd5b600c5490565b6108f3838383604051806020016040528060008152506113dc565b600d5461ffff1681565b6000610c89610955565b8210610ca75760405162461bcd60e51b815260040161083b9061304c565b60088281548110610cc857634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b600a54600160a01b900460ff1690565b6000818152600260205260408120546001600160a01b03168061077a5760405162461bcd60e51b815260040161083b90612df6565b610d27610cda565b15610d445760405162461bcd60e51b815260040161083b90612d25565b610d4c6116ca565b6001600160a01b0316326001600160a01b031614610d7c5760405162461bcd60e51b815260040161083b90612c05565b600d547f000000000000000000000000000000000000000000000000000000000000c35090610db090849061ffff166131d9565b1115610dce5760405162461bcd60e51b815260040161083b90612b73565b600082118015610ddf5750600a8211155b610dfb5760405162461bcd60e51b815260040161083b9061301f565b600c54600d5461ffff161015610e6f57600c54600d54610e2090849061ffff166131d9565b1115610e3e5760405162461bcd60e51b815260040161083b90612cee565b34600b5483610e4d919061322a565b14610e6a5760405162461bcd60e51b815260040161083b90612bd5565b610e7a565b3415610e7a57600080fd5b60008082610e9657604080516000815260208101909152610ee8565b8367ffffffffffffffff811115610ebd57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610ee6578160200160208202803683370190505b505b90506000805b8581101561103257600d805461ffff16906000610f0a836132c7565b82546101009290920a61ffff818102199093169183160217909155600d54610f3e9250610f39914291166131d9565b6119c0565b600d54909250610f529061ffff1683611a02565b506000610f5e83611bd8565b9050851580610f865750610f706116ca565b6001600160a01b0316816001600160a01b031614155b15610fa257600d54610f9d90829061ffff16611cba565b611002565b603454600d54610fbf916001600160a01b03169061ffff16611cba565b600d54845161ffff90911690859084908110610feb57634e487b7160e01b600052603260045260246000fd5b602002602001019061ffff16908161ffff16815250505b600d546110129061ffff166109c4565b61101c90866131d9565b945050808061102a906132e9565b915050610eee565b5082156110a3576035546001600160a01b0316639dc29fac6110526116ca565b856040518363ffffffff1660e01b81526004016110709291906129d8565b600060405180830381600087803b15801561108a57600080fd5b505af115801561109e573d6000803e3d6000fd5b505050505b8315611113576034546001600160a01b03166381d449c16110c26116ca565b846040518363ffffffff1660e01b81526004016110e092919061297e565b600060405180830381600087803b1580156110fa57600080fd5b505af115801561110e573d6000803e3d6000fd5b505050505b5050505050565b60006001600160a01b0382166111425760405162461bcd60e51b815260040161083b90612dac565b506001600160a01b031660009081526003602052604090205490565b6111666116ca565b6001600160a01b03166111776111a9565b6001600160a01b03161461119d5760405162461bcd60e51b815260040161083b90612ec0565b6111a76000611cd8565b565b600a546001600160a01b031690565b6035546001600160a01b031681565b6111cf6116ca565b6001600160a01b03166111e06111a9565b6001600160a01b0316146112065760405162461bcd60e51b815260040161083b90612ec0565b600d80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b611238612501565b506000908152600e6020908152604091829020825161014081018452905460ff808216151583526101008083048216948401949094526201000082048116948301949094526301000000810484166060830152640100000000810484166080830152650100000000008104841660a083015266010000000000008104841660c0830152600160381b8104841660e0830152600160401b8104841692820192909252600160481b90910490911661012082015290565b6060600180546107919061328c565b600f6020526000908152604090205481565b6113166116ca565b6001600160a01b0316826001600160a01b031614156113475760405162461bcd60e51b815260040161083b90612c6b565b80600560006113546116ca565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556113986116ca565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516113d091906129f1565b60405180910390a35050565b6113ed6113e76116ca565b8361180e565b6114095760405162461bcd60e51b815260040161083b90612fce565b61141584848484611d2a565b50505050565b600b5481565b600c5481565b6060611432826116ad565b61144e5760405162461bcd60e51b815260040161083b90612f3e565b60365460405163c87b56dd60e01b81526001600160a01b039091169063c87b56dd9061147e908590600401613170565b60006040518083038186803b15801561149657600080fd5b505afa1580156114aa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261077a919081019061276d565b600e6020526000908152604090205460ff80821691610100810482169162010000820481169163010000008104821691640100000000820481169165010000000000810482169166010000000000008204811691600160381b8104821691600160401b8204811691600160481b9004168a565b6036546001600160a01b031681565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600d546201000090046001600160a01b031681565b61159f6116ca565b6001600160a01b03166115b06111a9565b6001600160a01b0316146115d65760405162461bcd60e51b815260040161083b90612ec0565b6001600160a01b0381166115fc5760405162461bcd60e51b815260040161083b90612b2d565b61095281611cd8565b7f000000000000000000000000000000000000000000000000000000000000c35081565b6116316116ca565b6001600160a01b03166116426111a9565b6001600160a01b0316146116685760405162461bcd60e51b815260040161083b90612ec0565b600b55565b60006001600160e01b031982166380ac58cd60e01b148061169e57506001600160e01b03198216635b5e139f60e01b145b8061077a575061077a82611d5d565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061170382610cea565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611744610cda565b156117615760405162461bcd60e51b815260040161083b90612d25565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861179d6116ca565b6040516117aa919061292d565b60405180910390a1565b6117bc610cda565b6117d85760405162461bcd60e51b815260040161083b90612a62565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61179d6116ca565b6000611819826116ad565b6118355760405162461bcd60e51b815260040161083b90612ca2565b600061184083610cea565b9050806001600160a01b0316846001600160a01b0316148061187b5750836001600160a01b031661187084610814565b6001600160a01b0316145b8061188b575061188b8185611554565b949350505050565b826001600160a01b03166118a682610cea565b6001600160a01b0316146118cc5760405162461bcd60e51b815260040161083b90612ef5565b6001600160a01b0382166118f25760405162461bcd60e51b815260040161083b90612c27565b6118fd838383611d76565b6119086000826116ce565b6001600160a01b0383166000908152600360205260408120805460019290611931908490613249565b90915550506001600160a01b038216600090815260036020526040812080546001929061195f9084906131d9565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000326119ce600143613249565b4042846040516020016119e49493929190612885565b60408051601f19818403018152919052805160209091012092915050565b611a0a612501565b611a1382611dff565b9050600f6000611a2283611f6d565b81526020019081526020016000205460001415611bbf5780600e600085815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff1602179055506101208201518160000160096101000a81548160ff021916908360ff16021790555090505082600f6000611ba984611f6d565b8152602081019190915260400160002055610ad3565b611bd183611bcc846119c0565b611a02565b9392505050565b600c54600d5460009161ffff909116111580611c015750611bfe600a60f584901c613304565b15155b15611c1557611c0e6116ca565b905061077d565b603454604051631e4c4f3560e11b81526000916001600160a01b031690633c989e6a90611c4a90609087901c90600401613170565b60206040518083038186803b158015611c6257600080fd5b505afa158015611c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9a9190612581565b90506001600160a01b03811661077a57611cb26116ca565b91505061077d565b611cd4828260405180602001604052806000815250611fae565b5050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611d35848484611893565b611d4184848484611fe1565b6114155760405162461bcd60e51b815260040161083b90612adb565b6001600160e01b031981166301ffc9a760e01b14919050565b611d818383836108f3565b6001600160a01b038316611d9d57611d98816120fc565b611dc0565b816001600160a01b0316836001600160a01b031614611dc057611dc08382612140565b6001600160a01b038216611ddc57611dd7816121dd565b6108f3565b826001600160a01b0316826001600160a01b0316146108f3576108f382826122b6565b611e07612501565b611e16600a61ffff8416613304565b1515808252600090611e29576009611e2c565b60005b60109390931c929050611e4d61ffff8416611e488360006131f1565b6122fa565b60ff16602083015260109290921c91611e6f61ffff8416611e488360016131f1565b60ff16604083015260109290921c91611e9161ffff8416611e488360026131f1565b60ff16606083015260109290921c91611eb361ffff8416611e488360036131f1565b60ff16608083015260109290921c91611ed561ffff8416611e488360046131f1565b60ff1660a083015260109290921c91611ef761ffff8416611e488360056131f1565b60ff1660c083015260109290921c91611f1961ffff8416611e488360066131f1565b60ff1660e083015260109290921c91611f3b61ffff8416611e488360076131f1565b60ff1661010083015260109290921c91611f5e61ffff8416611e488360086131f1565b60ff1661012083015250919050565b8051602080830151604080850151608086015160c087015160e088015160608901516101008a01516101208b0151965160009a6119e49a90999891016128b4565b611fb8838361241c565b611fc56000848484611fe1565b6108f35760405162461bcd60e51b815260040161083b90612adb565b6000611ff5846001600160a01b03166124fb565b156120f157836001600160a01b031663150b7a026120116116ca565b8786866040518563ffffffff1660e01b81526004016120339493929190612941565b602060405180830381600087803b15801561204d57600080fd5b505af192505050801561207d575060408051601f3d908101601f1916820190925261207a91810190612751565b60015b6120d7573d8080156120ab576040519150601f19603f3d011682016040523d82523d6000602084013e6120b0565b606091505b5080516120cf5760405162461bcd60e51b815260040161083b90612adb565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061188b565b506001949350505050565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6000600161214d8461111a565b6121579190613249565b6000838152600760205260409020549091508082146121aa576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906121ef90600190613249565b6000838152600960205260408120546008805493945090928490811061222557634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061225457634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061229a57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006122c18361111a565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60008060108360ff166012811061232157634e487b7160e01b600052603260045260246000fd5b015461232d9085613318565b905060108360ff166012811061235357634e487b7160e01b600052603260045260246000fd5b018160ff168154811061237657634e487b7160e01b600052603260045260246000fd5b60009182526020918290209181049091015460ff601f9092166101000a90048116600886901c90911610156123ac579050610ad3565b60228360ff16601281106123d057634e487b7160e01b600052603260045260246000fd5b018160ff16815481106123f357634e487b7160e01b600052603260045260246000fd5b90600052602060002090602091828204019190069054906101000a900460ff1691505092915050565b6001600160a01b0382166124425760405162461bcd60e51b815260040161083b90612e3f565b61244b816116ad565b156124685760405162461bcd60e51b815260040161083b90612b9e565b61247460008383611d76565b6001600160a01b038216600090815260036020526040812080546001929061249d9084906131d9565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b3b151590565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081019190915290565b8035801515811461077d57600080fd5b600060208284031215612576578081fd5b8135611bd18161337c565b600060208284031215612592578081fd5b8151611bd18161337c565b600080604083850312156125af578081fd5b82356125ba8161337c565b915060208301356125ca8161337c565b809150509250929050565b6000806000606084860312156125e9578081fd5b83356125f48161337c565b925060208401356126048161337c565b929592945050506040919091013590565b6000806000806080858703121561262a578081fd5b84356126358161337c565b935060208501356126458161337c565b925060408501359150606085013567ffffffffffffffff811115612667578182fd5b8501601f81018713612677578182fd5b803561268a612685826131b1565b613187565b81815288602083850101111561269e578384fd5b81602084016020830137908101602001929092525092959194509250565b600080604083850312156126ce578182fd5b82356126d98161337c565b91506126e760208401612555565b90509250929050565b60008060408385031215612702578182fd5b823561270d8161337c565b946020939093013593505050565b60006020828403121561272c578081fd5b611bd182612555565b600060208284031215612746578081fd5b8135611bd181613391565b600060208284031215612762578081fd5b8151611bd181613391565b60006020828403121561277e578081fd5b815167ffffffffffffffff811115612794578182fd5b8201601f810184136127a4578182fd5b80516127b2612685826131b1565b8181528560208385010111156127c6578384fd5b6127d7826020830160208601613260565b95945050505050565b6000602082840312156127f1578081fd5b5035919050565b6000806040838503121561280a578182fd5b823591506126e760208401612555565b6000806040838503121561282c578182fd5b50508035926020909101359150565b15159052565b60008151808452612859816020860160208601613260565b601f01601f19169290920160200192915050565b60ff169052565b60f81b6001600160f81b0319169052565b60609490941b6bffffffffffffffffffffffff1916845260148401929092526034830152605482015260740190565b89151560f890811b82526001600160f81b03198a821b8116600184015289821b8116600284015288821b8116600384015287821b8116600484015286821b8116600584015285821b811660068401529084901b166007820152600061291c6008830184612874565b506009019998505050505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061297490830184612841565b9695505050505050565b6001600160a01b038316815260406020808301829052835191830182905260009184820191906060850190845b818110156129cb57845161ffff16835293830193918301916001016129ab565b5090979650505050505050565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b9915158a5260ff98891660208b015296881660408a01529487166060890152928616608088015290851660a0870152841660c0860152831660e08501528216610100840152166101208201526101400190565b600060208252611bd16020830184612841565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b602080825260119082015270105b1b081d1bdad95b9cc81b5a5b9d1959607a1b604082015260600190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b602080825260169082015275125b9d985b1a59081c185e5b595b9d08185b5bdd5b9d60521b604082015260600190565b6020808252600890820152674f6e6c7920454f4160c01b604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252601f908201527f416c6c20746f6b656e73206f6e2d73616c6520616c726561647920736f6c6400604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b602080825260139082015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b604082015260600190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b6000610140820190506130ac82845161283b565b60208301516130be602084018261286d565b5060408301516130d1604084018261286d565b5060608301516130e4606084018261286d565b5060808301516130f7608084018261286d565b5060a083015161310a60a084018261286d565b5060c083015161311d60c084018261286d565b5060e083015161313060e084018261286d565b50610100808401516131448285018261286d565b5050610120808401516131598285018261286d565b505092915050565b61ffff91909116815260200190565b90815260200190565b60ff91909116815260200190565b60405181810167ffffffffffffffff811182821017156131a9576131a9613366565b604052919050565b600067ffffffffffffffff8211156131cb576131cb613366565b50601f01601f191660200190565b600082198211156131ec576131ec61333a565b500190565b600060ff821660ff84168060ff0382111561320e5761320e61333a565b019392505050565b60008261322557613225613350565b500490565b60008160001904831182151516156132445761324461333a565b500290565b60008282101561325b5761325b61333a565b500390565b60005b8381101561327b578181015183820152602001613263565b838111156114155750506000910152565b6002810460018216806132a057607f821691505b602082108114156132c157634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff808316818114156132df576132df61333a565b6001019392505050565b60006000198214156132fd576132fd61333a565b5060010190565b60008261331357613313613350565b500690565b600060ff83168061332b5761332b613350565b8060ff84160691505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461095257600080fd5b6001600160e01b03198116811461095257600080fdfea2646970667358221220add03aa082c7a88d5158c577974453d45a2fdd796c7a7e3a4ae8de19b89fbe6964736f6c63430008000033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002e4bf93bded3236d0719aa3ceb43932f279efe1f000000000000000000000000773e7ca9c70707313cc7b09ab8e38a44fd8aae10000000000000000000000000000000000000000000000000000000000000c350
-----Decoded View---------------
Arg [0] : _wool (address): 0x2E4bF93BdEd3236D0719aa3ceB43932f279EFe1F
Arg [1] : _traits (address): 0x773E7ca9C70707313cC7b09Ab8E38A44fd8AaE10
Arg [2] : _maxTokens (uint256): 50000
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000002e4bf93bded3236d0719aa3ceb43932f279efe1f
Arg [1] : 000000000000000000000000773e7ca9c70707313cc7b09ab8e38a44fd8aae10
Arg [2] : 000000000000000000000000000000000000000000000000000000000000c350
Loading...
Loading
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.