ERC-721
NFT
Overview
Max Total Supply
10,255 VFT
Holders
4,898
Market
Volume (24H)
6.7527 ETH
Min Price (24H)
$2,340.75 @ 0.750000 ETH
Max Price (24H)
$15,987.92 @ 5.122700 ETH
Other Info
Token Contract
Balance
1 VFTLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
This contract contains unverified libraries: RightwayMetadata, RightwayDecoder
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
RightwayToken
Compiler Version
v0.8.3+commit.8d00100c
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/AccessControl.sol'; import '../sales/Saleable.sol'; import './RightwayDecoder.sol'; import './RightwayMetadata.sol'; contract RightwayToken is ERC721Enumerable, Saleable, AccessControl { bytes32 public constant INFRA_ROLE = keccak256('INFRA_ROLE'); bytes32 public constant REDEEM_ROLE = keccak256('REDEEM_ROLE'); bytes32 public constant CONTENT_ROLE = keccak256('CONTENT_ROLE'); event TokenRedeemed(uint256 indexed tokenId); event TokenContentAdded(uint256 indexed tokenId); constructor( string memory name, string memory symbol, string memory newCreator ) ERC721(name, symbol) { creator = newCreator; dropSealed = false; contentApi = 'https://tbd.io/content'; metadataApi = string(abi.encodePacked('https://tbd.io/metadata/', addressToString(address(this)), '/')); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); } string public creator; address payable public royaltyAddress; uint256 public royaltyBps; /* * drop information */ RightwayDecoder.Drop internal drop; bool public dropSealed; mapping(uint256 => RightwayMetadata.TokenState) internal stateByToken; /* * hosting information */ string internal contentApi; string internal metadataApi; modifier unsealed() { require(!dropSealed, 'drop is sealed'); _; } modifier issealed() { require(dropSealed, 'drop is not sealed'); _; } function setDropRoyalties( address payable newRoyaltyAddress, uint256 newRoyaltyBps ) public onlyRole(DEFAULT_ADMIN_ROLE) { royaltyAddress = newRoyaltyAddress; royaltyBps = newRoyaltyBps; } function setApis( string calldata newContentApi, string calldata newMetadataApi ) public onlyRole(INFRA_ROLE) { contentApi = newContentApi; metadataApi = string(abi.encodePacked(newMetadataApi, '/', addressToString(address(this)), '/')); } function addDropContentLibraries( RightwayDecoder.DropContentLibrary[] memory contentLibraries ) public onlyRole(DEFAULT_ADMIN_ROLE) unsealed { for (uint idx = 0; idx < contentLibraries.length; idx++) { drop.contentLibraries.push(contentLibraries[idx]); } } function addDropContent( bytes32[] calldata content, uint offset ) public onlyRole(DEFAULT_ADMIN_ROLE) unsealed { uint idx = 0; while(idx < content.length) { drop.content[offset + idx] = content[idx]; idx++; } } function addDropStringData( bytes32[] calldata stringData, uint offset) public onlyRole(DEFAULT_ADMIN_ROLE) unsealed { uint idx = 0; while(idx < stringData.length) { drop.stringData[offset + idx] = stringData[idx]; idx++; } } function addDropSentences( bytes32[] calldata sentences, uint offset) public onlyRole(DEFAULT_ADMIN_ROLE) unsealed { uint idx = 0; while(idx < sentences.length) { drop.sentences[offset + idx] = sentences[idx]; idx++; } } function addDropAttributes( bytes32[] calldata attributes, uint offset) public onlyRole(DEFAULT_ADMIN_ROLE) unsealed { uint idx = 0; while(idx < attributes.length) { drop.attributes[offset + idx] = attributes[idx]; idx++; } } function addDropTemplates( bytes32[] calldata templates, uint offset) public onlyRole(DEFAULT_ADMIN_ROLE) unsealed { uint idx = 0; while(idx < templates.length) { drop.templates[offset + idx] = templates[idx]; idx++; } } function addDropEditions( bytes32[] calldata editions, uint offset) public onlyRole(DEFAULT_ADMIN_ROLE) unsealed { uint idx = 0; while(idx < editions.length) { drop.editions[offset + idx] = editions[idx]; idx++; } } function addDropTokens( bytes32[] calldata tokens, uint offset, uint length) public onlyRole(DEFAULT_ADMIN_ROLE) unsealed { uint idx = 0; while(idx < tokens.length) { drop.tokens[offset + idx] = tokens[idx]; idx++; } drop.numTokens = length; } function sealDrop() public onlyRole(DEFAULT_ADMIN_ROLE) unsealed { dropSealed = true; } function addTokenContent( uint256[] calldata tokens, string calldata slug, string calldata contentLibraryArweaveHash, uint16 contentIndex, string calldata contentType) public onlyRole(CONTENT_ROLE) issealed { for (uint idx = 0; idx < tokens.length; idx++) { require(_exists(tokens[idx]), 'No such token'); stateByToken[tokens[idx]].additionalContent.push(); uint cidx = stateByToken[tokens[idx]].additionalContent.length - 1; stateByToken[tokens[idx]].additionalContent[cidx].contentLibraryArweaveHash = contentLibraryArweaveHash; stateByToken[tokens[idx]].additionalContent[cidx].contentIndex = contentIndex; stateByToken[tokens[idx]].additionalContent[cidx].contentType = contentType; stateByToken[tokens[idx]].additionalContent[cidx].slug = slug; emit TokenContentAdded(tokens[idx]); } } function mint(address to, uint256 tokenId, uint16 attributesStart, uint16 attributesLength) public onlyRole(DEFAULT_ADMIN_ROLE) issealed { require(drop.numTokens > tokenId, 'No such token'); _safeMint(to, tokenId); RightwayMetadata.TokenState storage state = stateByToken[tokenId]; state.attributesStart = attributesStart; state.attributesLength = attributesLength; } function mintBatch(address to, uint256[] calldata tokenIds, uint16 attributesStart, uint16 attributesLength) public onlyRole(DEFAULT_ADMIN_ROLE) issealed { for (uint idx = 0; idx < tokenIds.length; idx++) { mint(to, tokenIds[idx], attributesStart, attributesLength); } } function redeem(uint256 tokenId, uint64 timestamp, string memory memo) public onlyRole(REDEEM_ROLE) issealed { require(_exists(tokenId), 'No such token'); RightwayMetadata.TokenState storage state = stateByToken[tokenId]; state.redemptions.push(); uint redemptionIdx = state.redemptions.length - 1; RightwayMetadata.TokenRedemption storage record = state.redemptions[redemptionIdx]; record.timestamp = timestamp; record.memo = memo; emit TokenRedeemed(tokenId); } function addressToString(address addr) internal pure returns(string memory) { bytes32 value = bytes32(uint256(uint160(addr))); bytes memory alphabet = '0123456789abcdef'; bytes memory str = new bytes(42); str[0] = '0'; str[1] = 'x'; for (uint256 i = 0; i < 20; i++) { str[2+i*2] = alphabet[uint8(value[i + 12] >> 4)]; str[3+i*2] = alphabet[uint8(value[i + 12] & 0x0f)]; } return string(str); } function getMetadata(uint256 tokenId) public view returns (RightwayMetadata.TokenMetadata memory) { RightwayMetadata.TokenState memory state; bool isMinted = false; if (_exists(tokenId)) { state = stateByToken[tokenId]; isMinted = true; } return RightwayMetadata.getMetadata(creator, drop, contentApi, tokenId, state, isMinted); } /** * @dev Base URI for computing {tokenURI}. Empty by default, can be overriden * in child contracts. */ function _baseURI() internal view virtual override returns (string memory) { return metadataApi; } /** * @dev Saleable interface */ function _processSaleOffering(uint256 offeringId, address buyer, uint256 price) internal override issealed { require(drop.numTokens > offeringId, 'No such token'); _safeMint(buyer, offeringId); RightwayMetadata.TokenState storage state = stateByToken[offeringId]; // solhint-disable-next-line not-rely-on-time state.soldOn = uint64(block.timestamp); state.buyer = buyer; state.price = price; } function registerSeller(address seller) public onlyRole(DEFAULT_ADMIN_ROLE) { _registerSeller(seller); } function deregisterSeller(address seller) public onlyRole(DEFAULT_ADMIN_ROLE) { _deregisterSeller(seller); } bytes4 private constant _INTERFACE_ID_FEES = 0xb7799584; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override (AccessControl, ERC721Enumerable) returns (bool) { return interfaceId == _INTERFACE_ID_FEES || AccessControl.supportsInterface(interfaceId) || ERC721Enumerable.supportsInterface(interfaceId); } function getFeeRecipients(uint256) public view returns (address payable[] memory) { address payable[] memory result = new address payable[](1); result[0] = royaltyAddress; return result; } function getFeeBps(uint256) public view returns (uint256[] memory) { uint256[] memory result = new uint256[](1); result[0] = royaltyBps; return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../utils/BinaryDecoder.sol'; import '../utils/PackedVarArray.sol'; library RightwayDecoder { struct DropContentLibrary { uint256 arweaveHash; } /* * content types: * 0 - image * 1 - vector * 2 - video * 3 - audio */ struct DropContent { uint8 contentLibrary; uint8 contentType; uint16 contentIndex; } // encoded as uint16 keyref, uint8 array (0/1), uint16 value-ref // arrays will have multiple entries struct DropAttribute { uint16 key; // from drop.stringData bool isArray; uint16 value; // from drop.stringData } struct DropTemplate { uint16 name; // from drop.sentences joined with ' ' uint16 description; // from drop.sentences joined with ' ' uint8 redemptions; uint64 redemptionExpiration; uint16 attributesStart; // from drop.attributes uint16 attributesLength; // from drop.attributes uint16 contentStart; // from drop.content uint16 contentLength; // from drop.content } struct DropEdition { uint16 template; uint16 size; uint16 attributesStart; // from drop.attributes uint16 attributesLength; // from drop.attributes uint16 contentStart; // from drop.content uint16 contentLength; // from drop.content } struct DropToken { uint16 edition; uint16 serial; } struct Drop { DropContentLibrary[] contentLibraries; // max of 256 content libraries bytes32[0xFFFF] content; bytes32[0xFFFF] stringData; // max of 64k strings bytes32[0xFFFF] sentences; // max of 64k strings bytes32[0xFFFF] attributes; bytes32[0xFFFF] templates; bytes32[0xFFFF] editions; bytes32[0xFFFF] tokens; uint numTokens; } function getBufferIndexAndOffset(uint index, uint stride) internal pure returns (uint, uint) { uint offset = index * stride; return (offset / 32, offset % 32); } function decodeDropAttribute(Drop storage drop, uint16 idx) public view returns ( DropAttribute memory ) { (uint bufferIndex, uint offset) = getBufferIndexAndOffset(idx, 6); DropAttribute memory result; uint8 isArray = 0; (result.key, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.attributes, bufferIndex, offset); (result.value, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.attributes, bufferIndex, offset); (isArray,,) = BinaryDecoder.decodeUint8(drop.attributes, bufferIndex, offset); result.isArray = isArray != 0; return result; } function decodeDropString(Drop storage drop, uint16 idx) public view returns ( string memory ) { return PackedVarArray.getString(drop.stringData, idx); } function copyBytesUsafe( bytes memory from, bytes memory to, uint offset) internal pure returns (uint){ for (uint idx = 0; idx < from.length; idx++) { to[offset + idx] = from[idx]; } return offset + from.length; } function decodeDropSentence(Drop storage drop, uint16 index ) public view returns (string memory) { uint16[] memory words = PackedVarArray.getUint16Array(drop.sentences, index); uint strLen = words.length - 1; // initialized to the number of spaces string[] memory strings = new string[](words.length); for (uint idx = 0; idx < words.length; idx++) { strings[idx] = PackedVarArray.getString(drop.stringData, words[idx]); strLen += bytes(strings[idx]).length; } bytes memory strRaw = new bytes(strLen); uint offset = 0; for (uint idx = 0; idx < words.length - 1; idx++) { offset = copyBytesUsafe(bytes(strings[idx]), strRaw, offset); strRaw[offset++] = 0x20; // ascii/utf8 space } copyBytesUsafe(bytes(strings[words.length - 1]), strRaw, offset); return string(strRaw); } function decodeDropEdition(Drop storage drop, uint16 idx) public view returns(DropEdition memory) { (uint bufferIndex, uint offset) = getBufferIndexAndOffset(idx, 12); DropEdition memory result; (result.template, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.editions, bufferIndex, offset); (result.size, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.editions, bufferIndex, offset); (result.attributesStart, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.editions, bufferIndex, offset); (result.attributesLength, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.editions, bufferIndex, offset); (result.contentStart, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.editions, bufferIndex, offset); (result.contentLength, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.editions, bufferIndex, offset); return result; } function decodeDropTemplate(Drop storage drop, uint16 idx) public view returns(DropTemplate memory) { (uint bufferIndex, uint offset) = getBufferIndexAndOffset(idx, 32); DropTemplate memory result; (result.name, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.templates, bufferIndex, offset); (result.description, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.templates, bufferIndex, offset); (result.redemptions, bufferIndex, offset) = BinaryDecoder.decodeUint8(drop.templates, bufferIndex, offset); (result.redemptionExpiration, bufferIndex, offset) = BinaryDecoder.decodeUint64Aligned(drop.templates, bufferIndex, offset); (result.attributesStart, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.templates, bufferIndex, offset); (result.attributesLength, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.templates, bufferIndex, offset); (result.contentStart, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.templates, bufferIndex, offset); (result.contentLength, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.templates, bufferIndex, offset); return result; } function decodeDropToken(Drop storage drop, uint16 idx) public view returns(DropToken memory) { (uint bufferIndex, uint offset) = getBufferIndexAndOffset(idx, 4); DropToken memory result; (result.edition, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.tokens, bufferIndex, offset); (result.serial, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.tokens, bufferIndex, offset); return result; } function decodeDropContent(Drop storage drop, uint16 idx) public view returns(DropContent memory) { DropContent memory result; (uint bufferIndex, uint offset) = getBufferIndexAndOffset(idx, 4); (result.contentLibrary, bufferIndex, offset) = BinaryDecoder.decodeUint8(drop.content, bufferIndex, offset); (result.contentType, bufferIndex, offset) = BinaryDecoder.decodeUint8(drop.content, bufferIndex, offset); (result.contentIndex, bufferIndex, offset) = BinaryDecoder.decodeUint16Aligned(drop.content, bufferIndex, offset); return result; } function getDropContentLibrary(Drop storage drop, uint16 idx) public view returns(DropContentLibrary storage) { return drop.contentLibraries[idx]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/utils/Strings.sol'; import '../utils/Base64.sol'; import './RightwayDecoder.sol'; library RightwayMetadata { /* * token state information */ struct TokenRedemption { uint64 timestamp; string memo; } struct AdditionalContent { string contentLibraryArweaveHash; uint16 contentIndex; string contentType; string slug; } struct TokenState { uint64 soldOn; uint256 price; address buyer; TokenRedemption[] redemptions; AdditionalContent[] additionalContent; uint16 attributesStart; uint16 attributesLength; } struct MetadataAttribute { bool isArray; string key; string[] values; } struct MetadataContent { string uri; string contentLibraryArweaveHash; uint16 contentIndex; string contentType; } struct MetadataAdditionalContent { string slug; string uri; string contentLibraryArweaveHash; uint16 contentIndex; string contentType; } struct TokenMetadata { string name; string description; MetadataAttribute[] attributes; uint256 editionSize; uint256 editionNumber; uint256 totalRedemptions; uint64 redemptionExpiration; MetadataContent[] content; TokenRedemption[] redemptions; uint64 soldOn; address buyer; uint256 price; bool isMinted; MetadataAdditionalContent[] additionalContent; } function reduceDropAttributes(RightwayDecoder.Drop storage drop, RightwayDecoder.DropAttribute[] memory dropAttribute ) internal view returns ( MetadataAttribute[] memory ) { if (dropAttribute.length == 0) { return new MetadataAttribute[](0); } uint resultCount = 0; uint16 lastKey = 0xFFFF; for (uint16 idx = 0; idx < dropAttribute.length; idx++) { if (!dropAttribute[idx].isArray || dropAttribute[idx].key != lastKey) { resultCount++; lastKey = dropAttribute[idx].key; } } MetadataAttribute[] memory result = new MetadataAttribute[](resultCount); resultCount = 0; lastKey = dropAttribute[0].key; for (uint16 idx = 0; idx < dropAttribute.length; idx++) { if (!dropAttribute[idx].isArray || dropAttribute[idx].key != lastKey) { result[resultCount].isArray = dropAttribute[idx].isArray; result[resultCount].key = RightwayDecoder.decodeDropString(drop, dropAttribute[idx].key); result[resultCount].values = new string[](1); result[resultCount].values[0] = RightwayDecoder.decodeDropString(drop, dropAttribute[idx].value); resultCount++; lastKey = dropAttribute[idx].key; } else { string[] memory oldValues = result[resultCount - 1].values; result[resultCount - 1].values = new string[](oldValues.length + 1); for( uint vidx = 0; vidx < oldValues.length; vidx++) { result[resultCount - 1].values[vidx] = oldValues[vidx]; } result[resultCount - 1].values[oldValues.length] = RightwayDecoder.decodeDropString(drop, dropAttribute[idx].value); } } return result; } function getAttributes(RightwayDecoder.Drop storage drop, uint16 start, uint16 length) internal view returns ( MetadataAttribute[] memory ) { if (length == 0) { return new MetadataAttribute[](0); } RightwayDecoder.DropAttribute[] memory dropAttributes = new RightwayDecoder.DropAttribute[](length); for (uint16 idx = 0; idx < length; idx++) { dropAttributes[idx] = RightwayDecoder.decodeDropAttribute(drop, idx + start); } return reduceDropAttributes(drop, dropAttributes); } function getAttributes(string storage creator, RightwayDecoder.Drop storage drop, TokenState memory state, RightwayDecoder.DropEdition memory edition, RightwayDecoder.DropTemplate memory template) internal view returns ( MetadataAttribute[] memory ) { MetadataAttribute[] memory tokenAttributes = getAttributes(drop, state.attributesStart, state.attributesLength); MetadataAttribute[] memory editionAttributes = getAttributes(drop, edition.attributesStart, edition.attributesLength); MetadataAttribute[] memory templateAttributes = getAttributes(drop, template.attributesStart, template.attributesLength); uint totalAttributes = tokenAttributes.length + editionAttributes.length + templateAttributes.length + 1; MetadataAttribute[] memory result = new MetadataAttribute[](totalAttributes); uint outputIdx = 0; for (uint idx = 0; idx < tokenAttributes.length; idx++) { result[outputIdx++] = tokenAttributes[idx]; } for (uint idx = 0; idx < editionAttributes.length; idx++) { result[outputIdx++] = editionAttributes[idx]; } for (uint idx = 0; idx < templateAttributes.length; idx++) { result[outputIdx++] = templateAttributes[idx]; } result[outputIdx].isArray = false; result[outputIdx].key = 'creator'; result[outputIdx].values = new string[](1); result[outputIdx].values[0] = creator; return result; } function getContentDetails(RightwayDecoder.Drop storage drop, string storage contentApi, uint16 index) public view returns ( string memory uri, string memory contentLibraryArweaveHash, uint16 contentIndex, string memory contentType ) { RightwayDecoder.DropContent memory content = RightwayDecoder.decodeDropContent(drop, index); RightwayDecoder.DropContentLibrary storage contentLibrary = RightwayDecoder.getDropContentLibrary(drop, content.contentLibrary); contentIndex = content.contentIndex; contentLibraryArweaveHash = Base64.encode(contentLibrary.arweaveHash); if (content.contentType == 0) { contentType = 'png'; } else if (content.contentType == 1) { contentType = 'jpg'; } else if (content.contentType == 2) { contentType = 'svg'; } else if (content.contentType == 3) { contentType = 'mp4'; } uri = string(abi.encodePacked(contentApi, '/', contentLibraryArweaveHash, '/', Strings.toString(contentIndex), '.', contentType )); } function getContent(RightwayDecoder.Drop storage drop, string storage contentApi, uint16 start, uint16 length) internal view returns(MetadataContent[] memory) { MetadataContent[] memory result = new MetadataContent[](length); for(uint16 idx = 0; idx < length; idx++) { (result[idx].uri, result[idx].contentLibraryArweaveHash, result[idx].contentIndex, result[idx].contentType) = getContentDetails(drop, contentApi, start+idx); } return result; } function getContents(RightwayDecoder.Drop storage drop, string storage contentApi, RightwayDecoder.DropEdition memory edition, RightwayDecoder.DropTemplate memory template) internal view returns (MetadataContent[] memory) { MetadataContent[] memory editionContent = getContent(drop, contentApi, edition.contentStart, edition.contentLength); MetadataContent[] memory templateContent = getContent(drop, contentApi, template.contentStart, template.contentLength); uint totalContents = editionContent.length + templateContent.length; MetadataContent[] memory result = new MetadataContent[](totalContents); uint outputIdx = 0; for (uint idx = 0; idx < editionContent.length; idx++) { result[outputIdx++] = editionContent[idx]; } for (uint idx = 0; idx < templateContent.length; idx++) { result[outputIdx++] = templateContent[idx]; } return result; } function getAdditionalContent(string storage contentApi, AdditionalContent memory content ) internal pure returns (MetadataAdditionalContent memory) { MetadataAdditionalContent memory result; result.uri = string(abi.encodePacked(contentApi, '/', content.contentLibraryArweaveHash, '/', Strings.toString(content.contentIndex), '.', content.contentType )); result.contentLibraryArweaveHash = content.contentLibraryArweaveHash; result.contentIndex = content.contentIndex; result.contentType = content.contentType; result.slug = content.slug; return result; } function getAdditionalContents(string storage contentApi, TokenState memory state) internal pure returns (MetadataAdditionalContent[] memory) { MetadataAdditionalContent[] memory result = new MetadataAdditionalContent[](state.additionalContent.length); uint outputIdx = 0; for (uint idx = 0; idx < state.additionalContent.length; idx++) { result[outputIdx++] = getAdditionalContent(contentApi, state.additionalContent[idx]); } return result; } function getTemplateMetadata(RightwayDecoder.Drop storage drop, TokenMetadata memory result, RightwayDecoder.DropTemplate memory template) public view { result.name = RightwayDecoder.decodeDropSentence(drop, template.name); result.description = RightwayDecoder.decodeDropSentence(drop, template.description); result.totalRedemptions = template.redemptions; result.redemptionExpiration = template.redemptionExpiration; } function getEditionMetadata(TokenMetadata memory result, RightwayDecoder.DropEdition memory edition ) public pure { result.editionSize = edition.size; } function getTokenMetadata(TokenMetadata memory result, string storage creator, RightwayDecoder.Drop storage drop, string storage contentApi, uint256 tokenId, TokenState memory state) public view { require(tokenId < drop.numTokens, 'No such token'); RightwayDecoder.DropToken memory token = RightwayDecoder.decodeDropToken(drop, uint16(tokenId)); RightwayDecoder.DropEdition memory edition = RightwayDecoder.decodeDropEdition(drop, token.edition); RightwayDecoder.DropTemplate memory template = RightwayDecoder.decodeDropTemplate(drop, edition.template); getTemplateMetadata(drop, result, template); getEditionMetadata(result, edition); result.editionNumber = token.serial; result.attributes = getAttributes(creator, drop, state, edition, template); result.content = getContents(drop, contentApi, edition, template); result.additionalContent = getAdditionalContents(contentApi, state); } function getStateMetadata(TokenMetadata memory result, TokenState memory state, bool isMinted) public pure { result.soldOn = state.soldOn; result.buyer = state.buyer; result.price = state.price; result.isMinted = isMinted; uint numRedemptions = state.redemptions.length; result.redemptions = new TokenRedemption[](numRedemptions); for (uint idx = 0; idx < numRedemptions; idx++) { result.redemptions[idx] = state.redemptions[idx]; } } function getMetadata(string storage creator, RightwayDecoder.Drop storage drop, string storage contentApi, uint256 tokenId, TokenState memory state, bool isMinted) public view returns (TokenMetadata memory){ TokenMetadata memory result; getTokenMetadata(result, creator, drop, contentApi, tokenId, state); getStateMetadata(result, state, isMinted); return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ISaleable { function processSale(uint256 offeringId, address buyer, uint256 price) external; function getSellersFor(uint256 offeringId) external view returns (address[] memory sellers); event SellerAdded(address indexed seller, uint256 indexed offeringId); event SellerRemoved(address indexed seller, uint256 indexed offeringId); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './ISaleable.sol'; abstract contract Saleable is ISaleable { mapping(uint256 => address[]) public authorizedSellersByOffer; mapping(address => bool) public authorizedSellersAllOffers; function isAuthorizedSellerOf(address seller, uint256 offeringId) public view returns (bool) { if (authorizedSellersAllOffers[seller]) { return true; } for (uint256 idx = 0; idx < authorizedSellersByOffer[offeringId].length; idx++) { if (authorizedSellersByOffer[offeringId][idx] == seller) { return true; } } return false; } function _processSaleOffering(uint256, address, uint256) internal virtual { require(false, 'Unimplemented'); } function processSale(uint256 offeringId, address buyer, uint256 price) public override { require(isAuthorizedSellerOf(msg.sender, offeringId), 'Seller not authorized'); _processSaleOffering(offeringId, buyer, price); } function _registerSeller(uint256 offeringId, address seller) internal { require(!isAuthorizedSellerOf(seller, offeringId), 'Seller is already authorized'); authorizedSellersByOffer[offeringId].push(seller); } function _registerSeller(address seller) internal { authorizedSellersAllOffers[seller] = true; } function _deregisterSeller(uint256 offeringId, address seller) internal { require(isAuthorizedSellerOf(seller, offeringId), 'Seller was not authorized'); uint256 index = 0; for (; index < authorizedSellersByOffer[offeringId].length; index++) { if (authorizedSellersByOffer[offeringId][index] == seller) { break; } } uint256 len = authorizedSellersByOffer[offeringId].length; if (index < len - 1) { address temp = authorizedSellersByOffer[offeringId][index]; authorizedSellersByOffer[offeringId][index] = authorizedSellersByOffer[offeringId][len]; authorizedSellersByOffer[offeringId][len] = temp; } authorizedSellersByOffer[offeringId].pop(); } function _deregisterSeller(address seller) internal { authorizedSellersAllOffers[seller] = false; } function getSellersFor(uint256 offeringId) public view override returns (address[] memory sellers) { sellers = authorizedSellersByOffer[offeringId]; } }
// SPDX-License-Identifier: MIT // Adapted from OpenZeppelin public expiriment // @dev see https://github.com/OpenZeppelin/solidity-jwt/blob/2a787f1c12c50da649eed1670b3a6d9c0221dd8e/contracts/Base64.sol for original pragma solidity ^0.8.0; library Base64 { bytes constant private BASE_64_URL_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'; function encode(uint256 bigint) external pure returns (string memory) { bytes32 buffer = bytes32(bigint); bytes memory res = new bytes(43); uint256 i = 0; uint256 j = 0; for (; i + 3 <= 32; i += 3) { (res[j], res[j+1], res[j+2], res[j+3]) = encode3( uint8(buffer[i]), uint8(buffer[i+1]), uint8(buffer[i+2]) ); j += 4; } (res[j], res[j+1], res[j+2], ) = encode3(uint8(buffer[30]), uint8(buffer[31]), 0); return string(res); } function encode3(uint256 a0, uint256 a1, uint256 a2) private pure returns (bytes1 b0, bytes1 b1, bytes1 b2, bytes1 b3) { uint256 n = (a0 << 16) | (a1 << 8) | a2; uint256 c0 = (n >> 18) & 63; uint256 c1 = (n >> 12) & 63; uint256 c2 = (n >> 6) & 63; uint256 c3 = (n ) & 63; b0 = BASE_64_URL_CHARS[c0]; b1 = BASE_64_URL_CHARS[c1]; b2 = BASE_64_URL_CHARS[c2]; b3 = BASE_64_URL_CHARS[c3]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library BinaryDecoder { function increment(uint bufferIdx, uint offset, uint amount) internal pure returns (uint, uint) { offset+=amount; return (bufferIdx + (offset / 32), offset % 32); } function decodeUint8(bytes32[0xFFFF] storage buffers, uint bufferIdx, uint offset) internal view returns (uint8, uint, uint) { uint8 result = 0; result |= uint8(buffers[bufferIdx][offset]); (bufferIdx, offset) = increment(bufferIdx, offset, 1); return (result, bufferIdx, offset); } function decodeUint16(bytes32[0xFFFF] storage buffers, uint bufferIdx, uint offset) internal view returns (uint16, uint, uint) { uint result = 0; if (offset % 32 < 31) { return decodeUint16Aligned(buffers, bufferIdx, offset); } result |= uint(uint8(buffers[bufferIdx][offset])) << 8; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])); (bufferIdx, offset) = increment(bufferIdx, offset, 1); return (uint16(result), bufferIdx, offset); } function decodeUint16Aligned(bytes32[0xFFFF] storage buffers, uint bufferIdx, uint offset) internal view returns (uint16, uint, uint) { uint result = 0; result |= uint(uint8(buffers[bufferIdx][offset])) << 8; result |= uint(uint8(buffers[bufferIdx][offset + 1])); (bufferIdx, offset) = increment(bufferIdx, offset, 2); return (uint16(result), bufferIdx, offset); } function decodeUint32(bytes32[0xFFFF] storage buffers, uint bufferIdx, uint offset) internal view returns (uint32, uint, uint) { if (offset % 32 < 29) { return decodeUint32Aligned(buffers, bufferIdx, offset); } uint result = 0; result |= uint(uint8(buffers[bufferIdx][offset])) << 24; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])) << 16; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])) << 8; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])); (bufferIdx, offset) = increment(bufferIdx, offset, 1); return (uint32(result), bufferIdx, offset); } function decodeUint32Aligned(bytes32[0xFFFF] storage buffers, uint bufferIdx, uint offset) internal view returns (uint32, uint, uint) { uint result = 0; result |= uint(uint8(buffers[bufferIdx][offset])) << 24; result |= uint(uint8(buffers[bufferIdx][offset + 1])) << 16; result |= uint(uint8(buffers[bufferIdx][offset + 2])) << 8; result |= uint(uint8(buffers[bufferIdx][offset + 3])); (bufferIdx, offset) = increment(bufferIdx, offset, 4); return (uint32(result), bufferIdx, offset); } function decodeUint64(bytes32[0xFFFF] storage buffers, uint bufferIdx, uint offset) internal view returns (uint64, uint, uint) { if (offset % 32 < 25) { return decodeUint64Aligned(buffers, bufferIdx, offset); } uint result = 0; result |= uint(uint8(buffers[bufferIdx][offset])) << 56; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])) << 48; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])) << 40; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])) << 32; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])) << 24; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])) << 16; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])) << 8; (bufferIdx, offset) = increment(bufferIdx, offset, 1); result |= uint(uint8(buffers[bufferIdx][offset])); (bufferIdx, offset) = increment(bufferIdx, offset, 1); return (uint64(result), bufferIdx, offset); } function decodeUint64Aligned(bytes32[0xFFFF] storage buffers, uint bufferIdx, uint offset) internal view returns (uint64, uint, uint) { uint result = 0; result |= uint(uint8(buffers[bufferIdx][offset])) << 56; result |= uint(uint8(buffers[bufferIdx][offset + 1])) << 48; result |= uint(uint8(buffers[bufferIdx][offset + 2])) << 40; result |= uint(uint8(buffers[bufferIdx][offset + 3])) << 32; result |= uint(uint8(buffers[bufferIdx][offset + 4])) << 24; result |= uint(uint8(buffers[bufferIdx][offset + 5])) << 16; result |= uint(uint8(buffers[bufferIdx][offset + 6])) << 8; result |= uint(uint8(buffers[bufferIdx][offset + 7])); (bufferIdx, offset) = increment(bufferIdx, offset, 8); return (uint64(result), bufferIdx, offset); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './BinaryDecoder.sol'; library PackedVarArray { function getString(bytes32[0xFFFF] storage buffers, uint offset, uint len) internal view returns (string memory) { bytes memory result = new bytes(len); uint bufferIdx = offset / 32; uint bufferOffset = offset % 32; uint outIdx = 0; uint remaining = len; uint bufferCap = 32 - bufferOffset; while (outIdx < len) { uint copyCount = remaining > bufferCap ? bufferCap : remaining; uint lastOffset = bufferOffset + copyCount; bytes32 buffer = bytes32(buffers[bufferIdx]); while( bufferOffset < lastOffset) { result[outIdx++] = buffer[bufferOffset++]; } remaining -= copyCount; bufferCap = 32; bufferOffset = 0; bufferIdx++; } return string(result); } function getString(bytes32[0xFFFF] storage buffers, uint16 index) internal view returns (string memory) { uint offsetLoc = uint(index) * 4; uint stringOffsetLen; (stringOffsetLen,,) = BinaryDecoder.decodeUint32Aligned(buffers, offsetLoc / 32, offsetLoc % 32); uint stringOffset = stringOffsetLen & 0xFFFFFF; uint stringLen = stringOffsetLen >> 24; return getString(buffers, stringOffset, stringLen); } function getUint16Array(bytes32[0xFFFF] storage buffers, uint offset, uint len) internal view returns (uint16[] memory) { uint16[] memory result = new uint16[](len); uint bufferIdx = offset / 32; uint bufferOffset = offset % 32; uint outIdx = 0; uint remaining = len * 2; uint bufferCap = 32 - bufferOffset; while (outIdx < len) { uint copyCount = remaining > bufferCap ? bufferCap : remaining; uint lastOffset = bufferOffset + copyCount; bytes32 buffer = bytes32(buffers[bufferIdx]); while (bufferOffset < lastOffset) { result[outIdx] = uint16(uint8(buffer[bufferOffset++])) << 8; result[outIdx] |= uint16(uint8(buffer[bufferOffset++])); outIdx++; } remaining -= copyCount; bufferCap = 32; bufferOffset = 0; bufferIdx++; } return result; } function getUint16Array(bytes32[0xFFFF] storage buffers, uint16 index) internal view returns (uint16[] memory) { uint offsetLoc = uint(index) * 4; uint arrOffsetLen; (arrOffsetLen, ,) = BinaryDecoder.decodeUint32Aligned(buffers, offsetLoc / 32, offsetLoc % 32); uint arrOffset = arrOffsetLen & 0xFFFFFF; uint arrLen = arrOffsetLen >> 24; return getUint16Array(buffers, arrOffset, arrLen); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, address account) external view returns (bool); function getRoleAdmin(bytes32 role) external view returns (bytes32); function grantRole(bytes32 role, address account) external; function revokeRole(bytes32 role, address account) external; function renounceRole(bytes32 role, address account) external; } /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ */ function _checkRole(bytes32 role, address account) internal view { if(!hasRole(role, account)) { revert(string(abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ))); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// 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}. Empty by default, can be overriden * in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual { _mint(to, tokenId); require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { // solhint-disable-next-line no-inline-assembly 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` 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 { } }
// 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; /** * @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 "../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; 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 "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly 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"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev 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) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant alphabet = "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] = alphabet[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "libraries": { "/home/bart/git/InfinityTokens-contract/contracts/custom/RightwayMetadata.sol": { "RightwayMetadata": "0xEdbF1D9Ab63294cDA3965CafDA82E1F8A23A66E5" }, "/home/bart/git/InfinityTokens-contract/contracts/custom/RightwayDecoder.sol": { "RightwayDecoder": "0xcFD8AE98cA84D8314ad985ab8787F481c1C1927e" } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"newCreator","type":"string"}],"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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"uint256","name":"offeringId","type":"uint256"}],"name":"SellerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"uint256","name":"offeringId","type":"uint256"}],"name":"SellerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenContentAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenRedeemed","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":[],"name":"CONTENT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INFRA_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REDEEM_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"attributes","type":"bytes32[]"},{"internalType":"uint256","name":"offset","type":"uint256"}],"name":"addDropAttributes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"content","type":"bytes32[]"},{"internalType":"uint256","name":"offset","type":"uint256"}],"name":"addDropContent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"arweaveHash","type":"uint256"}],"internalType":"struct RightwayDecoder.DropContentLibrary[]","name":"contentLibraries","type":"tuple[]"}],"name":"addDropContentLibraries","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"editions","type":"bytes32[]"},{"internalType":"uint256","name":"offset","type":"uint256"}],"name":"addDropEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"sentences","type":"bytes32[]"},{"internalType":"uint256","name":"offset","type":"uint256"}],"name":"addDropSentences","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"stringData","type":"bytes32[]"},{"internalType":"uint256","name":"offset","type":"uint256"}],"name":"addDropStringData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"templates","type":"bytes32[]"},{"internalType":"uint256","name":"offset","type":"uint256"}],"name":"addDropTemplates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"tokens","type":"bytes32[]"},{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"length","type":"uint256"}],"name":"addDropTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"string","name":"slug","type":"string"},{"internalType":"string","name":"contentLibraryArweaveHash","type":"string"},{"internalType":"uint16","name":"contentIndex","type":"uint16"},{"internalType":"string","name":"contentType","type":"string"}],"name":"addTokenContent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"authorizedSellersAllOffers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"authorizedSellersByOffer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"creator","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"seller","type":"address"}],"name":"deregisterSeller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dropSealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMetadata","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"components":[{"internalType":"bool","name":"isArray","type":"bool"},{"internalType":"string","name":"key","type":"string"},{"internalType":"string[]","name":"values","type":"string[]"}],"internalType":"struct RightwayMetadata.MetadataAttribute[]","name":"attributes","type":"tuple[]"},{"internalType":"uint256","name":"editionSize","type":"uint256"},{"internalType":"uint256","name":"editionNumber","type":"uint256"},{"internalType":"uint256","name":"totalRedemptions","type":"uint256"},{"internalType":"uint64","name":"redemptionExpiration","type":"uint64"},{"components":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"string","name":"contentLibraryArweaveHash","type":"string"},{"internalType":"uint16","name":"contentIndex","type":"uint16"},{"internalType":"string","name":"contentType","type":"string"}],"internalType":"struct RightwayMetadata.MetadataContent[]","name":"content","type":"tuple[]"},{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"string","name":"memo","type":"string"}],"internalType":"struct RightwayMetadata.TokenRedemption[]","name":"redemptions","type":"tuple[]"},{"internalType":"uint64","name":"soldOn","type":"uint64"},{"internalType":"address","name":"buyer","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bool","name":"isMinted","type":"bool"},{"components":[{"internalType":"string","name":"slug","type":"string"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"string","name":"contentLibraryArweaveHash","type":"string"},{"internalType":"uint16","name":"contentIndex","type":"uint16"},{"internalType":"string","name":"contentType","type":"string"}],"internalType":"struct RightwayMetadata.MetadataAdditionalContent[]","name":"additionalContent","type":"tuple[]"}],"internalType":"struct RightwayMetadata.TokenMetadata","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"offeringId","type":"uint256"}],"name":"getSellersFor","outputs":[{"internalType":"address[]","name":"sellers","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"offeringId","type":"uint256"}],"name":"isAuthorizedSellerOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint16","name":"attributesStart","type":"uint16"},{"internalType":"uint16","name":"attributesLength","type":"uint16"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint16","name":"attributesStart","type":"uint16"},{"internalType":"uint16","name":"attributesLength","type":"uint16"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"offeringId","type":"uint256"},{"internalType":"address","name":"buyer","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"processSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"string","name":"memo","type":"string"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seller","type":"address"}],"name":"registerSeller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyBps","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":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sealDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newContentApi","type":"string"},{"internalType":"string","name":"newMetadataApi","type":"string"}],"name":"setApis","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 payable","name":"newRoyaltyAddress","type":"address"},{"internalType":"uint256","name":"newRoyaltyBps","type":"uint256"}],"name":"setDropRoyalties","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"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200545838038062005458833981016040819052620000349162000589565b8251839083906200004d90600090602085019062000454565b5080516200006390600190602084019062000454565b505081516200007b9150600d90602084019062000454565b506207000b805460ff191690556040805180820190915260168082527f68747470733a2f2f7462642e696f2f636f6e74656e74000000000000000000006020909201918252620000d0916207000d9162000454565b50620000dc306200012d565b604051602001620000ee919062000616565b6040516020818303038152906040526207000e90805190602001906200011692919062000454565b5062000124600033620003a0565b5050506200075f565b604080518082018252601081526f181899199a1a9b1b9c1cb0b131b232b360811b60208201528151602a80825260608281019094526001600160a01b0385169291600091602082018180368337019050509050600360fc1b81600081518110620001a757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110620001e557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060005b60148110156200039757826004856200021a84600c62000668565b602081106200023957634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b031916901c60f81c60ff16815181106200026e57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916826200028b83600262000683565b6200029890600262000668565b81518110620002b757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053508284620002dd83600c62000668565b60208110620002fc57634e487b7160e01b600052603260045260246000fd5b825191901a600f169081106200032257634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916826200033f83600262000683565b6200034c90600362000668565b815181106200036b57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350806200038e8162000715565b915050620001ff565b50949350505050565b620003ac8282620003b0565b5050565b6000828152600c602090815260408083206001600160a01b038516845290915290205460ff16620003ac576000828152600c602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620004103390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b8280546200046290620006d8565b90600052602060002090601f016020900481019282620004865760008555620004d1565b82601f10620004a157805160ff1916838001178555620004d1565b82800160010185558215620004d1579182015b82811115620004d1578251825591602001919060010190620004b4565b50620004df929150620004e3565b5090565b5b80821115620004df5760008155600101620004e4565b600082601f8301126200050b578081fd5b81516001600160401b038082111562000528576200052862000749565b604051601f8301601f19908116603f0116810190828211818310171562000553576200055362000749565b816040528381528660208588010111156200056c578485fd5b6200057f846020830160208901620006a5565b9695505050505050565b6000806000606084860312156200059e578283fd5b83516001600160401b0380821115620005b5578485fd5b620005c387838801620004fa565b94506020860151915080821115620005d9578384fd5b620005e787838801620004fa565b93506040860151915080821115620005fd578283fd5b506200060c86828701620004fa565b9150509250925092565b60007f68747470733a2f2f7462642e696f2f6d657461646174612f00000000000000008252825162000650816018850160208701620006a5565b602f60f81b6018939091019283015250601901919050565b600082198211156200067e576200067e62000733565b500190565b6000816000190483118215151615620006a057620006a062000733565b500290565b60005b83811015620006c2578181015183820152602001620006a8565b83811115620006d2576000848401525b50505050565b600181811c90821680620006ed57607f821691505b602082108114156200070f57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156200072c576200072c62000733565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b614ce9806200076f6000396000f3fe608060405234801561001057600080fd5b50600436106103425760003560e01c806395d89b41116101b8578063be07dd5611610104578063d55c557d116100a2578063dbeb7de41161007c578063dbeb7de414610776578063e985e9c514610789578063ea2680e6146107c5578063fdf75336146107d857610342565b8063d55c557d1461072d578063d746d2a714610740578063d7544c711461076357610342565b8063c63adb2b116100de578063c63adb2b146106d7578063c87b56dd146106e0578063caab0432146106f3578063d547741f1461071a57610342565b8063be07dd561461068a578063bff14ee4146106b1578063c3f2af7d146106c457610342565b8063a8314edc11610171578063b3ca73001161014b578063b3ca73001461063e578063b6332cd714610651578063b88d4fde14610664578063b9c4d9fb1461067757610342565b8063a8314edc14610605578063ad2f852a14610618578063add49af61461062b57610342565b806395d89b411461058f578063a217fddf14610597578063a22cb4651461059f578063a25ca617146105b2578063a35b0af3146105c5578063a574cea4146105e557610342565b80632f745c59116102925780636352211e1161023057806370a082311161020a57806370a082311461052f578063772576c71461054257806381b877441461056957806391d148541461057c57610342565b80636352211e146104f65780636a0c9d66146105095780636bce809a1461051c57610342565b80633f2965f01161026c5780633f2965f0146104b557806342842e0e146104c85780634f6ccce7146104db5780635d512de9146104ee57610342565b80632f745c591461047c57806334343f971461048f57806336568abe146104a257610342565b80630ffb4c08116102ff578063244a5656116102d9578063244a565614610420578063248a9ca3146104335780632e0b31c4146104565780632f2ff15d1461046957610342565b80630ffb4c08146103ec57806318160ddd146103fb57806323b872dd1461040d57610342565b806301ffc9a71461034757806302d05d3f1461036f57806306fdde0314610384578063081812fc1461038c578063095ea7b3146103b75780630ebd4c7f146103cc575b600080fd5b61035a610355366004613f97565b6107eb565b60405190151581526020015b60405180910390f35b610377610827565b604051610366919061474c565b6103776108b5565b61039f61039a366004613f5b565b610947565b6040516001600160a01b039091168152602001610366565b6103ca6103c5366004613ce0565b6109d4565b005b6103df6103da366004613f5b565b610aea565b6040516103669190614714565b6207000b5461035a9060ff1681565b6008545b604051908152602001610366565b6103ca61041b366004613b7d565b610b45565b6103ca61042e366004613d44565b610b76565b6103ff610441366004613f5b565b6000908152600c602052604090206001015490565b6103ca610464366004613e86565b610c25565b6103ca610477366004613f73565b610fd9565b6103ff61048a366004613ce0565b610fff565b6103ca61049d366004613fcf565b611098565b6103ca6104b0366004613f73565b61111d565b6103ca6104c3366004613afe565b61119b565b6103ca6104d6366004613b7d565b6111cf565b6103ff6104e9366004613f5b565b6111ea565b6103ca61128b565b61039f610504366004613f5b565b6112ce565b6103ca610517366004613afe565b611345565b6103ca61052a366004613b1a565b611376565b6103ff61053d366004613afe565b6113a9565b6103ff7f23ab158aaf38f3699bf4266a91ca312794fa7ad6ee01e00dd03738daa058501e81565b6103ca6105773660046141ca565b611430565b61035a61058a366004613f73565b611489565b6103776114b4565b6103ff600081565b6103ca6105ad366004613cb3565b6114c3565b6103ca6105c0366004613d44565b611595565b6105d86105d3366004613f5b565b61163a565b60405161036691906146d3565b6105f86105f3366004613f5b565b6116a6565b604051610366919061493e565b61039f6106133660046141f0565b611bb4565b600e5461039f906001600160a01b031681565b61035a610639366004613ce0565b611bec565b6103ca61064c366004614211565b611ca9565b6103ca61065f366004613ddb565b611de9565b6103ca610672366004613bbd565b611e7f565b6105d8610685366004613f5b565b611eb7565b6103ff7f9abc57040bfcfa57b85b08824ec5ac8a2760aa67e3edf2af636feb2f0b09ff6f81565b6103ca6106bf366004613cf2565b611f2a565b6103ca6106d2366004613d44565b611fc0565b6103ff600f5481565b6103776106ee366004613f5b565b612067565b6103ff7f0e8d189d3bb3f499b0afc25b0024719edc7426579927f629d3464e695403963a81565b6103ca610728366004613f73565b612132565b6103ca61073b366004613d44565b612158565b61035a61074e366004613afe565b600b6020526000908152604090205460ff1681565b6103ca610771366004613c39565b6121ff565b6103ca610784366004613d8d565b612287565b61035a610797366004613b45565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6103ca6107d3366004613d44565b61233a565b6103ca6107e6366004613d44565b6123e1565b60006001600160e01b03198216632dde656160e21b1480610810575061081082612488565b8061081f575061081f826124a9565b90505b919050565b600d805461083490614ba6565b80601f016020809104026020016040519081016040528092919081815260200182805461086090614ba6565b80156108ad5780601f10610882576101008083540402835291602001916108ad565b820191906000526020600020905b81548152906001019060200180831161089057829003601f168201915b505050505081565b6060600080546108c490614ba6565b80601f01602080910402602001604051908101604052809291908181526020018280546108f090614ba6565b801561093d5780601f106109125761010080835404028352916020019161093d565b820191906000526020600020905b81548152906001019060200180831161092057829003601f168201915b5050505050905090565b6000610952826124ce565b6109b85760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006109df826112ce565b9050806001600160a01b0316836001600160a01b03161415610a4d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016109af565b336001600160a01b0382161480610a695750610a698133610797565b610adb5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016109af565b610ae583836124eb565b505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050600f5481600081518110610b3457634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b610b4f3382612559565b610b6b5760405162461bcd60e51b81526004016109af906148ed565b610ae583838361263f565b6000610b8381335b6127ea565b6207000b5460ff1615610ba85760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e57848482818110610bd357634e487b7160e01b600052603260045260246000fd5b602002919091013590506203000e610beb8386614b01565b61ffff8110610c0a57634e487b7160e01b600052603260045260246000fd5b015580610c1681614be1565b915050610bab565b5050505050565b7f9abc57040bfcfa57b85b08824ec5ac8a2760aa67e3edf2af636feb2f0b09ff6f610c508133610b7e565b6207000b5460ff16610c745760405162461bcd60e51b81526004016109af906148c1565b60005b89811015610fcc57610cae8b8b83818110610ca257634e487b7160e01b600052603260045260246000fd5b905060200201356124ce565b610cca5760405162461bcd60e51b81526004016109af90614820565b6207000c60008c8c84818110610cf057634e487b7160e01b600052603260045260246000fd5b6020908102929092013583525081019190915260400160009081206004018054600190810182559082526207000c828e8e86818110610d3f57634e487b7160e01b600052603260045260246000fd5b90506020020135815260200190815260200160002060040180549050610d659190614b4c565b905087876207000c60008f8f87818110610d8f57634e487b7160e01b600052603260045260246000fd5b9050602002013581526020019081526020016000206004018381548110610dc657634e487b7160e01b600052603260045260246000fd5b60009182526020909120610de093600490920201916134da565b50856207000c60008e8e86818110610e0857634e487b7160e01b600052603260045260246000fd5b9050602002013581526020019081526020016000206004018281548110610e3f57634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160010160006101000a81548161ffff021916908361ffff16021790555084846207000c60008f8f87818110610e9257634e487b7160e01b600052603260045260246000fd5b9050602002013581526020019081526020016000206004018381548110610ec957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600402016002019190610ee79291906134da565b5089896207000c60008f8f87818110610f1057634e487b7160e01b600052603260045260246000fd5b9050602002013581526020019081526020016000206004018381548110610f4757634e487b7160e01b600052603260045260246000fd5b90600052602060002090600402016003019190610f659291906134da565b508b8b83818110610f8657634e487b7160e01b600052603260045260246000fd5b905060200201357f67a177a786b1233e098191defadcbcc4529e024b977e3b0529a658473f47d3d160405160405180910390a25080610fc481614be1565b915050610c77565b5050505050505050505050565b6000828152600c6020526040902060010154610ff58133610b7e565b610ae5838361284e565b600061100a836113a9565b821061106c5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016109af565b506001600160a01b03821660009081526006602090815260408083208484529091529020545b92915050565b7f0e8d189d3bb3f499b0afc25b0024719edc7426579927f629d3464e695403963a6110c38133610b7e565b6110d16207000d86866134da565b5082826110dd306128d4565b6040516020016110ef939291906145b7565b6040516020818303038152906040526207000e908051906020019061111592919061355e565b505050505050565b6001600160a01b038116331461118d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016109af565b6111978282612b2f565b5050565b60006111a78133610b7e565b611197826001600160a01b03166000908152600b60205260409020805460ff19166001179055565b610ae583838360405180602001604052806000815250611e7f565b60006111f560085490565b82106112585760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016109af565b6008828154811061127957634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60006112978133610b7e565b6207000b5460ff16156112bc5760405162461bcd60e51b81526004016109af90614847565b506207000b805460ff19166001179055565b6000818152600260205260408120546001600160a01b03168061081f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016109af565b60006113518133610b7e565b611197826001600160a01b03166000908152600b60205260409020805460ff19169055565b60006113828133610b7e565b50600e80546001600160a01b0319166001600160a01b039390931692909217909155600f55565b60006001600160a01b0382166114145760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016109af565b506001600160a01b031660009081526003602052604090205490565b61143a3384611bec565b61147e5760405162461bcd60e51b815260206004820152601560248201527414d95b1b195c881b9bdd08185d5d1a1bdc9a5e9959605a1b60448201526064016109af565b610ae5838383612b96565b6000918252600c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600180546108c490614ba6565b6001600160a01b03821633141561151c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109af565b3360008181526005602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611589911515815260200190565b60405180910390a35050565b60006115a18133610b7e565b6207000b5460ff16156115c65760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e578484828181106115f157634e487b7160e01b600052603260045260246000fd5b6020029190910135905060116116078386614b01565b61ffff811061162657634e487b7160e01b600052603260045260246000fd5b01558061163281614be1565b9150506115c9565b6000818152600a602090815260409182902080548351818402810184019094528084526060939283018282801561169a57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161167c575b50505050509050919050565b611735604051806101c0016040528060608152602001606081526020016060815260200160008152602001600081526020016000815260200160006001600160401b03168152602001606081526020016060815260200160006001600160401b0316815260200160006001600160a01b0316815260200160008152602001600015158152602001606081525090565b6040805160e0810182526000808252602082018190529181018290526060808201819052608082015260a0810182905260c0810182905290611776846124ce565b15611b125760008481526207000c60209081526040808320815160e08101835281546001600160401b0316815260018201548185015260028201546001600160a01b031681840152600382018054845181870281018701909552808552919592946060870194939192919084015b828210156118bd576000848152602090819020604080518082019091526002850290910180546001600160401b03168252600181018054929391929184019161182c90614ba6565b80601f016020809104026020016040519081016040528092919081815260200182805461185890614ba6565b80156118a55780601f1061187a576101008083540402835291602001916118a5565b820191906000526020600020905b81548152906001019060200180831161188857829003601f168201915b505050505081525050815260200190600101906117e4565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015611ae4578382906000526020600020906004020160405180608001604052908160008201805461191d90614ba6565b80601f016020809104026020016040519081016040528092919081815260200182805461194990614ba6565b80156119965780601f1061196b57610100808354040283529160200191611996565b820191906000526020600020905b81548152906001019060200180831161197957829003601f168201915b5050509183525050600182015461ffff1660208201526002820180546040909201916119c190614ba6565b80601f01602080910402602001604051908101604052809291908181526020018280546119ed90614ba6565b8015611a3a5780601f10611a0f57610100808354040283529160200191611a3a565b820191906000526020600020905b815481529060010190602001808311611a1d57829003601f168201915b50505050508152602001600382018054611a5390614ba6565b80601f0160208091040260200160405190810160405280929190818152602001828054611a7f90614ba6565b8015611acc5780601f10611aa157610100808354040283529160200191611acc565b820191906000526020600020905b815481529060010190602001808311611aaf57829003601f168201915b505050505081525050815260200190600101906118ea565b505050908252506005919091015461ffff808216602084015262010000909104166040909101529150600190505b604051637253d1fb60e11b815273edbf1d9ab63294cda3965cafda82e1f8a23a66e59063e4a7a3f690611b5890600d906010906207000d908a908990899060040161475f565b60006040518083038186803b158015611b7057600080fd5b505af4158015611b84573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bac9190810190614037565b949350505050565b600a6020528160005260406000208181548110611bd057600080fd5b6000918252602090912001546001600160a01b03169150829050565b6001600160a01b0382166000908152600b602052604081205460ff1615611c1557506001611092565b60005b6000838152600a6020526040902054811015611c9f576000838152600a6020526040902080546001600160a01b038616919083908110611c6857634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415611c8d576001915050611092565b80611c9781614be1565b915050611c18565b5060009392505050565b7f23ab158aaf38f3699bf4266a91ca312794fa7ad6ee01e00dd03738daa058501e611cd48133610b7e565b6207000b5460ff16611cf85760405162461bcd60e51b81526004016109af906148c1565b611d01846124ce565b611d1d5760405162461bcd60e51b81526004016109af90614820565b60008481526207000c602052604081206003810180546001908101808355918452919291611d4a91614b4c565b90506000826003018281548110611d7157634e487b7160e01b600052603260045260246000fd5b600091825260209182902060029190910201805467ffffffffffffffff19166001600160401b0389161781558651909250611db49160018401919088019061355e565b5060405187907fb2330cf2285c34504055127120eeecb2d861a31044a427ffbdefd61a89ff6ac490600090a250505050505050565b6000611df58133610b7e565b6207000b5460ff1615611e1a5760405162461bcd60e51b81526004016109af90614847565b60005b8251811015610ae5576010600001838281518110611e4b57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101518254600181018455600093845291909220915191015580611e7781614be1565b915050611e1d565b611e893383612559565b611ea55760405162461bcd60e51b81526004016109af906148ed565b611eb184848484612c3b565b50505050565b60408051600180825281830190925260609160009190602080830190803683375050600e5482519293506001600160a01b031691839150600090611f0b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101529050919050565b6000611f368133610b7e565b6207000b5460ff16611f5a5760405162461bcd60e51b81526004016109af906148c1565b6207000a548410611f7d5760405162461bcd60e51b81526004016109af90614820565b611f878585612c6e565b5060009283526207000c6020526040909220600501805461ffff938416620100000263ffffffff19909116939092169290921717905550565b6000611fcc8133610b7e565b6207000b5460ff1615611ff15760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e5784848281811061201c57634e487b7160e01b600052603260045260246000fd5b60200291909101359050620100106120348386614b01565b61ffff811061205357634e487b7160e01b600052603260045260246000fd5b01558061205f81614be1565b915050611ff4565b6060612072826124ce565b6120d65760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016109af565b60006120e0612c88565b90506000815111612100576040518060200160405280600081525061212b565b8061210a84612c99565b60405160200161211b9291906145f2565b6040516020818303038152906040525b9392505050565b6000828152600c602052604090206001015461214e8133610b7e565b610ae58383612b2f565b60006121648133610b7e565b6207000b5460ff16156121895760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e578484828181106121b457634e487b7160e01b600052603260045260246000fd5b602002919091013590506205000c6121cc8386614b01565b61ffff81106121eb57634e487b7160e01b600052603260045260246000fd5b0155806121f781614be1565b91505061218c565b600061220b8133610b7e565b6207000b5460ff1661222f5760405162461bcd60e51b81526004016109af906148c1565b60005b8481101561227e5761226c8787878481811061225e57634e487b7160e01b600052603260045260246000fd5b905060200201358686611f2a565b8061227681614be1565b915050612232565b50505050505050565b60006122938133610b7e565b6207000b5460ff16156122b85760405162461bcd60e51b81526004016109af90614847565b60005b8481101561232e578585828181106122e357634e487b7160e01b600052603260045260246000fd5b602002919091013590506206000b6122fb8387614b01565b61ffff811061231a57634e487b7160e01b600052603260045260246000fd5b01558061232681614be1565b9150506122bb565b50506207000a55505050565b60006123468133610b7e565b6207000b5460ff161561236b5760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e5784848281811061239657634e487b7160e01b600052603260045260246000fd5b602002919091013590506204000d6123ae8386614b01565b61ffff81106123cd57634e487b7160e01b600052603260045260246000fd5b0155806123d981614be1565b91505061236e565b60006123ed8133610b7e565b6207000b5460ff16156124125760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e5784848281811061243d57634e487b7160e01b600052603260045260246000fd5b602002919091013590506202000f6124558386614b01565b61ffff811061247457634e487b7160e01b600052603260045260246000fd5b01558061248081614be1565b915050612415565b60006001600160e01b03198216637965db0b60e01b148061081f575061081f825b60006001600160e01b0319821663780e9d6360e01b148061081f575061081f82612db3565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612520826112ce565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612564826124ce565b6125c55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109af565b60006125d0836112ce565b9050806001600160a01b0316846001600160a01b0316148061260b5750836001600160a01b031661260084610947565b6001600160a01b0316145b80611bac57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff16611bac565b826001600160a01b0316612652826112ce565b6001600160a01b0316146126ba5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016109af565b6001600160a01b03821661271c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109af565b612727838383612e03565b6127326000826124eb565b6001600160a01b038316600090815260036020526040812080546001929061275b908490614b4c565b90915550506001600160a01b0382166000908152600360205260408120805460019290612789908490614b01565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6127f48282611489565b6111975761280c816001600160a01b03166014612ec0565b612817836020612ec0565b604051602001612828929190614621565b60408051601f198184030181529082905262461bcd60e51b82526109af9160040161474c565b6128588282611489565b611197576000828152600c602090815260408083206001600160a01b03851684529091529020805460ff191660011790556128903390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b604080518082018252601081526f181899199a1a9b1b9c1cb0b131b232b360811b60208201528151602a80825260608281019094526001600160a01b0385169291600091602082018180368337019050509050600360fc1b8160008151811061294d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061298a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060005b6014811015612b2657826004856129bc84600c614b01565b602081106129da57634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b031916901c60f81c60ff1681518110612a0e57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b03191682612a29836002614b2d565b612a34906002614b01565b81518110612a5257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053508284612a7683600c614b01565b60208110612a9457634e487b7160e01b600052603260045260246000fd5b825191901a600f16908110612ab957634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b03191682612ad4836002614b2d565b612adf906003614b01565b81518110612afd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080612b1e81614be1565b9150506129a4565b50949350505050565b612b398282611489565b15611197576000828152600c602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6207000b5460ff16612bba5760405162461bcd60e51b81526004016109af906148c1565b6207000a548310612bdd5760405162461bcd60e51b81526004016109af90614820565b612be78284612c6e565b60009283526207000c6020526040909220805467ffffffffffffffff1916426001600160401b03161781556002810180546001600160a01b0319166001600160a01b03939093169290921790915560010155565b612c4684848461263f565b612c52848484846130a1565b611eb15760405162461bcd60e51b81526004016109af9061486f565b6111978282604051806020016040528060008152506131ae565b60606207000e80546108c490614ba6565b606081612cbe57506040805180820190915260018152600360fc1b6020820152610822565b8160005b8115612ce85780612cd281614be1565b9150612ce19050600a83614b19565b9150612cc2565b6000816001600160401b03811115612d1057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612d3a576020820181803683370190505b5090505b8415611bac57612d4f600183614b4c565b9150612d5c600a86614bfc565b612d67906030614b01565b60f81b818381518110612d8a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612dac600a86614b19565b9450612d3e565b60006001600160e01b031982166380ac58cd60e01b1480612de457506001600160e01b03198216635b5e139f60e01b145b8061081f57506301ffc9a760e01b6001600160e01b031983161461081f565b6001600160a01b038316612e5e57612e5981600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612e81565b816001600160a01b0316836001600160a01b031614612e8157612e8183826131e1565b6001600160a01b038216612e9d57612e988161327e565b610ae5565b826001600160a01b0316826001600160a01b031614610ae557610ae58282613357565b60606000612ecf836002614b2d565b612eda906002614b01565b6001600160401b03811115612eff57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612f29576020820181803683370190505b509050600360fc1b81600081518110612f5257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612f8f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612fb3846002614b2d565b612fbe906001614b01565b90505b6001811115613052576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061300057634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061302457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361304b81614b8f565b9050612fc1565b50831561212b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109af565b60006001600160a01b0384163b156131a357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906130e5903390899088908890600401614696565b602060405180830381600087803b1580156130ff57600080fd5b505af192505050801561312f575060408051601f3d908101601f1916820190925261312c91810190613fb3565b60015b613189573d80801561315d576040519150601f19603f3d011682016040523d82523d6000602084013e613162565b606091505b5080516131815760405162461bcd60e51b81526004016109af9061486f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611bac565b506001949350505050565b6131b8838361339b565b6131c560008484846130a1565b610ae55760405162461bcd60e51b81526004016109af9061486f565b600060016131ee846113a9565b6131f89190614b4c565b60008381526007602052604090205490915080821461324b576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061329090600190614b4c565b600083815260096020526040812054600880549394509092849081106132c657634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600883815481106132f557634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061333b57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000613362836113a9565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b0382166133f15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109af565b6133fa816124ce565b156134475760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109af565b61345360008383612e03565b6001600160a01b038216600090815260036020526040812080546001929061347c908490614b01565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280546134e690614ba6565b90600052602060002090601f016020900481019282613508576000855561354e565b82601f106135215782800160ff1982351617855561354e565b8280016001018555821561354e579182015b8281111561354e578235825591602001919060010190613533565b5061355a9291506135d2565b5090565b82805461356a90614ba6565b90600052602060002090601f01602090048101928261358c576000855561354e565b82601f106135a557805160ff191683800117855561354e565b8280016001018555821561354e579182015b8281111561354e5782518255916020019190600101906135b7565b5b8082111561355a57600081556001016135d3565b60006135fa6135f584614ada565b614a87565b905082815283838301111561360e57600080fd5b828260208301376000602084830101529392505050565b805161082281614c52565b60008083601f840112613641578182fd5b5081356001600160401b03811115613657578182fd5b6020830191508360208260051b850101111561367257600080fd5b9250929050565b600082601f830112613689578081fd5b815160206136996135f583614ab7565b82815281810190858301855b8581101561378d578151880160a080601f19838d030112156136c5578889fd5b6136ce81614a87565b878301516001600160401b03808211156136e6578b8cfd5b6136f48e8b84880101613aa5565b83526040850151915080821115613709578b8cfd5b6137178e8b84880101613aa5565b8a84015260609150818501518181111561372f578c8dfd5b61373d8f8c83890101613aa5565b6040850152506080613750818701613ae8565b84840152938501519381851115613765578c8dfd5b6137738f8c87890101613aa5565b9084015250508652505092840192908401906001016136a5565b5090979650505050505050565b600082601f8301126137aa578081fd5b81516137b86135f582614ab7565b818152602080820191908501845b848110156138bf57815187016060818a03601f190112156137e5578687fd5b6137ef6060614a87565b60208201516137fd81614c6a565b815260408201516001600160401b038082111561381857898afd5b6138278c602084870101613aa5565b6020840152606084015191508082111561383f57898afd5b5080830192505089603f830112613854578788fd5b60208201516138656135f582614ab7565b8181526020810190604085018b5b848110156138a05761388b8f604084518a0101613aa5565b84526020938401939190910190600101613873565b50506040840152505085525060209384019391909101906001016137c6565b50909695505050505050565b600082601f8301126138db578081fd5b815160206138eb6135f583614ab7565b82815281810190858301855b8581101561378d5781518801608080601f19838d03011215613917578889fd5b61392081614a87565b878301516001600160401b0380821115613938578b8cfd5b6139468e8b84880101613aa5565b835260409150818501518181111561395c578c8dfd5b61396a8f8c83890101613aa5565b8b85015250606061397c818701613ae8565b84840152938501519381851115613991578c8dfd5b61399f8f8c87890101613aa5565b9084015250508652505092840192908401906001016138f7565b600082601f8301126139c9578081fd5b815160206139d96135f583614ab7565b82815281810190858301855b8581101561378d5781518801604080601f19838d03011215613a05578889fd5b613a0e81614a87565b87830151613a1b81614c9e565b815290820151906001600160401b03821115613a3557898afd5b613a438c8984860101613aa5565b818901528652505092840192908401906001016139e5565b805161082281614c6a565b60008083601f840112613a77578182fd5b5081356001600160401b03811115613a8d578182fd5b60208301915083602082850101111561367257600080fd5b600082601f830112613ab5578081fd5b8151613ac36135f582614ada565b818152846020838601011115613ad7578283fd5b611bac826020830160208701614b63565b805161082281614c8e565b805161082281614c9e565b600060208284031215613b0f578081fd5b813561212b81614c52565b60008060408385031215613b2c578081fd5b8235613b3781614c52565b946020939093013593505050565b60008060408385031215613b57578182fd5b8235613b6281614c52565b91506020830135613b7281614c52565b809150509250929050565b600080600060608486031215613b91578081fd5b8335613b9c81614c52565b92506020840135613bac81614c52565b929592945050506040919091013590565b60008060008060808587031215613bd2578182fd5b8435613bdd81614c52565b93506020850135613bed81614c52565b92506040850135915060608501356001600160401b03811115613c0e578182fd5b8501601f81018713613c1e578182fd5b613c2d878235602084016135e7565b91505092959194509250565b600080600080600060808688031215613c50578283fd5b8535613c5b81614c52565b945060208601356001600160401b03811115613c75578384fd5b613c8188828901613630565b9095509350506040860135613c9581614c8e565b91506060860135613ca581614c8e565b809150509295509295909350565b60008060408385031215613cc5578182fd5b8235613cd081614c52565b91506020830135613b7281614c6a565b60008060408385031215613b2c578182fd5b60008060008060808587031215613d07578182fd5b8435613d1281614c52565b9350602085013592506040850135613d2981614c8e565b91506060850135613d3981614c8e565b939692955090935050565b600080600060408486031215613d58578081fd5b83356001600160401b03811115613d6d578182fd5b613d7986828701613630565b909790965060209590950135949350505050565b60008060008060608587031215613da2578182fd5b84356001600160401b03811115613db7578283fd5b613dc387828801613630565b90989097506020870135966040013595509350505050565b60006020808385031215613ded578182fd5b82356001600160401b03811115613e02578283fd5b8301601f81018513613e12578283fd5b8035613e206135f582614ab7565b80828252848201915084840188868560051b8701011115613e3f578687fd5b8694505b83851015613e7a5785818a031215613e59578687fd5b613e6286614a87565b81358152835260019490940193918501918501613e43565b50979650505050505050565b600080600080600080600080600060a08a8c031215613ea3578687fd5b89356001600160401b0380821115613eb9578889fd5b613ec58d838e01613630565b909b50995060208c0135915080821115613edd578889fd5b613ee98d838e01613a66565b909950975060408c0135915080821115613f01578586fd5b613f0d8d838e01613a66565b909750955060608c01359150613f2282614c8e565b90935060808b01359080821115613f37578384fd5b50613f448c828d01613a66565b915080935050809150509295985092959850929598565b600060208284031215613f6c578081fd5b5035919050565b60008060408385031215613f85578182fd5b823591506020830135613b7281614c52565b600060208284031215613fa8578081fd5b813561212b81614c78565b600060208284031215613fc4578081fd5b815161212b81614c78565b60008060008060408587031215613fe4578182fd5b84356001600160401b0380821115613ffa578384fd5b61400688838901613a66565b9096509450602087013591508082111561401e578384fd5b5061402b87828801613a66565b95989497509550505050565b600060208284031215614048578081fd5b81516001600160401b038082111561405e578283fd5b81840191506101c0808387031215614074578384fd5b61407d81614a87565b905082518281111561408d578485fd5b61409987828601613aa5565b8252506020830151828111156140ad578485fd5b6140b987828601613aa5565b6020830152506040830151828111156140d0578485fd5b6140dc8782860161379a565b604083015250606083015160608201526080830151608082015260a083015160a082015261410c60c08401613af3565b60c082015260e083015182811115614122578485fd5b61412e878286016138cb565b60e0830152506101008084015183811115614147578586fd5b614153888287016139b9565b828401525050610120614167818501613af3565b90820152610140614179848201613625565b908201526101608381015190820152610180614196818501613a5b565b908201526101a083810151838111156141ad578586fd5b6141b988828701613679565b918301919091525095945050505050565b6000806000606084860312156141de578081fd5b833592506020840135613bac81614c52565b60008060408385031215614202578182fd5b50508035926020909101359150565b600080600060608486031215614225578081fd5b83359250602084013561423781614c9e565b915060408401356001600160401b03811115614251578182fd5b8401601f81018613614261578182fd5b614270868235602084016135e7565b9150509250925092565b600082825180855260208086019550808260051b840101818601855b8481101561378d57601f198684030189528151608081518186526142bc8287018261458b565b91505061ffff868301511686860152604080830151868303828801526142e2838261458b565b9250505060608083015192508582038187015250614300818361458b565b9a86019a9450505090830190600101614296565b600082825180855260208086019550808260051b840101818601855b8481101561378d57601f19868403018952815160a081518186526143568287018261458b565b915050858201518582038787015261436e828261458b565b91505060408083015186830382880152614388838261458b565b92505050606061ffff81840151168187015250608080830151925085820381870152506143b5818361458b565b9a86019a9450505090830190600101614330565b600081518084526020808501808196506005915083821b8101838701865b86811015614482578383038a52815160608151151585528782015181898701526144138287018261458b565b604093840151878203948801949094528351808252938a0193909250898301915080891b83018a018c5b8281101561446b57601f1985830301845261445982875161458b565b958c0195938c0193915060010161443d565b509d8a019d965050509287019250506001016143e7565b509098975050505050505050565b600082825180855260208086019550808260051b840101818601855b8481101561378d57601f198684030189528151608081518186526144d28287018261458b565b91505085820151858203878701526144ea828261458b565b915050604061ffff8184015116818701525060608083015192508582038187015250614516818361458b565b9a86019a94505050908301906001016144ac565b6000815180845260208085019450848260051b8601828601855b8581101561378d578383038952815180516001600160401b0316845285015160408685018190526145778186018361458b565b9a87019a9450505090840190600101614544565b600081518084526145a3816020860160208601614b63565b601f01601f19169290920160200192915050565b600083858337838201818152602f60f81b80825284516145de816001850160208901614b63565b600192019182015260020195945050505050565b60008351614604818460208801614b63565b835190830190614618818360208801614b63565b01949350505050565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351614659816017850160208801614b63565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161468a816028840160208801614b63565b01602801949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906146c99083018461458b565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156138bf5783516001600160a01b0316835292840192918401916001016146ef565b6020808252825182820181905260009190848201906040850190845b818110156138bf57835183529284019291840191600101614730565b60006020825261212b602083018461458b565b600087825286602083015285604083015284606083015260c060808301526001600160401b0384511660c0830152602084015160e083015260018060a01b03604085015116610100830152606084015160e06101208401526147c56101a084018261452a565b9050608085015160bf19848303016101408501526147e3828261427a565b91505060a08501516147fc61016085018261ffff169052565b5060c0949094015161ffff166101808301525090151560a090910152949350505050565b6020808252600d908201526c27379039bab1b4103a37b5b2b760991b604082015260600190565b6020808252600e908201526d191c9bdc081a5cc81cd9585b195960921b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b602080825260129082015271191c9bdc081a5cc81b9bdd081cd9585b195960721b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60006020825282516101c080602085015261495d6101e085018361458b565b91506020850151601f198086850301604087015261497b848361458b565b9350604087015191508086850301606087015261499884836143c9565b935060608701516080870152608087015160a087015260a087015160c087015260c087015191506149d460e08701836001600160401b03169052565b60e087015191506101008187860301818801526149f18584614490565b945080880151925050610120818786030181880152614a10858461452a565b945080880151925050610140614a30818801846001600160401b03169052565b8701519150610160614a4c878201846001600160a01b03169052565b8701516101808781019190915287015191506101a0614a6e8188018415159052565b8701518685039091018387015290506146c98382614314565b604051601f8201601f191681016001600160401b0381118282101715614aaf57614aaf614c3c565b604052919050565b60006001600160401b03821115614ad057614ad0614c3c565b5060051b60200190565b60006001600160401b03821115614af357614af3614c3c565b50601f01601f191660200190565b60008219821115614b1457614b14614c10565b500190565b600082614b2857614b28614c26565b500490565b6000816000190483118215151615614b4757614b47614c10565b500290565b600082821015614b5e57614b5e614c10565b500390565b60005b83811015614b7e578181015183820152602001614b66565b83811115611eb15750506000910152565b600081614b9e57614b9e614c10565b506000190190565b600181811c90821680614bba57607f821691505b60208210811415614bdb57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614bf557614bf5614c10565b5060010190565b600082614c0b57614c0b614c26565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114614c6757600080fd5b50565b8015158114614c6757600080fd5b6001600160e01b031981168114614c6757600080fd5b61ffff81168114614c6757600080fd5b6001600160401b0381168114614c6757600080fdfea264697066735822122098018f19c70b0157f0ffa2eda2b9cd7996001fb24383180eb769629435fba45f64736f6c63430008030033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000a566565467269656e64730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035646540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a566565467269656e647300000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103425760003560e01c806395d89b41116101b8578063be07dd5611610104578063d55c557d116100a2578063dbeb7de41161007c578063dbeb7de414610776578063e985e9c514610789578063ea2680e6146107c5578063fdf75336146107d857610342565b8063d55c557d1461072d578063d746d2a714610740578063d7544c711461076357610342565b8063c63adb2b116100de578063c63adb2b146106d7578063c87b56dd146106e0578063caab0432146106f3578063d547741f1461071a57610342565b8063be07dd561461068a578063bff14ee4146106b1578063c3f2af7d146106c457610342565b8063a8314edc11610171578063b3ca73001161014b578063b3ca73001461063e578063b6332cd714610651578063b88d4fde14610664578063b9c4d9fb1461067757610342565b8063a8314edc14610605578063ad2f852a14610618578063add49af61461062b57610342565b806395d89b411461058f578063a217fddf14610597578063a22cb4651461059f578063a25ca617146105b2578063a35b0af3146105c5578063a574cea4146105e557610342565b80632f745c59116102925780636352211e1161023057806370a082311161020a57806370a082311461052f578063772576c71461054257806381b877441461056957806391d148541461057c57610342565b80636352211e146104f65780636a0c9d66146105095780636bce809a1461051c57610342565b80633f2965f01161026c5780633f2965f0146104b557806342842e0e146104c85780634f6ccce7146104db5780635d512de9146104ee57610342565b80632f745c591461047c57806334343f971461048f57806336568abe146104a257610342565b80630ffb4c08116102ff578063244a5656116102d9578063244a565614610420578063248a9ca3146104335780632e0b31c4146104565780632f2ff15d1461046957610342565b80630ffb4c08146103ec57806318160ddd146103fb57806323b872dd1461040d57610342565b806301ffc9a71461034757806302d05d3f1461036f57806306fdde0314610384578063081812fc1461038c578063095ea7b3146103b75780630ebd4c7f146103cc575b600080fd5b61035a610355366004613f97565b6107eb565b60405190151581526020015b60405180910390f35b610377610827565b604051610366919061474c565b6103776108b5565b61039f61039a366004613f5b565b610947565b6040516001600160a01b039091168152602001610366565b6103ca6103c5366004613ce0565b6109d4565b005b6103df6103da366004613f5b565b610aea565b6040516103669190614714565b6207000b5461035a9060ff1681565b6008545b604051908152602001610366565b6103ca61041b366004613b7d565b610b45565b6103ca61042e366004613d44565b610b76565b6103ff610441366004613f5b565b6000908152600c602052604090206001015490565b6103ca610464366004613e86565b610c25565b6103ca610477366004613f73565b610fd9565b6103ff61048a366004613ce0565b610fff565b6103ca61049d366004613fcf565b611098565b6103ca6104b0366004613f73565b61111d565b6103ca6104c3366004613afe565b61119b565b6103ca6104d6366004613b7d565b6111cf565b6103ff6104e9366004613f5b565b6111ea565b6103ca61128b565b61039f610504366004613f5b565b6112ce565b6103ca610517366004613afe565b611345565b6103ca61052a366004613b1a565b611376565b6103ff61053d366004613afe565b6113a9565b6103ff7f23ab158aaf38f3699bf4266a91ca312794fa7ad6ee01e00dd03738daa058501e81565b6103ca6105773660046141ca565b611430565b61035a61058a366004613f73565b611489565b6103776114b4565b6103ff600081565b6103ca6105ad366004613cb3565b6114c3565b6103ca6105c0366004613d44565b611595565b6105d86105d3366004613f5b565b61163a565b60405161036691906146d3565b6105f86105f3366004613f5b565b6116a6565b604051610366919061493e565b61039f6106133660046141f0565b611bb4565b600e5461039f906001600160a01b031681565b61035a610639366004613ce0565b611bec565b6103ca61064c366004614211565b611ca9565b6103ca61065f366004613ddb565b611de9565b6103ca610672366004613bbd565b611e7f565b6105d8610685366004613f5b565b611eb7565b6103ff7f9abc57040bfcfa57b85b08824ec5ac8a2760aa67e3edf2af636feb2f0b09ff6f81565b6103ca6106bf366004613cf2565b611f2a565b6103ca6106d2366004613d44565b611fc0565b6103ff600f5481565b6103776106ee366004613f5b565b612067565b6103ff7f0e8d189d3bb3f499b0afc25b0024719edc7426579927f629d3464e695403963a81565b6103ca610728366004613f73565b612132565b6103ca61073b366004613d44565b612158565b61035a61074e366004613afe565b600b6020526000908152604090205460ff1681565b6103ca610771366004613c39565b6121ff565b6103ca610784366004613d8d565b612287565b61035a610797366004613b45565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6103ca6107d3366004613d44565b61233a565b6103ca6107e6366004613d44565b6123e1565b60006001600160e01b03198216632dde656160e21b1480610810575061081082612488565b8061081f575061081f826124a9565b90505b919050565b600d805461083490614ba6565b80601f016020809104026020016040519081016040528092919081815260200182805461086090614ba6565b80156108ad5780601f10610882576101008083540402835291602001916108ad565b820191906000526020600020905b81548152906001019060200180831161089057829003601f168201915b505050505081565b6060600080546108c490614ba6565b80601f01602080910402602001604051908101604052809291908181526020018280546108f090614ba6565b801561093d5780601f106109125761010080835404028352916020019161093d565b820191906000526020600020905b81548152906001019060200180831161092057829003601f168201915b5050505050905090565b6000610952826124ce565b6109b85760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006109df826112ce565b9050806001600160a01b0316836001600160a01b03161415610a4d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016109af565b336001600160a01b0382161480610a695750610a698133610797565b610adb5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016109af565b610ae583836124eb565b505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050600f5481600081518110610b3457634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b610b4f3382612559565b610b6b5760405162461bcd60e51b81526004016109af906148ed565b610ae583838361263f565b6000610b8381335b6127ea565b6207000b5460ff1615610ba85760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e57848482818110610bd357634e487b7160e01b600052603260045260246000fd5b602002919091013590506203000e610beb8386614b01565b61ffff8110610c0a57634e487b7160e01b600052603260045260246000fd5b015580610c1681614be1565b915050610bab565b5050505050565b7f9abc57040bfcfa57b85b08824ec5ac8a2760aa67e3edf2af636feb2f0b09ff6f610c508133610b7e565b6207000b5460ff16610c745760405162461bcd60e51b81526004016109af906148c1565b60005b89811015610fcc57610cae8b8b83818110610ca257634e487b7160e01b600052603260045260246000fd5b905060200201356124ce565b610cca5760405162461bcd60e51b81526004016109af90614820565b6207000c60008c8c84818110610cf057634e487b7160e01b600052603260045260246000fd5b6020908102929092013583525081019190915260400160009081206004018054600190810182559082526207000c828e8e86818110610d3f57634e487b7160e01b600052603260045260246000fd5b90506020020135815260200190815260200160002060040180549050610d659190614b4c565b905087876207000c60008f8f87818110610d8f57634e487b7160e01b600052603260045260246000fd5b9050602002013581526020019081526020016000206004018381548110610dc657634e487b7160e01b600052603260045260246000fd5b60009182526020909120610de093600490920201916134da565b50856207000c60008e8e86818110610e0857634e487b7160e01b600052603260045260246000fd5b9050602002013581526020019081526020016000206004018281548110610e3f57634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160010160006101000a81548161ffff021916908361ffff16021790555084846207000c60008f8f87818110610e9257634e487b7160e01b600052603260045260246000fd5b9050602002013581526020019081526020016000206004018381548110610ec957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600402016002019190610ee79291906134da565b5089896207000c60008f8f87818110610f1057634e487b7160e01b600052603260045260246000fd5b9050602002013581526020019081526020016000206004018381548110610f4757634e487b7160e01b600052603260045260246000fd5b90600052602060002090600402016003019190610f659291906134da565b508b8b83818110610f8657634e487b7160e01b600052603260045260246000fd5b905060200201357f67a177a786b1233e098191defadcbcc4529e024b977e3b0529a658473f47d3d160405160405180910390a25080610fc481614be1565b915050610c77565b5050505050505050505050565b6000828152600c6020526040902060010154610ff58133610b7e565b610ae5838361284e565b600061100a836113a9565b821061106c5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016109af565b506001600160a01b03821660009081526006602090815260408083208484529091529020545b92915050565b7f0e8d189d3bb3f499b0afc25b0024719edc7426579927f629d3464e695403963a6110c38133610b7e565b6110d16207000d86866134da565b5082826110dd306128d4565b6040516020016110ef939291906145b7565b6040516020818303038152906040526207000e908051906020019061111592919061355e565b505050505050565b6001600160a01b038116331461118d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016109af565b6111978282612b2f565b5050565b60006111a78133610b7e565b611197826001600160a01b03166000908152600b60205260409020805460ff19166001179055565b610ae583838360405180602001604052806000815250611e7f565b60006111f560085490565b82106112585760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016109af565b6008828154811061127957634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60006112978133610b7e565b6207000b5460ff16156112bc5760405162461bcd60e51b81526004016109af90614847565b506207000b805460ff19166001179055565b6000818152600260205260408120546001600160a01b03168061081f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016109af565b60006113518133610b7e565b611197826001600160a01b03166000908152600b60205260409020805460ff19169055565b60006113828133610b7e565b50600e80546001600160a01b0319166001600160a01b039390931692909217909155600f55565b60006001600160a01b0382166114145760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016109af565b506001600160a01b031660009081526003602052604090205490565b61143a3384611bec565b61147e5760405162461bcd60e51b815260206004820152601560248201527414d95b1b195c881b9bdd08185d5d1a1bdc9a5e9959605a1b60448201526064016109af565b610ae5838383612b96565b6000918252600c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600180546108c490614ba6565b6001600160a01b03821633141561151c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109af565b3360008181526005602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611589911515815260200190565b60405180910390a35050565b60006115a18133610b7e565b6207000b5460ff16156115c65760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e578484828181106115f157634e487b7160e01b600052603260045260246000fd5b6020029190910135905060116116078386614b01565b61ffff811061162657634e487b7160e01b600052603260045260246000fd5b01558061163281614be1565b9150506115c9565b6000818152600a602090815260409182902080548351818402810184019094528084526060939283018282801561169a57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161167c575b50505050509050919050565b611735604051806101c0016040528060608152602001606081526020016060815260200160008152602001600081526020016000815260200160006001600160401b03168152602001606081526020016060815260200160006001600160401b0316815260200160006001600160a01b0316815260200160008152602001600015158152602001606081525090565b6040805160e0810182526000808252602082018190529181018290526060808201819052608082015260a0810182905260c0810182905290611776846124ce565b15611b125760008481526207000c60209081526040808320815160e08101835281546001600160401b0316815260018201548185015260028201546001600160a01b031681840152600382018054845181870281018701909552808552919592946060870194939192919084015b828210156118bd576000848152602090819020604080518082019091526002850290910180546001600160401b03168252600181018054929391929184019161182c90614ba6565b80601f016020809104026020016040519081016040528092919081815260200182805461185890614ba6565b80156118a55780601f1061187a576101008083540402835291602001916118a5565b820191906000526020600020905b81548152906001019060200180831161188857829003601f168201915b505050505081525050815260200190600101906117e4565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015611ae4578382906000526020600020906004020160405180608001604052908160008201805461191d90614ba6565b80601f016020809104026020016040519081016040528092919081815260200182805461194990614ba6565b80156119965780601f1061196b57610100808354040283529160200191611996565b820191906000526020600020905b81548152906001019060200180831161197957829003601f168201915b5050509183525050600182015461ffff1660208201526002820180546040909201916119c190614ba6565b80601f01602080910402602001604051908101604052809291908181526020018280546119ed90614ba6565b8015611a3a5780601f10611a0f57610100808354040283529160200191611a3a565b820191906000526020600020905b815481529060010190602001808311611a1d57829003601f168201915b50505050508152602001600382018054611a5390614ba6565b80601f0160208091040260200160405190810160405280929190818152602001828054611a7f90614ba6565b8015611acc5780601f10611aa157610100808354040283529160200191611acc565b820191906000526020600020905b815481529060010190602001808311611aaf57829003601f168201915b505050505081525050815260200190600101906118ea565b505050908252506005919091015461ffff808216602084015262010000909104166040909101529150600190505b604051637253d1fb60e11b815273edbf1d9ab63294cda3965cafda82e1f8a23a66e59063e4a7a3f690611b5890600d906010906207000d908a908990899060040161475f565b60006040518083038186803b158015611b7057600080fd5b505af4158015611b84573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bac9190810190614037565b949350505050565b600a6020528160005260406000208181548110611bd057600080fd5b6000918252602090912001546001600160a01b03169150829050565b6001600160a01b0382166000908152600b602052604081205460ff1615611c1557506001611092565b60005b6000838152600a6020526040902054811015611c9f576000838152600a6020526040902080546001600160a01b038616919083908110611c6857634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415611c8d576001915050611092565b80611c9781614be1565b915050611c18565b5060009392505050565b7f23ab158aaf38f3699bf4266a91ca312794fa7ad6ee01e00dd03738daa058501e611cd48133610b7e565b6207000b5460ff16611cf85760405162461bcd60e51b81526004016109af906148c1565b611d01846124ce565b611d1d5760405162461bcd60e51b81526004016109af90614820565b60008481526207000c602052604081206003810180546001908101808355918452919291611d4a91614b4c565b90506000826003018281548110611d7157634e487b7160e01b600052603260045260246000fd5b600091825260209182902060029190910201805467ffffffffffffffff19166001600160401b0389161781558651909250611db49160018401919088019061355e565b5060405187907fb2330cf2285c34504055127120eeecb2d861a31044a427ffbdefd61a89ff6ac490600090a250505050505050565b6000611df58133610b7e565b6207000b5460ff1615611e1a5760405162461bcd60e51b81526004016109af90614847565b60005b8251811015610ae5576010600001838281518110611e4b57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101518254600181018455600093845291909220915191015580611e7781614be1565b915050611e1d565b611e893383612559565b611ea55760405162461bcd60e51b81526004016109af906148ed565b611eb184848484612c3b565b50505050565b60408051600180825281830190925260609160009190602080830190803683375050600e5482519293506001600160a01b031691839150600090611f0b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101529050919050565b6000611f368133610b7e565b6207000b5460ff16611f5a5760405162461bcd60e51b81526004016109af906148c1565b6207000a548410611f7d5760405162461bcd60e51b81526004016109af90614820565b611f878585612c6e565b5060009283526207000c6020526040909220600501805461ffff938416620100000263ffffffff19909116939092169290921717905550565b6000611fcc8133610b7e565b6207000b5460ff1615611ff15760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e5784848281811061201c57634e487b7160e01b600052603260045260246000fd5b60200291909101359050620100106120348386614b01565b61ffff811061205357634e487b7160e01b600052603260045260246000fd5b01558061205f81614be1565b915050611ff4565b6060612072826124ce565b6120d65760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016109af565b60006120e0612c88565b90506000815111612100576040518060200160405280600081525061212b565b8061210a84612c99565b60405160200161211b9291906145f2565b6040516020818303038152906040525b9392505050565b6000828152600c602052604090206001015461214e8133610b7e565b610ae58383612b2f565b60006121648133610b7e565b6207000b5460ff16156121895760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e578484828181106121b457634e487b7160e01b600052603260045260246000fd5b602002919091013590506205000c6121cc8386614b01565b61ffff81106121eb57634e487b7160e01b600052603260045260246000fd5b0155806121f781614be1565b91505061218c565b600061220b8133610b7e565b6207000b5460ff1661222f5760405162461bcd60e51b81526004016109af906148c1565b60005b8481101561227e5761226c8787878481811061225e57634e487b7160e01b600052603260045260246000fd5b905060200201358686611f2a565b8061227681614be1565b915050612232565b50505050505050565b60006122938133610b7e565b6207000b5460ff16156122b85760405162461bcd60e51b81526004016109af90614847565b60005b8481101561232e578585828181106122e357634e487b7160e01b600052603260045260246000fd5b602002919091013590506206000b6122fb8387614b01565b61ffff811061231a57634e487b7160e01b600052603260045260246000fd5b01558061232681614be1565b9150506122bb565b50506207000a55505050565b60006123468133610b7e565b6207000b5460ff161561236b5760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e5784848281811061239657634e487b7160e01b600052603260045260246000fd5b602002919091013590506204000d6123ae8386614b01565b61ffff81106123cd57634e487b7160e01b600052603260045260246000fd5b0155806123d981614be1565b91505061236e565b60006123ed8133610b7e565b6207000b5460ff16156124125760405162461bcd60e51b81526004016109af90614847565b60005b83811015610c1e5784848281811061243d57634e487b7160e01b600052603260045260246000fd5b602002919091013590506202000f6124558386614b01565b61ffff811061247457634e487b7160e01b600052603260045260246000fd5b01558061248081614be1565b915050612415565b60006001600160e01b03198216637965db0b60e01b148061081f575061081f825b60006001600160e01b0319821663780e9d6360e01b148061081f575061081f82612db3565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612520826112ce565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612564826124ce565b6125c55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109af565b60006125d0836112ce565b9050806001600160a01b0316846001600160a01b0316148061260b5750836001600160a01b031661260084610947565b6001600160a01b0316145b80611bac57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff16611bac565b826001600160a01b0316612652826112ce565b6001600160a01b0316146126ba5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016109af565b6001600160a01b03821661271c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109af565b612727838383612e03565b6127326000826124eb565b6001600160a01b038316600090815260036020526040812080546001929061275b908490614b4c565b90915550506001600160a01b0382166000908152600360205260408120805460019290612789908490614b01565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6127f48282611489565b6111975761280c816001600160a01b03166014612ec0565b612817836020612ec0565b604051602001612828929190614621565b60408051601f198184030181529082905262461bcd60e51b82526109af9160040161474c565b6128588282611489565b611197576000828152600c602090815260408083206001600160a01b03851684529091529020805460ff191660011790556128903390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b604080518082018252601081526f181899199a1a9b1b9c1cb0b131b232b360811b60208201528151602a80825260608281019094526001600160a01b0385169291600091602082018180368337019050509050600360fc1b8160008151811061294d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061298a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060005b6014811015612b2657826004856129bc84600c614b01565b602081106129da57634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b031916901c60f81c60ff1681518110612a0e57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b03191682612a29836002614b2d565b612a34906002614b01565b81518110612a5257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053508284612a7683600c614b01565b60208110612a9457634e487b7160e01b600052603260045260246000fd5b825191901a600f16908110612ab957634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b03191682612ad4836002614b2d565b612adf906003614b01565b81518110612afd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080612b1e81614be1565b9150506129a4565b50949350505050565b612b398282611489565b15611197576000828152600c602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6207000b5460ff16612bba5760405162461bcd60e51b81526004016109af906148c1565b6207000a548310612bdd5760405162461bcd60e51b81526004016109af90614820565b612be78284612c6e565b60009283526207000c6020526040909220805467ffffffffffffffff1916426001600160401b03161781556002810180546001600160a01b0319166001600160a01b03939093169290921790915560010155565b612c4684848461263f565b612c52848484846130a1565b611eb15760405162461bcd60e51b81526004016109af9061486f565b6111978282604051806020016040528060008152506131ae565b60606207000e80546108c490614ba6565b606081612cbe57506040805180820190915260018152600360fc1b6020820152610822565b8160005b8115612ce85780612cd281614be1565b9150612ce19050600a83614b19565b9150612cc2565b6000816001600160401b03811115612d1057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612d3a576020820181803683370190505b5090505b8415611bac57612d4f600183614b4c565b9150612d5c600a86614bfc565b612d67906030614b01565b60f81b818381518110612d8a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612dac600a86614b19565b9450612d3e565b60006001600160e01b031982166380ac58cd60e01b1480612de457506001600160e01b03198216635b5e139f60e01b145b8061081f57506301ffc9a760e01b6001600160e01b031983161461081f565b6001600160a01b038316612e5e57612e5981600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612e81565b816001600160a01b0316836001600160a01b031614612e8157612e8183826131e1565b6001600160a01b038216612e9d57612e988161327e565b610ae5565b826001600160a01b0316826001600160a01b031614610ae557610ae58282613357565b60606000612ecf836002614b2d565b612eda906002614b01565b6001600160401b03811115612eff57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612f29576020820181803683370190505b509050600360fc1b81600081518110612f5257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612f8f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612fb3846002614b2d565b612fbe906001614b01565b90505b6001811115613052576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061300057634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061302457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361304b81614b8f565b9050612fc1565b50831561212b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109af565b60006001600160a01b0384163b156131a357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906130e5903390899088908890600401614696565b602060405180830381600087803b1580156130ff57600080fd5b505af192505050801561312f575060408051601f3d908101601f1916820190925261312c91810190613fb3565b60015b613189573d80801561315d576040519150601f19603f3d011682016040523d82523d6000602084013e613162565b606091505b5080516131815760405162461bcd60e51b81526004016109af9061486f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611bac565b506001949350505050565b6131b8838361339b565b6131c560008484846130a1565b610ae55760405162461bcd60e51b81526004016109af9061486f565b600060016131ee846113a9565b6131f89190614b4c565b60008381526007602052604090205490915080821461324b576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061329090600190614b4c565b600083815260096020526040812054600880549394509092849081106132c657634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600883815481106132f557634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061333b57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000613362836113a9565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b0382166133f15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109af565b6133fa816124ce565b156134475760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109af565b61345360008383612e03565b6001600160a01b038216600090815260036020526040812080546001929061347c908490614b01565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280546134e690614ba6565b90600052602060002090601f016020900481019282613508576000855561354e565b82601f106135215782800160ff1982351617855561354e565b8280016001018555821561354e579182015b8281111561354e578235825591602001919060010190613533565b5061355a9291506135d2565b5090565b82805461356a90614ba6565b90600052602060002090601f01602090048101928261358c576000855561354e565b82601f106135a557805160ff191683800117855561354e565b8280016001018555821561354e579182015b8281111561354e5782518255916020019190600101906135b7565b5b8082111561355a57600081556001016135d3565b60006135fa6135f584614ada565b614a87565b905082815283838301111561360e57600080fd5b828260208301376000602084830101529392505050565b805161082281614c52565b60008083601f840112613641578182fd5b5081356001600160401b03811115613657578182fd5b6020830191508360208260051b850101111561367257600080fd5b9250929050565b600082601f830112613689578081fd5b815160206136996135f583614ab7565b82815281810190858301855b8581101561378d578151880160a080601f19838d030112156136c5578889fd5b6136ce81614a87565b878301516001600160401b03808211156136e6578b8cfd5b6136f48e8b84880101613aa5565b83526040850151915080821115613709578b8cfd5b6137178e8b84880101613aa5565b8a84015260609150818501518181111561372f578c8dfd5b61373d8f8c83890101613aa5565b6040850152506080613750818701613ae8565b84840152938501519381851115613765578c8dfd5b6137738f8c87890101613aa5565b9084015250508652505092840192908401906001016136a5565b5090979650505050505050565b600082601f8301126137aa578081fd5b81516137b86135f582614ab7565b818152602080820191908501845b848110156138bf57815187016060818a03601f190112156137e5578687fd5b6137ef6060614a87565b60208201516137fd81614c6a565b815260408201516001600160401b038082111561381857898afd5b6138278c602084870101613aa5565b6020840152606084015191508082111561383f57898afd5b5080830192505089603f830112613854578788fd5b60208201516138656135f582614ab7565b8181526020810190604085018b5b848110156138a05761388b8f604084518a0101613aa5565b84526020938401939190910190600101613873565b50506040840152505085525060209384019391909101906001016137c6565b50909695505050505050565b600082601f8301126138db578081fd5b815160206138eb6135f583614ab7565b82815281810190858301855b8581101561378d5781518801608080601f19838d03011215613917578889fd5b61392081614a87565b878301516001600160401b0380821115613938578b8cfd5b6139468e8b84880101613aa5565b835260409150818501518181111561395c578c8dfd5b61396a8f8c83890101613aa5565b8b85015250606061397c818701613ae8565b84840152938501519381851115613991578c8dfd5b61399f8f8c87890101613aa5565b9084015250508652505092840192908401906001016138f7565b600082601f8301126139c9578081fd5b815160206139d96135f583614ab7565b82815281810190858301855b8581101561378d5781518801604080601f19838d03011215613a05578889fd5b613a0e81614a87565b87830151613a1b81614c9e565b815290820151906001600160401b03821115613a3557898afd5b613a438c8984860101613aa5565b818901528652505092840192908401906001016139e5565b805161082281614c6a565b60008083601f840112613a77578182fd5b5081356001600160401b03811115613a8d578182fd5b60208301915083602082850101111561367257600080fd5b600082601f830112613ab5578081fd5b8151613ac36135f582614ada565b818152846020838601011115613ad7578283fd5b611bac826020830160208701614b63565b805161082281614c8e565b805161082281614c9e565b600060208284031215613b0f578081fd5b813561212b81614c52565b60008060408385031215613b2c578081fd5b8235613b3781614c52565b946020939093013593505050565b60008060408385031215613b57578182fd5b8235613b6281614c52565b91506020830135613b7281614c52565b809150509250929050565b600080600060608486031215613b91578081fd5b8335613b9c81614c52565b92506020840135613bac81614c52565b929592945050506040919091013590565b60008060008060808587031215613bd2578182fd5b8435613bdd81614c52565b93506020850135613bed81614c52565b92506040850135915060608501356001600160401b03811115613c0e578182fd5b8501601f81018713613c1e578182fd5b613c2d878235602084016135e7565b91505092959194509250565b600080600080600060808688031215613c50578283fd5b8535613c5b81614c52565b945060208601356001600160401b03811115613c75578384fd5b613c8188828901613630565b9095509350506040860135613c9581614c8e565b91506060860135613ca581614c8e565b809150509295509295909350565b60008060408385031215613cc5578182fd5b8235613cd081614c52565b91506020830135613b7281614c6a565b60008060408385031215613b2c578182fd5b60008060008060808587031215613d07578182fd5b8435613d1281614c52565b9350602085013592506040850135613d2981614c8e565b91506060850135613d3981614c8e565b939692955090935050565b600080600060408486031215613d58578081fd5b83356001600160401b03811115613d6d578182fd5b613d7986828701613630565b909790965060209590950135949350505050565b60008060008060608587031215613da2578182fd5b84356001600160401b03811115613db7578283fd5b613dc387828801613630565b90989097506020870135966040013595509350505050565b60006020808385031215613ded578182fd5b82356001600160401b03811115613e02578283fd5b8301601f81018513613e12578283fd5b8035613e206135f582614ab7565b80828252848201915084840188868560051b8701011115613e3f578687fd5b8694505b83851015613e7a5785818a031215613e59578687fd5b613e6286614a87565b81358152835260019490940193918501918501613e43565b50979650505050505050565b600080600080600080600080600060a08a8c031215613ea3578687fd5b89356001600160401b0380821115613eb9578889fd5b613ec58d838e01613630565b909b50995060208c0135915080821115613edd578889fd5b613ee98d838e01613a66565b909950975060408c0135915080821115613f01578586fd5b613f0d8d838e01613a66565b909750955060608c01359150613f2282614c8e565b90935060808b01359080821115613f37578384fd5b50613f448c828d01613a66565b915080935050809150509295985092959850929598565b600060208284031215613f6c578081fd5b5035919050565b60008060408385031215613f85578182fd5b823591506020830135613b7281614c52565b600060208284031215613fa8578081fd5b813561212b81614c78565b600060208284031215613fc4578081fd5b815161212b81614c78565b60008060008060408587031215613fe4578182fd5b84356001600160401b0380821115613ffa578384fd5b61400688838901613a66565b9096509450602087013591508082111561401e578384fd5b5061402b87828801613a66565b95989497509550505050565b600060208284031215614048578081fd5b81516001600160401b038082111561405e578283fd5b81840191506101c0808387031215614074578384fd5b61407d81614a87565b905082518281111561408d578485fd5b61409987828601613aa5565b8252506020830151828111156140ad578485fd5b6140b987828601613aa5565b6020830152506040830151828111156140d0578485fd5b6140dc8782860161379a565b604083015250606083015160608201526080830151608082015260a083015160a082015261410c60c08401613af3565b60c082015260e083015182811115614122578485fd5b61412e878286016138cb565b60e0830152506101008084015183811115614147578586fd5b614153888287016139b9565b828401525050610120614167818501613af3565b90820152610140614179848201613625565b908201526101608381015190820152610180614196818501613a5b565b908201526101a083810151838111156141ad578586fd5b6141b988828701613679565b918301919091525095945050505050565b6000806000606084860312156141de578081fd5b833592506020840135613bac81614c52565b60008060408385031215614202578182fd5b50508035926020909101359150565b600080600060608486031215614225578081fd5b83359250602084013561423781614c9e565b915060408401356001600160401b03811115614251578182fd5b8401601f81018613614261578182fd5b614270868235602084016135e7565b9150509250925092565b600082825180855260208086019550808260051b840101818601855b8481101561378d57601f198684030189528151608081518186526142bc8287018261458b565b91505061ffff868301511686860152604080830151868303828801526142e2838261458b565b9250505060608083015192508582038187015250614300818361458b565b9a86019a9450505090830190600101614296565b600082825180855260208086019550808260051b840101818601855b8481101561378d57601f19868403018952815160a081518186526143568287018261458b565b915050858201518582038787015261436e828261458b565b91505060408083015186830382880152614388838261458b565b92505050606061ffff81840151168187015250608080830151925085820381870152506143b5818361458b565b9a86019a9450505090830190600101614330565b600081518084526020808501808196506005915083821b8101838701865b86811015614482578383038a52815160608151151585528782015181898701526144138287018261458b565b604093840151878203948801949094528351808252938a0193909250898301915080891b83018a018c5b8281101561446b57601f1985830301845261445982875161458b565b958c0195938c0193915060010161443d565b509d8a019d965050509287019250506001016143e7565b509098975050505050505050565b600082825180855260208086019550808260051b840101818601855b8481101561378d57601f198684030189528151608081518186526144d28287018261458b565b91505085820151858203878701526144ea828261458b565b915050604061ffff8184015116818701525060608083015192508582038187015250614516818361458b565b9a86019a94505050908301906001016144ac565b6000815180845260208085019450848260051b8601828601855b8581101561378d578383038952815180516001600160401b0316845285015160408685018190526145778186018361458b565b9a87019a9450505090840190600101614544565b600081518084526145a3816020860160208601614b63565b601f01601f19169290920160200192915050565b600083858337838201818152602f60f81b80825284516145de816001850160208901614b63565b600192019182015260020195945050505050565b60008351614604818460208801614b63565b835190830190614618818360208801614b63565b01949350505050565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351614659816017850160208801614b63565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161468a816028840160208801614b63565b01602801949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906146c99083018461458b565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156138bf5783516001600160a01b0316835292840192918401916001016146ef565b6020808252825182820181905260009190848201906040850190845b818110156138bf57835183529284019291840191600101614730565b60006020825261212b602083018461458b565b600087825286602083015285604083015284606083015260c060808301526001600160401b0384511660c0830152602084015160e083015260018060a01b03604085015116610100830152606084015160e06101208401526147c56101a084018261452a565b9050608085015160bf19848303016101408501526147e3828261427a565b91505060a08501516147fc61016085018261ffff169052565b5060c0949094015161ffff166101808301525090151560a090910152949350505050565b6020808252600d908201526c27379039bab1b4103a37b5b2b760991b604082015260600190565b6020808252600e908201526d191c9bdc081a5cc81cd9585b195960921b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b602080825260129082015271191c9bdc081a5cc81b9bdd081cd9585b195960721b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60006020825282516101c080602085015261495d6101e085018361458b565b91506020850151601f198086850301604087015261497b848361458b565b9350604087015191508086850301606087015261499884836143c9565b935060608701516080870152608087015160a087015260a087015160c087015260c087015191506149d460e08701836001600160401b03169052565b60e087015191506101008187860301818801526149f18584614490565b945080880151925050610120818786030181880152614a10858461452a565b945080880151925050610140614a30818801846001600160401b03169052565b8701519150610160614a4c878201846001600160a01b03169052565b8701516101808781019190915287015191506101a0614a6e8188018415159052565b8701518685039091018387015290506146c98382614314565b604051601f8201601f191681016001600160401b0381118282101715614aaf57614aaf614c3c565b604052919050565b60006001600160401b03821115614ad057614ad0614c3c565b5060051b60200190565b60006001600160401b03821115614af357614af3614c3c565b50601f01601f191660200190565b60008219821115614b1457614b14614c10565b500190565b600082614b2857614b28614c26565b500490565b6000816000190483118215151615614b4757614b47614c10565b500290565b600082821015614b5e57614b5e614c10565b500390565b60005b83811015614b7e578181015183820152602001614b66565b83811115611eb15750506000910152565b600081614b9e57614b9e614c10565b506000190190565b600181811c90821680614bba57607f821691505b60208210811415614bdb57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614bf557614bf5614c10565b5060010190565b600082614c0b57614c0b614c26565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114614c6757600080fd5b50565b8015158114614c6757600080fd5b6001600160e01b031981168114614c6757600080fd5b61ffff81168114614c6757600080fd5b6001600160401b0381168114614c6757600080fdfea264697066735822122098018f19c70b0157f0ffa2eda2b9cd7996001fb24383180eb769629435fba45f64736f6c63430008030033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000a566565467269656e64730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035646540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a566565467269656e647300000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): VeeFriends
Arg [1] : symbol (string): VFT
Arg [2] : newCreator (string): VeeFriends
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [3] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [4] : 566565467269656e647300000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [6] : 5646540000000000000000000000000000000000000000000000000000000000
Arg [7] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [8] : 566565467269656e647300000000000000000000000000000000000000000000
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.