ERC-721
Overview
Max Total Supply
333 DVN
Holders
151
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
5 DVNLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
DVN
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 99999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; // ,ggg, ,gggggggggggg, // dP""8I ,dPYb, I8 dP"""88""""""Y8b, // dP 88 IP'`Yb I8 Yb, 88 `8b, // dP 88 I8 8I gg 88888888 `" 88 `8b gg gg // ,8' 88 I8 8' "" I8 88 Y8 "" "" // d88888888 I8 dP ,gggg,gg ,ggggg, ,gggggg, gg I8 ,ggg,,ggg,,ggg, ,ggggg, 88 d8 gg ggg gg gg ,ggg,,ggg, ,ggggg, // __ ,8" 88 I8dP dP" "Y8I dP" "Y8gggdP""""8I 88 I8 ,8" "8P" "8P" "8, dP" "Y8ggg 88 ,8P 88 d8"Yb 88bg88 ,8" "8P" "8, dP" "Y8ggg // dP" ,8P Y8 I8P i8' ,8I i8' ,8I ,8' 8I 88 ,I8, I8 8I 8I 8I i8' ,8I 88 ,8P' 88 dP I8 8I 88 I8 8I 8I i8' ,8I // Yb,_,dP `8b,,d8b,_ ,d8, ,d8I ,d8, ,d8',dP Y8,_,88,_,d88b,,dP 8I 8I Yb,,d8, ,d8' 88______,dP'_,88,_,dP I8, ,8I_,88,_,dP 8I Yb,,d8, ,d8' // "Y8P" `Y88P'"Y88P"Y8888P"888P"Y8888P" 8P `Y88P""Y88P""Y88P' 8I 8I `Y8P"Y8888P" 888888888P" 8P""Y88" "Y8P" 8P""Y88P' 8I `Y8P"Y8888P" // ,d8I' // ,dP'8I // ,8" 8I // I8 8I // `8, ,8I // `Y8P" import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Base64.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/finance/PaymentSplitter.sol"; import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol"; contract DVN is ERC721, ERC721URIStorage, ERC721Enumerable, ERC721Royalty, Ownable, DefaultOperatorFilterer, PaymentSplitter, ChainlinkClient { error InvalidPrice(address emitter); error SaleNotStarted(address emitter); error SoldOut(address emitter); error EtherTransferFail(address emitter); event Sold(address indexed to, uint256 price, uint256 tokenId); event MetadataUpdate(uint256 _tokenId); event StableDilutionMetadataRequested(uint256 _tokenId); event StableDilutionMetadataReceived(uint256 _tokenId); event PermanentURI(string _value, uint256 indexed _id); using Strings for uint256; using Chainlink for Chainlink.Request; uint256 private constant STARTING_INDEX = 1; uint256 public constant MAX_SUPPLY = 333; uint256 public constant AUCTION_PRICE_CHANGE_TIME = 10 minutes; uint256[] public AUCTION_PRICES = [0.69 ether, 0.51 ether, 0.38 ether, 0.28 ether, 0.21 ether, 0.15 ether, 0.11 ether]; bool metadataFrozen = false; bool preminted = false; uint256 private currentMintTokenId = STARTING_INDEX; string public placeholderTokenUri; uint256 public saleStartTime; bytes32 private jobId; uint256 private fee; mapping(bytes32 => uint256) requestToTokenId; struct ChainlinkInformation { address chainlinkToken; address chainlinkOracle; bytes32 jobId; uint256 fee; } constructor( string memory _name, string memory _symbol, string memory _placeholderTokenUri, uint256 _saleStartTime, address _royalReceiver, uint96 _royalFeeNumerator, address[] memory payees, uint256[] memory shares_, ChainlinkInformation memory chainlinkInformation ) payable ERC721(_name, _symbol) PaymentSplitter(payees, shares_) { placeholderTokenUri = _placeholderTokenUri; saleStartTime = _saleStartTime; if (_royalReceiver != address(0)) { _setDefaultRoyalty(_royalReceiver, _royalFeeNumerator); } setChainlinkToken(chainlinkInformation.chainlinkToken); setChainlinkOracle(chainlinkInformation.chainlinkOracle); jobId = chainlinkInformation.jobId; fee = chainlinkInformation.fee; } function preMint(address to) public onlyOwner { if (totalSupply() >= MAX_SUPPLY) revert SoldOut(address(this)); require(!preminted, "Only one premint is allowed"); preminted = true; mintInternal(to); } function mint() public payable { if (totalSupply() >= MAX_SUPPLY) revert SoldOut(address(this)); if (block.timestamp < saleStartTime) { revert SaleNotStarted(address(this)); } uint256 price = currentPrice(); if (msg.value != price) revert InvalidPrice(address(this)); emit Sold(msg.sender, price, currentMintTokenId); mintInternal(msg.sender); } function setLinkFee(uint256 _fee) public onlyOwner { fee = _fee; } function mintInternal(address to) private { _safeMint(to, currentMintTokenId); requestStableDilutionMetadata(currentMintTokenId, to); _setTokenURI(currentMintTokenId, placeholderTokenUri); ++currentMintTokenId; } function currentPrice() public view returns (uint256) { if (block.timestamp < saleStartTime) return AUCTION_PRICES[0]; uint256 index = (block.timestamp - saleStartTime) / AUCTION_PRICE_CHANGE_TIME; uint256 priceIndex = index >= AUCTION_PRICES.length ? AUCTION_PRICES.length - 1 : index; return AUCTION_PRICES[priceIndex]; } function auctionPrices() public view returns (uint256[] memory) { uint256 priceCount = AUCTION_PRICES.length; uint256[] memory _prices = new uint256[](priceCount); for (uint256 i; i < priceCount; ++i) { _prices[i] = AUCTION_PRICES[i]; } return _prices; } function requestStableDilutionMetadata(uint256 tokenId, address to) public returns (bytes32 requestId) { emit StableDilutionMetadataRequested(tokenId); Chainlink.Request memory req = buildChainlinkRequest( jobId, address(this), this.fulfill.selector ); req.add( "get", string(abi.encodePacked("https://www.stable-dilution.art/nft/item/generation/6/", Strings.toString(tokenId), "/", Strings.toHexString(uint256(uint160(to)), 20))) ); req.add("path", "metadataUrl"); requestId = sendChainlinkRequest(req, fee); requestToTokenId[requestId] = tokenId; } function fulfill( bytes32 _requestId, string memory _metadataUri ) public virtual recordChainlinkFulfillment(_requestId) { uint256 tokenId = requestToTokenId[_requestId]; emit StableDilutionMetadataReceived(tokenId); _setTokenURI(tokenId, _metadataUri); emit MetadataUpdate(tokenId); } function withdrawLink() public onlyOwner { LinkTokenInterface link = LinkTokenInterface(chainlinkTokenAddress()); require( link.transfer(msg.sender, link.balanceOf(address(this))), "Unable to transfer" ); } function setSaleStartTime(uint256 _saleStartTime) public onlyOwner { saleStartTime = _saleStartTime; } function freezeMetadata() public onlyOwner() { require(metadataFrozen == false, "Metadata already frozen"); metadataFrozen = true; for (uint256 i = STARTING_INDEX; i <= totalSupply(); ++i) { emit PermanentURI(tokenURI(i), i); } } function setTokenUri(uint256[] calldata tokenIds, string[] calldata _metadataUris) public onlyOwner { require(metadataFrozen == false, "Metadata frozen"); require(tokenIds.length == _metadataUris.length, "Arrays need to be same size"); for(uint256 i=0;i<tokenIds.length;i++) { _setTokenURI(tokenIds[i], _metadataUris[i]); emit MetadataUpdate(tokenIds[i]); } } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); } function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner { super._setDefaultRoyalty(receiver, feeNumerator); } function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); } function _burn(uint256 tokenId) internal override(ERC721, ERC721Royalty, ERC721URIStorage) { super._burn(tokenId); } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Royalty, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } function setApprovalForAll(address operator, bool approved) public override(ERC721, IERC721) onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public override(ERC721, IERC721) onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom(address from, address to, uint256 tokenId) public override(ERC721, IERC721) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId) public override(ERC721, IERC721) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override(ERC721, IERC721) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {CBORChainlink} from "./vendor/CBORChainlink.sol"; import {BufferChainlink} from "./vendor/BufferChainlink.sol"; /** * @title Library for common Chainlink functions * @dev Uses imported CBOR library for encoding to buffer */ library Chainlink { uint256 internal constant defaultBufferSize = 256; // solhint-disable-line const-name-snakecase using CBORChainlink for BufferChainlink.buffer; struct Request { bytes32 id; address callbackAddress; bytes4 callbackFunctionId; uint256 nonce; BufferChainlink.buffer buf; } /** * @notice Initializes a Chainlink request * @dev Sets the ID, callback address, and callback function signature on the request * @param self The uninitialized request * @param jobId The Job Specification ID * @param callbackAddr The callback address * @param callbackFunc The callback function signature * @return The initialized request */ function initialize( Request memory self, bytes32 jobId, address callbackAddr, bytes4 callbackFunc ) internal pure returns (Chainlink.Request memory) { BufferChainlink.init(self.buf, defaultBufferSize); self.id = jobId; self.callbackAddress = callbackAddr; self.callbackFunctionId = callbackFunc; return self; } /** * @notice Sets the data for the buffer without encoding CBOR on-chain * @dev CBOR can be closed with curly-brackets {} or they can be left off * @param self The initialized request * @param data The CBOR data */ function setBuffer(Request memory self, bytes memory data) internal pure { BufferChainlink.init(self.buf, data.length); BufferChainlink.append(self.buf, data); } /** * @notice Adds a string value to the request with a given key name * @param self The initialized request * @param key The name of the key * @param value The string value to add */ function add( Request memory self, string memory key, string memory value ) internal pure { self.buf.encodeString(key); self.buf.encodeString(value); } /** * @notice Adds a bytes value to the request with a given key name * @param self The initialized request * @param key The name of the key * @param value The bytes value to add */ function addBytes( Request memory self, string memory key, bytes memory value ) internal pure { self.buf.encodeString(key); self.buf.encodeBytes(value); } /** * @notice Adds a int256 value to the request with a given key name * @param self The initialized request * @param key The name of the key * @param value The int256 value to add */ function addInt( Request memory self, string memory key, int256 value ) internal pure { self.buf.encodeString(key); self.buf.encodeInt(value); } /** * @notice Adds a uint256 value to the request with a given key name * @param self The initialized request * @param key The name of the key * @param value The uint256 value to add */ function addUint( Request memory self, string memory key, uint256 value ) internal pure { self.buf.encodeString(key); self.buf.encodeUInt(value); } /** * @notice Adds an array of strings to the request with a given key name * @param self The initialized request * @param key The name of the key * @param values The array of string values to add */ function addStringArray( Request memory self, string memory key, string[] memory values ) internal pure { self.buf.encodeString(key); self.buf.startArray(); for (uint256 i = 0; i < values.length; i++) { self.buf.encodeString(values[i]); } self.buf.endSequence(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./Chainlink.sol"; import "./interfaces/ENSInterface.sol"; import "./interfaces/LinkTokenInterface.sol"; import "./interfaces/ChainlinkRequestInterface.sol"; import "./interfaces/OperatorInterface.sol"; import "./interfaces/PointerInterface.sol"; import {ENSResolver as ENSResolver_Chainlink} from "./vendor/ENSResolver.sol"; /** * @title The ChainlinkClient contract * @notice Contract writers can inherit this contract in order to create requests for the * Chainlink network */ abstract contract ChainlinkClient { using Chainlink for Chainlink.Request; uint256 internal constant LINK_DIVISIBILITY = 10**18; uint256 private constant AMOUNT_OVERRIDE = 0; address private constant SENDER_OVERRIDE = address(0); uint256 private constant ORACLE_ARGS_VERSION = 1; uint256 private constant OPERATOR_ARGS_VERSION = 2; bytes32 private constant ENS_TOKEN_SUBNAME = keccak256("link"); bytes32 private constant ENS_ORACLE_SUBNAME = keccak256("oracle"); address private constant LINK_TOKEN_POINTER = 0xC89bD4E1632D3A43CB03AAAd5262cbe4038Bc571; ENSInterface private s_ens; bytes32 private s_ensNode; LinkTokenInterface private s_link; OperatorInterface private s_oracle; uint256 private s_requestCount = 1; mapping(bytes32 => address) private s_pendingRequests; event ChainlinkRequested(bytes32 indexed id); event ChainlinkFulfilled(bytes32 indexed id); event ChainlinkCancelled(bytes32 indexed id); /** * @notice Creates a request that can hold additional parameters * @param specId The Job Specification ID that the request will be created for * @param callbackAddr address to operate the callback on * @param callbackFunctionSignature function signature to use for the callback * @return A Chainlink Request struct in memory */ function buildChainlinkRequest( bytes32 specId, address callbackAddr, bytes4 callbackFunctionSignature ) internal pure returns (Chainlink.Request memory) { Chainlink.Request memory req; return req.initialize(specId, callbackAddr, callbackFunctionSignature); } /** * @notice Creates a request that can hold additional parameters * @param specId The Job Specification ID that the request will be created for * @param callbackFunctionSignature function signature to use for the callback * @return A Chainlink Request struct in memory */ function buildOperatorRequest(bytes32 specId, bytes4 callbackFunctionSignature) internal view returns (Chainlink.Request memory) { Chainlink.Request memory req; return req.initialize(specId, address(this), callbackFunctionSignature); } /** * @notice Creates a Chainlink request to the stored oracle address * @dev Calls `chainlinkRequestTo` with the stored oracle address * @param req The initialized Chainlink Request * @param payment The amount of LINK to send for the request * @return requestId The request ID */ function sendChainlinkRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) { return sendChainlinkRequestTo(address(s_oracle), req, payment); } /** * @notice Creates a Chainlink request to the specified oracle address * @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to * send LINK which creates a request on the target oracle contract. * Emits ChainlinkRequested event. * @param oracleAddress The address of the oracle for the request * @param req The initialized Chainlink Request * @param payment The amount of LINK to send for the request * @return requestId The request ID */ function sendChainlinkRequestTo( address oracleAddress, Chainlink.Request memory req, uint256 payment ) internal returns (bytes32 requestId) { uint256 nonce = s_requestCount; s_requestCount = nonce + 1; bytes memory encodedRequest = abi.encodeWithSelector( ChainlinkRequestInterface.oracleRequest.selector, SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent req.id, address(this), req.callbackFunctionId, nonce, ORACLE_ARGS_VERSION, req.buf.buf ); return _rawRequest(oracleAddress, nonce, payment, encodedRequest); } /** * @notice Creates a Chainlink request to the stored oracle address * @dev This function supports multi-word response * @dev Calls `sendOperatorRequestTo` with the stored oracle address * @param req The initialized Chainlink Request * @param payment The amount of LINK to send for the request * @return requestId The request ID */ function sendOperatorRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) { return sendOperatorRequestTo(address(s_oracle), req, payment); } /** * @notice Creates a Chainlink request to the specified oracle address * @dev This function supports multi-word response * @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to * send LINK which creates a request on the target oracle contract. * Emits ChainlinkRequested event. * @param oracleAddress The address of the oracle for the request * @param req The initialized Chainlink Request * @param payment The amount of LINK to send for the request * @return requestId The request ID */ function sendOperatorRequestTo( address oracleAddress, Chainlink.Request memory req, uint256 payment ) internal returns (bytes32 requestId) { uint256 nonce = s_requestCount; s_requestCount = nonce + 1; bytes memory encodedRequest = abi.encodeWithSelector( OperatorInterface.operatorRequest.selector, SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent req.id, req.callbackFunctionId, nonce, OPERATOR_ARGS_VERSION, req.buf.buf ); return _rawRequest(oracleAddress, nonce, payment, encodedRequest); } /** * @notice Make a request to an oracle * @param oracleAddress The address of the oracle for the request * @param nonce used to generate the request ID * @param payment The amount of LINK to send for the request * @param encodedRequest data encoded for request type specific format * @return requestId The request ID */ function _rawRequest( address oracleAddress, uint256 nonce, uint256 payment, bytes memory encodedRequest ) private returns (bytes32 requestId) { requestId = keccak256(abi.encodePacked(this, nonce)); s_pendingRequests[requestId] = oracleAddress; emit ChainlinkRequested(requestId); require(s_link.transferAndCall(oracleAddress, payment, encodedRequest), "unable to transferAndCall to oracle"); } /** * @notice Allows a request to be cancelled if it has not been fulfilled * @dev Requires keeping track of the expiration value emitted from the oracle contract. * Deletes the request from the `pendingRequests` mapping. * Emits ChainlinkCancelled event. * @param requestId The request ID * @param payment The amount of LINK sent for the request * @param callbackFunc The callback function specified for the request * @param expiration The time of the expiration for the request */ function cancelChainlinkRequest( bytes32 requestId, uint256 payment, bytes4 callbackFunc, uint256 expiration ) internal { OperatorInterface requested = OperatorInterface(s_pendingRequests[requestId]); delete s_pendingRequests[requestId]; emit ChainlinkCancelled(requestId); requested.cancelOracleRequest(requestId, payment, callbackFunc, expiration); } /** * @notice the next request count to be used in generating a nonce * @dev starts at 1 in order to ensure consistent gas cost * @return returns the next request count to be used in a nonce */ function getNextRequestCount() internal view returns (uint256) { return s_requestCount; } /** * @notice Sets the stored oracle address * @param oracleAddress The address of the oracle contract */ function setChainlinkOracle(address oracleAddress) internal { s_oracle = OperatorInterface(oracleAddress); } /** * @notice Sets the LINK token address * @param linkAddress The address of the LINK token contract */ function setChainlinkToken(address linkAddress) internal { s_link = LinkTokenInterface(linkAddress); } /** * @notice Sets the Chainlink token address for the public * network as given by the Pointer contract */ function setPublicChainlinkToken() internal { setChainlinkToken(PointerInterface(LINK_TOKEN_POINTER).getAddress()); } /** * @notice Retrieves the stored address of the LINK token * @return The address of the LINK token */ function chainlinkTokenAddress() internal view returns (address) { return address(s_link); } /** * @notice Retrieves the stored address of the oracle contract * @return The address of the oracle contract */ function chainlinkOracleAddress() internal view returns (address) { return address(s_oracle); } /** * @notice Allows for a request which was created on another contract to be fulfilled * on this contract * @param oracleAddress The address of the oracle contract that will fulfill the request * @param requestId The request ID used for the response */ function addChainlinkExternalRequest(address oracleAddress, bytes32 requestId) internal notPendingRequest(requestId) { s_pendingRequests[requestId] = oracleAddress; } /** * @notice Sets the stored oracle and LINK token contracts with the addresses resolved by ENS * @dev Accounts for subnodes having different resolvers * @param ensAddress The address of the ENS contract * @param node The ENS node hash */ function useChainlinkWithENS(address ensAddress, bytes32 node) internal { s_ens = ENSInterface(ensAddress); s_ensNode = node; bytes32 linkSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_TOKEN_SUBNAME)); ENSResolver_Chainlink resolver = ENSResolver_Chainlink(s_ens.resolver(linkSubnode)); setChainlinkToken(resolver.addr(linkSubnode)); updateChainlinkOracleWithENS(); } /** * @notice Sets the stored oracle contract with the address resolved by ENS * @dev This may be called on its own as long as `useChainlinkWithENS` has been called previously */ function updateChainlinkOracleWithENS() internal { bytes32 oracleSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_ORACLE_SUBNAME)); ENSResolver_Chainlink resolver = ENSResolver_Chainlink(s_ens.resolver(oracleSubnode)); setChainlinkOracle(resolver.addr(oracleSubnode)); } /** * @notice Ensures that the fulfillment is valid for this contract * @dev Use if the contract developer prefers methods instead of modifiers for validation * @param requestId The request ID for fulfillment */ function validateChainlinkCallback(bytes32 requestId) internal recordChainlinkFulfillment(requestId) // solhint-disable-next-line no-empty-blocks { } /** * @dev Reverts if the sender is not the oracle of the request. * Emits ChainlinkFulfilled event. * @param requestId The request ID for fulfillment */ modifier recordChainlinkFulfillment(bytes32 requestId) { require(msg.sender == s_pendingRequests[requestId], "Source must be the oracle of the request"); delete s_pendingRequests[requestId]; emit ChainlinkFulfilled(requestId); _; } /** * @dev Reverts if the request is already pending * @param requestId The request ID for fulfillment */ modifier notPendingRequest(bytes32 requestId) { require(s_pendingRequests[requestId] == address(0), "Request is already pending"); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ChainlinkRequestInterface { function oracleRequest( address sender, uint256 requestPrice, bytes32 serviceAgreementID, address callbackAddress, bytes4 callbackFunctionId, uint256 nonce, uint256 dataVersion, bytes calldata data ) external; function cancelOracleRequest( bytes32 requestId, uint256 payment, bytes4 callbackFunctionId, uint256 expiration ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ENSInterface { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); // Logged when the owner of a node transfers ownership to a new account. event Transfer(bytes32 indexed node, address owner); // Logged when the resolver for a node changes. event NewResolver(bytes32 indexed node, address resolver); // Logged when the TTL of a node changes event NewTTL(bytes32 indexed node, uint64 ttl); function setSubnodeOwner( bytes32 node, bytes32 label, address owner ) external; function setResolver(bytes32 node, address resolver) external; function setOwner(bytes32 node, address owner) external; function setTTL(bytes32 node, uint64 ttl) external; function owner(bytes32 node) external view returns (address); function resolver(bytes32 node) external view returns (address); function ttl(bytes32 node) external view returns (uint64); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface LinkTokenInterface { function allowance(address owner, address spender) external view returns (uint256 remaining); function approve(address spender, uint256 value) external returns (bool success); function balanceOf(address owner) external view returns (uint256 balance); function decimals() external view returns (uint8 decimalPlaces); function decreaseApproval(address spender, uint256 addedValue) external returns (bool success); function increaseApproval(address spender, uint256 subtractedValue) external; function name() external view returns (string memory tokenName); function symbol() external view returns (string memory tokenSymbol); function totalSupply() external view returns (uint256 totalTokensIssued); function transfer(address to, uint256 value) external returns (bool success); function transferAndCall( address to, uint256 value, bytes calldata data ) external returns (bool success); function transferFrom( address from, address to, uint256 value ) external returns (bool success); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./OracleInterface.sol"; import "./ChainlinkRequestInterface.sol"; interface OperatorInterface is OracleInterface, ChainlinkRequestInterface { function operatorRequest( address sender, uint256 payment, bytes32 specId, bytes4 callbackFunctionId, uint256 nonce, uint256 dataVersion, bytes calldata data ) external; function fulfillOracleRequest2( bytes32 requestId, uint256 payment, address callbackAddress, bytes4 callbackFunctionId, uint256 expiration, bytes calldata data ) external returns (bool); function ownerTransferAndCall( address to, uint256 value, bytes calldata data ) external returns (bool success); function distributeFunds(address payable[] calldata receivers, uint256[] calldata amounts) external payable; function getAuthorizedSenders() external returns (address[] memory); function setAuthorizedSenders(address[] calldata senders) external; function getForwarder() external returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface OracleInterface { function fulfillOracleRequest( bytes32 requestId, uint256 payment, address callbackAddress, bytes4 callbackFunctionId, uint256 expiration, bytes32 data ) external returns (bool); function isAuthorizedSender(address node) external view returns (bool); function withdraw(address recipient, uint256 amount) external; function withdrawable() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface PointerInterface { function getAddress() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev A library for working with mutable byte buffers in Solidity. * * Byte buffers are mutable and expandable, and provide a variety of primitives * for writing to them. At any time you can fetch a bytes object containing the * current contents of the buffer. The bytes object should not be stored between * operations, as it may change due to resizing of the buffer. */ library BufferChainlink { /** * @dev Represents a mutable buffer. Buffers have a current value (buf) and * a capacity. The capacity may be longer than the current value, in * which case it can be extended without the need to allocate more memory. */ struct buffer { bytes buf; uint256 capacity; } /** * @dev Initializes a buffer with an initial capacity. * @param buf The buffer to initialize. * @param capacity The number of bytes of space to allocate the buffer. * @return The buffer, for chaining. */ function init(buffer memory buf, uint256 capacity) internal pure returns (buffer memory) { if (capacity % 32 != 0) { capacity += 32 - (capacity % 32); } // Allocate space for the buffer data buf.capacity = capacity; assembly { let ptr := mload(0x40) mstore(buf, ptr) mstore(ptr, 0) mstore(0x40, add(32, add(ptr, capacity))) } return buf; } /** * @dev Initializes a new buffer from an existing bytes object. * Changes to the buffer may mutate the original value. * @param b The bytes object to initialize the buffer with. * @return A new buffer. */ function fromBytes(bytes memory b) internal pure returns (buffer memory) { buffer memory buf; buf.buf = b; buf.capacity = b.length; return buf; } function resize(buffer memory buf, uint256 capacity) private pure { bytes memory oldbuf = buf.buf; init(buf, capacity); append(buf, oldbuf); } function max(uint256 a, uint256 b) private pure returns (uint256) { if (a > b) { return a; } return b; } /** * @dev Sets buffer length to 0. * @param buf The buffer to truncate. * @return The original buffer, for chaining.. */ function truncate(buffer memory buf) internal pure returns (buffer memory) { assembly { let bufptr := mload(buf) mstore(bufptr, 0) } return buf; } /** * @dev Writes a byte string to a buffer. Resizes if doing so would exceed * the capacity of the buffer. * @param buf The buffer to append to. * @param off The start offset to write to. * @param data The data to append. * @param len The number of bytes to copy. * @return The original buffer, for chaining. */ function write( buffer memory buf, uint256 off, bytes memory data, uint256 len ) internal pure returns (buffer memory) { require(len <= data.length); if (off + len > buf.capacity) { resize(buf, max(buf.capacity, len + off) * 2); } uint256 dest; uint256 src; assembly { // Memory address of the buffer data let bufptr := mload(buf) // Length of existing buffer data let buflen := mload(bufptr) // Start address = buffer address + offset + sizeof(buffer length) dest := add(add(bufptr, 32), off) // Update buffer length if we're extending it if gt(add(len, off), buflen) { mstore(bufptr, add(len, off)) } src := add(data, 32) } // Copy word-length chunks while possible for (; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } dest += 32; src += 32; } // Copy remaining bytes unchecked { uint256 mask = (256**(32 - len)) - 1; assembly { let srcpart := and(mload(src), not(mask)) let destpart := and(mload(dest), mask) mstore(dest, or(destpart, srcpart)) } } return buf; } /** * @dev Appends a byte string to a buffer. Resizes if doing so would exceed * the capacity of the buffer. * @param buf The buffer to append to. * @param data The data to append. * @param len The number of bytes to copy. * @return The original buffer, for chaining. */ function append( buffer memory buf, bytes memory data, uint256 len ) internal pure returns (buffer memory) { return write(buf, buf.buf.length, data, len); } /** * @dev Appends a byte string to a buffer. Resizes if doing so would exceed * the capacity of the buffer. * @param buf The buffer to append to. * @param data The data to append. * @return The original buffer, for chaining. */ function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) { return write(buf, buf.buf.length, data, data.length); } /** * @dev Writes a byte to the buffer. Resizes if doing so would exceed the * capacity of the buffer. * @param buf The buffer to append to. * @param off The offset to write the byte at. * @param data The data to append. * @return The original buffer, for chaining. */ function writeUint8( buffer memory buf, uint256 off, uint8 data ) internal pure returns (buffer memory) { if (off >= buf.capacity) { resize(buf, buf.capacity * 2); } assembly { // Memory address of the buffer data let bufptr := mload(buf) // Length of existing buffer data let buflen := mload(bufptr) // Address = buffer address + sizeof(buffer length) + off let dest := add(add(bufptr, off), 32) mstore8(dest, data) // Update buffer length if we extended it if eq(off, buflen) { mstore(bufptr, add(buflen, 1)) } } return buf; } /** * @dev Appends a byte to the buffer. Resizes if doing so would exceed the * capacity of the buffer. * @param buf The buffer to append to. * @param data The data to append. * @return The original buffer, for chaining. */ function appendUint8(buffer memory buf, uint8 data) internal pure returns (buffer memory) { return writeUint8(buf, buf.buf.length, data); } /** * @dev Writes up to 32 bytes to the buffer. Resizes if doing so would * exceed the capacity of the buffer. * @param buf The buffer to append to. * @param off The offset to write at. * @param data The data to append. * @param len The number of bytes to write (left-aligned). * @return The original buffer, for chaining. */ function write( buffer memory buf, uint256 off, bytes32 data, uint256 len ) private pure returns (buffer memory) { if (len + off > buf.capacity) { resize(buf, (len + off) * 2); } unchecked { uint256 mask = (256**len) - 1; // Right-align data data = data >> (8 * (32 - len)); assembly { // Memory address of the buffer data let bufptr := mload(buf) // Address = buffer address + sizeof(buffer length) + off + len let dest := add(add(bufptr, off), len) mstore(dest, or(and(mload(dest), not(mask)), data)) // Update buffer length if we extended it if gt(add(off, len), mload(bufptr)) { mstore(bufptr, add(off, len)) } } } return buf; } /** * @dev Writes a bytes20 to the buffer. Resizes if doing so would exceed the * capacity of the buffer. * @param buf The buffer to append to. * @param off The offset to write at. * @param data The data to append. * @return The original buffer, for chaining. */ function writeBytes20( buffer memory buf, uint256 off, bytes20 data ) internal pure returns (buffer memory) { return write(buf, off, bytes32(data), 20); } /** * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed * the capacity of the buffer. * @param buf The buffer to append to. * @param data The data to append. * @return The original buffer, for chhaining. */ function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) { return write(buf, buf.buf.length, bytes32(data), 20); } /** * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed * the capacity of the buffer. * @param buf The buffer to append to. * @param data The data to append. * @return The original buffer, for chaining. */ function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) { return write(buf, buf.buf.length, data, 32); } /** * @dev Writes an integer to the buffer. Resizes if doing so would exceed * the capacity of the buffer. * @param buf The buffer to append to. * @param off The offset to write at. * @param data The data to append. * @param len The number of bytes to write (right-aligned). * @return The original buffer, for chaining. */ function writeInt( buffer memory buf, uint256 off, uint256 data, uint256 len ) private pure returns (buffer memory) { if (len + off > buf.capacity) { resize(buf, (len + off) * 2); } uint256 mask = (256**len) - 1; assembly { // Memory address of the buffer data let bufptr := mload(buf) // Address = buffer address + off + sizeof(buffer length) + len let dest := add(add(bufptr, off), len) mstore(dest, or(and(mload(dest), not(mask)), data)) // Update buffer length if we extended it if gt(add(off, len), mload(bufptr)) { mstore(bufptr, add(off, len)) } } return buf; } /** * @dev Appends a byte to the end of the buffer. Resizes if doing so would * exceed the capacity of the buffer. * @param buf The buffer to append to. * @param data The data to append. * @return The original buffer. */ function appendInt( buffer memory buf, uint256 data, uint256 len ) internal pure returns (buffer memory) { return writeInt(buf, buf.buf.length, data, len); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.4.19; import {BufferChainlink} from "./BufferChainlink.sol"; library CBORChainlink { using BufferChainlink for BufferChainlink.buffer; uint8 private constant MAJOR_TYPE_INT = 0; uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1; uint8 private constant MAJOR_TYPE_BYTES = 2; uint8 private constant MAJOR_TYPE_STRING = 3; uint8 private constant MAJOR_TYPE_ARRAY = 4; uint8 private constant MAJOR_TYPE_MAP = 5; uint8 private constant MAJOR_TYPE_TAG = 6; uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7; uint8 private constant TAG_TYPE_BIGNUM = 2; uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3; function encodeFixedNumeric(BufferChainlink.buffer memory buf, uint8 major, uint64 value) private pure { if(value <= 23) { buf.appendUint8(uint8((major << 5) | value)); } else if (value <= 0xFF) { buf.appendUint8(uint8((major << 5) | 24)); buf.appendInt(value, 1); } else if (value <= 0xFFFF) { buf.appendUint8(uint8((major << 5) | 25)); buf.appendInt(value, 2); } else if (value <= 0xFFFFFFFF) { buf.appendUint8(uint8((major << 5) | 26)); buf.appendInt(value, 4); } else { buf.appendUint8(uint8((major << 5) | 27)); buf.appendInt(value, 8); } } function encodeIndefiniteLengthType(BufferChainlink.buffer memory buf, uint8 major) private pure { buf.appendUint8(uint8((major << 5) | 31)); } function encodeUInt(BufferChainlink.buffer memory buf, uint value) internal pure { if(value > 0xFFFFFFFFFFFFFFFF) { encodeBigNum(buf, value); } else { encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value)); } } function encodeInt(BufferChainlink.buffer memory buf, int value) internal pure { if(value < -0x10000000000000000) { encodeSignedBigNum(buf, value); } else if(value > 0xFFFFFFFFFFFFFFFF) { encodeBigNum(buf, uint(value)); } else if(value >= 0) { encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(uint256(value))); } else { encodeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(uint256(-1 - value))); } } function encodeBytes(BufferChainlink.buffer memory buf, bytes memory value) internal pure { encodeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length)); buf.append(value); } function encodeBigNum(BufferChainlink.buffer memory buf, uint value) internal pure { buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM)); encodeBytes(buf, abi.encode(value)); } function encodeSignedBigNum(BufferChainlink.buffer memory buf, int input) internal pure { buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)); encodeBytes(buf, abi.encode(uint256(-1 - input))); } function encodeString(BufferChainlink.buffer memory buf, string memory value) internal pure { encodeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length)); buf.append(bytes(value)); } function startArray(BufferChainlink.buffer memory buf) internal pure { encodeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY); } function startMap(BufferChainlink.buffer memory buf) internal pure { encodeIndefiniteLengthType(buf, MAJOR_TYPE_MAP); } function endSequence(BufferChainlink.buffer memory buf) internal pure { encodeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract ENSResolver { function addr(bytes32 node) public view virtual returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (finance/PaymentSplitter.sol) pragma solidity ^0.8.0; import "../token/ERC20/utils/SafeERC20.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. The distribution of shares is set at the * time of contract deployment and can't be updated thereafter. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. * * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you * to run tests before sending real value to this contract. */ contract PaymentSplitter is Context { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; mapping(IERC20 => uint256) private _erc20TotalReleased; mapping(IERC20 => mapping(address => uint256)) private _erc20Released; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20 * contract. */ function totalReleased(IERC20 token) public view returns (uint256) { return _erc20TotalReleased[token]; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an * IERC20 contract. */ function released(IERC20 token, address account) public view returns (uint256) { return _erc20Released[token][account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Getter for the amount of payee's releasable Ether. */ function releasable(address account) public view returns (uint256) { uint256 totalReceived = address(this).balance + totalReleased(); return _pendingPayment(account, totalReceived, released(account)); } /** * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an * IERC20 contract. */ function releasable(IERC20 token, address account) public view returns (uint256) { uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); return _pendingPayment(account, totalReceived, released(token, account)); } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _totalReleased is the sum of all values in _released. // If "_totalReleased += payment" does not overflow, then "_released[account] += payment" cannot overflow. _totalReleased += payment; unchecked { _released[account] += payment; } Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20 * contract. */ function release(IERC20 token, address account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(token, account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _erc20TotalReleased[token] is the sum of all values in _erc20Released[token]. // If "_erc20TotalReleased[token] += payment" does not overflow, then "_erc20Released[token][account] += payment" // cannot overflow. _erc20TotalReleased[token] += payment; unchecked { _erc20Released[token][account] += payment; } SafeERC20.safeTransfer(token, account, payment); emit ERC20PaymentReleased(token, account, payment); } /** * @dev internal logic for computing the pending payment of an `account` given the token historical balances and * already released amounts. */ function _pendingPayment( address account, uint256 totalReceived, uint256 alreadyReleased ) private view returns (uint256) { return (totalReceived * _shares[account]) / _totalShares - alreadyReleased; } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); 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) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden 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 token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @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 _ownerOf(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) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @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 from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-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. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256, /* firstTokenId */ uint256 batchSize ) internal virtual { if (batchSize > 1) { if (from != address(0)) { _balances[from] -= batchSize; } if (to != address(0)) { _balances[to] += batchSize; } } } /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev See {ERC721-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); if (batchSize > 1) { // Will only trigger during construction. Batch transferring (minting) is not available afterwards. revert("ERC721Enumerable: consecutive transfers not supported"); } uint256 tokenId = firstTokenId; if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Royalty.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../common/ERC2981.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev Extension of ERC721 with the ERC2981 NFT Royalty Standard, a standardized way to retrieve royalty payment * information. * * Royalty information can be specified globally for all token ids via {ERC2981-_setDefaultRoyalty}, and/or individually for * specific token ids via {ERC2981-_setTokenRoyalty}. The latter takes precedence over the first. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC721Royalty is ERC2981, ERC721 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } /** * @dev See {ERC721-_burn}. This override additionally clears the royalty information for the token. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); _resetTokenRoyalty(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorage is ERC721 { using Strings for uint256; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev See {ERC721-_burn}. This override additionally checks to see if a * token-specific URI was set for the token, and if so, it deletes the token URI from * the storage mapping. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * 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; /** * @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 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * 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 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 the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol) pragma solidity ^0.8.0; /** * @dev Provides a set of functions to operate with Base64 strings. * * _Available since v4.5._ */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 32) // Run over the input, 3 bytes at a time for { let dataPtr := data let endPtr := add(data, mload(data)) } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 bytes (18 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F which is the number of // the previous character in the ASCII table prior to the Base64 Table // The result is then added to the table to get the character to write, // and finally write it in the result pointer but with a left shift // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFilterer} from "./OperatorFilterer.sol"; import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol"; /** * @title DefaultOperatorFilterer * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. * @dev Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract DefaultOperatorFilterer is OperatorFilterer { /// @dev The constructor that is called when the contract is being deployed. constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { /** * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns * true if supplied registrant address is not registered. */ function isOperatorAllowed(address registrant, address operator) external view returns (bool); /** * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner. */ function register(address registrant) external; /** * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes. */ function registerAndSubscribe(address registrant, address subscription) external; /** * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another * address without subscribing. */ function registerAndCopyEntries(address registrant, address registrantToCopy) external; /** * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. * Note that this does not remove any filtered addresses or codeHashes. * Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes. */ function unregister(address addr) external; /** * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered. */ function updateOperator(address registrant, address operator, bool filtered) external; /** * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates. */ function updateOperators(address registrant, address[] calldata operators, bool filtered) external; /** * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered. */ function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; /** * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates. */ function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; /** * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous * subscription if present. * Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, * subscriptions will not be forwarded. Instead the former subscription's existing entries will still be * used. */ function subscribe(address registrant, address registrantToSubscribe) external; /** * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes. */ function unsubscribe(address registrant, bool copyExistingEntries) external; /** * @notice Get the subscription address of a given registrant, if any. */ function subscriptionOf(address addr) external returns (address registrant); /** * @notice Get the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscribers(address registrant) external returns (address[] memory); /** * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscriberAt(address registrant, uint256 index) external returns (address); /** * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr. */ function copyEntriesOf(address registrant, address registrantToCopy) external; /** * @notice Returns true if operator is filtered by a given address or its subscription. */ function isOperatorFiltered(address registrant, address operator) external returns (bool); /** * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription. */ function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); /** * @notice Returns true if a codeHash is filtered by a given address or its subscription. */ function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); /** * @notice Returns a list of filtered operators for a given address or its subscription. */ function filteredOperators(address addr) external returns (address[] memory); /** * @notice Returns the set of filtered codeHashes for a given address or its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashes(address addr) external returns (bytes32[] memory); /** * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredOperatorAt(address registrant, uint256 index) external returns (address); /** * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); /** * @notice Returns true if an address has registered */ function isRegistered(address addr) external returns (bool); /** * @dev Convenience method to compute the code hash of an arbitrary contract */ function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E; address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol"; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. * Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract OperatorFilterer { /// @dev Emitted when an operator is not allowed. error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS); /// @dev The constructor that is called when the contract is being deployed. constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } /** * @dev A helper function to check if an operator is allowed. */ modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } /** * @dev A helper function to check if an operator approval is allowed. */ modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } /** * @dev A helper function to check if an operator is allowed. */ function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { // under normal circumstances, this function will revert rather than return false, but inheriting contracts // may specify their own OperatorFilterRegistry implementations, which may behave differently if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
{ "optimizer": { "enabled": true, "runs": 99999 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
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":"_placeholderTokenUri","type":"string"},{"internalType":"uint256","name":"_saleStartTime","type":"uint256"},{"internalType":"address","name":"_royalReceiver","type":"address"},{"internalType":"uint96","name":"_royalFeeNumerator","type":"uint96"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares_","type":"uint256[]"},{"components":[{"internalType":"address","name":"chainlinkToken","type":"address"},{"internalType":"address","name":"chainlinkOracle","type":"address"},{"internalType":"bytes32","name":"jobId","type":"bytes32"},{"internalType":"uint256","name":"fee","type":"uint256"}],"internalType":"struct DVN.ChainlinkInformation","name":"chainlinkInformation","type":"tuple"}],"stateMutability":"payable","type":"constructor"},{"inputs":[{"internalType":"address","name":"emitter","type":"address"}],"name":"EtherTransferFail","type":"error"},{"inputs":[{"internalType":"address","name":"emitter","type":"address"}],"name":"InvalidPrice","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[{"internalType":"address","name":"emitter","type":"address"}],"name":"SaleNotStarted","type":"error"},{"inputs":[{"internalType":"address","name":"emitter","type":"address"}],"name":"SoldOut","type":"error"},{"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":"id","type":"bytes32"}],"name":"ChainlinkCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"PayeeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Sold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"StableDilutionMetadataReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"StableDilutionMetadataRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"AUCTION_PRICES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AUCTION_PRICE_CHANGE_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"auctionPrices","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"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":"currentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"string","name":"_metadataUri","type":"string"}],"name":"fulfill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"payee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"placeholderTokenUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"preMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"requestStableDilutionMetadata","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"saleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setLinkFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleStartTime","type":"uint256"}],"name":"setSaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"_metadataUris","type":"string[]"}],"name":"setTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawLink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60016019556101606040526709935f581f0500006080908152670713e24c4373000060a05267054607fc96a6000060c0526703e2c284391c000060e0526702ea11e32ad5000061010052670214e8348c4f000061012052670186cc6acd4b0000610140526200007390601b90600762000760565b50601c805461ffff191690556001601d556040516200689638819003908190833981016040819052620000a69162000a5a565b8282733cc6cdda760b79bafa08df41ecfa224f810dceb660018c8c6002620000cf838262000c0d565b506003620000de828262000c0d565b505050620000fb620000f56200041b60201b60201c565b6200041f565b6daaeb6d7670e522a718067333cd4e3b15620002405780156200018e57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200016f57600080fd5b505af115801562000184573d6000803e3d6000fd5b5050505062000240565b6001600160a01b03821615620001df5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000154565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200022657600080fd5b505af11580156200023b573d6000803e3d6000fd5b505050505b50508051825114620002b45760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620003075760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f207061796565730000000000006044820152606401620002ab565b60005b825181101562000373576200035e8382815181106200032d576200032d62000cd9565b60200260200101518383815181106200034a576200034a62000cd9565b60200260200101516200047160201b60201c565b806200036a8162000d05565b9150506200030a565b50601e9150620003869050888262000c0d565b50601f8690556001600160a01b03851615620003a857620003a885856200065f565b8051620003d190601780546001600160a01b0319166001600160a01b0392909216919091179055565b6020810151620003fd90601880546001600160a01b0319166001600160a01b0392909216919091179055565b6040810151602055606001516021555062000d3d9650505050505050565b3390565b600d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620004de5760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b6064820152608401620002ab565b60008111620005305760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a207368617265732061726520300000006044820152606401620002ab565b6001600160a01b03821660009081526010602052604090205415620005ac5760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b6064820152608401620002ab565b60128054600181019091557fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440180546001600160a01b0319166001600160a01b0384169081179091556000908152601060205260409020819055600e546200061690829062000d21565b600e55604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b6127106001600160601b0382161115620006cf5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401620002ab565b6001600160a01b038216620007275760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620002ab565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b828054828255906000526020600020908101928215620007a9579160200282015b82811115620007a957825182906001600160401b031690559160200191906001019062000781565b50620007b7929150620007bb565b5090565b5b80821115620007b75760008155600101620007bc565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620008135762000813620007d2565b604052919050565b600082601f8301126200082d57600080fd5b81516001600160401b03811115620008495762000849620007d2565b60206200085f601f8301601f19168201620007e8565b82815285828487010111156200087457600080fd5b60005b838110156200089457858101830151828201840152820162000877565b506000928101909101919091529392505050565b80516001600160a01b0381168114620008c057600080fd5b919050565b80516001600160601b0381168114620008c057600080fd5b60006001600160401b03821115620008f957620008f9620007d2565b5060051b60200190565b600082601f8301126200091557600080fd5b815160206200092e6200092883620008dd565b620007e8565b82815260059290921b840181019181810190868411156200094e57600080fd5b8286015b8481101562000974576200096681620008a8565b835291830191830162000952565b509695505050505050565b600082601f8301126200099157600080fd5b81516020620009a46200092883620008dd565b82815260059290921b84018101918181019086841115620009c457600080fd5b8286015b84811015620009745780518352918301918301620009c8565b600060808284031215620009f457600080fd5b604051608081016001600160401b038111828210171562000a195762000a19620007d2565b60405290508062000a2a83620008a8565b815262000a3a60208401620008a8565b602082015260408301516040820152606083015160608201525092915050565b60008060008060008060008060006101808a8c03121562000a7a57600080fd5b89516001600160401b038082111562000a9257600080fd5b62000aa08d838e016200081b565b9a5060208c015191508082111562000ab757600080fd5b62000ac58d838e016200081b565b995060408c015191508082111562000adc57600080fd5b62000aea8d838e016200081b565b985060608c0151975062000b0160808d01620008a8565b965062000b1160a08d01620008c5565b955060c08c015191508082111562000b2857600080fd5b62000b368d838e0162000903565b945060e08c015191508082111562000b4d57600080fd5b5062000b5c8c828d016200097f565b92505062000b6f8b6101008c01620009e1565b90509295985092959850929598565b600181811c9082168062000b9357607f821691505b60208210810362000bb457634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000c0857600081815260208120601f850160051c8101602086101562000be35750805b601f850160051c820191505b8181101562000c045782815560010162000bef565b5050505b505050565b81516001600160401b0381111562000c295762000c29620007d2565b62000c418162000c3a845462000b7e565b8462000bba565b602080601f83116001811462000c79576000841562000c605750858301515b600019600386901b1c1916600185901b17855562000c04565b600085815260208120601f198616915b8281101562000caa5788860151825594840194600190910190840162000c89565b508582101562000cc95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820162000d1a5762000d1a62000cef565b5060010190565b8082018082111562000d375762000d3762000cef565b92915050565b615b498062000d4d6000396000f3fe6080604052600436106103225760003560e01c806354d44968116101a5578063a22cb465116100ec578063ce7c2ac211610095578063e33b7de31161006f578063e33b7de3146109ae578063e985e9c5146109c3578063f2fde38b14610a19578063fd955ed914610a3957600080fd5b8063ce7c2ac214610913578063d111515d14610956578063d79779b21461096b57600080fd5b8063c45ac050116100c6578063c45ac050146108b3578063c87b56dd146108d3578063cd8ff657146108f357600080fd5b8063a22cb46514610853578063a3f8eace14610873578063b88d4fde1461089357600080fd5b80638b83209b1161014e57806395d89b411161012857806395d89b41146107e65780639852595c146107fb5780639d1b464a1461083e57600080fd5b80638b83209b146107865780638da5cb5b146107a65780638dc654a2146107d157600080fd5b806370a082311161017f57806370a0823114610731578063715018a6146107515780637fad2d121461076657600080fd5b806354d44968146106d9578063577f6198146106ef5780636352211e1461071157600080fd5b80632f745c591161026957806342842e0e116102125780634db331e5116101ec5780634db331e5146106795780634f6ccce714610699578063525f8a5c146106b957600080fd5b806342842e0e1461062457806348b75044146106445780634cf5f7a41461066457600080fd5b80633a98ef39116102435780633a98ef391461059a578063406072a9146105af57806341f434341461060257600080fd5b80632f745c591461054457806332cb6b0c14610564578063374419961461057a57600080fd5b806318160ddd116102cb57806323b872dd116102a557806323b872dd146104b8578063240eecb7146104d85780632a55205a146104f857600080fd5b806318160ddd1461046357806319165587146104825780631cbaee2d146104a257600080fd5b8063081812fc116102fc578063081812fc146103f6578063095ea7b31461043b5780631249c58b1461045b57600080fd5b806301ffc9a71461037d57806304634d8d146103b257806306fdde03146103d457600080fd5b36610378577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be770336040805173ffffffffffffffffffffffffffffffffffffffff90921682523460208301520160405180910390a1005b600080fd5b34801561038957600080fd5b5061039d610398366004614f0c565b610a59565b60405190151581526020015b60405180910390f35b3480156103be57600080fd5b506103d26103cd366004614f4b565b610a6a565b005b3480156103e057600080fd5b506103e9610a80565b6040516103a99190615003565b34801561040257600080fd5b50610416610411366004615016565b610b12565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103a9565b34801561044757600080fd5b506103d261045636600461502f565b610b46565b6103d2610b5f565b34801561046f57600080fd5b50600b545b6040519081526020016103a9565b34801561048e57600080fd5b506103d261049d36600461505b565b610c7e565b3480156104ae57600080fd5b50610474601f5481565b3480156104c457600080fd5b506103d26104d3366004615078565b610e6c565b3480156104e457600080fd5b506104746104f33660046150b9565b610ea4565b34801561050457600080fd5b506105186105133660046150de565b611046565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016103a9565b34801561055057600080fd5b5061047461055f36600461502f565b61113f565b34801561057057600080fd5b5061047461014d81565b34801561058657600080fd5b506103d26105953660046151c3565b61120e565b3480156105a657600080fd5b50600e54610474565b3480156105bb57600080fd5b506104746105ca36600461521e565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260146020908152604080832093909416825291909152205490565b34801561060e57600080fd5b506104166daaeb6d7670e522a718067333cd4e81565b34801561063057600080fd5b506103d261063f366004615078565b6113a4565b34801561065057600080fd5b506103d261065f36600461521e565b6113d6565b34801561067057600080fd5b506103e96115fb565b34801561068557600080fd5b50610474610694366004615016565b611689565b3480156106a557600080fd5b506104746106b4366004615016565b6116aa565b3480156106c557600080fd5b506103d26106d4366004615016565b611768565b3480156106e557600080fd5b5061047461025881565b3480156106fb57600080fd5b50610704611775565b6040516103a9919061524c565b34801561071d57600080fd5b5061041661072c366004615016565b61181f565b34801561073d57600080fd5b5061047461074c36600461505b565b6118ab565b34801561075d57600080fd5b506103d2611979565b34801561077257600080fd5b506103d26107813660046152d5565b61198d565b34801561079257600080fd5b506104166107a1366004615016565b611b5a565b3480156107b257600080fd5b50600d5473ffffffffffffffffffffffffffffffffffffffff16610416565b3480156107dd57600080fd5b506103d2611b97565b3480156107f257600080fd5b506103e9611d55565b34801561080757600080fd5b5061047461081636600461505b565b73ffffffffffffffffffffffffffffffffffffffff1660009081526011602052604090205490565b34801561084a57600080fd5b50610474611d64565b34801561085f57600080fd5b506103d261086e36600461534f565b611dfd565b34801561087f57600080fd5b5061047461088e36600461505b565b611e11565b34801561089f57600080fd5b506103d26108ae36600461537d565b611e66565b3480156108bf57600080fd5b506104746108ce36600461521e565b611e99565b3480156108df57600080fd5b506103e96108ee366004615016565b611fa4565b3480156108ff57600080fd5b506103d261090e366004615016565b611faf565b34801561091f57600080fd5b5061047461092e36600461505b565b73ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205490565b34801561096257600080fd5b506103d2611fbc565b34801561097757600080fd5b5061047461098636600461505b565b73ffffffffffffffffffffffffffffffffffffffff1660009081526013602052604090205490565b3480156109ba57600080fd5b50600f54610474565b3480156109cf57600080fd5b5061039d6109de36600461521e565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a2557600080fd5b506103d2610a3436600461505b565b6120b9565b348015610a4557600080fd5b506103d2610a5436600461505b565b61216d565b6000610a6482612261565b92915050565b610a7261226c565b610a7c82826122ed565b5050565b606060028054610a8f906153fd565b80601f0160208091040260200160405190810160405280929190818152602001828054610abb906153fd565b8015610b085780601f10610add57610100808354040283529160200191610b08565b820191906000526020600020905b815481529060010190602001808311610aeb57829003601f168201915b5050505050905090565b6000610b1d82612466565b5060009081526006602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b81610b50816124f1565b610b5a83836125f6565b505050565b61014d610b6b600b5490565b10610ba9576040517f519c7e2c0000000000000000000000000000000000000000000000000000000081523060048201526024015b60405180910390fd5b601f54421015610be7576040517fc9bbd13b000000000000000000000000000000000000000000000000000000008152306004820152602401610ba0565b6000610bf1611d64565b9050803414610c2e576040517fcd215006000000000000000000000000000000000000000000000000000000008152306004820152602401610ba0565b601d5460405133917fbac9694ac0daa55169abd117086fe32c89401d9a3b15dd1d34e55e0aa4e47a9d91610c6a91858252602082015260400190565b60405180910390a2610c7b3361277d565b50565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260106020526040902054610d30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201527f73686172657300000000000000000000000000000000000000000000000000006064820152608401610ba0565b6000610d3b82611e11565b905080600003610dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201527f647565207061796d656e740000000000000000000000000000000000000000006064820152608401610ba0565b80600f6000828254610ddf9190615479565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000908152601160205260409020805482019055610e198282612842565b6040805173ffffffffffffffffffffffffffffffffffffffff84168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a15050565b8273ffffffffffffffffffffffffffffffffffffffff81163314610e9357610e93336124f1565b610e9e84848461299c565b50505050565b60007f789bf7f3b2714c765ae963ccabd7c22556e02c73d0d35b16831c16e0cd6cee5383604051610ed791815260200190565b60405180910390a16000610ef560205430633744199660e01b612a3d565b9050610fa16040518060400160405280600381526020017f6765740000000000000000000000000000000000000000000000000000000000815250610f3986612ace565b610f5a8673ffffffffffffffffffffffffffffffffffffffff166014612b8c565b604051602001610f6b92919061548c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052839190612dcf565b6110206040518060400160405280600481526020017f70617468000000000000000000000000000000000000000000000000000000008152506040518060400160405280600b81526020017f6d6574616461746155726c00000000000000000000000000000000000000000081525083612dcf9092919063ffffffff16565b61102c81602154612ded565b600081815260226020526040902094909455509192915050565b600082815260016020908152604080832081518083019092525473ffffffffffffffffffffffffffffffffffffffff8116808352740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff1692820192909252829161110157506040805180820190915260005473ffffffffffffffffffffffffffffffffffffffff811682527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208201525b602081015160009061271090611125906bffffffffffffffffffffffff1687615533565b61112f9190615579565b91519350909150505b9250929050565b600061114a836118ab565b82106111d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610ba0565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600960209081526040808320938352929052205490565b6000828152601a6020526040902054829073ffffffffffffffffffffffffffffffffffffffff1633146112c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f536f75726365206d75737420626520746865206f7261636c65206f662074686560448201527f20726571756573740000000000000000000000000000000000000000000000006064820152608401610ba0565b6000818152601a602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a26000838152602260209081526040918290205491518281527f9b9df81562460abd1a099731bc59d4005ca2ba7716a57d31ddc0b6e0f17a9f75910160405180910390a161136b8184612e14565b6040518181527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a150505050565b8273ffffffffffffffffffffffffffffffffffffffff811633146113cb576113cb336124f1565b610e9e848484612edd565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260106020526040902054611488576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201527f73686172657300000000000000000000000000000000000000000000000000006064820152608401610ba0565b60006114948383611e99565b905080600003611526576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201527f647565207061796d656e740000000000000000000000000000000000000000006064820152608401610ba0565b73ffffffffffffffffffffffffffffffffffffffff83166000908152601360205260408120805483929061155b908490615479565b909155505073ffffffffffffffffffffffffffffffffffffffff80841660009081526014602090815260408083209386168352929052208054820190556115a3838383612ef8565b6040805173ffffffffffffffffffffffffffffffffffffffff8481168252602082018490528516917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a2505050565b601e8054611608906153fd565b80601f0160208091040260200160405190810160405280929190818152602001828054611634906153fd565b80156116815780601f1061165657610100808354040283529160200191611681565b820191906000526020600020905b81548152906001019060200180831161166457829003601f168201915b505050505081565b601b818154811061169957600080fd5b600091825260209091200154905081565b60006116b5600b5490565b8210611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610ba0565b600b82815481106117565761175661558d565b90600052602060002001549050919050565b61177061226c565b601f55565b601b5460609060008167ffffffffffffffff81111561179657611796615100565b6040519080825280602002602001820160405280156117bf578160200160208202803683370190505b50905060005b8281101561181857601b81815481106117e0576117e061558d565b90600052602060002001548282815181106117fd576117fd61558d565b6020908102919091010152611811816155bc565b90506117c5565b5092915050565b60008181526004602052604081205473ffffffffffffffffffffffffffffffffffffffff1680610a64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610ba0565b600073ffffffffffffffffffffffffffffffffffffffff8216611950576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610ba0565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526005602052604090205490565b61198161226c565b61198b6000612f85565b565b61199561226c565b601c5460ff1615611a02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4d657461646174612066726f7a656e00000000000000000000000000000000006044820152606401610ba0565b828114611a6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f417272617973206e65656420746f2062652073616d652073697a6500000000006044820152606401610ba0565b60005b83811015611b5357611af0858583818110611a8b57611a8b61558d565b90506020020135848484818110611aa457611aa461558d565b9050602002810190611ab691906155f4565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612e1492505050565b7ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7858583818110611b2357611b2361558d565b90506020020135604051611b3991815260200190565b60405180910390a180611b4b816155bc565b915050611a6e565b5050505050565b600060128281548110611b6f57611b6f61558d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1692915050565b611b9f61226c565b6000611bc060175473ffffffffffffffffffffffffffffffffffffffff1690565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290915073ffffffffffffffffffffffffffffffffffffffff82169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015611c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5b9190615659565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044016020604051808303816000875af1158015611ccb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cef9190615672565b610c7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e61626c6520746f207472616e7366657200000000000000000000000000006044820152606401610ba0565b606060038054610a8f906153fd565b6000601f54421015611d9457601b600081548110611d8457611d8461558d565b9060005260206000200154905090565b6000610258601f5442611da7919061568f565b611db19190615579565b601b54909150600090821015611dc75781611dd6565b601b54611dd69060019061568f565b9050601b8181548110611deb57611deb61558d565b90600052602060002001549250505090565b81611e07816124f1565b610b5a8383612ffc565b600080611e1d600f5490565b611e279047615479565b9050611e5f8382611e5a8673ffffffffffffffffffffffffffffffffffffffff1660009081526011602052604090205490565b613007565b9392505050565b8373ffffffffffffffffffffffffffffffffffffffff81163314611e8d57611e8d336124f1565b611b5385858585613052565b73ffffffffffffffffffffffffffffffffffffffff821660009081526013602052604081205481906040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015611f2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4f9190615659565b611f599190615479565b73ffffffffffffffffffffffffffffffffffffffff808616600090815260146020908152604080832093881683529290522054909150611f9c9084908390613007565b949350505050565b6060610a64826130f4565b611fb761226c565b602155565b611fc461226c565b601c5460ff1615612031576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d6574616461746120616c72656164792066726f7a656e0000000000000000006044820152606401610ba0565b601c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091555b600b548111610c7b57807fa109ba539900bf1b633f956d63c96fc89b814c7287f7aa50a9216d0b5565720761209483611fa4565b6040516120a19190615003565b60405180910390a26120b2816155bc565b9050612060565b6120c161226c565b73ffffffffffffffffffffffffffffffffffffffff8116612164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610ba0565b610c7b81612f85565b61217561226c565b61014d612181600b5490565b106121ba576040517f519c7e2c000000000000000000000000000000000000000000000000000000008152306004820152602401610ba0565b601c54610100900460ff161561222c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4f6e6c79206f6e65207072656d696e7420697320616c6c6f77656400000000006044820152606401610ba0565b601c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055610c7b8161277d565b6000610a64826131fc565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461198b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba0565b6127106bffffffffffffffffffffffff8216111561238d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610ba0565b73ffffffffffffffffffffffffffffffffffffffff821661240a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610ba0565b6040805180820190915273ffffffffffffffffffffffffffffffffffffffff9092168083526bffffffffffffffffffffffff90911660209092018290527401000000000000000000000000000000000000000090910217600055565b60008181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16610c7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610ba0565b6daaeb6d7670e522a718067333cd4e3b15610c7b576040517fc617113400000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a89190615672565b610c7b576040517fede71dcc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610ba0565b60006126018261181f565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036126be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610ba0565b3373ffffffffffffffffffffffffffffffffffffffff821614806126e757506126e781336109de565b612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610ba0565b610b5a8383613252565b61278981601d546132f2565b612795601d5482610ea4565b5061282c601d54601e80546127a9906153fd565b80601f01602080910402602001604051908101604052809291908181526020018280546127d5906153fd565b80156128225780601f106127f757610100808354040283529160200191612822565b820191906000526020600020905b81548152906001019060200180831161280557829003601f168201915b5050505050612e14565b601d6000815461283b906155bc565b9091555050565b804710156128ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610ba0565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114612906576040519150601f19603f3d011682016040523d82523d6000602084013e61290b565b606091505b5050905080610b5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610ba0565b6129a6338261330c565b612a32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610ba0565b610b5a8383836133cb565b612a7b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b612ab96040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b612ac5818686866136d3565b95945050505050565b60606000612adb8361376b565b600101905060008167ffffffffffffffff811115612afb57612afb615100565b6040519080825280601f01601f191660200182016040528015612b25576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084612b2f57509392505050565b60606000612b9b836002615533565b612ba6906002615479565b67ffffffffffffffff811115612bbe57612bbe615100565b6040519080825280601f01601f191660200182016040528015612be8576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612c1f57612c1f61558d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612c8257612c8261558d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612cbe846002615533565b612cc9906001615479565b90505b6001811115612d66577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612d0a57612d0a61558d565b1a60f81b828281518110612d2057612d2061558d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612d5f816156a2565b9050612ccc565b508315611e5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba0565b6080830151612dde908361384d565b6080830151610b5a908261384d565b601854600090611e5f9073ffffffffffffffffffffffffffffffffffffffff168484613864565b60008281526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16612ec5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201527f6578697374656e7420746f6b656e0000000000000000000000000000000000006064820152608401610ba0565b6000828152600860205260409020610b5a8282615725565b610b5a83838360405180602001604052806000815250611e66565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610b5a90849061395b565b600d805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610a7c338383613a67565b600e5473ffffffffffffffffffffffffffffffffffffffff84166000908152601060205260408120549091839161303e9086615533565b6130489190615579565b611f9c919061568f565b61305c338361330c565b6130e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610ba0565b610e9e84848484613b94565b60606130ff82612466565b60008281526008602052604081208054613118906153fd565b80601f0160208091040260200160405190810160405280929190818152602001828054613144906153fd565b80156131915780601f1061316657610100808354040283529160200191613191565b820191906000526020600020905b81548152906001019060200180831161317457829003601f168201915b5050505050905060006131af60408051602081019091526000815290565b905080516000036131c1575092915050565b8151156131f35780826040516020016131db92919061583f565b60405160208183030381529060405292505050919050565b611f9c84613c37565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d63000000000000000000000000000000000000000000000000000000001480610a645750610a6482613caa565b600081815260066020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915581906132ac8261181f565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b610a7c828260405180602001604052806000815250613d4c565b6000806133188361181f565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480613386575073ffffffffffffffffffffffffffffffffffffffff80821660009081526007602090815260408083209388168352929052205460ff165b80611f9c57508373ffffffffffffffffffffffffffffffffffffffff166133ac84610b12565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b8273ffffffffffffffffffffffffffffffffffffffff166133eb8261181f565b73ffffffffffffffffffffffffffffffffffffffff161461348e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610ba0565b73ffffffffffffffffffffffffffffffffffffffff8216613530576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610ba0565b61353d8383836001613def565b8273ffffffffffffffffffffffffffffffffffffffff1661355d8261181f565b73ffffffffffffffffffffffffffffffffffffffff1614613600576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610ba0565b600081815260066020908152604080832080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690915573ffffffffffffffffffffffffffffffffffffffff8781168086526005855283862080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905590871680865283862080546001019055868652600490945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6137116040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b6137218560800151610100613dfb565b505091835273ffffffffffffffffffffffffffffffffffffffff1660208301527fffffffff0000000000000000000000000000000000000000000000000000000016604082015290565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106137b4577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106137e0576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106137fe57662386f26fc10000830492506010015b6305f5e1008310613816576305f5e100830492506008015b612710831061382a57612710830492506004015b6064831061383c576064830492506002015b600a8310610a645760010192915050565b61385a8260038351613e60565b610b5a8282613f6f565b601954600090613875816001615479565b601955835160408086015160808701515191516000937f4042994600000000000000000000000000000000000000000000000000000000936138c69386938493923092918a9160019160240161586e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152905061395186838684613f96565b9695505050505050565b60006139bd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166141a49092919063ffffffff16565b805190915015610b5a57808060200190518101906139db9190615672565b610b5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610ba0565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603613afc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610ba0565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526007602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613b9f8484846133cb565b613bab848484846141b3565b610e9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610ba0565b6060613c4282612466565b6000613c5960408051602081019091526000815290565b90506000815111613c795760405180602001604052806000815250611e5f565b80613c8384612ace565b604051602001613c9492919061583f565b6040516020818303038152906040529392505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480613d3d57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610a645750610a64826143a3565b613d56838361443a565b613d6360008484846141b3565b610b5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610ba0565b610e9e8484848461466d565b604080518082019091526060815260006020820152613e1b6020836158f7565b15613e4357613e2b6020836158f7565b613e3690602061568f565b613e409083615479565b91505b506020828101829052604080518085526000815290920101905290565b60178167ffffffffffffffff1611613e8557610e9e8360e0600585901b168317614816565b60ff8167ffffffffffffffff1611613ec357613eac836018611fe0600586901b1617614816565b50610e9e8367ffffffffffffffff8316600161483b565b61ffff8167ffffffffffffffff1611613f0257613eeb836019611fe0600586901b1617614816565b50610e9e8367ffffffffffffffff8316600261483b565b63ffffffff8167ffffffffffffffff1611613f4357613f2c83601a611fe0600586901b1617614816565b50610e9e8367ffffffffffffffff8316600461483b565b613f5883601b611fe0600586901b1617614816565b50610e9e8367ffffffffffffffff8316600861483b565b604080518082019091526060815260006020820152611e5f83846000015151848551614861565b6040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b16602082015260348101849052600090605401604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815282825280516020918201206000818152601a90925291812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a26017546040517f4000aea000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690634000aea0906140d59088908790879060040161590b565b6020604051808303816000875af11580156140f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141189190615672565b611f9c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f726160448201527f636c6500000000000000000000000000000000000000000000000000000000006064820152608401610ba0565b6060611f9c8484600085614969565b600073ffffffffffffffffffffffffffffffffffffffff84163b1561439b576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a029061422a903390899088908890600401615940565b6020604051808303816000875af1925050508015614283575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526142809181019061597f565b60015b614350573d8080156142b1576040519150601f19603f3d011682016040523d82523d6000602084013e6142b6565b606091505b508051600003614348576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610ba0565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611f9c565b506001611f9c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a000000000000000000000000000000000000000000000000000000001480610a6457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610a64565b73ffffffffffffffffffffffffffffffffffffffff82166144b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610ba0565b60008181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1615614543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610ba0565b614551600083836001613def565b60008181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16156145dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610ba0565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260056020908152604080832080546001019055848352600490915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b61467984848484614a82565b600181111561470a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e736563757469766520747260448201527f616e7366657273206e6f7420737570706f7274656400000000000000000000006064820152608401610ba0565b8173ffffffffffffffffffffffffffffffffffffffff85166147735761476e81600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b6147b0565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16146147b0576147b08582614b3e565b73ffffffffffffffffffffffffffffffffffffffff84166147d9576147d481614bf5565b611b53565b8473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614611b5357611b538482614ca4565b604080518082019091526060815260006020820152611e5f8384600001515184614cf5565b604080518082019091526060815260006020820152611f9c848560000151518585614d50565b604080518082019091526060815260006020820152825182111561488457600080fd5b60208501516148938386615479565b11156148c6576148c6856148b6876020015187866148b19190615479565b614dd1565b6148c1906002615533565b614de8565b6000808651805187602083010193508088870111156148e55787860182525b505050602084015b602084106149255780518252614904602083615479565b9150614911602082615479565b905061491e60208561568f565b93506148ed565b5181517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60208690036101000a019081169019919091161790525083949350505050565b6060824710156149fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610ba0565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051614a24919061599c565b60006040518083038185875af1925050503d8060008114614a61576040519150601f19603f3d011682016040523d82523d6000602084013e614a66565b606091505b5091509150614a7787838387614dff565b979650505050505050565b6001811115610e9e5773ffffffffffffffffffffffffffffffffffffffff841615614ae25773ffffffffffffffffffffffffffffffffffffffff841660009081526005602052604081208054839290614adc90849061568f565b90915550505b73ffffffffffffffffffffffffffffffffffffffff831615610e9e5773ffffffffffffffffffffffffffffffffffffffff831660009081526005602052604081208054839290614b33908490615479565b909155505050505050565b60006001614b4b846118ab565b614b55919061568f565b6000838152600a6020526040902054909150808214614bb55773ffffffffffffffffffffffffffffffffffffffff841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a6020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600981528383209183525290812055565b600b54600090614c079060019061568f565b6000838152600c6020526040812054600b8054939450909284908110614c2f57614c2f61558d565b9060005260206000200154905080600b8381548110614c5057614c5061558d565b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b805480614c8857614c886159b8565b6001900381819060005260206000200160009055905550505050565b6000614caf836118ab565b73ffffffffffffffffffffffffffffffffffffffff90931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b60408051808201909152606081526000602082015283602001518310614d2a57614d2a84856020015160026148c19190615533565b8351805160208583010184815350808503614d46576001810182525b5093949350505050565b6040805180820190915260608152600060208201526020850151614d748584615479565b1115614d8857614d88856148b68685615479565b60006001614d9884610100615b07565b614da2919061568f565b9050855183868201018583198251161781525080518487011115614dc65783860181525b509495945050505050565b600081831115614de2575081610a64565b50919050565b8151614df48383613dfb565b50610e9e8382613f6f565b60608315614e95578251600003614e8e5773ffffffffffffffffffffffffffffffffffffffff85163b614e8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ba0565b5081611f9c565b611f9c8383815115614eaa5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba09190615003565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610c7b57600080fd5b600060208284031215614f1e57600080fd5b8135611e5f81614ede565b73ffffffffffffffffffffffffffffffffffffffff81168114610c7b57600080fd5b60008060408385031215614f5e57600080fd5b8235614f6981614f29565b915060208301356bffffffffffffffffffffffff81168114614f8a57600080fd5b809150509250929050565b60005b83811015614fb0578181015183820152602001614f98565b50506000910152565b60008151808452614fd1816020860160208601614f95565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611e5f6020830184614fb9565b60006020828403121561502857600080fd5b5035919050565b6000806040838503121561504257600080fd5b823561504d81614f29565b946020939093013593505050565b60006020828403121561506d57600080fd5b8135611e5f81614f29565b60008060006060848603121561508d57600080fd5b833561509881614f29565b925060208401356150a881614f29565b929592945050506040919091013590565b600080604083850312156150cc57600080fd5b823591506020830135614f8a81614f29565b600080604083850312156150f157600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff8084111561514a5761514a615100565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561519057615190615100565b816040528093508581528686860111156151a957600080fd5b858560208301376000602087830101525050509392505050565b600080604083850312156151d657600080fd5b82359150602083013567ffffffffffffffff8111156151f457600080fd5b8301601f8101851361520557600080fd5b6152148582356020840161512f565b9150509250929050565b6000806040838503121561523157600080fd5b823561523c81614f29565b91506020830135614f8a81614f29565b6020808252825182820181905260009190848201906040850190845b8181101561528457835183529284019291840191600101615268565b50909695505050505050565b60008083601f8401126152a257600080fd5b50813567ffffffffffffffff8111156152ba57600080fd5b6020830191508360208260051b850101111561113857600080fd5b600080600080604085870312156152eb57600080fd5b843567ffffffffffffffff8082111561530357600080fd5b61530f88838901615290565b9096509450602087013591508082111561532857600080fd5b5061533587828801615290565b95989497509550505050565b8015158114610c7b57600080fd5b6000806040838503121561536257600080fd5b823561536d81614f29565b91506020830135614f8a81615341565b6000806000806080858703121561539357600080fd5b843561539e81614f29565b935060208501356153ae81614f29565b925060408501359150606085013567ffffffffffffffff8111156153d157600080fd5b8501601f810187136153e257600080fd5b6153f18782356020840161512f565b91505092959194509250565b600181811c9082168061541157607f821691505b602082108103614de2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610a6457610a6461544a565b7f68747470733a2f2f7777772e737461626c652d64696c7574696f6e2e6172742f81527f6e66742f6974656d2f67656e65726174696f6e2f362f000000000000000000006020820152600083516154ea816036850160208801614f95565b7f2f000000000000000000000000000000000000000000000000000000000000006036918401918201528351615527816037840160208801614f95565b01603701949350505050565b8082028115828204841417610a6457610a6461544a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826155885761558861554a565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036155ed576155ed61544a565b5060010190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261562957600080fd5b83018035915067ffffffffffffffff82111561564457600080fd5b60200191503681900382131561113857600080fd5b60006020828403121561566b57600080fd5b5051919050565b60006020828403121561568457600080fd5b8151611e5f81615341565b81810381811115610a6457610a6461544a565b6000816156b1576156b161544a565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b601f821115610b5a57600081815260208120601f850160051c810160208610156156fe5750805b601f850160051c820191505b8181101561571d5782815560010161570a565b505050505050565b815167ffffffffffffffff81111561573f5761573f615100565b6157538161574d84546153fd565b846156d7565b602080601f8311600181146157a657600084156157705750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561571d565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156157f3578886015182559484019460019091019084016157d4565b508582101561582f57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60008351615851818460208801614f95565b835190830190615865818360208801614f95565b01949350505050565b600061010073ffffffffffffffffffffffffffffffffffffffff808c1684528a60208501528960408501528089166060850152507fffffffff00000000000000000000000000000000000000000000000000000000871660808401528560a08401528460c08401528060e08401526158e881840185614fb9565b9b9a5050505050505050505050565b6000826159065761590661554a565b500690565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201526000612ac56060830184614fb9565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526139516080830184614fb9565b60006020828403121561599157600080fd5b8151611e5f81614ede565b600082516159ae818460208701614f95565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600181815b80851115615a4057817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615a2657615a2661544a565b80851615615a3357918102915b93841c93908002906159ec565b509250929050565b600082615a5757506001610a64565b81615a6457506000610a64565b8160018114615a7a5760028114615a8457615aa0565b6001915050610a64565b60ff841115615a9557615a9561544a565b50506001821b610a64565b5060208310610133831016604e8410600b8410161715615ac3575081810a610a64565b615acd83836159e7565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615aff57615aff61544a565b029392505050565b6000611e5f8383615a4856fea26469706673582212209b4141bfe99f780d998c8ec76e63defafca80152b71638635ba888d87c1995b564736f6c63430008110033000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000643ecc90000000000000000000000000f50ac39c3c3bd062de4e47fcf8f3f9d37b94874a00000000000000000000000000000000000000000000000000000000000002ee000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca0000000000000000000000001db329cde457d68b872766f4e12f9532bca9149b38376131613564396239333634386635613966633930666538303336383561350000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000000000000000010416c676f7269746d6f20446976696e6f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000344564e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f68747470733a2f2f617277656176652e6e65742f63617a496d6b4478466a796b664b316c49556171434a5036762d794f704c5f4847534873724e346d663734000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000f50ac39c3c3bd062de4e47fcf8f3f9d37b94874a000000000000000000000000685e34c6a94f330fa494d708b652261140b55aba000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000032
Deployed Bytecode
0x6080604052600436106103225760003560e01c806354d44968116101a5578063a22cb465116100ec578063ce7c2ac211610095578063e33b7de31161006f578063e33b7de3146109ae578063e985e9c5146109c3578063f2fde38b14610a19578063fd955ed914610a3957600080fd5b8063ce7c2ac214610913578063d111515d14610956578063d79779b21461096b57600080fd5b8063c45ac050116100c6578063c45ac050146108b3578063c87b56dd146108d3578063cd8ff657146108f357600080fd5b8063a22cb46514610853578063a3f8eace14610873578063b88d4fde1461089357600080fd5b80638b83209b1161014e57806395d89b411161012857806395d89b41146107e65780639852595c146107fb5780639d1b464a1461083e57600080fd5b80638b83209b146107865780638da5cb5b146107a65780638dc654a2146107d157600080fd5b806370a082311161017f57806370a0823114610731578063715018a6146107515780637fad2d121461076657600080fd5b806354d44968146106d9578063577f6198146106ef5780636352211e1461071157600080fd5b80632f745c591161026957806342842e0e116102125780634db331e5116101ec5780634db331e5146106795780634f6ccce714610699578063525f8a5c146106b957600080fd5b806342842e0e1461062457806348b75044146106445780634cf5f7a41461066457600080fd5b80633a98ef39116102435780633a98ef391461059a578063406072a9146105af57806341f434341461060257600080fd5b80632f745c591461054457806332cb6b0c14610564578063374419961461057a57600080fd5b806318160ddd116102cb57806323b872dd116102a557806323b872dd146104b8578063240eecb7146104d85780632a55205a146104f857600080fd5b806318160ddd1461046357806319165587146104825780631cbaee2d146104a257600080fd5b8063081812fc116102fc578063081812fc146103f6578063095ea7b31461043b5780631249c58b1461045b57600080fd5b806301ffc9a71461037d57806304634d8d146103b257806306fdde03146103d457600080fd5b36610378577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be770336040805173ffffffffffffffffffffffffffffffffffffffff90921682523460208301520160405180910390a1005b600080fd5b34801561038957600080fd5b5061039d610398366004614f0c565b610a59565b60405190151581526020015b60405180910390f35b3480156103be57600080fd5b506103d26103cd366004614f4b565b610a6a565b005b3480156103e057600080fd5b506103e9610a80565b6040516103a99190615003565b34801561040257600080fd5b50610416610411366004615016565b610b12565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103a9565b34801561044757600080fd5b506103d261045636600461502f565b610b46565b6103d2610b5f565b34801561046f57600080fd5b50600b545b6040519081526020016103a9565b34801561048e57600080fd5b506103d261049d36600461505b565b610c7e565b3480156104ae57600080fd5b50610474601f5481565b3480156104c457600080fd5b506103d26104d3366004615078565b610e6c565b3480156104e457600080fd5b506104746104f33660046150b9565b610ea4565b34801561050457600080fd5b506105186105133660046150de565b611046565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016103a9565b34801561055057600080fd5b5061047461055f36600461502f565b61113f565b34801561057057600080fd5b5061047461014d81565b34801561058657600080fd5b506103d26105953660046151c3565b61120e565b3480156105a657600080fd5b50600e54610474565b3480156105bb57600080fd5b506104746105ca36600461521e565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260146020908152604080832093909416825291909152205490565b34801561060e57600080fd5b506104166daaeb6d7670e522a718067333cd4e81565b34801561063057600080fd5b506103d261063f366004615078565b6113a4565b34801561065057600080fd5b506103d261065f36600461521e565b6113d6565b34801561067057600080fd5b506103e96115fb565b34801561068557600080fd5b50610474610694366004615016565b611689565b3480156106a557600080fd5b506104746106b4366004615016565b6116aa565b3480156106c557600080fd5b506103d26106d4366004615016565b611768565b3480156106e557600080fd5b5061047461025881565b3480156106fb57600080fd5b50610704611775565b6040516103a9919061524c565b34801561071d57600080fd5b5061041661072c366004615016565b61181f565b34801561073d57600080fd5b5061047461074c36600461505b565b6118ab565b34801561075d57600080fd5b506103d2611979565b34801561077257600080fd5b506103d26107813660046152d5565b61198d565b34801561079257600080fd5b506104166107a1366004615016565b611b5a565b3480156107b257600080fd5b50600d5473ffffffffffffffffffffffffffffffffffffffff16610416565b3480156107dd57600080fd5b506103d2611b97565b3480156107f257600080fd5b506103e9611d55565b34801561080757600080fd5b5061047461081636600461505b565b73ffffffffffffffffffffffffffffffffffffffff1660009081526011602052604090205490565b34801561084a57600080fd5b50610474611d64565b34801561085f57600080fd5b506103d261086e36600461534f565b611dfd565b34801561087f57600080fd5b5061047461088e36600461505b565b611e11565b34801561089f57600080fd5b506103d26108ae36600461537d565b611e66565b3480156108bf57600080fd5b506104746108ce36600461521e565b611e99565b3480156108df57600080fd5b506103e96108ee366004615016565b611fa4565b3480156108ff57600080fd5b506103d261090e366004615016565b611faf565b34801561091f57600080fd5b5061047461092e36600461505b565b73ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205490565b34801561096257600080fd5b506103d2611fbc565b34801561097757600080fd5b5061047461098636600461505b565b73ffffffffffffffffffffffffffffffffffffffff1660009081526013602052604090205490565b3480156109ba57600080fd5b50600f54610474565b3480156109cf57600080fd5b5061039d6109de36600461521e565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a2557600080fd5b506103d2610a3436600461505b565b6120b9565b348015610a4557600080fd5b506103d2610a5436600461505b565b61216d565b6000610a6482612261565b92915050565b610a7261226c565b610a7c82826122ed565b5050565b606060028054610a8f906153fd565b80601f0160208091040260200160405190810160405280929190818152602001828054610abb906153fd565b8015610b085780601f10610add57610100808354040283529160200191610b08565b820191906000526020600020905b815481529060010190602001808311610aeb57829003601f168201915b5050505050905090565b6000610b1d82612466565b5060009081526006602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b81610b50816124f1565b610b5a83836125f6565b505050565b61014d610b6b600b5490565b10610ba9576040517f519c7e2c0000000000000000000000000000000000000000000000000000000081523060048201526024015b60405180910390fd5b601f54421015610be7576040517fc9bbd13b000000000000000000000000000000000000000000000000000000008152306004820152602401610ba0565b6000610bf1611d64565b9050803414610c2e576040517fcd215006000000000000000000000000000000000000000000000000000000008152306004820152602401610ba0565b601d5460405133917fbac9694ac0daa55169abd117086fe32c89401d9a3b15dd1d34e55e0aa4e47a9d91610c6a91858252602082015260400190565b60405180910390a2610c7b3361277d565b50565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260106020526040902054610d30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201527f73686172657300000000000000000000000000000000000000000000000000006064820152608401610ba0565b6000610d3b82611e11565b905080600003610dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201527f647565207061796d656e740000000000000000000000000000000000000000006064820152608401610ba0565b80600f6000828254610ddf9190615479565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000908152601160205260409020805482019055610e198282612842565b6040805173ffffffffffffffffffffffffffffffffffffffff84168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a15050565b8273ffffffffffffffffffffffffffffffffffffffff81163314610e9357610e93336124f1565b610e9e84848461299c565b50505050565b60007f789bf7f3b2714c765ae963ccabd7c22556e02c73d0d35b16831c16e0cd6cee5383604051610ed791815260200190565b60405180910390a16000610ef560205430633744199660e01b612a3d565b9050610fa16040518060400160405280600381526020017f6765740000000000000000000000000000000000000000000000000000000000815250610f3986612ace565b610f5a8673ffffffffffffffffffffffffffffffffffffffff166014612b8c565b604051602001610f6b92919061548c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052839190612dcf565b6110206040518060400160405280600481526020017f70617468000000000000000000000000000000000000000000000000000000008152506040518060400160405280600b81526020017f6d6574616461746155726c00000000000000000000000000000000000000000081525083612dcf9092919063ffffffff16565b61102c81602154612ded565b600081815260226020526040902094909455509192915050565b600082815260016020908152604080832081518083019092525473ffffffffffffffffffffffffffffffffffffffff8116808352740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff1692820192909252829161110157506040805180820190915260005473ffffffffffffffffffffffffffffffffffffffff811682527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208201525b602081015160009061271090611125906bffffffffffffffffffffffff1687615533565b61112f9190615579565b91519350909150505b9250929050565b600061114a836118ab565b82106111d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610ba0565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600960209081526040808320938352929052205490565b6000828152601a6020526040902054829073ffffffffffffffffffffffffffffffffffffffff1633146112c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f536f75726365206d75737420626520746865206f7261636c65206f662074686560448201527f20726571756573740000000000000000000000000000000000000000000000006064820152608401610ba0565b6000818152601a602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a26000838152602260209081526040918290205491518281527f9b9df81562460abd1a099731bc59d4005ca2ba7716a57d31ddc0b6e0f17a9f75910160405180910390a161136b8184612e14565b6040518181527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a150505050565b8273ffffffffffffffffffffffffffffffffffffffff811633146113cb576113cb336124f1565b610e9e848484612edd565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260106020526040902054611488576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201527f73686172657300000000000000000000000000000000000000000000000000006064820152608401610ba0565b60006114948383611e99565b905080600003611526576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201527f647565207061796d656e740000000000000000000000000000000000000000006064820152608401610ba0565b73ffffffffffffffffffffffffffffffffffffffff83166000908152601360205260408120805483929061155b908490615479565b909155505073ffffffffffffffffffffffffffffffffffffffff80841660009081526014602090815260408083209386168352929052208054820190556115a3838383612ef8565b6040805173ffffffffffffffffffffffffffffffffffffffff8481168252602082018490528516917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a2505050565b601e8054611608906153fd565b80601f0160208091040260200160405190810160405280929190818152602001828054611634906153fd565b80156116815780601f1061165657610100808354040283529160200191611681565b820191906000526020600020905b81548152906001019060200180831161166457829003601f168201915b505050505081565b601b818154811061169957600080fd5b600091825260209091200154905081565b60006116b5600b5490565b8210611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610ba0565b600b82815481106117565761175661558d565b90600052602060002001549050919050565b61177061226c565b601f55565b601b5460609060008167ffffffffffffffff81111561179657611796615100565b6040519080825280602002602001820160405280156117bf578160200160208202803683370190505b50905060005b8281101561181857601b81815481106117e0576117e061558d565b90600052602060002001548282815181106117fd576117fd61558d565b6020908102919091010152611811816155bc565b90506117c5565b5092915050565b60008181526004602052604081205473ffffffffffffffffffffffffffffffffffffffff1680610a64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610ba0565b600073ffffffffffffffffffffffffffffffffffffffff8216611950576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610ba0565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526005602052604090205490565b61198161226c565b61198b6000612f85565b565b61199561226c565b601c5460ff1615611a02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4d657461646174612066726f7a656e00000000000000000000000000000000006044820152606401610ba0565b828114611a6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f417272617973206e65656420746f2062652073616d652073697a6500000000006044820152606401610ba0565b60005b83811015611b5357611af0858583818110611a8b57611a8b61558d565b90506020020135848484818110611aa457611aa461558d565b9050602002810190611ab691906155f4565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612e1492505050565b7ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7858583818110611b2357611b2361558d565b90506020020135604051611b3991815260200190565b60405180910390a180611b4b816155bc565b915050611a6e565b5050505050565b600060128281548110611b6f57611b6f61558d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1692915050565b611b9f61226c565b6000611bc060175473ffffffffffffffffffffffffffffffffffffffff1690565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290915073ffffffffffffffffffffffffffffffffffffffff82169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015611c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5b9190615659565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044016020604051808303816000875af1158015611ccb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cef9190615672565b610c7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e61626c6520746f207472616e7366657200000000000000000000000000006044820152606401610ba0565b606060038054610a8f906153fd565b6000601f54421015611d9457601b600081548110611d8457611d8461558d565b9060005260206000200154905090565b6000610258601f5442611da7919061568f565b611db19190615579565b601b54909150600090821015611dc75781611dd6565b601b54611dd69060019061568f565b9050601b8181548110611deb57611deb61558d565b90600052602060002001549250505090565b81611e07816124f1565b610b5a8383612ffc565b600080611e1d600f5490565b611e279047615479565b9050611e5f8382611e5a8673ffffffffffffffffffffffffffffffffffffffff1660009081526011602052604090205490565b613007565b9392505050565b8373ffffffffffffffffffffffffffffffffffffffff81163314611e8d57611e8d336124f1565b611b5385858585613052565b73ffffffffffffffffffffffffffffffffffffffff821660009081526013602052604081205481906040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015611f2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4f9190615659565b611f599190615479565b73ffffffffffffffffffffffffffffffffffffffff808616600090815260146020908152604080832093881683529290522054909150611f9c9084908390613007565b949350505050565b6060610a64826130f4565b611fb761226c565b602155565b611fc461226c565b601c5460ff1615612031576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d6574616461746120616c72656164792066726f7a656e0000000000000000006044820152606401610ba0565b601c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091555b600b548111610c7b57807fa109ba539900bf1b633f956d63c96fc89b814c7287f7aa50a9216d0b5565720761209483611fa4565b6040516120a19190615003565b60405180910390a26120b2816155bc565b9050612060565b6120c161226c565b73ffffffffffffffffffffffffffffffffffffffff8116612164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610ba0565b610c7b81612f85565b61217561226c565b61014d612181600b5490565b106121ba576040517f519c7e2c000000000000000000000000000000000000000000000000000000008152306004820152602401610ba0565b601c54610100900460ff161561222c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4f6e6c79206f6e65207072656d696e7420697320616c6c6f77656400000000006044820152606401610ba0565b601c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055610c7b8161277d565b6000610a64826131fc565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461198b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ba0565b6127106bffffffffffffffffffffffff8216111561238d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610ba0565b73ffffffffffffffffffffffffffffffffffffffff821661240a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610ba0565b6040805180820190915273ffffffffffffffffffffffffffffffffffffffff9092168083526bffffffffffffffffffffffff90911660209092018290527401000000000000000000000000000000000000000090910217600055565b60008181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16610c7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610ba0565b6daaeb6d7670e522a718067333cd4e3b15610c7b576040517fc617113400000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a89190615672565b610c7b576040517fede71dcc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610ba0565b60006126018261181f565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036126be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610ba0565b3373ffffffffffffffffffffffffffffffffffffffff821614806126e757506126e781336109de565b612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610ba0565b610b5a8383613252565b61278981601d546132f2565b612795601d5482610ea4565b5061282c601d54601e80546127a9906153fd565b80601f01602080910402602001604051908101604052809291908181526020018280546127d5906153fd565b80156128225780601f106127f757610100808354040283529160200191612822565b820191906000526020600020905b81548152906001019060200180831161280557829003601f168201915b5050505050612e14565b601d6000815461283b906155bc565b9091555050565b804710156128ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610ba0565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114612906576040519150601f19603f3d011682016040523d82523d6000602084013e61290b565b606091505b5050905080610b5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610ba0565b6129a6338261330c565b612a32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610ba0565b610b5a8383836133cb565b612a7b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b612ab96040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b612ac5818686866136d3565b95945050505050565b60606000612adb8361376b565b600101905060008167ffffffffffffffff811115612afb57612afb615100565b6040519080825280601f01601f191660200182016040528015612b25576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084612b2f57509392505050565b60606000612b9b836002615533565b612ba6906002615479565b67ffffffffffffffff811115612bbe57612bbe615100565b6040519080825280601f01601f191660200182016040528015612be8576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612c1f57612c1f61558d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612c8257612c8261558d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612cbe846002615533565b612cc9906001615479565b90505b6001811115612d66577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612d0a57612d0a61558d565b1a60f81b828281518110612d2057612d2061558d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612d5f816156a2565b9050612ccc565b508315611e5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba0565b6080830151612dde908361384d565b6080830151610b5a908261384d565b601854600090611e5f9073ffffffffffffffffffffffffffffffffffffffff168484613864565b60008281526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16612ec5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201527f6578697374656e7420746f6b656e0000000000000000000000000000000000006064820152608401610ba0565b6000828152600860205260409020610b5a8282615725565b610b5a83838360405180602001604052806000815250611e66565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610b5a90849061395b565b600d805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610a7c338383613a67565b600e5473ffffffffffffffffffffffffffffffffffffffff84166000908152601060205260408120549091839161303e9086615533565b6130489190615579565b611f9c919061568f565b61305c338361330c565b6130e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608401610ba0565b610e9e84848484613b94565b60606130ff82612466565b60008281526008602052604081208054613118906153fd565b80601f0160208091040260200160405190810160405280929190818152602001828054613144906153fd565b80156131915780601f1061316657610100808354040283529160200191613191565b820191906000526020600020905b81548152906001019060200180831161317457829003601f168201915b5050505050905060006131af60408051602081019091526000815290565b905080516000036131c1575092915050565b8151156131f35780826040516020016131db92919061583f565b60405160208183030381529060405292505050919050565b611f9c84613c37565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d63000000000000000000000000000000000000000000000000000000001480610a645750610a6482613caa565b600081815260066020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915581906132ac8261181f565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b610a7c828260405180602001604052806000815250613d4c565b6000806133188361181f565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480613386575073ffffffffffffffffffffffffffffffffffffffff80821660009081526007602090815260408083209388168352929052205460ff165b80611f9c57508373ffffffffffffffffffffffffffffffffffffffff166133ac84610b12565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b8273ffffffffffffffffffffffffffffffffffffffff166133eb8261181f565b73ffffffffffffffffffffffffffffffffffffffff161461348e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610ba0565b73ffffffffffffffffffffffffffffffffffffffff8216613530576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610ba0565b61353d8383836001613def565b8273ffffffffffffffffffffffffffffffffffffffff1661355d8261181f565b73ffffffffffffffffffffffffffffffffffffffff1614613600576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610ba0565b600081815260066020908152604080832080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690915573ffffffffffffffffffffffffffffffffffffffff8781168086526005855283862080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905590871680865283862080546001019055868652600490945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6137116040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b6137218560800151610100613dfb565b505091835273ffffffffffffffffffffffffffffffffffffffff1660208301527fffffffff0000000000000000000000000000000000000000000000000000000016604082015290565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106137b4577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106137e0576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106137fe57662386f26fc10000830492506010015b6305f5e1008310613816576305f5e100830492506008015b612710831061382a57612710830492506004015b6064831061383c576064830492506002015b600a8310610a645760010192915050565b61385a8260038351613e60565b610b5a8282613f6f565b601954600090613875816001615479565b601955835160408086015160808701515191516000937f4042994600000000000000000000000000000000000000000000000000000000936138c69386938493923092918a9160019160240161586e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152905061395186838684613f96565b9695505050505050565b60006139bd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166141a49092919063ffffffff16565b805190915015610b5a57808060200190518101906139db9190615672565b610b5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610ba0565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603613afc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610ba0565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526007602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613b9f8484846133cb565b613bab848484846141b3565b610e9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610ba0565b6060613c4282612466565b6000613c5960408051602081019091526000815290565b90506000815111613c795760405180602001604052806000815250611e5f565b80613c8384612ace565b604051602001613c9492919061583f565b6040516020818303038152906040529392505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480613d3d57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610a645750610a64826143a3565b613d56838361443a565b613d6360008484846141b3565b610b5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610ba0565b610e9e8484848461466d565b604080518082019091526060815260006020820152613e1b6020836158f7565b15613e4357613e2b6020836158f7565b613e3690602061568f565b613e409083615479565b91505b506020828101829052604080518085526000815290920101905290565b60178167ffffffffffffffff1611613e8557610e9e8360e0600585901b168317614816565b60ff8167ffffffffffffffff1611613ec357613eac836018611fe0600586901b1617614816565b50610e9e8367ffffffffffffffff8316600161483b565b61ffff8167ffffffffffffffff1611613f0257613eeb836019611fe0600586901b1617614816565b50610e9e8367ffffffffffffffff8316600261483b565b63ffffffff8167ffffffffffffffff1611613f4357613f2c83601a611fe0600586901b1617614816565b50610e9e8367ffffffffffffffff8316600461483b565b613f5883601b611fe0600586901b1617614816565b50610e9e8367ffffffffffffffff8316600861483b565b604080518082019091526060815260006020820152611e5f83846000015151848551614861565b6040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b16602082015260348101849052600090605401604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815282825280516020918201206000818152601a90925291812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a26017546040517f4000aea000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690634000aea0906140d59088908790879060040161590b565b6020604051808303816000875af11580156140f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141189190615672565b611f9c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f726160448201527f636c6500000000000000000000000000000000000000000000000000000000006064820152608401610ba0565b6060611f9c8484600085614969565b600073ffffffffffffffffffffffffffffffffffffffff84163b1561439b576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a029061422a903390899088908890600401615940565b6020604051808303816000875af1925050508015614283575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526142809181019061597f565b60015b614350573d8080156142b1576040519150601f19603f3d011682016040523d82523d6000602084013e6142b6565b606091505b508051600003614348576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610ba0565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611f9c565b506001611f9c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a000000000000000000000000000000000000000000000000000000001480610a6457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610a64565b73ffffffffffffffffffffffffffffffffffffffff82166144b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610ba0565b60008181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1615614543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610ba0565b614551600083836001613def565b60008181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16156145dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610ba0565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260056020908152604080832080546001019055848352600490915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b61467984848484614a82565b600181111561470a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e736563757469766520747260448201527f616e7366657273206e6f7420737570706f7274656400000000000000000000006064820152608401610ba0565b8173ffffffffffffffffffffffffffffffffffffffff85166147735761476e81600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b6147b0565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16146147b0576147b08582614b3e565b73ffffffffffffffffffffffffffffffffffffffff84166147d9576147d481614bf5565b611b53565b8473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614611b5357611b538482614ca4565b604080518082019091526060815260006020820152611e5f8384600001515184614cf5565b604080518082019091526060815260006020820152611f9c848560000151518585614d50565b604080518082019091526060815260006020820152825182111561488457600080fd5b60208501516148938386615479565b11156148c6576148c6856148b6876020015187866148b19190615479565b614dd1565b6148c1906002615533565b614de8565b6000808651805187602083010193508088870111156148e55787860182525b505050602084015b602084106149255780518252614904602083615479565b9150614911602082615479565b905061491e60208561568f565b93506148ed565b5181517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60208690036101000a019081169019919091161790525083949350505050565b6060824710156149fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610ba0565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051614a24919061599c565b60006040518083038185875af1925050503d8060008114614a61576040519150601f19603f3d011682016040523d82523d6000602084013e614a66565b606091505b5091509150614a7787838387614dff565b979650505050505050565b6001811115610e9e5773ffffffffffffffffffffffffffffffffffffffff841615614ae25773ffffffffffffffffffffffffffffffffffffffff841660009081526005602052604081208054839290614adc90849061568f565b90915550505b73ffffffffffffffffffffffffffffffffffffffff831615610e9e5773ffffffffffffffffffffffffffffffffffffffff831660009081526005602052604081208054839290614b33908490615479565b909155505050505050565b60006001614b4b846118ab565b614b55919061568f565b6000838152600a6020526040902054909150808214614bb55773ffffffffffffffffffffffffffffffffffffffff841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a6020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600981528383209183525290812055565b600b54600090614c079060019061568f565b6000838152600c6020526040812054600b8054939450909284908110614c2f57614c2f61558d565b9060005260206000200154905080600b8381548110614c5057614c5061558d565b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b805480614c8857614c886159b8565b6001900381819060005260206000200160009055905550505050565b6000614caf836118ab565b73ffffffffffffffffffffffffffffffffffffffff90931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b60408051808201909152606081526000602082015283602001518310614d2a57614d2a84856020015160026148c19190615533565b8351805160208583010184815350808503614d46576001810182525b5093949350505050565b6040805180820190915260608152600060208201526020850151614d748584615479565b1115614d8857614d88856148b68685615479565b60006001614d9884610100615b07565b614da2919061568f565b9050855183868201018583198251161781525080518487011115614dc65783860181525b509495945050505050565b600081831115614de2575081610a64565b50919050565b8151614df48383613dfb565b50610e9e8382613f6f565b60608315614e95578251600003614e8e5773ffffffffffffffffffffffffffffffffffffffff85163b614e8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ba0565b5081611f9c565b611f9c8383815115614eaa5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba09190615003565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610c7b57600080fd5b600060208284031215614f1e57600080fd5b8135611e5f81614ede565b73ffffffffffffffffffffffffffffffffffffffff81168114610c7b57600080fd5b60008060408385031215614f5e57600080fd5b8235614f6981614f29565b915060208301356bffffffffffffffffffffffff81168114614f8a57600080fd5b809150509250929050565b60005b83811015614fb0578181015183820152602001614f98565b50506000910152565b60008151808452614fd1816020860160208601614f95565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611e5f6020830184614fb9565b60006020828403121561502857600080fd5b5035919050565b6000806040838503121561504257600080fd5b823561504d81614f29565b946020939093013593505050565b60006020828403121561506d57600080fd5b8135611e5f81614f29565b60008060006060848603121561508d57600080fd5b833561509881614f29565b925060208401356150a881614f29565b929592945050506040919091013590565b600080604083850312156150cc57600080fd5b823591506020830135614f8a81614f29565b600080604083850312156150f157600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff8084111561514a5761514a615100565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561519057615190615100565b816040528093508581528686860111156151a957600080fd5b858560208301376000602087830101525050509392505050565b600080604083850312156151d657600080fd5b82359150602083013567ffffffffffffffff8111156151f457600080fd5b8301601f8101851361520557600080fd5b6152148582356020840161512f565b9150509250929050565b6000806040838503121561523157600080fd5b823561523c81614f29565b91506020830135614f8a81614f29565b6020808252825182820181905260009190848201906040850190845b8181101561528457835183529284019291840191600101615268565b50909695505050505050565b60008083601f8401126152a257600080fd5b50813567ffffffffffffffff8111156152ba57600080fd5b6020830191508360208260051b850101111561113857600080fd5b600080600080604085870312156152eb57600080fd5b843567ffffffffffffffff8082111561530357600080fd5b61530f88838901615290565b9096509450602087013591508082111561532857600080fd5b5061533587828801615290565b95989497509550505050565b8015158114610c7b57600080fd5b6000806040838503121561536257600080fd5b823561536d81614f29565b91506020830135614f8a81615341565b6000806000806080858703121561539357600080fd5b843561539e81614f29565b935060208501356153ae81614f29565b925060408501359150606085013567ffffffffffffffff8111156153d157600080fd5b8501601f810187136153e257600080fd5b6153f18782356020840161512f565b91505092959194509250565b600181811c9082168061541157607f821691505b602082108103614de2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610a6457610a6461544a565b7f68747470733a2f2f7777772e737461626c652d64696c7574696f6e2e6172742f81527f6e66742f6974656d2f67656e65726174696f6e2f362f000000000000000000006020820152600083516154ea816036850160208801614f95565b7f2f000000000000000000000000000000000000000000000000000000000000006036918401918201528351615527816037840160208801614f95565b01603701949350505050565b8082028115828204841417610a6457610a6461544a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826155885761558861554a565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036155ed576155ed61544a565b5060010190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261562957600080fd5b83018035915067ffffffffffffffff82111561564457600080fd5b60200191503681900382131561113857600080fd5b60006020828403121561566b57600080fd5b5051919050565b60006020828403121561568457600080fd5b8151611e5f81615341565b81810381811115610a6457610a6461544a565b6000816156b1576156b161544a565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b601f821115610b5a57600081815260208120601f850160051c810160208610156156fe5750805b601f850160051c820191505b8181101561571d5782815560010161570a565b505050505050565b815167ffffffffffffffff81111561573f5761573f615100565b6157538161574d84546153fd565b846156d7565b602080601f8311600181146157a657600084156157705750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561571d565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156157f3578886015182559484019460019091019084016157d4565b508582101561582f57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60008351615851818460208801614f95565b835190830190615865818360208801614f95565b01949350505050565b600061010073ffffffffffffffffffffffffffffffffffffffff808c1684528a60208501528960408501528089166060850152507fffffffff00000000000000000000000000000000000000000000000000000000871660808401528560a08401528460c08401528060e08401526158e881840185614fb9565b9b9a5050505050505050505050565b6000826159065761590661554a565b500690565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201526000612ac56060830184614fb9565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526139516080830184614fb9565b60006020828403121561599157600080fd5b8151611e5f81614ede565b600082516159ae818460208701614f95565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600181815b80851115615a4057817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615a2657615a2661544a565b80851615615a3357918102915b93841c93908002906159ec565b509250929050565b600082615a5757506001610a64565b81615a6457506000610a64565b8160018114615a7a5760028114615a8457615aa0565b6001915050610a64565b60ff841115615a9557615a9561544a565b50506001821b610a64565b5060208310610133831016604e8410600b8410161715615ac3575081810a610a64565b615acd83836159e7565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615aff57615aff61544a565b029392505050565b6000611e5f8383615a4856fea26469706673582212209b4141bfe99f780d998c8ec76e63defafca80152b71638635ba888d87c1995b564736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000643ecc90000000000000000000000000f50ac39c3c3bd062de4e47fcf8f3f9d37b94874a00000000000000000000000000000000000000000000000000000000000002ee000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca0000000000000000000000001db329cde457d68b872766f4e12f9532bca9149b38376131613564396239333634386635613966633930666538303336383561350000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000000000000000010416c676f7269746d6f20446976696e6f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000344564e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f68747470733a2f2f617277656176652e6e65742f63617a496d6b4478466a796b664b316c49556171434a5036762d794f704c5f4847534873724e346d663734000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000f50ac39c3c3bd062de4e47fcf8f3f9d37b94874a000000000000000000000000685e34c6a94f330fa494d708b652261140b55aba000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000032
-----Decoded View---------------
Arg [0] : _name (string): Algoritmo Divino
Arg [1] : _symbol (string): DVN
Arg [2] : _placeholderTokenUri (string): https://arweave.net/cazImkDxFjykfK1lIUaqCJP6v-yOpL_HGSHsrN4mf74
Arg [3] : _saleStartTime (uint256): 1681837200
Arg [4] : _royalReceiver (address): 0xF50Ac39c3C3bd062dE4E47fCF8F3F9d37b94874a
Arg [5] : _royalFeeNumerator (uint96): 750
Arg [6] : payees (address[]): 0xF50Ac39c3C3bd062dE4E47fCF8F3F9d37b94874a,0x685e34c6A94F330fa494D708b652261140b55aBA
Arg [7] : shares_ (uint256[]): 50,50
Arg [8] : chainlinkInformation (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
-----Encoded View---------------
25 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [3] : 00000000000000000000000000000000000000000000000000000000643ecc90
Arg [4] : 000000000000000000000000f50ac39c3c3bd062de4e47fcf8f3f9d37b94874a
Arg [5] : 00000000000000000000000000000000000000000000000000000000000002ee
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000260
Arg [7] : 00000000000000000000000000000000000000000000000000000000000002c0
Arg [8] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [9] : 0000000000000000000000001db329cde457d68b872766f4e12f9532bca9149b
Arg [10] : 3837613161356439623933363438663561396663393066653830333638356135
Arg [11] : 0000000000000000000000000000000000000000000000001bc16d674ec80000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000010
Arg [13] : 416c676f7269746d6f20446976696e6f00000000000000000000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [15] : 44564e0000000000000000000000000000000000000000000000000000000000
Arg [16] : 000000000000000000000000000000000000000000000000000000000000003f
Arg [17] : 68747470733a2f2f617277656176652e6e65742f63617a496d6b4478466a796b
Arg [18] : 664b316c49556171434a5036762d794f704c5f4847534873724e346d66373400
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [20] : 000000000000000000000000f50ac39c3c3bd062de4e47fcf8f3f9d37b94874a
Arg [21] : 000000000000000000000000685e34c6a94f330fa494d708b652261140b55aba
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [24] : 0000000000000000000000000000000000000000000000000000000000000032
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.