ERC-721
Overview
Max Total Supply
159 FRAME
Holders
83
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 FRAMELoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
Customoose
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// contracts/CustoMoose.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./IToken.sol"; import "./Library.sol"; import "./TraitLibrary.sol"; import "./BytesLib.sol"; contract Customoose is ERC721Enumerable, Ownable { using BytesLib for bytes; using SafeMath for uint256; using Library for uint8; //Mappings mapping(uint256 => string) internal tokenIdToConfig; mapping(uint256 => uint256) internal tokenIdToStoredTrax; //uint256s uint256 MAX_SUPPLY = 10000; uint256 MINTS_PER_TIER = 1000; uint256 MINT_START = 1639418400; uint256 MINT_START_ETH = MINT_START.add(86400); uint256 MINT_DELAY = 43200; uint256 START_PRICE = 70000000000000000; uint256 MIN_PRICE = 20000000000000000; uint256 PRICE_DIFF = 5000000000000000; uint256 START_PRICE_TRAX = 10000000000000000000; uint256 PRICE_DIFF_TRAX = 10000000000000000000; //address address public mooseAddress; address public traxAddress; address public libraryAddress; address _owner; constructor(address _mooseAddress, address _traxAddress, address _libraryAddress) ERC721("Frame", "FRAME") { _owner = msg.sender; setMooseAddress(_mooseAddress); setTraxAddress(_traxAddress); setLibraryAddress(_libraryAddress); // test mint mintInternal(); } /* __ __ _ _ _ ___ _ _ | \/ (_)_ _| |_(_)_ _ __ _ | __| _ _ _ __| |_(_)___ _ _ ___ | |\/| | | ' \ _| | ' \/ _` | | _| || | ' \/ _| _| / _ \ ' \(_-< |_| |_|_|_||_\__|_|_||_\__, | |_| \_,_|_||_\__|\__|_\___/_||_/__/ |___/ */ /** * @dev Generates an 8 digit config */ function config() internal pure returns (string memory) { // This will generate an 9 character string. // All of them will start as 0 string memory currentConfig = "000000000"; return currentConfig; } /** * @dev Mint internal, this is to avoid code duplication. */ function mintInternal() internal returns (uint256 tokenId) { uint256 _totalSupply = totalSupply(); require(_totalSupply < MAX_SUPPLY); require(!Library.isContract(msg.sender)); uint256 thisTokenId = _totalSupply; tokenIdToConfig[thisTokenId] = config(); tokenIdToStoredTrax[thisTokenId] = 0; _mint(msg.sender, thisTokenId); return thisTokenId; } /** * @dev Mints new frame using TRAX */ function mintFrameWithTrax(uint8 _times) public { require(block.timestamp >= MINT_START, "Minting has not started"); uint256 allowance = IToken(traxAddress).allowance(msg.sender, address(this)); require(allowance >= _times * getMintPriceTrax(), "Check the token allowance"); IToken(traxAddress).burnFrom(msg.sender, _times * getMintPriceTrax()); for(uint256 i=0; i< _times; i++){ mintInternal(); } } /** * @dev Mints new frame using ETH */ function mintFrameWithEth(uint8 _times) public payable { require(block.timestamp >= MINT_START_ETH, "Minting for ETH has not started"); require((_times > 0 && _times <= 20)); require(msg.value >= _times * getMintPriceEth()); for(uint256 i=0; i< _times; i++){ mintInternal(); } } /** * @dev Mints new frame with customizations using ETH */ function mintCustomooseWithEth(string memory tokenConfig) public payable { require(block.timestamp >= MINT_START_ETH, "Minting for ETH has not started"); require(msg.value >= getMintPriceEth(), "Not enough ETH"); uint256 tokenId = mintInternal(); setTokenConfig(tokenId, tokenConfig); } /** * @dev Mints new frame with customizations using TRAX */ function mintCustomooseWithTrax(string memory tokenConfig) public payable { require(block.timestamp >= MINT_START, "Minting has not started"); uint256 allowance = IToken(traxAddress).allowance(msg.sender, address(this)); require(allowance >= getMintPriceTrax(), "Check the token allowance"); IToken(traxAddress).burnFrom(msg.sender, getMintPriceTrax()); uint256 tokenId = mintInternal(); setTokenConfig(tokenId, tokenConfig); } /** * @dev Burns a frame and returns TRAX */ function burnFrameForTrax(uint256 _tokenId) public { require(ownerOf(_tokenId) == msg.sender); //Burn token _transfer( msg.sender, 0x000000000000000000000000000000000000dEaD, _tokenId ); //Return the TRAX IToken(traxAddress).transfer( msg.sender, tokenIdToStoredTrax[_tokenId] ); } /** * @dev Sets a trait for a token */ function setTokenTrait(uint256 _tokenId, uint8 _traitIndex, uint8 _traitValue) public onlyOwner { string memory tokenConfig = tokenIdToConfig[_tokenId]; string memory newTokenConfig = Library.stringReplace(tokenConfig, _traitIndex, Library.toString(_traitValue)); tokenIdToConfig[_tokenId] = newTokenConfig; } /** * @dev Sets the config for a token */ function setTokenConfig(uint256 _tokenId, string memory _newConfig) public { require(keccak256(abi.encodePacked(tokenIdToConfig[_tokenId])) != keccak256(abi.encodePacked(_newConfig)), "Config must be different"); uint256 allowance = IToken(traxAddress).allowance(msg.sender, address(this)); (uint256 price, uint256 valueDiff, bool valueIncreased) = getCustomizationPrice(_tokenId, _newConfig); uint256 balance = IToken(traxAddress).balanceOf(msg.sender); require(allowance >= price, "Check the token allowance"); require(balance >= price, "You need more TRAX"); if(valueDiff >= 0 && valueIncreased) { IToken(traxAddress).transferFrom( msg.sender, address(this), valueDiff ); IToken(traxAddress).burnFrom(msg.sender, price.sub(valueDiff)); tokenIdToStoredTrax[_tokenId] += valueDiff; } else if(valueDiff >= 0 && !valueIncreased) { tokenIdToStoredTrax[_tokenId] -= valueDiff; } tokenIdToConfig[_tokenId] = _newConfig; } /** * @dev Takes an array of trait changes and gets the new config */ function getNewTokenConfig(uint256 _tokenId, uint8[2][] calldata _newTraits) public view returns (string memory) { string memory tokenConfig = tokenIdToConfig[_tokenId]; string memory newTokenConfig = tokenConfig; for (uint8 i = 0; i < _newTraits.length; i++) { string memory newTraitValue = Library.toString(_newTraits[i][1]); newTokenConfig = Library.stringReplace(newTokenConfig, _newTraits[i][0], newTraitValue); } return (newTokenConfig); } /** * @dev Gets the price of a newly minted frame */ function getMintCustomizationPrice(string memory _newConfig) public view returns (uint256 price) { price = 0; for (uint8 i = 0; i < 9; i++) { uint8 traitValue = convertInt(bytes(_newConfig).slice(i, 1).toUint8(0)); uint256 traitPrice = TraitLibrary(libraryAddress).getPrice(i, traitValue); price = price.add(traitPrice); } price = price.mul(10**16); return price; } /** * @dev Gets the price given a tokenId and new config */ function getCustomizationPrice(uint256 _tokenId, string memory _newConfig) public view returns (uint256 price, uint256 valueDiff, bool increased) { string memory tokenConfig = tokenIdToConfig[_tokenId]; uint256 currentValue = tokenIdToStoredTrax[_tokenId]; price = 0; uint256 futureValue = 0; for (uint8 i = 0; i < 9; i++) { uint8 traitValue = convertInt(bytes(_newConfig).slice(i, 1).toUint8(0)); uint256 traitPrice = TraitLibrary(libraryAddress).getPrice(i, traitValue); bool isChanged = keccak256(abi.encodePacked(bytes(tokenConfig).slice(i, 1))) != keccak256(abi.encodePacked(bytes(_newConfig).slice(i, 1))); futureValue = futureValue.add(traitPrice); if(isChanged) { price = price.add(traitPrice); } } price = price.mul(10**16); futureValue = futureValue.mul(10**16).div(100).mul(80); if(futureValue == currentValue) { valueDiff = 0; increased = true; } else if(futureValue > currentValue) { valueDiff = futureValue.sub(currentValue); increased = true; } else { valueDiff = currentValue.sub(futureValue); increased = false; } return (price, valueDiff, increased); } /** * @dev Gets the price of a specified trait */ function getTraitPrice(uint256 typeIndex, uint256 nameIndex) public view returns (uint256 traitPrice) { traitPrice = TraitLibrary(libraryAddress).getPrice(typeIndex, nameIndex); return traitPrice; } /** * @dev Gets the current mint price in ETH for a new frame */ function getMintPriceEth() public view returns (uint256 price) { if(block.timestamp < MINT_START_ETH) { return START_PRICE; } uint256 _mintTiersComplete = block.timestamp.sub(MINT_START_ETH).div(MINT_DELAY); if(PRICE_DIFF.mul(_mintTiersComplete) >= START_PRICE.sub(MIN_PRICE)) { return MIN_PRICE; } else { return START_PRICE - (PRICE_DIFF * _mintTiersComplete); } } /** * @dev Gets the current mint price in TRAX for a new frame */ function getMintPriceTrax() public view returns (uint256 price) { uint256 _totalSupply = totalSupply(); if(_totalSupply == 0) return START_PRICE_TRAX; uint256 _mintTiersComplete = _totalSupply.div(MINTS_PER_TIER); price = START_PRICE_TRAX.add(_mintTiersComplete.mul(PRICE_DIFF_TRAX)); return price; } /* ____ ___ ____ ___ _____ __ __ ____ __ ______ ____ ___ ____ _____ | \ / _] / || \ | || | || \ / ] || |/ \ | \ / ___/ | D ) / [_ | o || \ | __|| | || _ | / /| | | || || _ ( \_ | / | _]| || D | | |_ | | || | |/ / |_| |_| | || O || | |\__ | | \ | [_ | _ || | | _] | : || | / \_ | | | || || | |/ \ | | . \| || | || | | | | || | \ | | | | || || | |\ | |__|\_||_____||__|__||_____| |__| \__,_||__|__|\____| |__| |____|\___/ |__|__| \___| */ /** * @dev Convert a raw assembly int value to a pixel location */ function convertInt(uint8 _inputInt) internal pure returns (uint8) { if ( (_inputInt >= 48) && (_inputInt <= 57) ) { _inputInt -= 48; return _inputInt; } else { _inputInt -= 87; return _inputInt; } } /** * @dev Config to SVG function */ function configToSVG(string memory _config) public view returns (string memory) { string memory svgString; for (uint8 i = 0; i < 9; i++) { uint8 thisTraitIndex = convertInt(bytes(_config).slice(i, 1).toUint8(0)); bytes memory traitRects = TraitLibrary(libraryAddress).getRects(i, thisTraitIndex); if(bytes(traitRects).length == 0) continue; bool isRow = traitRects.slice(0, 1).equal(bytes("r")); uint16 j = 1; string memory thisColor = ""; bool newColor = true; while(j < bytes(traitRects).length) { if(newColor) { // get the color thisColor = string(traitRects.slice(j, 3)); j += 3; newColor = false; continue; } else { // if pipe, new color if ( traitRects.slice(j, 1).equal(bytes("|")) ) { newColor = true; j += 1; continue; } else { // else add rects bytes memory thisRect = traitRects.slice(j, 3); uint8 x = convertInt(thisRect.slice(0, 1).toUint8(0)); uint8 y = convertInt(thisRect.slice(1, 1).toUint8(0)); uint8 length = convertInt(thisRect.slice(2, 1).toUint8(0)) + 1; if(isRow) { svgString = string( abi.encodePacked( svgString, "<rect class='c", thisColor, "' x='", x.toString(), "' y='", y.toString(), "' width='", length.toString(), "px' height='1px'", "/>" ) ); j += 3; continue; } else { svgString = string( abi.encodePacked( svgString, "<rect class='c", thisColor, "' x='", x.toString(), "' y='", y.toString(), "' height='", length.toString(), "px' width='1px'", "/>" ) ); j += 3; continue; } } } } } svgString = string( abi.encodePacked( '<svg id="moose-svg" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 32 32">', svgString, "<style>rect.bg{width:32px;height:32px;} #moose-svg{shape-rendering: crispedges;}", TraitLibrary(libraryAddress).getColors(), "</style></svg>" ) ); return svgString; } /** * @dev Config to metadata function */ function configToMetadata(string memory _config) public view returns (string memory) { string memory metadataString; for (uint8 i = 0; i < 9; i++) { uint8 thisTraitIndex = convertInt(bytes(_config).slice(i, 1).toUint8(0)); (string memory traitName, string memory traitType) = TraitLibrary(libraryAddress).getTraitInfo(i, thisTraitIndex); metadataString = string( abi.encodePacked( metadataString, '{"trait_type":"', traitType, '","value":"', traitName, '"}' ) ); if (i != 8) metadataString = string(abi.encodePacked(metadataString, ",")); } return string(abi.encodePacked("[", metadataString, "]")); } /** * @dev Returns the SVG and metadata for a token Id * @param _tokenId The tokenId to return the SVG and metadata for. */ function tokenURI(uint256 _tokenId) public view override returns (string memory) { require(_exists(_tokenId)); string memory tokenConfig = _tokenIdToConfig(_tokenId); return string( abi.encodePacked( "data:application/json;base64,", Library.encode( bytes( string( abi.encodePacked( '{"name": "FRAME Edition 0, Token #', Library.toString(_tokenId), '", "description": "FRAME tokens are fully customizable on-chain pixel art. Edition 0 is a collection of 32x32 Moose avatars.", "image": "data:image/svg+xml;base64,', Library.encode( bytes(configToSVG(tokenConfig)) ), '","attributes":', configToMetadata(tokenConfig), "}" ) ) ) ) ) ); } /** * @dev Returns a config for a given tokenId * @param _tokenId The tokenId to return the config for. */ function _tokenIdToConfig(uint256 _tokenId) public view returns (string memory) { string memory tokenConfig = tokenIdToConfig[_tokenId]; return tokenConfig; } /** * @dev Returns the current amount of TRAX stored for a given tokenId * @param _tokenId The tokenId to look up. */ function _tokenIdToStoredTrax(uint256 _tokenId) public view returns (uint256) { uint256 storedTrax = tokenIdToStoredTrax[_tokenId]; return storedTrax; } /** * @dev Returns the wallet of a given wallet. Mainly for ease for frontend devs. * @param _wallet The wallet to get the tokens of. */ function walletOfOwner(address _wallet) public view returns (uint256[] memory) { uint256 tokenCount = balanceOf(_wallet); uint256[] memory tokensId = new uint256[](tokenCount); for (uint256 i; i < tokenCount; i++) { tokensId[i] = tokenOfOwnerByIndex(_wallet, i); } return tokensId; } /* ___ __ __ ____ ___ ____ _____ __ __ ____ __ ______ ____ ___ ____ _____ / \ | |__| || \ / _]| \ | || | || \ / ] || |/ \ | \ / ___/ | || | | || _ | / [_ | D ) | __|| | || _ | / /| | | || || _ ( \_ | O || | | || | || _]| / | |_ | | || | |/ / |_| |_| | || O || | |\__ | | || ` ' || | || [_ | \ | _] | : || | / \_ | | | || || | |/ \ | | | \ / | | || || . \ | | | || | \ | | | | || || | |\ | \___/ \_/\_/ |__|__||_____||__|\_| |__| \__,_||__|__|\____| |__| |____|\___/ |__|__| \___| */ /** * @dev Sets the ERC721 token address * @param _mooseAddress The NFT address */ function setMooseAddress(address _mooseAddress) public onlyOwner { mooseAddress = _mooseAddress; } /** * @dev Sets the ERC20 token address * @param _traxAddress The token address */ function setTraxAddress(address _traxAddress) public onlyOwner { traxAddress = _traxAddress; } /** * @dev Sets the trait library address * @param _libraryAddress The token address */ function setLibraryAddress(address _libraryAddress) public onlyOwner { libraryAddress = _libraryAddress; } /** * @dev Withdraw ETH to owner */ function withdraw() public onlyOwner { uint256 balance = address(this).balance; payable(msg.sender).transfer(balance); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "./Library.sol"; contract TraitLibrary is Ownable { using Library for uint16; struct Trait { string traitName; string traitType; string rects; uint32 price; } //addresses address _owner; //uint arrays uint32[][9] PRICES; //byte arrays bytes[9] TYPES; bytes[][9] NAMES; bytes[][9] RECTS; bytes COLORS; constructor() { _owner = msg.sender; // Declare initial values TYPES = [ bytes("background"), bytes("body"), bytes("eye"), bytes("antler"), bytes("hat"), bytes("neck"), bytes("mouth"), bytes("nose"), bytes("accessory") ]; PRICES[0] = [0]; PRICES[1] = [0]; PRICES[2] = [0]; PRICES[3] = [0]; PRICES[4] = [0]; PRICES[5] = [0]; PRICES[6] = [0]; PRICES[7] = [0]; PRICES[8] = [0]; NAMES[0] = [ bytes("") ]; NAMES[1] = [ bytes("") ]; NAMES[2] = [ bytes("") ]; NAMES[3] = [ bytes("") ]; NAMES[4] = [ bytes("") ]; NAMES[5] = [ bytes("") ]; NAMES[6] = [ bytes("") ]; NAMES[7] = [ bytes("") ]; NAMES[8] = [ bytes("") ]; RECTS[0] = [ bytes("") ]; RECTS[1] = [ bytes("") ]; RECTS[2] = [ bytes("") ]; RECTS[3] = [ bytes("") ]; RECTS[4] = [ bytes("") ]; RECTS[5] = [ bytes("") ]; RECTS[6] = [ bytes("") ]; RECTS[7] = [ bytes("") ]; RECTS[8] = [ bytes("") ]; } /** * @dev Gets the rects a trait from storage * @param traitIndex The trait type index * @param traitValue The location within the array */ function getRects(uint256 traitIndex, uint256 traitValue) public view returns (bytes memory rects) { // return string(abi.encodePacked(RECTS[traitIndex][traitValue])); return RECTS[traitIndex][traitValue]; } /** * @dev Gets a trait from storage * @param traitIndex The trait type index * @param traitValue The location within the array */ function getTraitInfo(uint256 traitIndex, uint256 traitValue) public view returns (string memory traitName, string memory traitType) { return ( string(abi.encodePacked(NAMES[traitIndex][traitValue])), string(abi.encodePacked(TYPES[traitIndex])) ); } /** * @dev Gets the price of a trait from storage * @param traitIndex The trait type index * @param traitValue The location within the array */ function getPrice(uint256 traitIndex, uint256 traitValue) public view returns (uint32 price) { return PRICES[traitIndex][traitValue]; } /** * @dev Adds entries to trait metadata * @param _traitTypeIndex The trait type index * @param traits Array of traits to add */ function addTraits(uint256 _traitTypeIndex, Trait[] memory traits) public onlyOwner { for (uint256 i = 0; i < traits.length; i++) { PRICES[_traitTypeIndex].push(traits[i].price); NAMES[_traitTypeIndex].push(bytes(abi.encodePacked(traits[i].traitName))); RECTS[_traitTypeIndex].push(bytes(abi.encodePacked(traits[i].rects))); } return; } /** * @dev Clear entries to trait metadata * @param _traitTypeIndex The trait type index */ function clearTrait(uint256 _traitTypeIndex) public onlyOwner { PRICES[_traitTypeIndex] = [0]; NAMES[_traitTypeIndex] = [bytes("")]; RECTS[_traitTypeIndex] = [bytes("")]; return; } /** * @dev Gets the color string */ function getColors() public pure returns (string memory colors) { return ".c000{fill:#000000}.c001{fill:#000008}.c002{fill:#00000a}.c003{fill:#00000b}.c004{fill:#000101}.c005{fill:#000202}.c006{fill:#001efd}.c007{fill:#001eff}.c008{fill:#002259}.c009{fill:#005189}.c010{fill:#006bff}.c011{fill:#008544}.c012{fill:#00881d}.c013{fill:#00aa0c}.c014{fill:#00b09e}.c015{fill:#00b4ff}.c016{fill:#00c7f1}.c017{fill:#00eaff}.c018{fill:#010000}.c019{fill:#010001}.c020{fill:#010101}.c021{fill:#017db1}.c022{fill:#020100}.c023{fill:#020202}.c024{fill:#022d00}.c025{fill:#024d01}.c026{fill:#02b4da}.c027{fill:#030202}.c028{fill:#030303}.c029{fill:#035223}.c030{fill:#040303}.c031{fill:#040309}.c032{fill:#0456c7}.c033{fill:#050505}.c034{fill:#051429}.c035{fill:#051c3e}.c036{fill:#060405}.c037{fill:#060605}.c038{fill:#070404}.c039{fill:#070707}.c040{fill:#080500}.c041{fill:#080604}.c042{fill:#080808}.c043{fill:#0879df}.c044{fill:#0904eb}.c045{fill:#090500}.c046{fill:#09897b}.c047{fill:#09f200}.c048{fill:#0a0a0a}.c049{fill:#0a0e13}.c050{fill:#0ad200}.c051{fill:#0b0907}.c052{fill:#0b0a09}.c053{fill:#0b0b0b}.c054{fill:#0b7b08}.c055{fill:#0b87f7}.c056{fill:#0b8f08}.c057{fill:#0d031e}.c058{fill:#0d0c0d}.c059{fill:#0d0d0d}.c060{fill:#0e0603}.c061{fill:#0e09c5}.c062{fill:#0e0d0d}.c063{fill:#0e0e0e}.c064{fill:#0f0602}.c065{fill:#0f095e}.c066{fill:#0f09f9}.c067{fill:#100603}.c068{fill:#101010}.c069{fill:#104b01}.c070{fill:#106ae7}.c071{fill:#107a46}.c072{fill:#1098b8}.c073{fill:#110502}.c074{fill:#110968}.c075{fill:#121111}.c076{fill:#131313}.c077{fill:#141414}.c078{fill:#141515}.c079{fill:#146b00}.c080{fill:#150f2d}.c081{fill:#156103}.c082{fill:#161616}.c083{fill:#17f4dd}.c084{fill:#18120a}.c085{fill:#182257}.c086{fill:#18371e}.c087{fill:#1a0db0}.c088{fill:#1a0eac}.c089{fill:#1c31c9}.c090{fill:#1d0ed1}.c091{fill:#1e1300}.c092{fill:#1e1b1c}.c093{fill:#1e1d1c}.c094{fill:#1f170d}.c095{fill:#2110ec}.c096{fill:#212121}.c097{fill:#215a36}.c098{fill:#231e1e}.c099{fill:#232222}.c100{fill:#252627}.c101{fill:#25b5f8}.c102{fill:#262929}.c103{fill:#272321}.c104{fill:#27ec0d}.c105{fill:#281900}.c106{fill:#29050a}.c107{fill:#299b01}.c108{fill:#2b3635}.c109{fill:#2c2729}.c110{fill:#2c27f3}.c111{fill:#2c2a28}.c112{fill:#2d130c}.c113{fill:#2e2113}.c114{fill:#2e260d}.c115{fill:#2e47ff}.c116{fill:#2e6a4b}.c117{fill:#2e9e40}.c118{fill:#2f0041}.c119{fill:#313021}.c120{fill:#323333}.c121{fill:#332eec}.c122{fill:#333a02}.c123{fill:#349d92}.c124{fill:#353537}.c125{fill:#364643}.c126{fill:#372014}.c127{fill:#372501}.c128{fill:#3a4703}.c129{fill:#3c2402}.c130{fill:#3d1005}.c131{fill:#3d301d}.c132{fill:#3d320e}.c133{fill:#3e383a}.c134{fill:#3e3e3e}.c135{fill:#3f3fed}.c136{fill:#3f4c03}.c137{fill:#410000}.c138{fill:#412ce5}.c139{fill:#422de5}.c140{fill:#424244}.c141{fill:#425c5a}.c142{fill:#435303}.c143{fill:#436060}.c144{fill:#448f61}.c145{fill:#44d0e6}.c146{fill:#451a08}.c147{fill:#464b64}.c148{fill:#473f42}.c149{fill:#47ffee}.c150{fill:#482e20}.c151{fill:#484a4a}.c152{fill:#494334}.c153{fill:#4a443f}.c154{fill:#4a4aff}.c155{fill:#4b1e0b}.c156{fill:#4b4545}.c157{fill:#4b4643}.c158{fill:#4b4a05}.c159{fill:#4c4c4c}.c160{fill:#4c8020}.c161{fill:#4d3b4d}.c162{fill:#4d4c48}.c163{fill:#4d5466}.c164{fill:#4f3533}.c165{fill:#4f4f51}.c166{fill:#4f5049}.c167{fill:#503820}.c168{fill:#504c47}.c169{fill:#513222}.c170{fill:#516d63}.c171{fill:#518d3c}.c172{fill:#520169}.c173{fill:#534016}.c174{fill:#535254}.c175{fill:#535556}.c176{fill:#535e9c}.c177{fill:#54ccff}.c178{fill:#554c4f}.c179{fill:#55aa48}.c180{fill:#564c4e}.c181{fill:#580002}.c182{fill:#582f19}.c183{fill:#585341}.c184{fill:#585858}.c185{fill:#595a5a}.c186{fill:#5a3200}.c187{fill:#5a5a5b}.c188{fill:#5a5a5c}.c189{fill:#5a9346}.c190{fill:#5c311a}.c191{fill:#5c5115}.c192{fill:#5c5a5b}.c193{fill:#5c8e8c}.c194{fill:#5d1d0c}.c195{fill:#5e341f}.c196{fill:#5e3700}.c197{fill:#5e5e5e}.c198{fill:#5fa551}.c199{fill:#604b31}.c200{fill:#614327}.c201{fill:#615c3c}.c202{fill:#624c3f}.c203{fill:#625e40}.c204{fill:#626262}.c205{fill:#632b1c}.c206{fill:#63564a}.c207{fill:#63605c}.c208{fill:#654f21}.c209{fill:#6574a4}.c210{fill:#6593eb}.c211{fill:#676767}.c212{fill:#684a11}.c213{fill:#686868}.c214{fill:#69ac0f}.c215{fill:#69bf9c}.c216{fill:#6a0500}.c217{fill:#6b3d02}.c218{fill:#6ba6db}.c219{fill:#6c0104}.c220{fill:#6d6949}.c221{fill:#6da25a}.c222{fill:#6e3421}.c223{fill:#6e6d6d}.c224{fill:#6f0809}.c225{fill:#700b00}.c226{fill:#707070}.c227{fill:#70c4ce}.c228{fill:#716e70}.c229{fill:#725e15}.c230{fill:#727877}.c231{fill:#72daff}.c232{fill:#737373}.c233{fill:#73b95a}.c234{fill:#73cd46}.c235{fill:#74bf2d}.c236{fill:#757575}.c237{fill:#75daf2}.c238{fill:#774000}.c239{fill:#775e07}.c240{fill:#776d6d}.c241{fill:#787e91}.c242{fill:#7b6c48}.c243{fill:#7d0600}.c244{fill:#7e0310}.c245{fill:#7e4002}.c246{fill:#7f4121}.c247{fill:#7f5203}.c248{fill:#807f7f}.c249{fill:#816f6f}.c250{fill:#824903}.c251{fill:#82682f}.c252{fill:#830316}.c253{fill:#83eceb}.c254{fill:#840915}.c255{fill:#848484}.c256{fill:#848999}.c257{fill:#850500}.c258{fill:#850915}.c259{fill:#858585}.c260{fill:#85db67}.c261{fill:#868787}.c262{fill:#87b037}.c263{fill:#880198}.c264{fill:#8ae586}.c265{fill:#8b4b00}.c266{fill:#8c170c}.c267{fill:#8c898b}.c268{fill:#8cbb2f}.c269{fill:#8d0015}.c270{fill:#8e23f2}.c271{fill:#8e5345}.c272{fill:#8e5900}.c273{fill:#8e5c00}.c274{fill:#8e7a16}.c275{fill:#8f6948}.c276{fill:#915e3c}.c277{fill:#916302}.c278{fill:#919191}.c279{fill:#920505}.c280{fill:#929192}.c281{fill:#930900}.c282{fill:#94910c}.c283{fill:#952318}.c284{fill:#95d8f5}.c285{fill:#96a3b1}.c286{fill:#974c0e}.c287{fill:#977730}.c288{fill:#989898}.c289{fill:#99ceec}.c290{fill:#9b0413}.c291{fill:#9b0993}.c292{fill:#9b3e00}.c293{fill:#9b8301}.c294{fill:#9c5582}.c295{fill:#9c8a22}.c296{fill:#9d7b10}.c297{fill:#9d8664}.c298{fill:#9eaecd}.c299{fill:#9ecfbe}.c300{fill:#9f0206}.c301{fill:#9f4c85}.c302{fill:#9fdcf7}.c303{fill:#a0a0a2}.c304{fill:#a0e066}.c305{fill:#a163a0}.c306{fill:#a17a01}.c307{fill:#a25201}.c308{fill:#a26adc}.c309{fill:#a27f08}.c310{fill:#a29da0}.c311{fill:#a37909}.c312{fill:#a3a3a3}.c313{fill:#a50001}.c314{fill:#a50311}.c315{fill:#a50f10}.c316{fill:#a642b6}.c317{fill:#a67b0d}.c318{fill:#a6d5c5}.c319{fill:#a7a3a6}.c320{fill:#a8895d}.c321{fill:#a8b1a8}.c322{fill:#aa7d54}.c323{fill:#abaaa6}.c324{fill:#ae8f6b}.c325{fill:#af0101}.c326{fill:#af5803}.c327{fill:#af8719}.c328{fill:#afe3fa}.c329{fill:#b00101}.c330{fill:#b0acac}.c331{fill:#b0acaf}.c332{fill:#b1b1b1}.c333{fill:#b20000}.c334{fill:#b2272b}.c335{fill:#b3362a}.c336{fill:#b40909}.c337{fill:#b4b0aa}.c338{fill:#b51f17}.c339{fill:#b58f6d}.c340{fill:#b69012}.c341{fill:#b6b6b7}.c342{fill:#b6eaff}.c343{fill:#b709be}.c344{fill:#b7875c}.c345{fill:#b7905a}.c346{fill:#b8b9b9}.c347{fill:#b9263d}.c348{fill:#ba0010}.c349{fill:#ba9a04}.c350{fill:#bc1622}.c351{fill:#bc2e2e}.c352{fill:#bea101}.c353{fill:#c06c00}.c354{fill:#c0834d}.c355{fill:#c1bcbc}.c356{fill:#c20417}.c357{fill:#c29f01}.c358{fill:#c32a1c}.c359{fill:#c3762a}.c360{fill:#c3a812}.c361{fill:#c4b299}.c362{fill:#c504a9}.c363{fill:#c5c8c9}.c364{fill:#c80409}.c365{fill:#c900cb}.c366{fill:#cad0c9}.c367{fill:#cc3443}.c368{fill:#cccccc}.c369{fill:#ccced1}.c370{fill:#cd7079}.c371{fill:#cda601}.c372{fill:#cda65d}.c373{fill:#cdc3c3}.c374{fill:#cdcfd2}.c375{fill:#cdd0d2}.c376{fill:#cebd22}.c377{fill:#cfcfcf}.c378{fill:#cfd0d0}.c379{fill:#d08507}.c380{fill:#d095f5}.c381{fill:#d15b2b}.c382{fill:#d20000}.c383{fill:#d22121}.c384{fill:#d27935}.c385{fill:#d27dd4}.c386{fill:#d2b52a}.c387{fill:#d31017}.c388{fill:#d4a0f7}.c389{fill:#d4cd16}.c390{fill:#d59702}.c391{fill:#d5d5d5}.c392{fill:#d5ff84}.c393{fill:#d6b19f}.c394{fill:#d6d6d6}.c395{fill:#d70101}.c396{fill:#d7b2a0}.c397{fill:#d7b943}.c398{fill:#d8d85c}.c399{fill:#d8d8d8}.c400{fill:#d9b3fa}.c401{fill:#d9c6ab}.c402{fill:#db0d0d}.c403{fill:#db5c0f}.c404{fill:#dbb348}.c405{fill:#dbecf2}.c406{fill:#dd2a2a}.c407{fill:#dd3ea3}.c408{fill:#dd4638}.c409{fill:#dedede}.c410{fill:#dfba39}.c411{fill:#e08811}.c412{fill:#e1ebff}.c413{fill:#e25245}.c414{fill:#e26012}.c415{fill:#e27a04}.c416{fill:#e3c0b4}.c417{fill:#e3e3e3}.c418{fill:#e3edff}.c419{fill:#e3f1ff}.c420{fill:#e45526}.c421{fill:#e4c6bc}.c422{fill:#e4d954}.c423{fill:#e4effe}.c424{fill:#e504e7}.c425{fill:#e5b53b}.c426{fill:#e5c688}.c427{fill:#e5e5e5}.c428{fill:#e60e0e}.c429{fill:#e6de04}.c430{fill:#e812f5}.c431{fill:#e870d2}.c432{fill:#e92828}.c433{fill:#e936a8}.c434{fill:#e9392d}.c435{fill:#e9fadf}.c436{fill:#ea8700}.c437{fill:#eb362d}.c438{fill:#eba3ba}.c439{fill:#ebacc0}.c440{fill:#ebf4f7}.c441{fill:#ec2eab}.c442{fill:#ece401}.c443{fill:#ed6dd1}.c444{fill:#edd2b7}.c445{fill:#ee5c07}.c446{fill:#eec06e}.c447{fill:#eeca00}.c448{fill:#eeeeee}.c449{fill:#ef402c}.c450{fill:#efcb00}.c451{fill:#efeb89}.c452{fill:#efeded}.c453{fill:#f08306}.c454{fill:#f0d74d}.c455{fill:#f0e110}.c456{fill:#f19949}.c457{fill:#f1f1f1}.c458{fill:#f23289}.c459{fill:#f2584a}.c460{fill:#f2f0f0}.c461{fill:#f327ae}.c462{fill:#f33a84}.c463{fill:#f34080}.c464{fill:#f3c87b}.c465{fill:#f3f0f0}.c466{fill:#f4ab3a}.c467{fill:#f4f0f0}.c468{fill:#f4f1f1}.c469{fill:#f5596e}.c470{fill:#f5735d}.c471{fill:#f57859}.c472{fill:#f6f2f2}.c473{fill:#f7d81e}.c474{fill:#f7f4f4}.c475{fill:#f7f6f6}.c476{fill:#f8f6f6}.c477{fill:#f8f8f8}.c478{fill:#f90808}.c479{fill:#f9ce6b}.c480{fill:#f9dc3b}.c481{fill:#f9e784}.c482{fill:#f9ec76}.c483{fill:#fa1a02}.c484{fill:#faf569}.c485{fill:#faf6f6}.c486{fill:#fbdd4b}.c487{fill:#fbf6f6}.c488{fill:#fc0000}.c489{fill:#fc00ff}.c490{fill:#fcf301}.c491{fill:#fdde60}.c492{fill:#fde80c}.c493{fill:#fde85e}.c494{fill:#febc0e}.c495{fill:#fec02a}.c496{fill:#fec901}.c497{fill:#fee85d}.c498{fill:#feed84}.c499{fill:#fef601}.c500{fill:#ff0000}.c501{fill:#ff002a}.c502{fill:#ff00f6}.c503{fill:#ff2626}.c504{fill:#ff2a2f}.c505{fill:#ff7200}.c506{fill:#ff9000}.c507{fill:#ffb400}.c508{fill:#ffd627}.c509{fill:#ffd800}.c510{fill:#ffe646}.c511{fill:#fff201}.c512{fill:#fff383}.c513{fill:#fff600}.c514{fill:#ffffff}"; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library Library { string internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; function encode(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ""; // load the table into memory string memory table = TABLE; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((data.length + 2) / 3); // add some extra buffer at the end required for the writing string memory result = new string(encodedLen + 32); assembly { // set the actual output length mstore(result, encodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 3 bytes at a time for { } lt(dataPtr, endPtr) { } { dataPtr := add(dataPtr, 3) // read 3 bytes let input := mload(dataPtr) // write 4 characters mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(6, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(input, 0x3F)))) ) resultPtr := add(resultPtr, 1) } // padding with '=' switch mod(mload(data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } function parseInt(string memory _a) internal pure returns (uint8 _parsedInt) { bytes memory bresult = bytes(_a); uint8 mint = 0; for (uint8 i = 0; i < bresult.length; i++) { if ( (uint8(uint8(bresult[i])) >= 48) && (uint8(uint8(bresult[i])) <= 57) ) { mint *= 10; mint += uint8(bresult[i]) - 48; } } return mint; } function substring( string memory str, uint256 startIndex, uint256 endIndex ) internal pure returns (string memory) { bytes memory strBytes = bytes(str); bytes memory result = new bytes(endIndex - startIndex); for (uint256 i = startIndex; i < endIndex; i++) { result[i - startIndex] = strBytes[i]; } return string(result); } function stringReplace(string memory _string, uint256 _pos, string memory _letter) internal pure returns (string memory) { bytes memory _stringBytes = bytes(_string); bytes memory result = new bytes(_stringBytes.length); for(uint i = 0; i < _stringBytes.length; i++) { result[i] = _stringBytes[i]; if(i==_pos) result[i]=bytes(_letter)[0]; } return string(result); } function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } }
// contracts/IToken.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IToken is IERC20 { function burnFrom(address account, uint256 amount) external; }
// SPDX-License-Identifier: Unlicense /* * @title Solidity Bytes Arrays Utils * @author Gonçalo Sá <[email protected]> * * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. */ pragma solidity >=0.8.0 <0.9.0; library BytesLib { function concat( bytes memory _preBytes, bytes memory _postBytes ) internal pure returns (bytes memory) { bytes memory tempBytes; assembly { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // Store the length of the first bytes array at the beginning of // the memory for tempBytes. let length := mload(_preBytes) mstore(tempBytes, length) // Maintain a memory counter for the current write location in the // temp bytes array by adding the 32 bytes for the array length to // the starting location. let mc := add(tempBytes, 0x20) // Stop copying when the memory counter reaches the length of the // first bytes array. let end := add(mc, length) for { // Initialize a copy counter to the start of the _preBytes data, // 32 bytes into its memory. let cc := add(_preBytes, 0x20) } lt(mc, end) { // Increase both counters by 32 bytes each iteration. mc := add(mc, 0x20) cc := add(cc, 0x20) } { // Write the _preBytes data into the tempBytes memory 32 bytes // at a time. mstore(mc, mload(cc)) } // Add the length of _postBytes to the current length of tempBytes // and store it as the new length in the first 32 bytes of the // tempBytes memory. length := mload(_postBytes) mstore(tempBytes, add(length, mload(tempBytes))) // Move the memory counter back from a multiple of 0x20 to the // actual end of the _preBytes data. mc := end // Stop copying when the memory counter reaches the new combined // length of the arrays. end := add(mc, length) for { let cc := add(_postBytes, 0x20) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } // Update the free-memory pointer by padding our last write location // to 32 bytes: add 31 bytes to the end of tempBytes to move to the // next 32 byte block, then round down to the nearest multiple of // 32. If the sum of the length of the two arrays is zero then add // one before rounding down to leave a blank 32 bytes (the length block with 0). mstore(0x40, and( add(add(end, iszero(add(length, mload(_preBytes)))), 31), not(31) // Round down to the nearest 32 bytes. )) } return tempBytes; } function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal { assembly { // Read the first 32 bytes of _preBytes storage, which is the length // of the array. (We don't need to use the offset into the slot // because arrays use the entire slot.) let fslot := sload(_preBytes.slot) // Arrays of 31 bytes or less have an even value in their slot, // while longer arrays have an odd value. The actual length is // the slot divided by two for odd values, and the lowest order // byte divided by two for even values. // If the slot is even, bitwise and the slot with 255 and divide by // two to get the length. If the slot is odd, bitwise and the slot // with -1 and divide by two. let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) let newlength := add(slength, mlength) // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage switch add(lt(slength, 32), lt(newlength, 32)) case 2 { // Since the new array still fits in the slot, we just need to // update the contents of the slot. // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length sstore( _preBytes.slot, // all the modifications to the slot are inside this // next block add( // we can just add to the slot contents because the // bytes we want to change are the LSBs fslot, add( mul( div( // load the bytes from memory mload(add(_postBytes, 0x20)), // zero all bytes to the right exp(0x100, sub(32, mlength)) ), // and now shift left the number of bytes to // leave space for the length in the slot exp(0x100, sub(32, newlength)) ), // increase length by the double of the memory // bytes length mul(mlength, 2) ) ) ) } case 1 { // The stored value fits in the slot, but the combined value // will exceed it. // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // The contents of the _postBytes array start 32 bytes into // the structure. Our first read should obtain the `submod` // bytes that can fit into the unused space in the last word // of the stored array. To get this, we read 32 bytes starting // from `submod`, so the data we read overlaps with the array // contents by `submod` bytes. Masking the lowest-order // `submod` bytes allows us to add that value directly to the // stored value. let submod := sub(32, slength) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore( sc, add( and( fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00 ), and(mload(mc), mask) ) ) for { mc := add(mc, 0x20) sc := add(sc, 1) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } default { // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) // Start copying to the last used word of the stored array. let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // Copy over the first `submod` bytes of the new data as in // case 1 above. let slengthmod := mod(slength, 32) let mlengthmod := mod(mlength, 32) let submod := sub(32, slengthmod) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore(sc, add(sload(sc), and(mload(mc), mask))) for { sc := add(sc, 1) mc := add(mc, 0x20) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } } } function slice( bytes memory _bytes, uint256 _start, uint256 _length ) internal pure returns (bytes memory) { require(_length + 31 >= _length, "slice_overflow"); require(_bytes.length >= _start + _length, "slice_outOfBounds"); bytes memory tempBytes; assembly { switch iszero(_length) case 0 { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // The first word of the slice result is potentially a partial // word read from the original array. To read it, we calculate // the length of that partial word and start copying that many // bytes into the array. The first word we copy will start with // data we don't care about, but the last `lengthmod` bytes will // land at the beginning of the contents of the new array. When // we're done copying, we overwrite the full first word with // the actual length of the slice. let lengthmod := and(_length, 31) // The multiplication in the next line is necessary // because when slicing multiples of 32 bytes (lengthmod == 0) // the following copy loop was copying the origin's length // and then ending prematurely not copying everything it should. let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) let end := add(mc, _length) for { // The multiplication in the next line has the same exact purpose // as the one above. let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } mstore(tempBytes, _length) //update free-memory pointer //allocating the array padded to 32 bytes like the compiler does now mstore(0x40, and(add(mc, 31), not(31))) } //if we want a zero-length slice let's just return a zero-length array default { tempBytes := mload(0x40) //zero out the 32 bytes slice we are about to return //we need to do it because Solidity does not garbage collect mstore(tempBytes, 0) mstore(0x40, add(tempBytes, 0x20)) } } return tempBytes; } function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) { require(_bytes.length >= _start + 20, "toAddress_outOfBounds"); address tempAddress; assembly { tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) } return tempAddress; } function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) { require(_bytes.length >= _start + 1 , "toUint8_outOfBounds"); uint8 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x1), _start)) } return tempUint; } function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) { require(_bytes.length >= _start + 2, "toUint16_outOfBounds"); uint16 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x2), _start)) } return tempUint; } function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) { require(_bytes.length >= _start + 4, "toUint32_outOfBounds"); uint32 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x4), _start)) } return tempUint; } function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) { require(_bytes.length >= _start + 8, "toUint64_outOfBounds"); uint64 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x8), _start)) } return tempUint; } function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) { require(_bytes.length >= _start + 12, "toUint96_outOfBounds"); uint96 tempUint; assembly { tempUint := mload(add(add(_bytes, 0xc), _start)) } return tempUint; } function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) { require(_bytes.length >= _start + 16, "toUint128_outOfBounds"); uint128 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x10), _start)) } return tempUint; } function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) { require(_bytes.length >= _start + 32, "toUint256_outOfBounds"); uint256 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x20), _start)) } return tempUint; } function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) { require(_bytes.length >= _start + 32, "toBytes32_outOfBounds"); bytes32 tempBytes32; assembly { tempBytes32 := mload(add(add(_bytes, 0x20), _start)) } return tempBytes32; } function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) { bool success = true; assembly { let length := mload(_preBytes) // if lengths don't match the arrays are not equal switch eq(length, mload(_postBytes)) case 1 { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 let mc := add(_preBytes, 0x20) let end := add(mc, length) for { let cc := add(_postBytes, 0x20) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) } eq(add(lt(mc, end), cb), 2) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { // if any of these checks fails then arrays are not equal if iszero(eq(mload(mc), mload(cc))) { // unsuccess: success := 0 cb := 0 } } } default { // unsuccess: success := 0 } } return success; } function equalStorage( bytes storage _preBytes, bytes memory _postBytes ) internal view returns (bool) { bool success = true; assembly { // we know _preBytes_offset is 0 let fslot := sload(_preBytes.slot) // Decode the length of the stored array like in concatStorage(). let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) // if lengths don't match the arrays are not equal switch eq(slength, mlength) case 1 { // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage if iszero(iszero(slength)) { switch lt(slength, 32) case 1 { // blank the last byte which is the length fslot := mul(div(fslot, 0x100), 0x100) if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) { // unsuccess: success := 0 } } default { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := keccak256(0x0, 0x20) let mc := add(_postBytes, 0x20) let end := add(mc, mlength) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) for {} eq(add(lt(mc, end), cb), 2) { sc := add(sc, 1) mc := add(mc, 0x20) } { if iszero(eq(sload(sc), mload(mc))) { // unsuccess: success := 0 cb := 0 } } } } } default { // unsuccess: success := 0 } } return success; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// 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 "./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 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; /** * @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; /** * @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; 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; 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 "../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 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 "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { 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; /** * @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 "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _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); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_mooseAddress","type":"address"},{"internalType":"address","name":"_traxAddress","type":"address"},{"internalType":"address","name":"_libraryAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"_tokenIdToConfig","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"_tokenIdToStoredTrax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"burnFrameForTrax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_config","type":"string"}],"name":"configToMetadata","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_config","type":"string"}],"name":"configToSVG","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_newConfig","type":"string"}],"name":"getCustomizationPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"valueDiff","type":"uint256"},{"internalType":"bool","name":"increased","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_newConfig","type":"string"}],"name":"getMintCustomizationPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintPriceEth","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintPriceTrax","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint8[2][]","name":"_newTraits","type":"uint8[2][]"}],"name":"getNewTokenConfig","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"typeIndex","type":"uint256"},{"internalType":"uint256","name":"nameIndex","type":"uint256"}],"name":"getTraitPrice","outputs":[{"internalType":"uint256","name":"traitPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"libraryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"tokenConfig","type":"string"}],"name":"mintCustomooseWithEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"tokenConfig","type":"string"}],"name":"mintCustomooseWithTrax","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_times","type":"uint8"}],"name":"mintFrameWithEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_times","type":"uint8"}],"name":"mintFrameWithTrax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mooseAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"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":"_libraryAddress","type":"address"}],"name":"setLibraryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_mooseAddress","type":"address"}],"name":"setMooseAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_newConfig","type":"string"}],"name":"setTokenConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint8","name":"_traitIndex","type":"uint8"},{"internalType":"uint8","name":"_traitValue","type":"uint8"}],"name":"setTokenTrait","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_traxAddress","type":"address"}],"name":"setTraxAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":"traxAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052612710600d556103e8600e556361b78a20600f556200003762015180600f546200017760201b620027c61790919060201c565b60105561a8c060115566f8b0a10e47000060125566470de4df8200006013556611c37937e08000601455678ac7230489e80000601555678ac7230489e800006016553480156200008657600080fd5b50604051620051df380380620051df833981016040819052620000a99162000940565b604051806040016040528060058152602001644672616d6560d81b815250604051806040016040528060058152602001644652414d4560d81b8152508160009080519060200190620000fd9291906200087d565b508051620001139060019060208401906200087d565b505050620001306200012a6200018c60201b60201c565b62000190565b601a80546001600160a01b031916331790556200014d83620001e2565b620001588262000253565b6200016381620002c0565b6200016d6200032d565b5050505062000a11565b600062000185828462000989565b9392505050565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600a546001600160a01b03163314620002315760405162461bcd60e51b81526020600482018190526024820152600080516020620051bf83398151915260448201526064015b60405180910390fd5b601780546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b031633146200029e5760405162461bcd60e51b81526020600482018190526024820152600080516020620051bf833981519152604482015260640162000228565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b031633146200030b5760405162461bcd60e51b81526020600482018190526024820152600080516020620051bf833981519152604482015260640162000228565b601980546001600160a01b0319166001600160a01b0392909216919091179055565b6000806200033a60085490565b9050600d5481106200034b57600080fd5b6200036133620003db60201b620027d21760201c565b156200036c57600080fd5b806200039460408051808201909152600981526803030303030303030360bc1b602082015290565b6000828152600b602090815260409091208251620003b993919291909101906200087d565b506000818152600c6020526040812055620003d53382620003e1565b92915050565b3b151590565b6001600160a01b038216620004395760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640162000228565b6000818152600260205260409020546001600160a01b031615620004a05760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640162000228565b620004ae6000838362000537565b6001600160a01b0382166000908152600360205260408120805460019290620004d990849062000989565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6200054f838383620005ed60201b62000a881760201c565b6001600160a01b038316620005ad57620005a781600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b620005d3565b816001600160a01b0316836001600160a01b031614620005d357620005d3838262000618565b6001600160a01b038216620005f257620005ed81620006c5565b505050565b826001600160a01b0316826001600160a01b031614620005ed57620005ed8282620007a3565b600060016200063284620007f460201b620015361760201c565b6200063e9190620009a4565b60008381526007602052604090205490915080821462000692576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090620006d990600190620009a4565b600083815260096020526040812054600880549394509092849081106200071057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600883815481106200074057634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806200078757634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000620007bb83620007f460201b620015361760201c565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60006001600160a01b038216620008615760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840162000228565b506001600160a01b031660009081526003602052604090205490565b8280546200088b90620009be565b90600052602060002090601f016020900481019282620008af5760008555620008fa565b82601f10620008ca57805160ff1916838001178555620008fa565b82800160010185558215620008fa579182015b82811115620008fa578251825591602001919060010190620008dd565b50620009089291506200090c565b5090565b5b808211156200090857600081556001016200090d565b80516001600160a01b03811681146200093b57600080fd5b919050565b60008060006060848603121562000955578283fd5b620009608462000923565b9250620009706020850162000923565b9150620009806040850162000923565b90509250925092565b600082198211156200099f576200099f620009fb565b500190565b600082821015620009b957620009b9620009fb565b500390565b600181811c90821680620009d357607f821691505b60208210811415620009f557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b61479e8062000a216000396000f3fe6080604052600436106102675760003560e01c806370dcc45d11610144578063aa807fe2116100b6578063c446d6f81161007a578063c446d6f814610737578063c87b56dd14610757578063d2c91c8f14610777578063e985e9c514610797578063f09c8fb2146107e0578063f2fde38b1461080057600080fd5b8063aa807fe2146106a4578063b32fc877146106c4578063b595c9c9146106d7578063b816f513146106f7578063b88d4fde1461071757600080fd5b80638c136815116101085780638c136815146105fc5780638da5cb5b1461061c57806395d89b411461063a57806396a7d9471461064f5780639a0c930e14610664578063a22cb4651461068457600080fd5b806370dcc45d1461057f578063715018a61461059457806374c0dfe6146105a95780637ec7f9fe146105c95780638bbadf40146105e957600080fd5b8063401eeebc116101dd578063499b433f116101a1578063499b433f146104cc5780634f687814146104ec5780634f6ccce7146104ff5780635837e2681461051f5780636352211e1461053f57806370a082311461055f57600080fd5b8063401eeebc1461040257806342842e0e14610422578063438b63001461044257806345764fd01461046f5780634863ba17146104ac57600080fd5b806310c62a3a1161022f57806310c62a3a1461034b57806318160ddd1461036b57806323b872dd146103805780632ada5503146103a05780632f745c59146103cd5780633ccfd60b146103ed57600080fd5b806301ffc9a71461026c57806306fdde03146102a1578063081812fc146102c3578063095ea7b3146102fb578063096192d81461031d575b600080fd5b34801561027857600080fd5b5061028c6102873660046139f6565b610820565b60405190151581526020015b60405180910390f35b3480156102ad57600080fd5b506102b661084b565b60405161029891906143c3565b3480156102cf57600080fd5b506102e36102de366004613b37565b6108dd565b6040516001600160a01b039091168152602001610298565b34801561030757600080fd5b5061031b6103163660046139b1565b610977565b005b34801561032957600080fd5b5061033d610338366004613c1a565b610a8d565b604051908152602001610298565b34801561035757600080fd5b5061031b61036636600461387c565b610b1e565b34801561037757600080fd5b5060085461033d565b34801561038c57600080fd5b5061031b61039b3660046138c8565b610b6a565b3480156103ac57600080fd5b5061033d6103bb366004613b37565b6000908152600c602052604090205490565b3480156103d957600080fd5b5061033d6103e83660046139b1565b610b9b565b3480156103f957600080fd5b5061031b610c31565b34801561040e57600080fd5b506017546102e3906001600160a01b031681565b34801561042e57600080fd5b5061031b61043d3660046138c8565b610c8e565b34801561044e57600080fd5b5061046261045d36600461387c565b610ca9565b604051610298919061437f565b34801561047b57600080fd5b5061048f61048a366004613be0565b610d66565b604080519384526020840192909252151590820152606001610298565b3480156104b857600080fd5b5061031b6104c736600461387c565b61101e565b3480156104d857600080fd5b506102b66104e7366004613b67565b61106a565b61031b6104fa366004613c9a565b611211565b34801561050b57600080fd5b5061033d61051a366004613b37565b6112cd565b34801561052b57600080fd5b506102b661053a366004613a73565b61136e565b34801561054b57600080fd5b506102e361055a366004613b37565b6114bf565b34801561056b57600080fd5b5061033d61057a36600461387c565b611536565b34801561058b57600080fd5b5061033d6115bd565b3480156105a057600080fd5b5061031b611645565b3480156105b557600080fd5b5061033d6105c4366004613a73565b61167b565b3480156105d557600080fd5b5061031b6105e4366004613b37565b611773565b61031b6105f7366004613a73565b611832565b34801561060857600080fd5b506018546102e3906001600160a01b031681565b34801561062857600080fd5b50600a546001600160a01b03166102e3565b34801561064657600080fd5b506102b66118e2565b34801561065b57600080fd5b5061033d6118f1565b34801561067057600080fd5b506102b661067f366004613b37565b61194d565b34801561069057600080fd5b5061031b61069f36600461397b565b6119f1565b3480156106b057600080fd5b5061031b6106bf366004613c3b565b611ab6565b61031b6106d2366004613a73565b611bc0565b3480156106e357600080fd5b506102b66106f2366004613a73565b611d45565b34801561070357600080fd5b506019546102e3906001600160a01b031681565b34801561072357600080fd5b5061031b610732366004613903565b6120b9565b34801561074357600080fd5b5061031b610752366004613c9a565b6120f1565b34801561076357600080fd5b506102b6610772366004613b37565b6122a3565b34801561078357600080fd5b5061031b61079236600461387c565b612330565b3480156107a357600080fd5b5061028c6107b2366004613896565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156107ec57600080fd5b5061031b6107fb366004613be0565b61237c565b34801561080c57600080fd5b5061031b61081b36600461387c565b61272b565b60006001600160e01b0319821663780e9d6360e01b14806108455750610845826127d8565b92915050565b60606000805461085a90614638565b80601f016020809104026020016040519081016040528092919081815260200182805461088690614638565b80156108d35780601f106108a8576101008083540402835291602001916108d3565b820191906000526020600020905b8154815290600101906020018083116108b657829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661095b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610982826114bf565b9050806001600160a01b0316836001600160a01b031614156109f05760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610952565b336001600160a01b0382161480610a0c5750610a0c81336107b2565b610a7e5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610952565b610a888383612828565b505050565b601954604051635cf4ee9160e01b815260048101849052602481018390526000916001600160a01b031690635cf4ee919060440160206040518083038186803b158015610ad957600080fd5b505afa158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b119190613c76565b63ffffffff169392505050565b600a546001600160a01b03163314610b485760405162461bcd60e51b81526004016109529061445f565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b610b743382612896565b610b905760405162461bcd60e51b815260040161095290614494565b610a8883838361298d565b6000610ba683611536565b8210610c085760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610952565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600a546001600160a01b03163314610c5b5760405162461bcd60e51b81526004016109529061445f565b6040514790339082156108fc029083906000818181858888f19350505050158015610c8a573d6000803e3d6000fd5b5050565b610a88838383604051806020016040528060008152506120b9565b60606000610cb683611536565b90506000816001600160401b03811115610ce057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d09578160200160208202803683370190505b50905060005b82811015610d5e57610d218582610b9b565b828281518110610d4157634e487b7160e01b600052603260045260246000fd5b602090810291909101015280610d5681614673565b915050610d0f565b509392505050565b6000828152600b60205260408120805482918291829190610d8690614638565b80601f0160208091040260200160405190810160405280929190818152602001828054610db290614638565b8015610dff5780601f10610dd457610100808354040283529160200191610dff565b820191906000526020600020905b815481529060010190602001808311610de257829003601f168201915b5050506000898152600c60205260408120549097509293508691508190505b60098160ff161015610f94576000610e4d610e4882610e428c60ff87166001612b38565b90612c45565b612ca1565b601954604051635cf4ee9160e01b815260ff8086166004830152831660248201529192506000916001600160a01b0390911690635cf4ee919060440160206040518083038186803b158015610ea157600080fd5b505afa158015610eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed99190613c76565b63ffffffff1690506000610efc8460ff1660018d612b389092919063ffffffff16565b604051602001610f0c9190613cfc565b60408051601f198184030181529190528051602090910120610f338860ff87166001612b38565b604051602001610f439190613cfc565b60408051601f19818403018152919052805160209091012014159050610f6985836127c6565b94508015610f7e57610f7b8a836127c6565b99505b5050508080610f8c9061468e565b915050610e1e565b50610fa686662386f26fc10000612cdb565b9550610fcf6050610fc96064610fc385662386f26fc10000612cdb565b90612ce7565b90612cdb565b905081811415610fe6576000945060019350611014565b8181111561100357610ff88183612cf3565b945060019350611014565b61100d8282612cf3565b9450600093505b5050509250925092565b600a546001600160a01b031633146110485760405162461bcd60e51b81526004016109529061445f565b601980546001600160a01b0319166001600160a01b0392909216919091179055565b6000838152600b602052604081208054606092919061108890614638565b80601f01602080910402602001604051908101604052809291908181526020018280546110b490614638565b80156111015780601f106110d657610100808354040283529160200191611101565b820191906000526020600020905b8154815290600101906020018083116110e457829003601f168201915b50505050509050600081905060005b60ff811685111561120557600061118487878460ff1681811061114357634e487b7160e01b600052603260045260246000fd5b90506040020160016002811061116957634e487b7160e01b600052603260045260246000fd5b60200201602081019061117c9190613c9a565b60ff16612cff565b90506111ef8388888560ff168181106111ad57634e487b7160e01b600052603260045260246000fd5b9050604002016000600281106111d357634e487b7160e01b600052603260045260246000fd5b6020020160208101906111e69190613c9a565b60ff1683612e18565b92505080806111fd9061468e565b915050611110565b509150505b9392505050565b6010544210156112635760405162461bcd60e51b815260206004820152601f60248201527f4d696e74696e6720666f722045544820686173206e6f742073746172746564006044820152606401610952565b60008160ff1611801561127a575060148160ff1611155b61128357600080fd5b61128b6115bd565b6112989060ff83166145b3565b3410156112a457600080fd5b60005b8160ff16811015610c8a576112ba612f61565b50806112c581614673565b9150506112a7565b60006112d860085490565b821061133b5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610952565b6008828154811061135c57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60608060005b60098160ff161015611496576000611398610e4882610e428860ff87166001612b38565b601954604051630ffad37f60e01b815260ff80861660048301528316602482015291925060009182916001600160a01b031690630ffad37f9060440160006040518083038186803b1580156113ec57600080fd5b505afa158015611400573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114289190810190613ad7565b9150915084818360405160200161144193929190613f0f565b60405160208183030381529060405294508360ff16600814611480578460405160200161146e9190613d18565b60405160208183030381529060405294505b505050808061148e9061468e565b915050611374565b50806040516020016114a89190614194565b604051602081830303815290604052915050919050565b6000818152600260205260408120546001600160a01b0316806108455760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610952565b60006001600160a01b0382166115a15760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610952565b506001600160a01b031660009081526003602052604090205490565b60006010544210156115d0575060125490565b60006115ed601154610fc360105442612cf390919063ffffffff16565b9050611606601354601254612cf390919063ffffffff16565b6014546116139083612cdb565b1061162057505060135490565b8060145461162e91906145b3565b60125461163b91906145d2565b91505090565b5090565b600a546001600160a01b0316331461166f5760405162461bcd60e51b81526004016109529061445f565b6116796000612fed565b565b6000805b60098160ff1610156117615760006116a3610e4882610e428760ff87166001612b38565b601954604051635cf4ee9160e01b815260ff8086166004830152831660248201529192506000916001600160a01b0390911690635cf4ee919060440160206040518083038186803b1580156116f757600080fd5b505afa15801561170b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172f9190613c76565b63ffffffff16905061174a81856127c690919063ffffffff16565b9350505080806117599061468e565b91505061167f565b5061084581662386f26fc10000612cdb565b3361177d826114bf565b6001600160a01b03161461179057600080fd5b61179d3361dead8361298d565b6018546000828152600c60205260409081902054905163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b1580156117fa57600080fd5b505af115801561180e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8a91906139da565b6010544210156118845760405162461bcd60e51b815260206004820152601f60248201527f4d696e74696e6720666f722045544820686173206e6f742073746172746564006044820152606401610952565b61188c6115bd565b3410156118cc5760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610952565b60006118d6612f61565b9050610c8a818361237c565b60606001805461085a90614638565b6000806118fd60085490565b90508061190c57505060155490565b6000611923600e5483612ce790919063ffffffff16565b905061194661193d60165483612cdb90919063ffffffff16565b601554906127c6565b9250505090565b6000818152600b602052604081208054606092919061196b90614638565b80601f016020809104026020016040519081016040528092919081815260200182805461199790614638565b80156119e45780601f106119b9576101008083540402835291602001916119e4565b820191906000526020600020905b8154815290600101906020018083116119c757829003601f168201915b5093979650505050505050565b6001600160a01b038216331415611a4a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610952565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b03163314611ae05760405162461bcd60e51b81526004016109529061445f565b6000838152600b602052604081208054611af990614638565b80601f0160208091040260200160405190810160405280929190818152602001828054611b2590614638565b8015611b725780601f10611b4757610100808354040283529160200191611b72565b820191906000526020600020905b815481529060010190602001808311611b5557829003601f168201915b505050505090506000611b94828560ff16611b8f8660ff16612cff565b612e18565b6000868152600b602090815260409091208251929350611bb8929091840190613718565b505050505050565b600f54421015611c0c5760405162461bcd60e51b8152602060048201526017602482015276135a5b9d1a5b99c81a185cc81b9bdd081cdd185c9d1959604a1b6044820152606401610952565b601854604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e9060440160206040518083038186803b158015611c5657600080fd5b505afa158015611c6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8e9190613b4f565b9050611c986118f1565b811015611cb75760405162461bcd60e51b815260040161095290614428565b6018546001600160a01b03166379cc679033611cd16118f1565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015611d1757600080fd5b505af1158015611d2b573d6000803e3d6000fd5b505050506000611d39612f61565b9050610a88818461237c565b60608060005b60098160ff161015612010576000611d6f610e4882610e428860ff87166001612b38565b60195460405163a8e8633360e01b815260ff8086166004830152831660248201529192506000916001600160a01b039091169063a8e863339060440160006040518083038186803b158015611dc357600080fd5b505afa158015611dd7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611dff9190810190613a2e565b9050805160001415611e12575050611ffe565b6000611e4e604051806040016040528060018152602001603960f91b815250611e486000600186612b389092919063ffffffff16565b9061303f565b604080516020810190915260008152909150600190815b84518361ffff161015611ff7578015611ea057611e888561ffff85166003612b38565b9150611e9560038461453c565b925060009050611e65565b611ed7604051806040016040528060018152602001601f60fa1b815250611e488561ffff16600189612b389092919063ffffffff16565b15611ef057506001611ee9818461453c565b9250611e65565b6000611f028661ffff86166003612b38565b90506000611f19610e4882610e4285826001612b38565b90506000611f30610e4882610e4286600180612b38565b90506000611f48610e4882610e428760026001612b38565b611f5390600161457a565b90508715611fbd578b86611f698560ff16612cff565b611f758560ff16612cff565b611f818560ff16612cff565b604051602001611f95959493929190613e2a565b60408051601f198184030181529190529b50611fb260038861453c565b965050505050611e65565b8b86611fcb8560ff16612cff565b611fd78560ff16612cff565b611fe38560ff16612cff565b604051602001611f95959493929190613d3d565b5050505050505b806120088161468e565b915050611d4b565b50601954604080516387c79d1d60e01b8152905183926001600160a01b0316916387c79d1d916004808301926000929190829003018186803b15801561205557600080fd5b505afa158015612069573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120919190810190613aa5565b6040516020016120a292919061420d565b60408051601f198184030181529190529392505050565b6120c33383612896565b6120df5760405162461bcd60e51b815260040161095290614494565b6120eb848484846130a3565b50505050565b600f5442101561213d5760405162461bcd60e51b8152602060048201526017602482015276135a5b9d1a5b99c81a185cc81b9bdd081cdd185c9d1959604a1b6044820152606401610952565b601854604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e9060440160206040518083038186803b15801561218757600080fd5b505afa15801561219b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121bf9190613b4f565b90506121c96118f1565b6121d69060ff84166145b3565b8110156121f55760405162461bcd60e51b815260040161095290614428565b6018546001600160a01b03166379cc67903361220f6118f1565b61221c9060ff87166145b3565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561226257600080fd5b505af1158015612276573d6000803e3d6000fd5b5050505060005b8260ff16811015610a8857612290612f61565b508061229b81614673565b91505061227d565b6000818152600260205260409020546060906001600160a01b03166122c757600080fd5b60006122d28361194d565b90506123206122e084612cff565b6122f16122ec84611d45565b6130d6565b6122fa8461136e565b60405160200161230c9392919061402c565b6040516020818303038152906040526130d6565b6040516020016114a891906141c8565b600a546001600160a01b0316331461235a5760405162461bcd60e51b81526004016109529061445f565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b8060405160200161238d9190613cfc565b60408051601f1981840301815282825280516020918201206000868152600b83529290922091926123bf929101613f95565b6040516020818303038152906040528051906020012014156124235760405162461bcd60e51b815260206004820152601860248201527f436f6e666967206d75737420626520646966666572656e7400000000000000006044820152606401610952565b601854604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e9060440160206040518083038186803b15801561246d57600080fd5b505afa158015612481573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124a59190613b4f565b905060008060006124b68686610d66565b6018546040516370a0823160e01b815233600482015293965091945092506000916001600160a01b03909116906370a082319060240160206040518083038186803b15801561250457600080fd5b505afa158015612518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253c9190613b4f565b90508385101561255e5760405162461bcd60e51b815260040161095290614428565b838110156125a35760405162461bcd60e51b81526020600482015260126024820152710b2deea40dccacac840dadee4ca40a8a482b60731b6044820152606401610952565b81156126d9576018546040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b03909116906323b872dd90606401602060405180830381600087803b1580156125fb57600080fd5b505af115801561260f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061263391906139da565b506018546001600160a01b03166379cc6790336126508787612cf3565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561269657600080fd5b505af11580156126aa573d6000803e3d6000fd5b5050506000888152600c6020526040812080548693509091906126ce908490614562565b909155506127029050565b81612702576000878152600c6020526040812080548592906126fc9084906145d2565b90915550505b6000878152600b60209081526040909120875161272192890190613718565b5050505050505050565b600a546001600160a01b031633146127555760405162461bcd60e51b81526004016109529061445f565b6001600160a01b0381166127ba5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610952565b6127c381612fed565b50565b600061120a8284614562565b3b151590565b60006001600160e01b031982166380ac58cd60e01b148061280957506001600160e01b03198216635b5e139f60e01b145b8061084557506301ffc9a760e01b6001600160e01b0319831614610845565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061285d826114bf565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b031661290f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610952565b600061291a836114bf565b9050806001600160a01b0316846001600160a01b031614806129555750836001600160a01b031661294a846108dd565b6001600160a01b0316145b8061298557506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166129a0826114bf565b6001600160a01b031614612a085760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610952565b6001600160a01b038216612a6a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610952565b612a7583838361324b565b612a80600082612828565b6001600160a01b0383166000908152600360205260408120805460019290612aa99084906145d2565b90915550506001600160a01b0382166000908152600360205260408120805460019290612ad7908490614562565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b606081612b4681601f614562565b1015612b855760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610952565b612b8f8284614562565b84511015612bd35760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610952565b606082158015612bf25760405191506000825260208201604052612c3c565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612c2b578051835260209283019201612c13565b5050858452601f01601f1916604052505b50949350505050565b6000612c52826001614562565b83511015612c985760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401610952565b50016001015190565b600060308260ff1610158015612cbb575060398260ff1611155b15612ccb576108456030836145e9565b6108456057836145e9565b919050565b600061120a82846145b3565b600061120a828461459f565b600061120a82846145d2565b606081612d235750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612d4d5780612d3781614673565b9150612d469050600a8361459f565b9150612d27565b6000816001600160401b03811115612d7557634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612d9f576020820181803683370190505b5090505b841561298557612db46001836145d2565b9150612dc1600a866146ae565b612dcc906030614562565b60f81b818381518110612def57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612e11600a8661459f565b9450612da3565b60606000849050600081516001600160401b03811115612e4857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612e72576020820181803683370190505b50905060005b825181101561120557828181518110612ea157634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b828281518110612ecc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535085811415612f4f5784600081518110612f0c57634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b828281518110612f3757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053505b80612f5981614673565b915050612e78565b600080612f6d60085490565b9050600d548110612f7d57600080fd5b333b15612f8957600080fd5b80612fb060408051808201909152600981526803030303030303030360bc1b602082015290565b6000828152600b602090815260409091208251612fd39391929190910190613718565b506000818152600c60205260408120556108453382613303565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b81518151600091600191811480831461305b5760009250613099565b600160208701838101602088015b6002848385100114156130945780518351146130885760009650600093505b60209283019201613069565b505050505b5090949350505050565b6130ae84848461298d565b6130ba84848484613451565b6120eb5760405162461bcd60e51b8152600401610952906143d6565b60608151600014156130f657505060408051602081019091526000815290565b600060405180606001604052806040815260200161472960409139905060006003845160026131259190614562565b61312f919061459f565b61313a9060046145b3565b90506000613149826020614562565b6001600160401b0381111561316e57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613198576020820181803683370190505b509050818152600183018586518101602084015b818310156132065760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b938201939093526004016131ac565b60038951066001811461322057600281146132315761323d565b613d3d60f01b60011983015261323d565b603d60f81b6000198301525b509398975050505050505050565b6001600160a01b0383166132a6576132a181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6132c9565b816001600160a01b0316836001600160a01b0316146132c9576132c9838261355e565b6001600160a01b0382166132e057610a88816135fb565b826001600160a01b0316826001600160a01b031614610a8857610a8882826136d4565b6001600160a01b0382166133595760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610952565b6000818152600260205260409020546001600160a01b0316156133be5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610952565b6133ca6000838361324b565b6001600160a01b03821660009081526003602052604081208054600192906133f3908490614562565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561355357604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061349590339089908890889060040161434c565b602060405180830381600087803b1580156134af57600080fd5b505af19250505080156134df575060408051601f3d908101601f191682019092526134dc91810190613a12565b60015b613539573d80801561350d576040519150601f19603f3d011682016040523d82523d6000602084013e613512565b606091505b5080516135315760405162461bcd60e51b8152600401610952906143d6565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612985565b506001949350505050565b6000600161356b84611536565b61357591906145d2565b6000838152600760205260409020549091508082146135c8576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061360d906001906145d2565b6000838152600960205260408120546008805493945090928490811061364357634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061367257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806136b857634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006136df83611536565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b82805461372490614638565b90600052602060002090601f016020900481019282613746576000855561378c565b82601f1061375f57805160ff191683800117855561378c565b8280016001018555821561378c579182015b8281111561378c578251825591602001919060010190613771565b506116419291505b808211156116415760008155600101613794565b60006137bb6137b684614515565b6144e5565b90508281528383830111156137cf57600080fd5b828260208301376000602084830101529392505050565b60006137f46137b684614515565b905082815283838301111561380857600080fd5b61120a83602083018461460c565b80356001600160a01b0381168114612cd657600080fd5b600082601f83011261383d578081fd5b61120a838335602085016137a8565b600082601f83011261385c578081fd5b61120a838351602085016137e6565b803560ff81168114612cd657600080fd5b60006020828403121561388d578081fd5b61120a82613816565b600080604083850312156138a8578081fd5b6138b183613816565b91506138bf60208401613816565b90509250929050565b6000806000606084860312156138dc578081fd5b6138e584613816565b92506138f360208501613816565b9150604084013590509250925092565b60008060008060808587031215613918578081fd5b61392185613816565b935061392f60208601613816565b92506040850135915060608501356001600160401b03811115613950578182fd5b8501601f81018713613960578182fd5b61396f878235602084016137a8565b91505092959194509250565b6000806040838503121561398d578182fd5b61399683613816565b915060208301356139a681614704565b809150509250929050565b600080604083850312156139c3578182fd5b6139cc83613816565b946020939093013593505050565b6000602082840312156139eb578081fd5b815161120a81614704565b600060208284031215613a07578081fd5b813561120a81614712565b600060208284031215613a23578081fd5b815161120a81614712565b600060208284031215613a3f578081fd5b81516001600160401b03811115613a54578182fd5b8201601f81018413613a64578182fd5b612985848251602084016137e6565b600060208284031215613a84578081fd5b81356001600160401b03811115613a99578182fd5b6129858482850161382d565b600060208284031215613ab6578081fd5b81516001600160401b03811115613acb578182fd5b6129858482850161384c565b60008060408385031215613ae9578182fd5b82516001600160401b0380821115613aff578384fd5b613b0b8683870161384c565b93506020850151915080821115613b20578283fd5b50613b2d8582860161384c565b9150509250929050565b600060208284031215613b48578081fd5b5035919050565b600060208284031215613b60578081fd5b5051919050565b600080600060408486031215613b7b578081fd5b8335925060208401356001600160401b0380821115613b98578283fd5b818601915086601f830112613bab578283fd5b813581811115613bb9578384fd5b8760208260061b8501011115613bcd578384fd5b6020830194508093505050509250925092565b60008060408385031215613bf2578182fd5b8235915060208301356001600160401b03811115613c0e578182fd5b613b2d8582860161382d565b60008060408385031215613c2c578182fd5b50508035926020909101359150565b600080600060608486031215613c4f578081fd5b83359250613c5f6020850161386b565b9150613c6d6040850161386b565b90509250925092565b600060208284031215613c87578081fd5b815163ffffffff8116811461120a578182fd5b600060208284031215613cab578081fd5b61120a8261386b565b60008151808452613ccc81602086016020860161460c565b601f01601f19169290920160200192915050565b60008151613cf281856020860161460c565b9290920192915050565b60008251613d0e81846020870161460c565b9190910192915050565b60008251613d2a81846020870161460c565b600b60fa1b920191825250600101919050565b60008651613d4f818460208b0161460c565b6d3c7265637420636c6173733d276360901b9083019081528651613d7a81600e840160208b0161460c565b642720783d2760d81b600e92909101918201528551613da0816013840160208a0161460c565b642720793d2760d81b601392909101918201528451613dc681601884016020890161460c565b6927206865696768743d2760b01b601892909101918201528351613df181602284016020880161460c565b6e7078272077696474683d273170782760881b9101602281019190915261179f60f11b6031820152603381015b98975050505050505050565b60008651613e3c818460208b0161460c565b6d3c7265637420636c6173733d276360901b9083019081528651613e6781600e840160208b0161460c565b642720783d2760d81b600e92909101918201528551613e8d816013840160208a0161460c565b642720793d2760d81b601392909101918201528451613eb381601884016020890161460c565b68272077696474683d2760b81b601892909101918201528351613edd81602184016020880161460c565b6f707827206865696768743d273170782760801b9101602181019190915261179f60f11b603182015260338101613e1e565b60008451613f2181846020890161460c565b6e3d913a3930b4ba2fba3cb832911d1160891b9083019081528451613f4d81600f84016020890161460c565b6a1116113b30b63ab2911d1160a91b600f92909101918201528351613f7981601a84016020880161460c565b61227d60f01b601a9290910191820152601c0195945050505050565b600080835482600182811c915080831680613fb157607f831692505b6020808410821415613fd157634e487b7160e01b87526022600452602487fd5b818015613fe55760018114613ff657613094565b60ff19861689528489019650613094565b60008a815260209020885b8681101561401a5781548b820152908501908301614001565b50505096909201979650505050505050565b7f7b226e616d65223a20224652414d452045646974696f6e20302c20546f6b656e815261202360f01b60208201526000845161406f81602285016020890161460c565b7f222c20226465736372697074696f6e223a20224652414d4520746f6b656e73206022918401918201527f6172652066756c6c7920637573746f6d697a61626c65206f6e2d636861696e2060428201527f706978656c206172742e2045646974696f6e2030206973206120636f6c6c656360628201527f74696f6e206f66203332783332204d6f6f736520617661746172732e222c202260828201527f696d616765223a2022646174613a696d6167652f7376672b786d6c3b6261736560a2820152620d8d0b60ea1b60c282015284516141508160c584016020890161460c565b6e11161130ba3a3934b13aba32b9911d60891b60c5929091019182015261418a61417d60d4830186613ce0565b607d60f81b815260010190565b9695505050505050565b605b60f81b8152600082516141b081600185016020870161460c565b605d60f81b6001939091019283015250600201919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161420081601d85016020870161460c565b91909101601d0192915050565b7f3c7376672069643d226d6f6f73652d7376672220786d6c6e733d22687474703a81527f2f2f7777772e77332e6f72672f323030302f737667222070726573657276654160208201527f7370656374526174696f3d22784d696e594d696e206d6565742220766965774260408201526e37bc1e91181018101999101999111f60891b6060820152600083516142a981606f85016020880161460c565b7f3c7374796c653e726563742e62677b77696474683a333270783b686569676874606f918401918201527f3a333270783b7d20236d6f6f73652d7376677b73686170652d72656e64657269608f8201526f6e673a20637269737065646765733b7d60801b60af82015283516143258160bf84016020880161460c565b6d1e17b9ba3cb6329f1e17b9bb339f60911b60bf929091019182015260cd01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061418a90830184613cb4565b6020808252825182820181905260009190848201906040850190845b818110156143b75783518352928401929184019160010161439b565b50909695505050505050565b60208152600061120a6020830184613cb4565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526019908201527f436865636b2074686520746f6b656e20616c6c6f77616e636500000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f191681016001600160401b038111828210171561450d5761450d6146ee565b604052919050565b60006001600160401b0382111561452e5761452e6146ee565b50601f01601f191660200190565b600061ffff808316818516808303821115614559576145596146c2565b01949350505050565b60008219821115614575576145756146c2565b500190565b600060ff821660ff84168060ff03821115614597576145976146c2565b019392505050565b6000826145ae576145ae6146d8565b500490565b60008160001904831182151516156145cd576145cd6146c2565b500290565b6000828210156145e4576145e46146c2565b500390565b600060ff821660ff841680821015614603576146036146c2565b90039392505050565b60005b8381101561462757818101518382015260200161460f565b838111156120eb5750506000910152565b600181811c9082168061464c57607f821691505b6020821081141561466d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614687576146876146c2565b5060010190565b600060ff821660ff8114156146a5576146a56146c2565b60010192915050565b6000826146bd576146bd6146d8565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146127c357600080fd5b6001600160e01b0319811681146127c357600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220b7637940ab86e7c821f2573a411f1907ddf57bf301011aae7b52e6920398ad1f64736f6c634300080400334f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65720000000000000000000000003146dd9c200421a9c7d7b67bd1b75ba3e2c15310000000000000000000000000c92e730eebaca3d16d6c17f7f4646dce923663e8000000000000000000000000bf93b24a734d76ee6d685edad9f5d67371bed18a
Deployed Bytecode
0x6080604052600436106102675760003560e01c806370dcc45d11610144578063aa807fe2116100b6578063c446d6f81161007a578063c446d6f814610737578063c87b56dd14610757578063d2c91c8f14610777578063e985e9c514610797578063f09c8fb2146107e0578063f2fde38b1461080057600080fd5b8063aa807fe2146106a4578063b32fc877146106c4578063b595c9c9146106d7578063b816f513146106f7578063b88d4fde1461071757600080fd5b80638c136815116101085780638c136815146105fc5780638da5cb5b1461061c57806395d89b411461063a57806396a7d9471461064f5780639a0c930e14610664578063a22cb4651461068457600080fd5b806370dcc45d1461057f578063715018a61461059457806374c0dfe6146105a95780637ec7f9fe146105c95780638bbadf40146105e957600080fd5b8063401eeebc116101dd578063499b433f116101a1578063499b433f146104cc5780634f687814146104ec5780634f6ccce7146104ff5780635837e2681461051f5780636352211e1461053f57806370a082311461055f57600080fd5b8063401eeebc1461040257806342842e0e14610422578063438b63001461044257806345764fd01461046f5780634863ba17146104ac57600080fd5b806310c62a3a1161022f57806310c62a3a1461034b57806318160ddd1461036b57806323b872dd146103805780632ada5503146103a05780632f745c59146103cd5780633ccfd60b146103ed57600080fd5b806301ffc9a71461026c57806306fdde03146102a1578063081812fc146102c3578063095ea7b3146102fb578063096192d81461031d575b600080fd5b34801561027857600080fd5b5061028c6102873660046139f6565b610820565b60405190151581526020015b60405180910390f35b3480156102ad57600080fd5b506102b661084b565b60405161029891906143c3565b3480156102cf57600080fd5b506102e36102de366004613b37565b6108dd565b6040516001600160a01b039091168152602001610298565b34801561030757600080fd5b5061031b6103163660046139b1565b610977565b005b34801561032957600080fd5b5061033d610338366004613c1a565b610a8d565b604051908152602001610298565b34801561035757600080fd5b5061031b61036636600461387c565b610b1e565b34801561037757600080fd5b5060085461033d565b34801561038c57600080fd5b5061031b61039b3660046138c8565b610b6a565b3480156103ac57600080fd5b5061033d6103bb366004613b37565b6000908152600c602052604090205490565b3480156103d957600080fd5b5061033d6103e83660046139b1565b610b9b565b3480156103f957600080fd5b5061031b610c31565b34801561040e57600080fd5b506017546102e3906001600160a01b031681565b34801561042e57600080fd5b5061031b61043d3660046138c8565b610c8e565b34801561044e57600080fd5b5061046261045d36600461387c565b610ca9565b604051610298919061437f565b34801561047b57600080fd5b5061048f61048a366004613be0565b610d66565b604080519384526020840192909252151590820152606001610298565b3480156104b857600080fd5b5061031b6104c736600461387c565b61101e565b3480156104d857600080fd5b506102b66104e7366004613b67565b61106a565b61031b6104fa366004613c9a565b611211565b34801561050b57600080fd5b5061033d61051a366004613b37565b6112cd565b34801561052b57600080fd5b506102b661053a366004613a73565b61136e565b34801561054b57600080fd5b506102e361055a366004613b37565b6114bf565b34801561056b57600080fd5b5061033d61057a36600461387c565b611536565b34801561058b57600080fd5b5061033d6115bd565b3480156105a057600080fd5b5061031b611645565b3480156105b557600080fd5b5061033d6105c4366004613a73565b61167b565b3480156105d557600080fd5b5061031b6105e4366004613b37565b611773565b61031b6105f7366004613a73565b611832565b34801561060857600080fd5b506018546102e3906001600160a01b031681565b34801561062857600080fd5b50600a546001600160a01b03166102e3565b34801561064657600080fd5b506102b66118e2565b34801561065b57600080fd5b5061033d6118f1565b34801561067057600080fd5b506102b661067f366004613b37565b61194d565b34801561069057600080fd5b5061031b61069f36600461397b565b6119f1565b3480156106b057600080fd5b5061031b6106bf366004613c3b565b611ab6565b61031b6106d2366004613a73565b611bc0565b3480156106e357600080fd5b506102b66106f2366004613a73565b611d45565b34801561070357600080fd5b506019546102e3906001600160a01b031681565b34801561072357600080fd5b5061031b610732366004613903565b6120b9565b34801561074357600080fd5b5061031b610752366004613c9a565b6120f1565b34801561076357600080fd5b506102b6610772366004613b37565b6122a3565b34801561078357600080fd5b5061031b61079236600461387c565b612330565b3480156107a357600080fd5b5061028c6107b2366004613896565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156107ec57600080fd5b5061031b6107fb366004613be0565b61237c565b34801561080c57600080fd5b5061031b61081b36600461387c565b61272b565b60006001600160e01b0319821663780e9d6360e01b14806108455750610845826127d8565b92915050565b60606000805461085a90614638565b80601f016020809104026020016040519081016040528092919081815260200182805461088690614638565b80156108d35780601f106108a8576101008083540402835291602001916108d3565b820191906000526020600020905b8154815290600101906020018083116108b657829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661095b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610982826114bf565b9050806001600160a01b0316836001600160a01b031614156109f05760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610952565b336001600160a01b0382161480610a0c5750610a0c81336107b2565b610a7e5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610952565b610a888383612828565b505050565b601954604051635cf4ee9160e01b815260048101849052602481018390526000916001600160a01b031690635cf4ee919060440160206040518083038186803b158015610ad957600080fd5b505afa158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b119190613c76565b63ffffffff169392505050565b600a546001600160a01b03163314610b485760405162461bcd60e51b81526004016109529061445f565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b610b743382612896565b610b905760405162461bcd60e51b815260040161095290614494565b610a8883838361298d565b6000610ba683611536565b8210610c085760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610952565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600a546001600160a01b03163314610c5b5760405162461bcd60e51b81526004016109529061445f565b6040514790339082156108fc029083906000818181858888f19350505050158015610c8a573d6000803e3d6000fd5b5050565b610a88838383604051806020016040528060008152506120b9565b60606000610cb683611536565b90506000816001600160401b03811115610ce057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d09578160200160208202803683370190505b50905060005b82811015610d5e57610d218582610b9b565b828281518110610d4157634e487b7160e01b600052603260045260246000fd5b602090810291909101015280610d5681614673565b915050610d0f565b509392505050565b6000828152600b60205260408120805482918291829190610d8690614638565b80601f0160208091040260200160405190810160405280929190818152602001828054610db290614638565b8015610dff5780601f10610dd457610100808354040283529160200191610dff565b820191906000526020600020905b815481529060010190602001808311610de257829003601f168201915b5050506000898152600c60205260408120549097509293508691508190505b60098160ff161015610f94576000610e4d610e4882610e428c60ff87166001612b38565b90612c45565b612ca1565b601954604051635cf4ee9160e01b815260ff8086166004830152831660248201529192506000916001600160a01b0390911690635cf4ee919060440160206040518083038186803b158015610ea157600080fd5b505afa158015610eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed99190613c76565b63ffffffff1690506000610efc8460ff1660018d612b389092919063ffffffff16565b604051602001610f0c9190613cfc565b60408051601f198184030181529190528051602090910120610f338860ff87166001612b38565b604051602001610f439190613cfc565b60408051601f19818403018152919052805160209091012014159050610f6985836127c6565b94508015610f7e57610f7b8a836127c6565b99505b5050508080610f8c9061468e565b915050610e1e565b50610fa686662386f26fc10000612cdb565b9550610fcf6050610fc96064610fc385662386f26fc10000612cdb565b90612ce7565b90612cdb565b905081811415610fe6576000945060019350611014565b8181111561100357610ff88183612cf3565b945060019350611014565b61100d8282612cf3565b9450600093505b5050509250925092565b600a546001600160a01b031633146110485760405162461bcd60e51b81526004016109529061445f565b601980546001600160a01b0319166001600160a01b0392909216919091179055565b6000838152600b602052604081208054606092919061108890614638565b80601f01602080910402602001604051908101604052809291908181526020018280546110b490614638565b80156111015780601f106110d657610100808354040283529160200191611101565b820191906000526020600020905b8154815290600101906020018083116110e457829003601f168201915b50505050509050600081905060005b60ff811685111561120557600061118487878460ff1681811061114357634e487b7160e01b600052603260045260246000fd5b90506040020160016002811061116957634e487b7160e01b600052603260045260246000fd5b60200201602081019061117c9190613c9a565b60ff16612cff565b90506111ef8388888560ff168181106111ad57634e487b7160e01b600052603260045260246000fd5b9050604002016000600281106111d357634e487b7160e01b600052603260045260246000fd5b6020020160208101906111e69190613c9a565b60ff1683612e18565b92505080806111fd9061468e565b915050611110565b509150505b9392505050565b6010544210156112635760405162461bcd60e51b815260206004820152601f60248201527f4d696e74696e6720666f722045544820686173206e6f742073746172746564006044820152606401610952565b60008160ff1611801561127a575060148160ff1611155b61128357600080fd5b61128b6115bd565b6112989060ff83166145b3565b3410156112a457600080fd5b60005b8160ff16811015610c8a576112ba612f61565b50806112c581614673565b9150506112a7565b60006112d860085490565b821061133b5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610952565b6008828154811061135c57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60608060005b60098160ff161015611496576000611398610e4882610e428860ff87166001612b38565b601954604051630ffad37f60e01b815260ff80861660048301528316602482015291925060009182916001600160a01b031690630ffad37f9060440160006040518083038186803b1580156113ec57600080fd5b505afa158015611400573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114289190810190613ad7565b9150915084818360405160200161144193929190613f0f565b60405160208183030381529060405294508360ff16600814611480578460405160200161146e9190613d18565b60405160208183030381529060405294505b505050808061148e9061468e565b915050611374565b50806040516020016114a89190614194565b604051602081830303815290604052915050919050565b6000818152600260205260408120546001600160a01b0316806108455760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610952565b60006001600160a01b0382166115a15760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610952565b506001600160a01b031660009081526003602052604090205490565b60006010544210156115d0575060125490565b60006115ed601154610fc360105442612cf390919063ffffffff16565b9050611606601354601254612cf390919063ffffffff16565b6014546116139083612cdb565b1061162057505060135490565b8060145461162e91906145b3565b60125461163b91906145d2565b91505090565b5090565b600a546001600160a01b0316331461166f5760405162461bcd60e51b81526004016109529061445f565b6116796000612fed565b565b6000805b60098160ff1610156117615760006116a3610e4882610e428760ff87166001612b38565b601954604051635cf4ee9160e01b815260ff8086166004830152831660248201529192506000916001600160a01b0390911690635cf4ee919060440160206040518083038186803b1580156116f757600080fd5b505afa15801561170b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172f9190613c76565b63ffffffff16905061174a81856127c690919063ffffffff16565b9350505080806117599061468e565b91505061167f565b5061084581662386f26fc10000612cdb565b3361177d826114bf565b6001600160a01b03161461179057600080fd5b61179d3361dead8361298d565b6018546000828152600c60205260409081902054905163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b1580156117fa57600080fd5b505af115801561180e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8a91906139da565b6010544210156118845760405162461bcd60e51b815260206004820152601f60248201527f4d696e74696e6720666f722045544820686173206e6f742073746172746564006044820152606401610952565b61188c6115bd565b3410156118cc5760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610952565b60006118d6612f61565b9050610c8a818361237c565b60606001805461085a90614638565b6000806118fd60085490565b90508061190c57505060155490565b6000611923600e5483612ce790919063ffffffff16565b905061194661193d60165483612cdb90919063ffffffff16565b601554906127c6565b9250505090565b6000818152600b602052604081208054606092919061196b90614638565b80601f016020809104026020016040519081016040528092919081815260200182805461199790614638565b80156119e45780601f106119b9576101008083540402835291602001916119e4565b820191906000526020600020905b8154815290600101906020018083116119c757829003601f168201915b5093979650505050505050565b6001600160a01b038216331415611a4a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610952565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b03163314611ae05760405162461bcd60e51b81526004016109529061445f565b6000838152600b602052604081208054611af990614638565b80601f0160208091040260200160405190810160405280929190818152602001828054611b2590614638565b8015611b725780601f10611b4757610100808354040283529160200191611b72565b820191906000526020600020905b815481529060010190602001808311611b5557829003601f168201915b505050505090506000611b94828560ff16611b8f8660ff16612cff565b612e18565b6000868152600b602090815260409091208251929350611bb8929091840190613718565b505050505050565b600f54421015611c0c5760405162461bcd60e51b8152602060048201526017602482015276135a5b9d1a5b99c81a185cc81b9bdd081cdd185c9d1959604a1b6044820152606401610952565b601854604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e9060440160206040518083038186803b158015611c5657600080fd5b505afa158015611c6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8e9190613b4f565b9050611c986118f1565b811015611cb75760405162461bcd60e51b815260040161095290614428565b6018546001600160a01b03166379cc679033611cd16118f1565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015611d1757600080fd5b505af1158015611d2b573d6000803e3d6000fd5b505050506000611d39612f61565b9050610a88818461237c565b60608060005b60098160ff161015612010576000611d6f610e4882610e428860ff87166001612b38565b60195460405163a8e8633360e01b815260ff8086166004830152831660248201529192506000916001600160a01b039091169063a8e863339060440160006040518083038186803b158015611dc357600080fd5b505afa158015611dd7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611dff9190810190613a2e565b9050805160001415611e12575050611ffe565b6000611e4e604051806040016040528060018152602001603960f91b815250611e486000600186612b389092919063ffffffff16565b9061303f565b604080516020810190915260008152909150600190815b84518361ffff161015611ff7578015611ea057611e888561ffff85166003612b38565b9150611e9560038461453c565b925060009050611e65565b611ed7604051806040016040528060018152602001601f60fa1b815250611e488561ffff16600189612b389092919063ffffffff16565b15611ef057506001611ee9818461453c565b9250611e65565b6000611f028661ffff86166003612b38565b90506000611f19610e4882610e4285826001612b38565b90506000611f30610e4882610e4286600180612b38565b90506000611f48610e4882610e428760026001612b38565b611f5390600161457a565b90508715611fbd578b86611f698560ff16612cff565b611f758560ff16612cff565b611f818560ff16612cff565b604051602001611f95959493929190613e2a565b60408051601f198184030181529190529b50611fb260038861453c565b965050505050611e65565b8b86611fcb8560ff16612cff565b611fd78560ff16612cff565b611fe38560ff16612cff565b604051602001611f95959493929190613d3d565b5050505050505b806120088161468e565b915050611d4b565b50601954604080516387c79d1d60e01b8152905183926001600160a01b0316916387c79d1d916004808301926000929190829003018186803b15801561205557600080fd5b505afa158015612069573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120919190810190613aa5565b6040516020016120a292919061420d565b60408051601f198184030181529190529392505050565b6120c33383612896565b6120df5760405162461bcd60e51b815260040161095290614494565b6120eb848484846130a3565b50505050565b600f5442101561213d5760405162461bcd60e51b8152602060048201526017602482015276135a5b9d1a5b99c81a185cc81b9bdd081cdd185c9d1959604a1b6044820152606401610952565b601854604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e9060440160206040518083038186803b15801561218757600080fd5b505afa15801561219b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121bf9190613b4f565b90506121c96118f1565b6121d69060ff84166145b3565b8110156121f55760405162461bcd60e51b815260040161095290614428565b6018546001600160a01b03166379cc67903361220f6118f1565b61221c9060ff87166145b3565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561226257600080fd5b505af1158015612276573d6000803e3d6000fd5b5050505060005b8260ff16811015610a8857612290612f61565b508061229b81614673565b91505061227d565b6000818152600260205260409020546060906001600160a01b03166122c757600080fd5b60006122d28361194d565b90506123206122e084612cff565b6122f16122ec84611d45565b6130d6565b6122fa8461136e565b60405160200161230c9392919061402c565b6040516020818303038152906040526130d6565b6040516020016114a891906141c8565b600a546001600160a01b0316331461235a5760405162461bcd60e51b81526004016109529061445f565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b8060405160200161238d9190613cfc565b60408051601f1981840301815282825280516020918201206000868152600b83529290922091926123bf929101613f95565b6040516020818303038152906040528051906020012014156124235760405162461bcd60e51b815260206004820152601860248201527f436f6e666967206d75737420626520646966666572656e7400000000000000006044820152606401610952565b601854604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e9060440160206040518083038186803b15801561246d57600080fd5b505afa158015612481573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124a59190613b4f565b905060008060006124b68686610d66565b6018546040516370a0823160e01b815233600482015293965091945092506000916001600160a01b03909116906370a082319060240160206040518083038186803b15801561250457600080fd5b505afa158015612518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253c9190613b4f565b90508385101561255e5760405162461bcd60e51b815260040161095290614428565b838110156125a35760405162461bcd60e51b81526020600482015260126024820152710b2deea40dccacac840dadee4ca40a8a482b60731b6044820152606401610952565b81156126d9576018546040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b03909116906323b872dd90606401602060405180830381600087803b1580156125fb57600080fd5b505af115801561260f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061263391906139da565b506018546001600160a01b03166379cc6790336126508787612cf3565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561269657600080fd5b505af11580156126aa573d6000803e3d6000fd5b5050506000888152600c6020526040812080548693509091906126ce908490614562565b909155506127029050565b81612702576000878152600c6020526040812080548592906126fc9084906145d2565b90915550505b6000878152600b60209081526040909120875161272192890190613718565b5050505050505050565b600a546001600160a01b031633146127555760405162461bcd60e51b81526004016109529061445f565b6001600160a01b0381166127ba5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610952565b6127c381612fed565b50565b600061120a8284614562565b3b151590565b60006001600160e01b031982166380ac58cd60e01b148061280957506001600160e01b03198216635b5e139f60e01b145b8061084557506301ffc9a760e01b6001600160e01b0319831614610845565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061285d826114bf565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b031661290f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610952565b600061291a836114bf565b9050806001600160a01b0316846001600160a01b031614806129555750836001600160a01b031661294a846108dd565b6001600160a01b0316145b8061298557506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166129a0826114bf565b6001600160a01b031614612a085760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610952565b6001600160a01b038216612a6a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610952565b612a7583838361324b565b612a80600082612828565b6001600160a01b0383166000908152600360205260408120805460019290612aa99084906145d2565b90915550506001600160a01b0382166000908152600360205260408120805460019290612ad7908490614562565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b606081612b4681601f614562565b1015612b855760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610952565b612b8f8284614562565b84511015612bd35760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610952565b606082158015612bf25760405191506000825260208201604052612c3c565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612c2b578051835260209283019201612c13565b5050858452601f01601f1916604052505b50949350505050565b6000612c52826001614562565b83511015612c985760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401610952565b50016001015190565b600060308260ff1610158015612cbb575060398260ff1611155b15612ccb576108456030836145e9565b6108456057836145e9565b919050565b600061120a82846145b3565b600061120a828461459f565b600061120a82846145d2565b606081612d235750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612d4d5780612d3781614673565b9150612d469050600a8361459f565b9150612d27565b6000816001600160401b03811115612d7557634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612d9f576020820181803683370190505b5090505b841561298557612db46001836145d2565b9150612dc1600a866146ae565b612dcc906030614562565b60f81b818381518110612def57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612e11600a8661459f565b9450612da3565b60606000849050600081516001600160401b03811115612e4857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612e72576020820181803683370190505b50905060005b825181101561120557828181518110612ea157634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b828281518110612ecc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535085811415612f4f5784600081518110612f0c57634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b828281518110612f3757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053505b80612f5981614673565b915050612e78565b600080612f6d60085490565b9050600d548110612f7d57600080fd5b333b15612f8957600080fd5b80612fb060408051808201909152600981526803030303030303030360bc1b602082015290565b6000828152600b602090815260409091208251612fd39391929190910190613718565b506000818152600c60205260408120556108453382613303565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b81518151600091600191811480831461305b5760009250613099565b600160208701838101602088015b6002848385100114156130945780518351146130885760009650600093505b60209283019201613069565b505050505b5090949350505050565b6130ae84848461298d565b6130ba84848484613451565b6120eb5760405162461bcd60e51b8152600401610952906143d6565b60608151600014156130f657505060408051602081019091526000815290565b600060405180606001604052806040815260200161472960409139905060006003845160026131259190614562565b61312f919061459f565b61313a9060046145b3565b90506000613149826020614562565b6001600160401b0381111561316e57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613198576020820181803683370190505b509050818152600183018586518101602084015b818310156132065760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b938201939093526004016131ac565b60038951066001811461322057600281146132315761323d565b613d3d60f01b60011983015261323d565b603d60f81b6000198301525b509398975050505050505050565b6001600160a01b0383166132a6576132a181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6132c9565b816001600160a01b0316836001600160a01b0316146132c9576132c9838261355e565b6001600160a01b0382166132e057610a88816135fb565b826001600160a01b0316826001600160a01b031614610a8857610a8882826136d4565b6001600160a01b0382166133595760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610952565b6000818152600260205260409020546001600160a01b0316156133be5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610952565b6133ca6000838361324b565b6001600160a01b03821660009081526003602052604081208054600192906133f3908490614562565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561355357604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061349590339089908890889060040161434c565b602060405180830381600087803b1580156134af57600080fd5b505af19250505080156134df575060408051601f3d908101601f191682019092526134dc91810190613a12565b60015b613539573d80801561350d576040519150601f19603f3d011682016040523d82523d6000602084013e613512565b606091505b5080516135315760405162461bcd60e51b8152600401610952906143d6565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612985565b506001949350505050565b6000600161356b84611536565b61357591906145d2565b6000838152600760205260409020549091508082146135c8576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061360d906001906145d2565b6000838152600960205260408120546008805493945090928490811061364357634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061367257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806136b857634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006136df83611536565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b82805461372490614638565b90600052602060002090601f016020900481019282613746576000855561378c565b82601f1061375f57805160ff191683800117855561378c565b8280016001018555821561378c579182015b8281111561378c578251825591602001919060010190613771565b506116419291505b808211156116415760008155600101613794565b60006137bb6137b684614515565b6144e5565b90508281528383830111156137cf57600080fd5b828260208301376000602084830101529392505050565b60006137f46137b684614515565b905082815283838301111561380857600080fd5b61120a83602083018461460c565b80356001600160a01b0381168114612cd657600080fd5b600082601f83011261383d578081fd5b61120a838335602085016137a8565b600082601f83011261385c578081fd5b61120a838351602085016137e6565b803560ff81168114612cd657600080fd5b60006020828403121561388d578081fd5b61120a82613816565b600080604083850312156138a8578081fd5b6138b183613816565b91506138bf60208401613816565b90509250929050565b6000806000606084860312156138dc578081fd5b6138e584613816565b92506138f360208501613816565b9150604084013590509250925092565b60008060008060808587031215613918578081fd5b61392185613816565b935061392f60208601613816565b92506040850135915060608501356001600160401b03811115613950578182fd5b8501601f81018713613960578182fd5b61396f878235602084016137a8565b91505092959194509250565b6000806040838503121561398d578182fd5b61399683613816565b915060208301356139a681614704565b809150509250929050565b600080604083850312156139c3578182fd5b6139cc83613816565b946020939093013593505050565b6000602082840312156139eb578081fd5b815161120a81614704565b600060208284031215613a07578081fd5b813561120a81614712565b600060208284031215613a23578081fd5b815161120a81614712565b600060208284031215613a3f578081fd5b81516001600160401b03811115613a54578182fd5b8201601f81018413613a64578182fd5b612985848251602084016137e6565b600060208284031215613a84578081fd5b81356001600160401b03811115613a99578182fd5b6129858482850161382d565b600060208284031215613ab6578081fd5b81516001600160401b03811115613acb578182fd5b6129858482850161384c565b60008060408385031215613ae9578182fd5b82516001600160401b0380821115613aff578384fd5b613b0b8683870161384c565b93506020850151915080821115613b20578283fd5b50613b2d8582860161384c565b9150509250929050565b600060208284031215613b48578081fd5b5035919050565b600060208284031215613b60578081fd5b5051919050565b600080600060408486031215613b7b578081fd5b8335925060208401356001600160401b0380821115613b98578283fd5b818601915086601f830112613bab578283fd5b813581811115613bb9578384fd5b8760208260061b8501011115613bcd578384fd5b6020830194508093505050509250925092565b60008060408385031215613bf2578182fd5b8235915060208301356001600160401b03811115613c0e578182fd5b613b2d8582860161382d565b60008060408385031215613c2c578182fd5b50508035926020909101359150565b600080600060608486031215613c4f578081fd5b83359250613c5f6020850161386b565b9150613c6d6040850161386b565b90509250925092565b600060208284031215613c87578081fd5b815163ffffffff8116811461120a578182fd5b600060208284031215613cab578081fd5b61120a8261386b565b60008151808452613ccc81602086016020860161460c565b601f01601f19169290920160200192915050565b60008151613cf281856020860161460c565b9290920192915050565b60008251613d0e81846020870161460c565b9190910192915050565b60008251613d2a81846020870161460c565b600b60fa1b920191825250600101919050565b60008651613d4f818460208b0161460c565b6d3c7265637420636c6173733d276360901b9083019081528651613d7a81600e840160208b0161460c565b642720783d2760d81b600e92909101918201528551613da0816013840160208a0161460c565b642720793d2760d81b601392909101918201528451613dc681601884016020890161460c565b6927206865696768743d2760b01b601892909101918201528351613df181602284016020880161460c565b6e7078272077696474683d273170782760881b9101602281019190915261179f60f11b6031820152603381015b98975050505050505050565b60008651613e3c818460208b0161460c565b6d3c7265637420636c6173733d276360901b9083019081528651613e6781600e840160208b0161460c565b642720783d2760d81b600e92909101918201528551613e8d816013840160208a0161460c565b642720793d2760d81b601392909101918201528451613eb381601884016020890161460c565b68272077696474683d2760b81b601892909101918201528351613edd81602184016020880161460c565b6f707827206865696768743d273170782760801b9101602181019190915261179f60f11b603182015260338101613e1e565b60008451613f2181846020890161460c565b6e3d913a3930b4ba2fba3cb832911d1160891b9083019081528451613f4d81600f84016020890161460c565b6a1116113b30b63ab2911d1160a91b600f92909101918201528351613f7981601a84016020880161460c565b61227d60f01b601a9290910191820152601c0195945050505050565b600080835482600182811c915080831680613fb157607f831692505b6020808410821415613fd157634e487b7160e01b87526022600452602487fd5b818015613fe55760018114613ff657613094565b60ff19861689528489019650613094565b60008a815260209020885b8681101561401a5781548b820152908501908301614001565b50505096909201979650505050505050565b7f7b226e616d65223a20224652414d452045646974696f6e20302c20546f6b656e815261202360f01b60208201526000845161406f81602285016020890161460c565b7f222c20226465736372697074696f6e223a20224652414d4520746f6b656e73206022918401918201527f6172652066756c6c7920637573746f6d697a61626c65206f6e2d636861696e2060428201527f706978656c206172742e2045646974696f6e2030206973206120636f6c6c656360628201527f74696f6e206f66203332783332204d6f6f736520617661746172732e222c202260828201527f696d616765223a2022646174613a696d6167652f7376672b786d6c3b6261736560a2820152620d8d0b60ea1b60c282015284516141508160c584016020890161460c565b6e11161130ba3a3934b13aba32b9911d60891b60c5929091019182015261418a61417d60d4830186613ce0565b607d60f81b815260010190565b9695505050505050565b605b60f81b8152600082516141b081600185016020870161460c565b605d60f81b6001939091019283015250600201919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161420081601d85016020870161460c565b91909101601d0192915050565b7f3c7376672069643d226d6f6f73652d7376672220786d6c6e733d22687474703a81527f2f2f7777772e77332e6f72672f323030302f737667222070726573657276654160208201527f7370656374526174696f3d22784d696e594d696e206d6565742220766965774260408201526e37bc1e91181018101999101999111f60891b6060820152600083516142a981606f85016020880161460c565b7f3c7374796c653e726563742e62677b77696474683a333270783b686569676874606f918401918201527f3a333270783b7d20236d6f6f73652d7376677b73686170652d72656e64657269608f8201526f6e673a20637269737065646765733b7d60801b60af82015283516143258160bf84016020880161460c565b6d1e17b9ba3cb6329f1e17b9bb339f60911b60bf929091019182015260cd01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061418a90830184613cb4565b6020808252825182820181905260009190848201906040850190845b818110156143b75783518352928401929184019160010161439b565b50909695505050505050565b60208152600061120a6020830184613cb4565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526019908201527f436865636b2074686520746f6b656e20616c6c6f77616e636500000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f191681016001600160401b038111828210171561450d5761450d6146ee565b604052919050565b60006001600160401b0382111561452e5761452e6146ee565b50601f01601f191660200190565b600061ffff808316818516808303821115614559576145596146c2565b01949350505050565b60008219821115614575576145756146c2565b500190565b600060ff821660ff84168060ff03821115614597576145976146c2565b019392505050565b6000826145ae576145ae6146d8565b500490565b60008160001904831182151516156145cd576145cd6146c2565b500290565b6000828210156145e4576145e46146c2565b500390565b600060ff821660ff841680821015614603576146036146c2565b90039392505050565b60005b8381101561462757818101518382015260200161460f565b838111156120eb5750506000910152565b600181811c9082168061464c57607f821691505b6020821081141561466d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614687576146876146c2565b5060010190565b600060ff821660ff8114156146a5576146a56146c2565b60010192915050565b6000826146bd576146bd6146d8565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146127c357600080fd5b6001600160e01b0319811681146127c357600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220b7637940ab86e7c821f2573a411f1907ddf57bf301011aae7b52e6920398ad1f64736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003146dd9c200421a9c7d7b67bd1b75ba3e2c15310000000000000000000000000c92e730eebaca3d16d6c17f7f4646dce923663e8000000000000000000000000bf93b24a734d76ee6d685edad9f5d67371bed18a
-----Decoded View---------------
Arg [0] : _mooseAddress (address): 0x3146Dd9c200421A9c7d7b67bd1b75Ba3e2c15310
Arg [1] : _traxAddress (address): 0xc92E730EeBaCA3d16d6C17F7F4646DcE923663e8
Arg [2] : _libraryAddress (address): 0xBF93B24a734d76eE6d685EdAD9f5d67371BeD18a
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000003146dd9c200421a9c7d7b67bd1b75ba3e2c15310
Arg [1] : 000000000000000000000000c92e730eebaca3d16d6c17f7f4646dce923663e8
Arg [2] : 000000000000000000000000bf93b24a734d76ee6d685edad9f5d67371bed18a
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.