Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Multichain Info
No addresses found
Latest 25 from a total of 262 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Safe Transfer Fr... | 19142305 | 421 days ago | IN | 0 ETH | 0.00207987 | ||||
Safe Transfer Fr... | 17912473 | 594 days ago | IN | 0 ETH | 0.00136896 | ||||
Safe Transfer Fr... | 17124622 | 704 days ago | IN | 0 ETH | 0.00361566 | ||||
Safe Transfer Fr... | 17115385 | 706 days ago | IN | 0 ETH | 0.00381267 | ||||
Safe Transfer Fr... | 17115273 | 706 days ago | IN | 0 ETH | 0.00437086 | ||||
Safe Transfer Fr... | 16920035 | 733 days ago | IN | 0 ETH | 0.00354497 | ||||
Safe Transfer Fr... | 16919993 | 733 days ago | IN | 0 ETH | 0.00355132 | ||||
Safe Transfer Fr... | 16919939 | 733 days ago | IN | 0 ETH | 0.00405815 | ||||
Safe Transfer Fr... | 16227074 | 830 days ago | IN | 0 ETH | 0.00195387 | ||||
Set Ask | 16227051 | 830 days ago | IN | 0 ETH | 0.00214017 | ||||
Multi Mint | 16227050 | 830 days ago | IN | 0 ETH | 0.01077252 | ||||
Set Ask | 16091024 | 849 days ago | IN | 0 ETH | 0.00129384 | ||||
Set Ask | 16091022 | 849 days ago | IN | 0 ETH | 0.00121073 | ||||
Multi Mint | 16091021 | 849 days ago | IN | 0 ETH | 0.01187828 | ||||
Set Ask | 15838446 | 885 days ago | IN | 0 ETH | 0.00091417 | ||||
Set Ask | 15838445 | 885 days ago | IN | 0 ETH | 0.00092014 | ||||
Multi Mint | 15838444 | 885 days ago | IN | 0 ETH | 0.00879346 | ||||
Set Ask | 15838439 | 885 days ago | IN | 0 ETH | 0.00094653 | ||||
Set Ask | 15838438 | 885 days ago | IN | 0 ETH | 0.00096356 | ||||
Multi Mint | 15838437 | 885 days ago | IN | 0 ETH | 0.00832387 | ||||
Set Ask | 15838406 | 885 days ago | IN | 0 ETH | 0.00105495 | ||||
Set Ask | 15838405 | 885 days ago | IN | 0 ETH | 0.0009641 | ||||
Set Ask | 15838403 | 885 days ago | IN | 0 ETH | 0.00104418 | ||||
Set Ask | 15838402 | 885 days ago | IN | 0 ETH | 0.0009795 | ||||
Multi Mint | 15838400 | 885 days ago | IN | 0 ETH | 0.01794957 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Media
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier:MIT pragma solidity ^0.8.7; pragma experimental ABIEncoderV2; import {ERC721Burnable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import {ERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import {ERC721URIStorage} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import {Counters} from "@openzeppelin/contracts/utils/Counters.sol"; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {Decimal} from "./Decimal.sol"; import {IMarket} from "./interfaces/IMarket.sol"; import "./interfaces/IMedia.sol"; /** * @title A media value system, with perpetual equity to creators * @notice This contract provides an interface to mint media with a market * owned by the creator. */ contract Media is IMedia, ReentrancyGuard, Ownable, ERC721Burnable, ERC721URIStorage, ERC721Enumerable { using Counters for Counters.Counter; using SafeMath for uint256; /* ******* * Globals * ******* */ // Address for the market address public marketContract; address public tokenContract; // Mapping from token to previous owner of the token mapping(uint256 => address) public previousTokenOwners; // Mapping from token id to creator address mapping(uint256 => address) public tokenCreators; // Mapping from creator address to their (enumerable) set of created tokens mapping(address => uint) private _creatorTokens; // Mapping from token id to sha256 hash of content mapping(uint256 => bytes32) public tokenContentHashes; // Mapping from token id to sha256 hash of metadata mapping(uint256 => bytes32) public tokenMetadataHashes; // Mapping from token id to metadataURI mapping(uint256 => string) private _tokenMetadataURIs; // Mapping from contentHash to bool mapping(bytes32 => bool) private _contentHashes; //keccak256("Permit(address spender,uint256 tokenId,uint256 nonce,uint256 deadline)"); bytes32 public constant PERMIT_TYPEHASH = 0x49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad; //keccak256("MintWithSig(bytes32 contentHash,bytes32 metadataHash,uint256 creatorShare,uint256 nonce,uint256 deadline)"); bytes32 public constant MINT_WITH_SIG_TYPEHASH = 0x2952e482b8e2b192305f87374d7af45dc2eafafe4f50d26a0c02e90f2fdbe14b; // Mapping from address to token id to permit nonce mapping(address => mapping(uint256 => uint256)) public permitNonces; // Mapping from address to mint with sig nonce mapping(address => uint256) public mintWithSigNonces; /* * bytes4(keccak256('name()')) == 0x06fdde03 * bytes4(keccak256('symbol()')) == 0x95d89b41 * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd * bytes4(keccak256('tokenMetadataURI(uint256)')) == 0x157c3df9 * * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd ^ 0x157c3df9 == 0x4e222e66 */ bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x4e222e66; Counters.Counter private _tokenIdTracker; /* ********* * Modifiers * ********* */ /** * @notice Require that the token has not been burned and has been minted */ modifier onlyExistingToken(uint256 tokenId) { require(_exists(tokenId), "Media: nonexistent token"); _; } /** * @notice Require that the token has had a content hash set */ modifier onlyTokenWithContentHash(uint256 tokenId) { require( tokenContentHashes[tokenId] != 0, "Media: token does not have hash of created content" ); _; } /** * @notice Require that the token has had a metadata hash set */ modifier onlyTokenWithMetadataHash(uint256 tokenId) { require( tokenMetadataHashes[tokenId] != 0, "Media: token does not have hash of its metadata" ); _; } /** * @notice Ensure that the provided spender is the approved or the owner of * the media for the specified tokenId */ modifier onlyApprovedOrOwner(address spender, uint256 tokenId) { require( _isApprovedOrOwner(spender, tokenId), "Media: Only approved or owner" ); _; } /** * @notice Ensure the token has been created (even if it has been burned) */ modifier onlyTokenCreated(uint256 tokenId) { require( _tokenIdTracker.current() > tokenId, "Media: token with that id does not exist" ); _; } /** * @notice Ensure that the provided URI is not empty */ modifier onlyValidURI(string memory uri) { require( bytes(uri).length != 0, "Media: specified uri must be non-empty" ); _; } /** * @notice On deployment, set the market contract address and register the * ERC721 metadata interface */ constructor(address marketContractAddr, address tokenContractAddr) ERC721("PLOT", "PLOT") { marketContract = marketContractAddr; tokenContract = tokenContractAddr; } /* ************** * View Functions * ************** */ /** * @notice return the URI for a particular piece of media with the specified tokenId * @dev This function is an override of the base OZ implementation because we * will return the tokenURI even if the media has been burned. In addition, this * protocol does not support a base URI, so relevant conditionals are removed. * @return the URI for a token */ function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) onlyTokenCreated(tokenId) returns (string memory) { return super.tokenURI(tokenId); } /** * @notice Return the metadata URI for a piece of media given the token URI * @return the metadata URI for the token */ function tokenMetadataURI(uint256 tokenId) external view override onlyTokenCreated(tokenId) returns (string memory) { return _tokenMetadataURIs[tokenId]; } /* **************** * Public Functions * **************** */ /** * @notice see IMedia */ function mint(MediaData memory data, IMarket.BidShares memory bidShares) public override nonReentrant onlyOwner { _mintForCreator(msg.sender, data, bidShares); } /** * @notice Multiple Mint */ function multiMint(MediaData[] memory _array) public onlyOwner { IMarket.BidShares memory bidShares = IMarket.BidShares( { prevOwner : Decimal.D256(0), creator : Decimal.D256( uint256(0).mul(Decimal.BASE)), owner : Decimal.D256(uint256(100).mul(Decimal.BASE)) } ); for(uint i=0; i<_array.length; i++){ mint(_array[i], bidShares); } } /** * @notice see IMedia */ function mintWithSig( address creator, MediaData memory data, IMarket.BidShares memory bidShares, EIP712Signature memory sig ) public override nonReentrant { require( sig.deadline == 0 || sig.deadline >= block.timestamp, "Media: mintWithSig expired" ); bytes32 domainSeparator = _calculateDomainSeparator(); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", domainSeparator, keccak256( abi.encode( MINT_WITH_SIG_TYPEHASH, data.contentHash, data.metadataHash, bidShares.creator.value, mintWithSigNonces[creator]++, sig.deadline ) ) ) ); address recoveredAddress = ecrecover(digest, sig.v, sig.r, sig.s); require( recoveredAddress != address(0) && creator == recoveredAddress, "Media: Signature invalid" ); _mintForCreator(recoveredAddress, data, bidShares); } /** * @notice see IMedia */ function auctionTransfer(uint256 tokenId, address recipient) external override { require(msg.sender == marketContract, "Media: only market contract"); previousTokenOwners[tokenId] = ownerOf(tokenId); _safeTransfer(ownerOf(tokenId), recipient, tokenId, ""); } /** * @notice see IMedia */ function setAsk(uint256 tokenId, IMarket.Ask memory ask) public override nonReentrant onlyApprovedOrOwner(msg.sender, tokenId) { require(ask.currency == tokenContract, "Market: Ask currency must be utility token"); IMarket(marketContract).setAsk(tokenId, ask); } /** * @notice see IMedia */ function removeAsk(uint256 tokenId) external override nonReentrant onlyApprovedOrOwner(msg.sender, tokenId) { IMarket(marketContract).removeAsk(tokenId); } /** * @notice see IMedia */ function setBid(uint256 tokenId, IMarket.Bid memory bid) public override nonReentrant onlyExistingToken(tokenId) { require(msg.sender == bid.bidder, "Market: Bidder must be msg sender"); require(bid.currency == tokenContract, "Market: Bid currency must be utility token"); IMarket(marketContract).setBid(tokenId, bid, msg.sender); } /** * @notice see IMedia */ function removeBid(uint256 tokenId) external override nonReentrant onlyTokenCreated(tokenId) { IMarket(marketContract).removeBid(tokenId, msg.sender); } /** * @notice see IMedia */ function acceptBid(uint256 tokenId, IMarket.Bid memory bid) public override nonReentrant onlyApprovedOrOwner(msg.sender, tokenId) { IMarket(marketContract).acceptBid(tokenId, bid); } /** * @notice Burn a token. * @dev Only callable if the media owner is also the creator. */ function burn(uint256 tokenId) public override nonReentrant onlyExistingToken(tokenId) onlyApprovedOrOwner(msg.sender, tokenId) { address owner = ownerOf(tokenId); require( tokenCreators[tokenId] == owner, "Media: owner is not creator of media" ); _burn(tokenId); } /** * @notice Revoke the approvals for a token. The provided `approve` function is not sufficient * for this protocol, as it does not allow an approved address to revoke it's own approval. * In instances where a 3rd party is interacting on a user's behalf via `permit`, they should * revoke their approval once their task is complete as a best practice. */ function revokeApproval(uint256 tokenId) external override nonReentrant { require( msg.sender == getApproved(tokenId), "Media: caller not approved address" ); _approve(address(0), tokenId); } /** * @notice see IMedia * @dev only callable by approved or owner */ function updateTokenURI(uint256 tokenId, string calldata _tokenURI) external override nonReentrant onlyApprovedOrOwner(msg.sender, tokenId) onlyTokenWithContentHash(tokenId) onlyValidURI(_tokenURI) { _setTokenURI(tokenId, _tokenURI); emit TokenURIUpdated(tokenId, msg.sender, _tokenURI); } /** * @notice see IMedia * @dev only callable by approved or owner */ function updateTokenMetadataURI( uint256 tokenId, string calldata metadataURI ) external override nonReentrant onlyApprovedOrOwner(msg.sender, tokenId) onlyTokenWithMetadataHash(tokenId) onlyValidURI(metadataURI) { _setTokenMetadataURI(tokenId, metadataURI); emit TokenMetadataURIUpdated(tokenId, msg.sender, metadataURI); } /** * @notice See IMedia * @dev This method is loosely based on the permit for ERC-20 tokens in EIP-2612, but modified * for ERC-721. */ function permit( address spender, uint256 tokenId, EIP712Signature memory sig ) public override nonReentrant onlyExistingToken(tokenId) { require( sig.deadline == 0 || sig.deadline >= block.timestamp, "Media: Permit expired" ); require(spender != address(0), "Media: spender cannot be 0x0"); bytes32 domainSeparator = _calculateDomainSeparator(); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", domainSeparator, keccak256( abi.encode( PERMIT_TYPEHASH, spender, tokenId, permitNonces[ownerOf(tokenId)][tokenId]++, sig.deadline ) ) ) ); address recoveredAddress = ecrecover(digest, sig.v, sig.r, sig.s); require( recoveredAddress != address(0) && ownerOf(tokenId) == recoveredAddress, "Media: Signature invalid" ); _approve(spender, tokenId); } /* ***************** * Private Functions * ***************** */ /** * @notice Creates a new token for `creator`. Its token ID will be automatically * assigned (and available on the emitted {IERC721-Transfer} event), and the token * URI autogenerated based on the base URI passed at construction. * * See {ERC721-_safeMint}. * * On mint, also set the sha256 hashes of the content and its metadata for integrity * checks, along with the initial URIs to point to the content and metadata. Attribute * the token ID to the creator, mark the content hash as used, and set the bid shares for * the media's market. * * Note that although the content hash must be unique for future mints to prevent duplicate media, * metadata has no such requirement. */ function _mintForCreator( address creator, MediaData memory data, IMarket.BidShares memory bidShares ) internal onlyValidURI(data.tokenURI) onlyValidURI(data.metadataURI) { require(data.contentHash != 0, "Media: content hash must be non-zero"); require( data.metadataHash != 0, "Media: metadata hash must be non-zero" ); uint256 tokenId = _tokenIdTracker.current(); _safeMint(creator, tokenId); _tokenIdTracker.increment(); _setTokenContentHash(tokenId, data.contentHash); _setTokenMetadataHash(tokenId, data.metadataHash); _setTokenMetadataURI(tokenId, data.metadataURI); _setTokenURI(tokenId, data.tokenURI); _creatorTokens[creator].add(tokenId); _contentHashes[data.contentHash] = true; tokenCreators[tokenId] = creator; previousTokenOwners[tokenId] = creator; IMarket(marketContract).setBidShares(tokenId, bidShares); } function getTokenCount() external view override returns(uint256) { return _tokenIdTracker.current(); } function _setTokenContentHash(uint256 tokenId, bytes32 contentHash) internal virtual onlyExistingToken(tokenId) { tokenContentHashes[tokenId] = contentHash; } function _setTokenMetadataHash(uint256 tokenId, bytes32 metadataHash) internal virtual onlyExistingToken(tokenId) { tokenMetadataHashes[tokenId] = metadataHash; } function _setTokenMetadataURI(uint256 tokenId, string memory metadataURI) internal virtual onlyExistingToken(tokenId) { _tokenMetadataURIs[tokenId] = metadataURI; } /** * @notice Destroys `tokenId`. * @dev We modify the OZ _burn implementation to * maintain metadata and to remove the * previous token owner from the piece */ function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { super._burn(tokenId); delete previousTokenOwners[tokenId]; } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } /** * @notice transfer a token and remove the ask for it. */ function _transfer( address from, address to, uint256 tokenId ) internal override { IMarket(marketContract).removeAsk(tokenId); super._transfer(from, to, tokenId); } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } /** * @dev Calculates EIP712 DOMAIN_SEPARATOR based on the current contract and chain ID. */ function _calculateDomainSeparator() internal view returns (bytes32) { uint256 chainID; /* solium-disable-next-line */ assembly { chainID := chainid() } return keccak256( abi.encode( keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ), keccak256(bytes("PLOT")), keccak256(bytes("1")), chainID, address(this) ) ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Burnable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../utils/Context.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be irreversibly burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be 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 owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || 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); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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) { require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token"); 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 Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @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 / b + (a % b == 0 ? 0 : 1); } }
// 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 v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier:MIT pragma solidity ^0.8.7; pragma experimental ABIEncoderV2; /** * NOTE: This file is a clone of the dydx protocol's Decimal.sol contract. It was forked from https://github.com/dydxprotocol/solo * at commit 2d8454e02702fe5bc455b848556660629c3cad36 * * It has not been modified other than to use a newer solidity in the pragma to match the rest of the contract suite of this project */ import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {Math} from "./Math.sol"; /** * @title Decimal * * Library that defines a fixed-point number with 18 decimal places. */ library Decimal { using SafeMath for uint256; // ============ Constants ============ uint256 constant BASE_POW = 18; uint256 constant BASE = 10**BASE_POW; // ============ Structs ============ struct D256 { uint256 value; } // ============ Functions ============ function one() internal pure returns (D256 memory) { return D256({value: BASE}); } function onePlus(D256 memory d) internal pure returns (D256 memory) { return D256({value: d.value.add(BASE)}); } function mul(uint256 target, D256 memory d) internal pure returns (uint256) { return Math.getPartial(target, d.value, BASE); } function div(uint256 target, D256 memory d) internal pure returns (uint256) { return Math.getPartial(target, BASE, d.value); } }
// SPDX-License-Identifier:MIT pragma solidity ^0.8.7; pragma experimental ABIEncoderV2; import {Decimal} from "../Decimal.sol"; /** * @title Interface for Plot Protocol's Market */ interface IMarket { struct Bid { // Amount of the currency being bid uint256 amount; // Address to the ERC20 token being used to bid address currency; // Address of the bidder address bidder; // Address of the recipient address recipient; // % of the next sale to award the current owner Decimal.D256 sellOnShare; } struct Ask { // Amount of the currency being asked uint256 amount; // Address to the ERC20 token being asked address currency; } struct BidShares { // % of sale value that goes to the _previous_ owner of the nft Decimal.D256 prevOwner; // % of sale value that goes to the original creator of the nft Decimal.D256 creator; // % of sale value that goes to the seller (current owner) of the nft Decimal.D256 owner; } struct TokenAskInfo { uint256 tokenId; uint256 askValue; address tokenOwner; } event BidCreated(uint256 indexed tokenId, Bid bid); event BidRemoved(uint256 indexed tokenId, Bid bid); event BidFinalized(uint256 indexed tokenId, Bid bid); event AskCreated(uint256 indexed tokenId, Ask ask); event AskRemoved(uint256 indexed tokenId, Ask ask); event BidShareUpdated(uint256 indexed tokenId, BidShares bidShares); function bidForTokenBidder(uint256 tokenId, address bidder) external view returns (Bid memory); function currentAskForToken(uint256 tokenId) external view returns (Ask memory); function bidSharesForToken(uint256 tokenId) external view returns (BidShares memory); function isValidBid(uint256 tokenId, uint256 bidAmount) external view returns (bool); function isValidBidShares(BidShares calldata bidShares) external pure returns (bool); function splitShare(Decimal.D256 calldata sharePercentage, uint256 amount) external pure returns (uint256); function configure(address mediaContractAddress) external; function setBidShares(uint256 tokenId, BidShares calldata bidShares) external; function setAsk(uint256 tokenId, Ask calldata ask) external; function removeAsk(uint256 tokenId) external; function setBid( uint256 tokenId, Bid calldata bid, address spender ) external; function removeBid(uint256 tokenId, address bidder) external; function acceptBid(uint256 tokenId, Bid calldata expectedBid) external; }
// SPDX-License-Identifier:MIT pragma solidity ^0.8.7; pragma experimental ABIEncoderV2; import {IMarket} from "./IMarket.sol"; /** * @title Interface for Plot Protocol's Media */ interface IMedia { struct EIP712Signature { uint256 deadline; uint8 v; bytes32 r; bytes32 s; } struct MediaData { // A valid URI of the content represented by this token string tokenURI; // A valid URI of the metadata associated with this token string metadataURI; // A SHA256 hash of the content pointed to by tokenURI bytes32 contentHash; // A SHA256 hash of the content pointed to by metadataURI bytes32 metadataHash; } event TokenURIUpdated(uint256 indexed _tokenId, address owner, string _uri); event TokenMetadataURIUpdated( uint256 indexed _tokenId, address owner, string _uri ); /** * @notice Return the metadata URI for a piece of media given the token URI */ function tokenMetadataURI(uint256 tokenId) external view returns (string memory); /** * @notice Mint new media for msg.sender. */ function mint(MediaData calldata data, IMarket.BidShares calldata bidShares) external; /** * @notice EIP-712 mintWithSig method. Mints new media for a creator given a valid signature. */ function mintWithSig( address creator, MediaData calldata data, IMarket.BidShares calldata bidShares, EIP712Signature calldata sig ) external; /** * @notice Transfer the token with the given ID to a given address. * Save the previous owner before the transfer, in case there is a sell-on fee. * @dev This can only be called by the auction contract specified at deployment */ function auctionTransfer(uint256 tokenId, address recipient) external; /** * @notice Set the ask on a piece of media */ function setAsk(uint256 tokenId, IMarket.Ask calldata ask) external; /** * @notice Remove the ask on a piece of media */ function removeAsk(uint256 tokenId) external; /** * @notice Set the bid on a piece of media */ function setBid(uint256 tokenId, IMarket.Bid calldata bid) external; /** * @notice Remove the bid on a piece of media */ function removeBid(uint256 tokenId) external; function acceptBid(uint256 tokenId, IMarket.Bid calldata bid) external; /** * @notice Revoke approval for a piece of media */ function revokeApproval(uint256 tokenId) external; /** * @notice Update the token URI */ function updateTokenURI(uint256 tokenId, string calldata tokenURI) external; /** * @notice get token count */ function getTokenCount() external view returns(uint256); /** * @notice Update the token metadata uri */ function updateTokenMetadataURI( uint256 tokenId, string calldata metadataURI ) external; /** * @notice EIP-712 permit method. Sets an approved spender given a valid signature. */ function permit( address spender, uint256 tokenId, EIP712Signature calldata sig ) external; }
// 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 (last updated v4.6.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 be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev 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 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.5.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 functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (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 pragma solidity ^0.8.7; pragma experimental ABIEncoderV2; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; /** * @title Math * * Library for non-standard Math functions * NOTE: This file is a clone of the dydx protocol's Decimal.sol contract. * It was forked from https://github.com/dydxprotocol/solo at commit * 2d8454e02702fe5bc455b848556660629c3cad36. It has not been modified other than to use a * newer solidity in the pragma to match the rest of the contract suite of this project. */ library Math { using SafeMath for uint256; // ============ Library Functions ============ /* * Return target * (numerator / denominator). */ function getPartial( uint256 target, uint256 numerator, uint256 denominator ) internal pure returns (uint256) { return target.mul(numerator).div(denominator); } /* * Return target * (numerator / denominator), but rounded up. */ function getPartialRoundUp( uint256 target, uint256 numerator, uint256 denominator ) internal pure returns (uint256) { if (target == 0 || numerator == 0) { // SafeMath will check for zero denominator return SafeMath.div(0, denominator); } return target.mul(numerator).sub(1).div(denominator).add(1); } function to128(uint256 number) internal pure returns (uint128) { uint128 result = uint128(number); require(result == number, "Math: Unsafe cast to uint128"); return result; } function to96(uint256 number) internal pure returns (uint96) { uint96 result = uint96(number); require(result == number, "Math: Unsafe cast to uint96"); return result; } function to32(uint256 number) internal pure returns (uint32) { uint32 result = uint32(number); require(result == number, "Math: Unsafe cast to uint32"); return result; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"marketContractAddr","type":"address"},{"internalType":"address","name":"tokenContractAddr","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"string","name":"_uri","type":"string"}],"name":"TokenMetadataURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"string","name":"_uri","type":"string"}],"name":"TokenURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MINT_WITH_SIG_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"bidder","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"sellOnShare","type":"tuple"}],"internalType":"struct IMarket.Bid","name":"bid","type":"tuple"}],"name":"acceptBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"auctionTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"string","name":"metadataURI","type":"string"},{"internalType":"bytes32","name":"contentHash","type":"bytes32"},{"internalType":"bytes32","name":"metadataHash","type":"bytes32"}],"internalType":"struct IMedia.MediaData","name":"data","type":"tuple"},{"components":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"prevOwner","type":"tuple"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"creator","type":"tuple"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"owner","type":"tuple"}],"internalType":"struct IMarket.BidShares","name":"bidShares","type":"tuple"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"creator","type":"address"},{"components":[{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"string","name":"metadataURI","type":"string"},{"internalType":"bytes32","name":"contentHash","type":"bytes32"},{"internalType":"bytes32","name":"metadataHash","type":"bytes32"}],"internalType":"struct IMedia.MediaData","name":"data","type":"tuple"},{"components":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"prevOwner","type":"tuple"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"creator","type":"tuple"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"owner","type":"tuple"}],"internalType":"struct IMarket.BidShares","name":"bidShares","type":"tuple"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IMedia.EIP712Signature","name":"sig","type":"tuple"}],"name":"mintWithSig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintWithSigNonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"string","name":"metadataURI","type":"string"},{"internalType":"bytes32","name":"contentHash","type":"bytes32"},{"internalType":"bytes32","name":"metadataHash","type":"bytes32"}],"internalType":"struct IMedia.MediaData[]","name":"_array","type":"tuple[]"}],"name":"multiMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IMedia.EIP712Signature","name":"sig","type":"tuple"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"permitNonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"previousTokenOwners","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"removeAsk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"removeBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"revokeApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"currency","type":"address"}],"internalType":"struct IMarket.Ask","name":"ask","type":"tuple"}],"name":"setAsk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"bidder","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"sellOnShare","type":"tuple"}],"internalType":"struct IMarket.Bid","name":"bid","type":"tuple"}],"name":"setBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenContentHashes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenCreators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenMetadataHashes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenMetadataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"metadataURI","type":"string"}],"name":"updateTokenMetadataURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"updateTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162004279380380620042798339810160408190526200003491620001eb565b604080518082018252600480825263141313d560e21b60208084018290528451808601909552918452908301526001600055906200007233620000d6565b81516200008790600290602085019062000128565b5080516200009d90600390602084019062000128565b5050600d80546001600160a01b039485166001600160a01b031991821617909155600e8054939094169216919091179091555062000260565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001369062000223565b90600052602060002090601f0160209004810192826200015a5760008555620001a5565b82601f106200017557805160ff1916838001178555620001a5565b82800160010185558215620001a5579182015b82811115620001a557825182559160200191906001019062000188565b50620001b3929150620001b7565b5090565b5b80821115620001b35760008155600101620001b8565b80516001600160a01b0381168114620001e657600080fd5b919050565b60008060408385031215620001ff57600080fd5b6200020a83620001ce565b91506200021a60208401620001ce565b90509250929050565b600181811c908216806200023857607f821691505b602082108114156200025a57634e487b7160e01b600052602260045260246000fd5b50919050565b61400980620002706000396000f3fe608060405234801561001057600080fd5b506004361061027f5760003560e01c806370a082311161015c578063b320f459116100ce578063e7f4ce4f11610087578063e7f4ce4f146105e8578063e985e9c5146105fb578063f2fde38b14610637578063f6b630f01461064a578063f8ccd5de1461065d578063fad321971461068857600080fd5b8063b320f4591461054c578063b88d4fde1461055f578063ba33939914610572578063c87b56dd14610585578063de5236fb14610598578063e0fd045f146105bf57600080fd5b80638da5cb5b116101205780638da5cb5b146104d157806395d89b41146104e25780639d8e7260146104ea578063a1794bcd14610513578063a22cb46514610526578063b1e130fc1461053957600080fd5b806370a0823114610488578063715018a61461049b57806375682e79146104a357806378a89567146104b65780637a7a1202146104be57600080fd5b806328220f35116101f557806342966c68116101b957806342966c68146104165780634f6ccce71461042957806355a373d61461043c5780635bf624221461044f57806362f24b70146104625780636352211e1461047557600080fd5b806328220f35146103a35780632cca3237146103b65780632f745c59146103c957806330adf81f146103dc57806342842e0e1461040357600080fd5b80630bcd899b116102475780630bcd899b1461032f5780630e2a17781461034f578063157c3df91461036257806318160ddd1461037557806318e97fd11461037d57806323b872dd1461039057600080fd5b806301ddc3b51461028457806301ffc9a7146102b757806306fdde03146102da578063081812fc146102ef578063095ea7b31461031a575b600080fd5b6102a46102923660046137cd565b60136020526000908152604090205481565b6040519081526020015b60405180910390f35b6102ca6102c536600461374e565b6106a8565b60405190151581526020016102ae565b6102e26106b9565b6040516102ae9190613abb565b6103026102fd3660046137cd565b61074b565b6040516001600160a01b0390911681526020016102ae565b61032d610328366004613620565b6107d8565b005b6102a461033d36600461346e565b60176020526000908152604090205481565b61032d61035d36600461364a565b6108ee565b6102e26103703660046137cd565b610bec565b600b546102a4565b61032d61038b366004613809565b610cb6565b61032d61039e3660046134bc565b610e60565b61032d6103b13660046137cd565b610e91565b61032d6103c4366004613788565b610f3c565b6102a46103d7366004613620565b610fa2565b6102a47f49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad81565b61032d6104113660046134bc565b611038565b61032d6104243660046137cd565b611053565b6102a46104373660046137cd565b611161565b600e54610302906001600160a01b031681565b61032d61045d3660046138f9565b6111f4565b61032d610470366004613884565b61135a565b6103026104833660046137cd565b61149d565b6102a461049636600461346e565b611514565b61032d61159b565b61032d6104b1366004613809565b6115d1565b6102a4611762565b61032d6104cc3660046135af565b611772565b6001546001600160a01b0316610302565b6102e26119dd565b6103026104f83660046137cd565b600f602052600090815260409020546001600160a01b031681565b600d54610302906001600160a01b031681565b61032d610534366004613573565b6119ec565b61032d6105473660046137cd565b6119fb565b61032d61055a3660046137cd565b611aaa565b61032d61056d3660046134f8565b611b67565b61032d6105803660046138f9565b611b9f565b6102e26105933660046137cd565b611c21565b6102a47f2952e482b8e2b192305f87374d7af45dc2eafafe4f50d26a0c02e90f2fdbe14b81565b6103026105cd3660046137cd565b6010602052600090815260409020546001600160a01b031681565b61032d6105f6366004613687565b611c5b565b6102ca610609366004613489565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b61032d61064536600461346e565b611d34565b61032d6106583660046137e6565b611dcf565b6102a461066b366004613620565b601660209081526000928352604080842090915290825290205481565b6102a46106963660046137cd565b60126020526000908152604090205481565b60006106b382611e81565b92915050565b6060600280546106c890613eeb565b80601f01602080910402602001604051908101604052809291908181526020018280546106f490613eeb565b80156107415780601f1061071657610100808354040283529160200191610741565b820191906000526020600020905b81548152906001019060200180831161072457829003601f168201915b5050505050905090565b600061075682611ea6565b6107bc5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600660205260409020546001600160a01b031690565b60006107e38261149d565b9050806001600160a01b0316836001600160a01b031614156108515760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107b3565b336001600160a01b038216148061086d575061086d8133610609565b6108df5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016107b3565b6108e98383611ec3565b505050565b600260005414156109115760405162461bcd60e51b81526004016107b390613c5c565b60026000558161092081611ea6565b61093c5760405162461bcd60e51b81526004016107b390613c25565b8151158061094b575081514211155b61098f5760405162461bcd60e51b81526020600482015260156024820152741359591a584e8814195c9b5a5d08195e1c1a5c9959605a1b60448201526064016107b3565b6001600160a01b0384166109e55760405162461bcd60e51b815260206004820152601c60248201527f4d656469613a207370656e6465722063616e6e6f74206265203078300000000060448201526064016107b3565b60006109ef611f31565b90506000817f49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad8787601685610a238361149d565b6001600160a01b03168152602080820192909252604090810160009081208c82529092528120805491610a5583613f20565b9091555088516040805160208101969096526001600160a01b03909416938501939093526060840191909152608083015260a082015260c00160405160208183030381529060405280519060200120604051602001610acb92919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600060018286602001518760400151886060015160405160008152602001604052604051610b2d949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015610b4f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610b8d5750806001600160a01b0316610b828761149d565b6001600160a01b0316145b610bd45760405162461bcd60e51b81526020600482015260186024820152771359591a584e8814da59db985d1d5c99481a5b9d985b1a5960421b60448201526064016107b3565b610bde8787611ec3565b505060016000555050505050565b60608180610bf960185490565b11610c165760405162461bcd60e51b81526004016107b390613ace565b60008381526014602052604090208054610c2f90613eeb565b80601f0160208091040260200160405190810160405280929190818152602001828054610c5b90613eeb565b8015610ca85780601f10610c7d57610100808354040283529160200191610ca8565b820191906000526020600020905b815481529060010190602001808311610c8b57829003601f168201915b505050505091505b50919050565b60026000541415610cd95760405162461bcd60e51b81526004016107b390613c5c565b60026000553383610cea8282611ffc565b610d065760405162461bcd60e51b81526004016107b390613b68565b6000858152601260205260409020548590610d7e5760405162461bcd60e51b815260206004820152603260248201527f4d656469613a20746f6b656e20646f6573206e6f7420686176652068617368206044820152711bd98818dc99585d19590818dbdb9d195b9d60721b60648201526084016107b3565b84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050825115159150610dd690505760405162461bcd60e51b81526004016107b390613c93565b610e168787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506120e692505050565b867f702fe2dc2dc0f68023540aa4a1e11811c0f29112f6ebf01e61b90538e4f29810338888604051610e4a93929190613a7b565b60405180910390a2505060016000555050505050565b610e6a3382611ffc565b610e865760405162461bcd60e51b81526004016107b390613bd4565b6108e9838383612171565b60026000541415610eb45760405162461bcd60e51b81526004016107b390613c5c565b60026000553381610ec58282611ffc565b610ee15760405162461bcd60e51b81526004016107b390613b68565b600d546040516328220f3560e01b8152600481018590526001600160a01b03909116906328220f35906024015b600060405180830381600087803b158015610f2857600080fd5b505af1158015610bde573d6000803e3d6000fd5b60026000541415610f5f5760405162461bcd60e51b81526004016107b390613c5c565b60026000556001546001600160a01b03163314610f8e5760405162461bcd60e51b81526004016107b390613b9f565b610f993383836121da565b50506001600055565b6000610fad83611514565b821061100f5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016107b3565b506001600160a01b03919091166000908152600960209081526040808320938352929052205490565b6108e983838360405180602001604052806000815250611b67565b600260005414156110765760405162461bcd60e51b81526004016107b390613c5c565b60026000558061108581611ea6565b6110a15760405162461bcd60e51b81526004016107b390613c25565b33826110ad8282611ffc565b6110c95760405162461bcd60e51b81526004016107b390613b68565b60006110d48561149d565b6000868152601060205260409020549091506001600160a01b0380831691161461114c5760405162461bcd60e51b8152602060048201526024808201527f4d656469613a206f776e6572206973206e6f742063726561746f72206f66206d6044820152636564696160e01b60648201526084016107b3565b6111558561242c565b50506001600055505050565b600061116c600b5490565b82106111cf5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016107b3565b600b82815481106111e2576111e2613f91565b90600052602060002001549050919050565b600260005414156112175760405162461bcd60e51b81526004016107b390613c5c565b60026000558161122681611ea6565b6112425760405162461bcd60e51b81526004016107b390613c25565b81604001516001600160a01b0316336001600160a01b0316146112b15760405162461bcd60e51b815260206004820152602160248201527f4d61726b65743a20426964646572206d757374206265206d73672073656e64656044820152603960f91b60648201526084016107b3565b600e5460208301516001600160a01b039081169116146113265760405162461bcd60e51b815260206004820152602a60248201527f4d61726b65743a204269642063757272656e6379206d757374206265207574696044820152693634ba3c903a37b5b2b760b11b60648201526084016107b3565b600d546040516317b6b0d360e31b81526001600160a01b039091169063bdb5869890610f0e90869086903390600401613ced565b6002600054141561137d5760405162461bcd60e51b81526004016107b390613c5c565b6002600055338261138e8282611ffc565b6113aa5760405162461bcd60e51b81526004016107b390613b68565b600e5460208401516001600160a01b0390811691161461141f5760405162461bcd60e51b815260206004820152602a60248201527f4d61726b65743a2041736b2063757272656e6379206d757374206265207574696044820152693634ba3c903a37b5b2b760b11b60648201526084016107b3565b600d5460405163062f24b760e41b8152600481018690528451602482015260208501516001600160a01b039081166044830152909116906362f24b70906064015b600060405180830381600087803b15801561147a57600080fd5b505af115801561148e573d6000803e3d6000fd5b50506001600055505050505050565b6000818152600460205260408120546001600160a01b0316806106b35760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107b3565b60006001600160a01b03821661157f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107b3565b506001600160a01b031660009081526005602052604090205490565b6001546001600160a01b031633146115c55760405162461bcd60e51b81526004016107b390613b9f565b6115cf6000612453565b565b600260005414156115f45760405162461bcd60e51b81526004016107b390613c5c565b600260005533836116058282611ffc565b6116215760405162461bcd60e51b81526004016107b390613b68565b60008581526013602052604090205485906116965760405162461bcd60e51b815260206004820152602f60248201527f4d656469613a20746f6b656e20646f6573206e6f74206861766520686173682060448201526e6f6620697473206d6574616461746160881b60648201526084016107b3565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250508251151591506116ee90505760405162461bcd60e51b81526004016107b390613c93565b61172e8787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b867fe3df41127db820c79e5b8d541a63e40e3e97b9af96f7a50bded13091b70df9ae338888604051610e4a93929190613a7b565b600061176d60185490565b905090565b600260005414156117955760405162461bcd60e51b81526004016107b390613c5c565b6002600055805115806117a9575080514211155b6117f55760405162461bcd60e51b815260206004820152601a60248201527f4d656469613a206d696e7457697468536967206578706972656400000000000060448201526064016107b3565b60006117ff611f31565b6040808601516060870151602080880151516001600160a01b038b16600090815260179092529381208054959650909486947f2952e482b8e2b192305f87374d7af45dc2eafafe4f50d26a0c02e90f2fdbe14b9493929091908761186283613f20565b9091555088516040805160208101979097528601949094526060850192909252608084015260a083015260c082015260e001604051602081830303815290604052805190602001206040516020016118d192919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600060018285602001518660400151876060015160405160008152602001604052604051611933949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611955573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580159061198b5750806001600160a01b0316876001600160a01b0316145b6119d25760405162461bcd60e51b81526020600482015260186024820152771359591a584e8814da59db985d1d5c99481a5b9d985b1a5960421b60448201526064016107b3565b610bde8187876121da565b6060600380546106c890613eeb565b6119f73383836124ea565b5050565b60026000541415611a1e5760405162461bcd60e51b81526004016107b390613c5c565b6002600055611a2c8161074b565b6001600160a01b0316336001600160a01b031614611a975760405162461bcd60e51b815260206004820152602260248201527f4d656469613a2063616c6c6572206e6f7420617070726f766564206164647265604482015261737360f01b60648201526084016107b3565b611aa2600082611ec3565b506001600055565b60026000541415611acd5760405162461bcd60e51b81526004016107b390613c5c565b60026000558080611add60185490565b11611afa5760405162461bcd60e51b81526004016107b390613ace565b600d5460405163776a083560e01b8152600481018490523360248201526001600160a01b039091169063776a083590604401600060405180830381600087803b158015611b4657600080fd5b505af1158015611b5a573d6000803e3d6000fd5b5050600160005550505050565b611b713383611ffc565b611b8d5760405162461bcd60e51b81526004016107b390613bd4565b611b99848484846125b9565b50505050565b60026000541415611bc25760405162461bcd60e51b81526004016107b390613c5c565b60026000553382611bd38282611ffc565b611bef5760405162461bcd60e51b81526004016107b390613b68565b600d5460405163ba33939960e01b81526001600160a01b039091169063ba339399906114609087908790600401613cd9565b60608180611c2e60185490565b11611c4b5760405162461bcd60e51b81526004016107b390613ace565b611c54836125ec565b9392505050565b6001546001600160a01b03163314611c855760405162461bcd60e51b81526004016107b390613b9f565b60408051608081018252600060608201818152825282516020818101909452909282019080611cc1611cb96012600a613de1565b60009061275b565b81525081526020016040518060200160405280611ced6012600a611ce59190613de1565b60649061275b565b90529052905060005b82518110156108e957611d22838281518110611d1457611d14613f91565b602002602001015183610f3c565b80611d2c81613f20565b915050611cf6565b6001546001600160a01b03163314611d5e5760405162461bcd60e51b81526004016107b390613b9f565b6001600160a01b038116611dc35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107b3565b611dcc81612453565b50565b600d546001600160a01b03163314611e295760405162461bcd60e51b815260206004820152601b60248201527f4d656469613a206f6e6c79206d61726b657420636f6e7472616374000000000060448201526064016107b3565b611e328261149d565b6000838152600f6020526040902080546001600160a01b0319166001600160a01b03929092169190911790556119f7611e6a8361149d565b8284604051806020016040528060008152506125b9565b60006001600160e01b0319821663780e9d6360e01b14806106b357506106b382612767565b6000908152600460205260409020546001600160a01b0316151590565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611ef88261149d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6040805180820182526004815263141313d560e21b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527faf76373b58b1481fc7445bcc4191ab0c3452c28550df5e6e81323cf3b4acaf97818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b600061200782611ea6565b6120685760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107b3565b60006120738361149d565b9050806001600160a01b0316846001600160a01b031614806120ba57506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b806120de5750836001600160a01b03166120d38461074b565b6001600160a01b0316145b949350505050565b6120ef82611ea6565b6121525760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016107b3565b600082815260086020908152604090912082516108e992840190613183565b600d546040516328220f3560e01b8152600481018390526001600160a01b03909116906328220f3590602401600060405180830381600087803b1580156121b757600080fd5b505af11580156121cb573d6000803e3d6000fd5b505050506108e98383836127b7565b815180516121fa5760405162461bcd60e51b81526004016107b390613c93565b6020830151805161221d5760405162461bcd60e51b81526004016107b390613c93565b604084015161227a5760405162461bcd60e51b8152602060048201526024808201527f4d656469613a20636f6e74656e742068617368206d757374206265206e6f6e2d6044820152637a65726f60e01b60648201526084016107b3565b60608401516122d95760405162461bcd60e51b815260206004820152602560248201527f4d656469613a206d657461646174612068617368206d757374206265206e6f6e6044820152642d7a65726f60d81b60648201526084016107b3565b60006122e460185490565b90506122f0868261295e565b6122fe601880546001019055565b61230c818660400151612978565b61231a8186606001516129b1565b6123288186602001516124a5565b6123368186600001516120e6565b6001600160a01b03861660009081526011602052604090205461235990826129ea565b50604085810151600090815260156020908152828220805460ff191660011790558382526010815282822080546001600160a01b038b81166001600160a01b03199283168117909355600f84529385902080549091169091179055600d5483516375aab41d60e11b8152600481018690528851516024820152918801515160448301529287015151606482015291169063eb55683a90608401600060405180830381600087803b15801561240c57600080fd5b505af1158015612420573d6000803e3d6000fd5b50505050505050505050565b612435816129f6565b6000908152600f6020526040902080546001600160a01b0319169055565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816124af81611ea6565b6124cb5760405162461bcd60e51b81526004016107b390613c25565b60008381526014602090815260409091208351611b9992850190613183565b816001600160a01b0316836001600160a01b0316141561254c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107b3565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6125c4848484612171565b6125d084848484612a36565b611b995760405162461bcd60e51b81526004016107b390613b16565b60606125f782611ea6565b61265d5760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b60648201526084016107b3565b6000828152600860205260408120805461267690613eeb565b80601f01602080910402602001604051908101604052809291908181526020018280546126a290613eeb565b80156126ef5780601f106126c4576101008083540402835291602001916126ef565b820191906000526020600020905b8154815290600101906020018083116126d257829003601f168201915b50505050509050600061270d60408051602081019091526000815290565b9050805160001415612720575092915050565b81511561275257808260405160200161273a929190613a0f565b60405160208183030381529060405292505050919050565b6120de84612b43565b6000611c548284613e89565b60006001600160e01b031982166380ac58cd60e01b148061279857506001600160e01b03198216635b5e139f60e01b145b806106b357506301ffc9a760e01b6001600160e01b03198316146106b3565b826001600160a01b03166127ca8261149d565b6001600160a01b03161461282e5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016107b3565b6001600160a01b0382166128905760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107b3565b61289b838383612c1a565b6128a6600082611ec3565b6001600160a01b03831660009081526005602052604081208054600192906128cf908490613ea8565b90915550506001600160a01b03821660009081526005602052604081208054600192906128fd908490613d72565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6119f7828260405180602001604052806000815250612c25565b8161298281611ea6565b61299e5760405162461bcd60e51b81526004016107b390613c25565b5060009182526012602052604090912055565b816129bb81611ea6565b6129d75760405162461bcd60e51b81526004016107b390613c25565b5060009182526013602052604090912055565b6000611c548284613d72565b6129ff81612c58565b60008181526008602052604090208054612a1890613eeb565b159050611dcc576000818152600860205260408120611dcc91613207565b60006001600160a01b0384163b15612b3857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612a7a903390899088908890600401613a3e565b602060405180830381600087803b158015612a9457600080fd5b505af1925050508015612ac4575060408051601f3d908101601f19168201909252612ac19181019061376b565b60015b612b1e573d808015612af2576040519150601f19603f3d011682016040523d82523d6000602084013e612af7565b606091505b508051612b165760405162461bcd60e51b81526004016107b390613b16565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506120de565b506001949350505050565b6060612b4e82611ea6565b612bb25760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016107b3565b6000612bc960408051602081019091526000815290565b90506000815111612be95760405180602001604052806000815250611c54565b80612bf384612cff565b604051602001612c04929190613a0f565b6040516020818303038152906040529392505050565b6108e9838383612dfc565b612c2f8383612eb4565b612c3c6000848484612a36565b6108e95760405162461bcd60e51b81526004016107b390613b16565b6000612c638261149d565b9050612c7181600084612c1a565b612c7c600083611ec3565b6001600160a01b0381166000908152600560205260408120805460019290612ca5908490613ea8565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b606081612d235750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612d4d5780612d3781613f20565b9150612d469050600a83613d8a565b9150612d27565b6000816001600160401b03811115612d6757612d67613fa7565b6040519080825280601f01601f191660200182016040528015612d91576020820181803683370190505b5090505b84156120de57612da6600183613ea8565b9150612db3600a86613f3b565b612dbe906030613d72565b60f81b818381518110612dd357612dd3613f91565b60200101906001600160f81b031916908160001a905350612df5600a86613d8a565b9450612d95565b6001600160a01b038316612e5757612e5281600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b612e7a565b816001600160a01b0316836001600160a01b031614612e7a57612e7a8382612ff3565b6001600160a01b038216612e91576108e981613090565b826001600160a01b0316826001600160a01b0316146108e9576108e9828261313f565b6001600160a01b038216612f0a5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107b3565b612f1381611ea6565b15612f605760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107b3565b612f6c60008383612c1a565b6001600160a01b0382166000908152600560205260408120805460019290612f95908490613d72565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000600161300084611514565b61300a9190613ea8565b6000838152600a602052604090205490915080821461305d576001600160a01b03841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a602090815260408084208490556001600160a01b039094168352600981528383209183525290812055565b600b546000906130a290600190613ea8565b6000838152600c6020526040812054600b80549394509092849081106130ca576130ca613f91565b9060005260206000200154905080600b83815481106130eb576130eb613f91565b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b80548061312357613123613f7b565b6001900381819060005260206000200160009055905550505050565b600061314a83611514565b6001600160a01b0390931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b82805461318f90613eeb565b90600052602060002090601f0160209004810192826131b157600085556131f7565b82601f106131ca57805160ff19168380011785556131f7565b828001600101855582156131f7579182015b828111156131f75782518255916020019190600101906131dc565b5061320392915061323d565b5090565b50805461321390613eeb565b6000825580601f10613223575050565b601f016020900490600052602060002090810190611dcc91905b5b80821115613203576000815560010161323e565b60006001600160401b0383111561326b5761326b613fa7565b61327e601f8401601f1916602001613d42565b905082815283838301111561329257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146132c057600080fd5b919050565b600082601f8301126132d657600080fd5b611c5483833560208501613252565b6000606082840312156132f757600080fd5b604051606081018181106001600160401b038211171561331957613319613fa7565b6040529050806133298484613356565b81526133388460208501613356565b602082015261334a8460408501613356565b60408201525092915050565b60006020828403121561336857600080fd5b604051602081018181106001600160401b038211171561338a5761338a613fa7565b6040529135825250919050565b6000608082840312156133a957600080fd5b6133b1613d1a565b905081358152602082013560ff811681146133cb57600080fd5b80602083015250604082013560408201526060820135606082015292915050565b6000608082840312156133fe57600080fd5b613406613d1a565b905081356001600160401b038082111561341f57600080fd5b61342b858386016132c5565b8352602084013591508082111561344157600080fd5b5061344e848285016132c5565b602083015250604082013560408201526060820135606082015292915050565b60006020828403121561348057600080fd5b611c54826132a9565b6000806040838503121561349c57600080fd5b6134a5836132a9565b91506134b3602084016132a9565b90509250929050565b6000806000606084860312156134d157600080fd5b6134da846132a9565b92506134e8602085016132a9565b9150604084013590509250925092565b6000806000806080858703121561350e57600080fd5b613517856132a9565b9350613525602086016132a9565b92506040850135915060608501356001600160401b0381111561354757600080fd5b8501601f8101871361355857600080fd5b61356787823560208401613252565b91505092959194509250565b6000806040838503121561358657600080fd5b61358f836132a9565b9150602083013580151581146135a457600080fd5b809150509250929050565b60008060008061012085870312156135c657600080fd5b6135cf856132a9565b935060208501356001600160401b038111156135ea57600080fd5b6135f6878288016133ec565b93505061360686604087016132e5565b91506136158660a08701613397565b905092959194509250565b6000806040838503121561363357600080fd5b61363c836132a9565b946020939093013593505050565b600080600060c0848603121561365f57600080fd5b613668846132a9565b92506020840135915061367e8560408601613397565b90509250925092565b6000602080838503121561369a57600080fd5b82356001600160401b03808211156136b157600080fd5b818501915085601f8301126136c557600080fd5b8135818111156136d7576136d7613fa7565b8060051b6136e6858201613d42565b8281528581019085870183870188018b101561370157600080fd5b60009350835b8581101561373e5781358781111561371d578586fd5b61372b8d8b838c01016133ec565b8552509288019290880190600101613707565b50909a9950505050505050505050565b60006020828403121561376057600080fd5b8135611c5481613fbd565b60006020828403121561377d57600080fd5b8151611c5481613fbd565b6000806080838503121561379b57600080fd5b82356001600160401b038111156137b157600080fd5b6137bd858286016133ec565b9250506134b384602085016132e5565b6000602082840312156137df57600080fd5b5035919050565b600080604083850312156137f957600080fd5b823591506134b3602084016132a9565b60008060006040848603121561381e57600080fd5b8335925060208401356001600160401b038082111561383c57600080fd5b818601915086601f83011261385057600080fd5b81358181111561385f57600080fd5b87602082850101111561387157600080fd5b6020830194508093505050509250925092565b600080828403606081121561389857600080fd5b833592506040601f19820112156138ae57600080fd5b50604051604081018181106001600160401b03821117156138d1576138d1613fa7565b8060405250602084013581526138e9604085016132a9565b6020820152809150509250929050565b60008082840360c081121561390d57600080fd5b8335925060a0601f198201121561392357600080fd5b5060405160a081018181106001600160401b038211171561394657613946613fa7565b80604052506020840135815261395e604085016132a9565b602082015261396f606085016132a9565b6040820152613980608085016132a9565b60608201526139928560a08601613356565b6080820152809150509250929050565b600081518084526139ba816020860160208601613ebf565b601f01601f19169290920160200192915050565b805182526020808201516001600160a01b03908116918401919091526040808301518216908401526060808301519091169083015260809081015151910152565b60008351613a21818460208801613ebf565b835190830190613a35818360208801613ebf565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613a71908301846139a2565b9695505050505050565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b602081526000611c5460208301846139a2565b60208082526028908201527f4d656469613a20746f6b656e2077697468207468617420696420646f6573206e6040820152671bdd08195e1a5cdd60c21b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601d908201527f4d656469613a204f6e6c7920617070726f766564206f72206f776e6572000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526018908201527f4d656469613a206e6f6e6578697374656e7420746f6b656e0000000000000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526026908201527f4d656469613a2073706563696669656420757269206d757374206265206e6f6e6040820152652d656d70747960d01b606082015260800190565b82815260c08101611c5460208301846139ce565b83815260e08101613d0160208301856139ce565b6001600160a01b039290921660c0919091015292915050565b604051608081016001600160401b0381118282101715613d3c57613d3c613fa7565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613d6a57613d6a613fa7565b604052919050565b60008219821115613d8557613d85613f4f565b500190565b600082613d9957613d99613f65565b500490565b600181815b80851115613dd9578160001904821115613dbf57613dbf613f4f565b80851615613dcc57918102915b93841c9390800290613da3565b509250929050565b6000611c548383600082613df7575060016106b3565b81613e04575060006106b3565b8160018114613e1a5760028114613e2457613e40565b60019150506106b3565b60ff841115613e3557613e35613f4f565b50506001821b6106b3565b5060208310610133831016604e8410600b8410161715613e63575081810a6106b3565b613e6d8383613d9e565b8060001904821115613e8157613e81613f4f565b029392505050565b6000816000190483118215151615613ea357613ea3613f4f565b500290565b600082821015613eba57613eba613f4f565b500390565b60005b83811015613eda578181015183820152602001613ec2565b83811115611b995750506000910152565b600181811c90821680613eff57607f821691505b60208210811415610cb057634e487b7160e01b600052602260045260246000fd5b6000600019821415613f3457613f34613f4f565b5060010190565b600082613f4a57613f4a613f65565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114611dcc57600080fdfea2646970667358221220ad6cc1838e8ee440596e604a86daf628043fc88f38dffb915caa9c18936b6faf64736f6c63430008070033000000000000000000000000b5fe28baad22578d3da379619da652975f21ab02000000000000000000000000282aa2c0fbd975da67361a91912b4c7ad7b01c63
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061027f5760003560e01c806370a082311161015c578063b320f459116100ce578063e7f4ce4f11610087578063e7f4ce4f146105e8578063e985e9c5146105fb578063f2fde38b14610637578063f6b630f01461064a578063f8ccd5de1461065d578063fad321971461068857600080fd5b8063b320f4591461054c578063b88d4fde1461055f578063ba33939914610572578063c87b56dd14610585578063de5236fb14610598578063e0fd045f146105bf57600080fd5b80638da5cb5b116101205780638da5cb5b146104d157806395d89b41146104e25780639d8e7260146104ea578063a1794bcd14610513578063a22cb46514610526578063b1e130fc1461053957600080fd5b806370a0823114610488578063715018a61461049b57806375682e79146104a357806378a89567146104b65780637a7a1202146104be57600080fd5b806328220f35116101f557806342966c68116101b957806342966c68146104165780634f6ccce71461042957806355a373d61461043c5780635bf624221461044f57806362f24b70146104625780636352211e1461047557600080fd5b806328220f35146103a35780632cca3237146103b65780632f745c59146103c957806330adf81f146103dc57806342842e0e1461040357600080fd5b80630bcd899b116102475780630bcd899b1461032f5780630e2a17781461034f578063157c3df91461036257806318160ddd1461037557806318e97fd11461037d57806323b872dd1461039057600080fd5b806301ddc3b51461028457806301ffc9a7146102b757806306fdde03146102da578063081812fc146102ef578063095ea7b31461031a575b600080fd5b6102a46102923660046137cd565b60136020526000908152604090205481565b6040519081526020015b60405180910390f35b6102ca6102c536600461374e565b6106a8565b60405190151581526020016102ae565b6102e26106b9565b6040516102ae9190613abb565b6103026102fd3660046137cd565b61074b565b6040516001600160a01b0390911681526020016102ae565b61032d610328366004613620565b6107d8565b005b6102a461033d36600461346e565b60176020526000908152604090205481565b61032d61035d36600461364a565b6108ee565b6102e26103703660046137cd565b610bec565b600b546102a4565b61032d61038b366004613809565b610cb6565b61032d61039e3660046134bc565b610e60565b61032d6103b13660046137cd565b610e91565b61032d6103c4366004613788565b610f3c565b6102a46103d7366004613620565b610fa2565b6102a47f49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad81565b61032d6104113660046134bc565b611038565b61032d6104243660046137cd565b611053565b6102a46104373660046137cd565b611161565b600e54610302906001600160a01b031681565b61032d61045d3660046138f9565b6111f4565b61032d610470366004613884565b61135a565b6103026104833660046137cd565b61149d565b6102a461049636600461346e565b611514565b61032d61159b565b61032d6104b1366004613809565b6115d1565b6102a4611762565b61032d6104cc3660046135af565b611772565b6001546001600160a01b0316610302565b6102e26119dd565b6103026104f83660046137cd565b600f602052600090815260409020546001600160a01b031681565b600d54610302906001600160a01b031681565b61032d610534366004613573565b6119ec565b61032d6105473660046137cd565b6119fb565b61032d61055a3660046137cd565b611aaa565b61032d61056d3660046134f8565b611b67565b61032d6105803660046138f9565b611b9f565b6102e26105933660046137cd565b611c21565b6102a47f2952e482b8e2b192305f87374d7af45dc2eafafe4f50d26a0c02e90f2fdbe14b81565b6103026105cd3660046137cd565b6010602052600090815260409020546001600160a01b031681565b61032d6105f6366004613687565b611c5b565b6102ca610609366004613489565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b61032d61064536600461346e565b611d34565b61032d6106583660046137e6565b611dcf565b6102a461066b366004613620565b601660209081526000928352604080842090915290825290205481565b6102a46106963660046137cd565b60126020526000908152604090205481565b60006106b382611e81565b92915050565b6060600280546106c890613eeb565b80601f01602080910402602001604051908101604052809291908181526020018280546106f490613eeb565b80156107415780601f1061071657610100808354040283529160200191610741565b820191906000526020600020905b81548152906001019060200180831161072457829003601f168201915b5050505050905090565b600061075682611ea6565b6107bc5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600660205260409020546001600160a01b031690565b60006107e38261149d565b9050806001600160a01b0316836001600160a01b031614156108515760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107b3565b336001600160a01b038216148061086d575061086d8133610609565b6108df5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016107b3565b6108e98383611ec3565b505050565b600260005414156109115760405162461bcd60e51b81526004016107b390613c5c565b60026000558161092081611ea6565b61093c5760405162461bcd60e51b81526004016107b390613c25565b8151158061094b575081514211155b61098f5760405162461bcd60e51b81526020600482015260156024820152741359591a584e8814195c9b5a5d08195e1c1a5c9959605a1b60448201526064016107b3565b6001600160a01b0384166109e55760405162461bcd60e51b815260206004820152601c60248201527f4d656469613a207370656e6465722063616e6e6f74206265203078300000000060448201526064016107b3565b60006109ef611f31565b90506000817f49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad8787601685610a238361149d565b6001600160a01b03168152602080820192909252604090810160009081208c82529092528120805491610a5583613f20565b9091555088516040805160208101969096526001600160a01b03909416938501939093526060840191909152608083015260a082015260c00160405160208183030381529060405280519060200120604051602001610acb92919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600060018286602001518760400151886060015160405160008152602001604052604051610b2d949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015610b4f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610b8d5750806001600160a01b0316610b828761149d565b6001600160a01b0316145b610bd45760405162461bcd60e51b81526020600482015260186024820152771359591a584e8814da59db985d1d5c99481a5b9d985b1a5960421b60448201526064016107b3565b610bde8787611ec3565b505060016000555050505050565b60608180610bf960185490565b11610c165760405162461bcd60e51b81526004016107b390613ace565b60008381526014602052604090208054610c2f90613eeb565b80601f0160208091040260200160405190810160405280929190818152602001828054610c5b90613eeb565b8015610ca85780601f10610c7d57610100808354040283529160200191610ca8565b820191906000526020600020905b815481529060010190602001808311610c8b57829003601f168201915b505050505091505b50919050565b60026000541415610cd95760405162461bcd60e51b81526004016107b390613c5c565b60026000553383610cea8282611ffc565b610d065760405162461bcd60e51b81526004016107b390613b68565b6000858152601260205260409020548590610d7e5760405162461bcd60e51b815260206004820152603260248201527f4d656469613a20746f6b656e20646f6573206e6f7420686176652068617368206044820152711bd98818dc99585d19590818dbdb9d195b9d60721b60648201526084016107b3565b84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050825115159150610dd690505760405162461bcd60e51b81526004016107b390613c93565b610e168787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506120e692505050565b867f702fe2dc2dc0f68023540aa4a1e11811c0f29112f6ebf01e61b90538e4f29810338888604051610e4a93929190613a7b565b60405180910390a2505060016000555050505050565b610e6a3382611ffc565b610e865760405162461bcd60e51b81526004016107b390613bd4565b6108e9838383612171565b60026000541415610eb45760405162461bcd60e51b81526004016107b390613c5c565b60026000553381610ec58282611ffc565b610ee15760405162461bcd60e51b81526004016107b390613b68565b600d546040516328220f3560e01b8152600481018590526001600160a01b03909116906328220f35906024015b600060405180830381600087803b158015610f2857600080fd5b505af1158015610bde573d6000803e3d6000fd5b60026000541415610f5f5760405162461bcd60e51b81526004016107b390613c5c565b60026000556001546001600160a01b03163314610f8e5760405162461bcd60e51b81526004016107b390613b9f565b610f993383836121da565b50506001600055565b6000610fad83611514565b821061100f5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016107b3565b506001600160a01b03919091166000908152600960209081526040808320938352929052205490565b6108e983838360405180602001604052806000815250611b67565b600260005414156110765760405162461bcd60e51b81526004016107b390613c5c565b60026000558061108581611ea6565b6110a15760405162461bcd60e51b81526004016107b390613c25565b33826110ad8282611ffc565b6110c95760405162461bcd60e51b81526004016107b390613b68565b60006110d48561149d565b6000868152601060205260409020549091506001600160a01b0380831691161461114c5760405162461bcd60e51b8152602060048201526024808201527f4d656469613a206f776e6572206973206e6f742063726561746f72206f66206d6044820152636564696160e01b60648201526084016107b3565b6111558561242c565b50506001600055505050565b600061116c600b5490565b82106111cf5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016107b3565b600b82815481106111e2576111e2613f91565b90600052602060002001549050919050565b600260005414156112175760405162461bcd60e51b81526004016107b390613c5c565b60026000558161122681611ea6565b6112425760405162461bcd60e51b81526004016107b390613c25565b81604001516001600160a01b0316336001600160a01b0316146112b15760405162461bcd60e51b815260206004820152602160248201527f4d61726b65743a20426964646572206d757374206265206d73672073656e64656044820152603960f91b60648201526084016107b3565b600e5460208301516001600160a01b039081169116146113265760405162461bcd60e51b815260206004820152602a60248201527f4d61726b65743a204269642063757272656e6379206d757374206265207574696044820152693634ba3c903a37b5b2b760b11b60648201526084016107b3565b600d546040516317b6b0d360e31b81526001600160a01b039091169063bdb5869890610f0e90869086903390600401613ced565b6002600054141561137d5760405162461bcd60e51b81526004016107b390613c5c565b6002600055338261138e8282611ffc565b6113aa5760405162461bcd60e51b81526004016107b390613b68565b600e5460208401516001600160a01b0390811691161461141f5760405162461bcd60e51b815260206004820152602a60248201527f4d61726b65743a2041736b2063757272656e6379206d757374206265207574696044820152693634ba3c903a37b5b2b760b11b60648201526084016107b3565b600d5460405163062f24b760e41b8152600481018690528451602482015260208501516001600160a01b039081166044830152909116906362f24b70906064015b600060405180830381600087803b15801561147a57600080fd5b505af115801561148e573d6000803e3d6000fd5b50506001600055505050505050565b6000818152600460205260408120546001600160a01b0316806106b35760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107b3565b60006001600160a01b03821661157f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107b3565b506001600160a01b031660009081526005602052604090205490565b6001546001600160a01b031633146115c55760405162461bcd60e51b81526004016107b390613b9f565b6115cf6000612453565b565b600260005414156115f45760405162461bcd60e51b81526004016107b390613c5c565b600260005533836116058282611ffc565b6116215760405162461bcd60e51b81526004016107b390613b68565b60008581526013602052604090205485906116965760405162461bcd60e51b815260206004820152602f60248201527f4d656469613a20746f6b656e20646f6573206e6f74206861766520686173682060448201526e6f6620697473206d6574616461746160881b60648201526084016107b3565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250508251151591506116ee90505760405162461bcd60e51b81526004016107b390613c93565b61172e8787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b867fe3df41127db820c79e5b8d541a63e40e3e97b9af96f7a50bded13091b70df9ae338888604051610e4a93929190613a7b565b600061176d60185490565b905090565b600260005414156117955760405162461bcd60e51b81526004016107b390613c5c565b6002600055805115806117a9575080514211155b6117f55760405162461bcd60e51b815260206004820152601a60248201527f4d656469613a206d696e7457697468536967206578706972656400000000000060448201526064016107b3565b60006117ff611f31565b6040808601516060870151602080880151516001600160a01b038b16600090815260179092529381208054959650909486947f2952e482b8e2b192305f87374d7af45dc2eafafe4f50d26a0c02e90f2fdbe14b9493929091908761186283613f20565b9091555088516040805160208101979097528601949094526060850192909252608084015260a083015260c082015260e001604051602081830303815290604052805190602001206040516020016118d192919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600060018285602001518660400151876060015160405160008152602001604052604051611933949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611955573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580159061198b5750806001600160a01b0316876001600160a01b0316145b6119d25760405162461bcd60e51b81526020600482015260186024820152771359591a584e8814da59db985d1d5c99481a5b9d985b1a5960421b60448201526064016107b3565b610bde8187876121da565b6060600380546106c890613eeb565b6119f73383836124ea565b5050565b60026000541415611a1e5760405162461bcd60e51b81526004016107b390613c5c565b6002600055611a2c8161074b565b6001600160a01b0316336001600160a01b031614611a975760405162461bcd60e51b815260206004820152602260248201527f4d656469613a2063616c6c6572206e6f7420617070726f766564206164647265604482015261737360f01b60648201526084016107b3565b611aa2600082611ec3565b506001600055565b60026000541415611acd5760405162461bcd60e51b81526004016107b390613c5c565b60026000558080611add60185490565b11611afa5760405162461bcd60e51b81526004016107b390613ace565b600d5460405163776a083560e01b8152600481018490523360248201526001600160a01b039091169063776a083590604401600060405180830381600087803b158015611b4657600080fd5b505af1158015611b5a573d6000803e3d6000fd5b5050600160005550505050565b611b713383611ffc565b611b8d5760405162461bcd60e51b81526004016107b390613bd4565b611b99848484846125b9565b50505050565b60026000541415611bc25760405162461bcd60e51b81526004016107b390613c5c565b60026000553382611bd38282611ffc565b611bef5760405162461bcd60e51b81526004016107b390613b68565b600d5460405163ba33939960e01b81526001600160a01b039091169063ba339399906114609087908790600401613cd9565b60608180611c2e60185490565b11611c4b5760405162461bcd60e51b81526004016107b390613ace565b611c54836125ec565b9392505050565b6001546001600160a01b03163314611c855760405162461bcd60e51b81526004016107b390613b9f565b60408051608081018252600060608201818152825282516020818101909452909282019080611cc1611cb96012600a613de1565b60009061275b565b81525081526020016040518060200160405280611ced6012600a611ce59190613de1565b60649061275b565b90529052905060005b82518110156108e957611d22838281518110611d1457611d14613f91565b602002602001015183610f3c565b80611d2c81613f20565b915050611cf6565b6001546001600160a01b03163314611d5e5760405162461bcd60e51b81526004016107b390613b9f565b6001600160a01b038116611dc35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107b3565b611dcc81612453565b50565b600d546001600160a01b03163314611e295760405162461bcd60e51b815260206004820152601b60248201527f4d656469613a206f6e6c79206d61726b657420636f6e7472616374000000000060448201526064016107b3565b611e328261149d565b6000838152600f6020526040902080546001600160a01b0319166001600160a01b03929092169190911790556119f7611e6a8361149d565b8284604051806020016040528060008152506125b9565b60006001600160e01b0319821663780e9d6360e01b14806106b357506106b382612767565b6000908152600460205260409020546001600160a01b0316151590565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611ef88261149d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6040805180820182526004815263141313d560e21b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527faf76373b58b1481fc7445bcc4191ab0c3452c28550df5e6e81323cf3b4acaf97818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b600061200782611ea6565b6120685760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107b3565b60006120738361149d565b9050806001600160a01b0316846001600160a01b031614806120ba57506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b806120de5750836001600160a01b03166120d38461074b565b6001600160a01b0316145b949350505050565b6120ef82611ea6565b6121525760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016107b3565b600082815260086020908152604090912082516108e992840190613183565b600d546040516328220f3560e01b8152600481018390526001600160a01b03909116906328220f3590602401600060405180830381600087803b1580156121b757600080fd5b505af11580156121cb573d6000803e3d6000fd5b505050506108e98383836127b7565b815180516121fa5760405162461bcd60e51b81526004016107b390613c93565b6020830151805161221d5760405162461bcd60e51b81526004016107b390613c93565b604084015161227a5760405162461bcd60e51b8152602060048201526024808201527f4d656469613a20636f6e74656e742068617368206d757374206265206e6f6e2d6044820152637a65726f60e01b60648201526084016107b3565b60608401516122d95760405162461bcd60e51b815260206004820152602560248201527f4d656469613a206d657461646174612068617368206d757374206265206e6f6e6044820152642d7a65726f60d81b60648201526084016107b3565b60006122e460185490565b90506122f0868261295e565b6122fe601880546001019055565b61230c818660400151612978565b61231a8186606001516129b1565b6123288186602001516124a5565b6123368186600001516120e6565b6001600160a01b03861660009081526011602052604090205461235990826129ea565b50604085810151600090815260156020908152828220805460ff191660011790558382526010815282822080546001600160a01b038b81166001600160a01b03199283168117909355600f84529385902080549091169091179055600d5483516375aab41d60e11b8152600481018690528851516024820152918801515160448301529287015151606482015291169063eb55683a90608401600060405180830381600087803b15801561240c57600080fd5b505af1158015612420573d6000803e3d6000fd5b50505050505050505050565b612435816129f6565b6000908152600f6020526040902080546001600160a01b0319169055565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816124af81611ea6565b6124cb5760405162461bcd60e51b81526004016107b390613c25565b60008381526014602090815260409091208351611b9992850190613183565b816001600160a01b0316836001600160a01b0316141561254c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107b3565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6125c4848484612171565b6125d084848484612a36565b611b995760405162461bcd60e51b81526004016107b390613b16565b60606125f782611ea6565b61265d5760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b60648201526084016107b3565b6000828152600860205260408120805461267690613eeb565b80601f01602080910402602001604051908101604052809291908181526020018280546126a290613eeb565b80156126ef5780601f106126c4576101008083540402835291602001916126ef565b820191906000526020600020905b8154815290600101906020018083116126d257829003601f168201915b50505050509050600061270d60408051602081019091526000815290565b9050805160001415612720575092915050565b81511561275257808260405160200161273a929190613a0f565b60405160208183030381529060405292505050919050565b6120de84612b43565b6000611c548284613e89565b60006001600160e01b031982166380ac58cd60e01b148061279857506001600160e01b03198216635b5e139f60e01b145b806106b357506301ffc9a760e01b6001600160e01b03198316146106b3565b826001600160a01b03166127ca8261149d565b6001600160a01b03161461282e5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016107b3565b6001600160a01b0382166128905760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107b3565b61289b838383612c1a565b6128a6600082611ec3565b6001600160a01b03831660009081526005602052604081208054600192906128cf908490613ea8565b90915550506001600160a01b03821660009081526005602052604081208054600192906128fd908490613d72565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6119f7828260405180602001604052806000815250612c25565b8161298281611ea6565b61299e5760405162461bcd60e51b81526004016107b390613c25565b5060009182526012602052604090912055565b816129bb81611ea6565b6129d75760405162461bcd60e51b81526004016107b390613c25565b5060009182526013602052604090912055565b6000611c548284613d72565b6129ff81612c58565b60008181526008602052604090208054612a1890613eeb565b159050611dcc576000818152600860205260408120611dcc91613207565b60006001600160a01b0384163b15612b3857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612a7a903390899088908890600401613a3e565b602060405180830381600087803b158015612a9457600080fd5b505af1925050508015612ac4575060408051601f3d908101601f19168201909252612ac19181019061376b565b60015b612b1e573d808015612af2576040519150601f19603f3d011682016040523d82523d6000602084013e612af7565b606091505b508051612b165760405162461bcd60e51b81526004016107b390613b16565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506120de565b506001949350505050565b6060612b4e82611ea6565b612bb25760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016107b3565b6000612bc960408051602081019091526000815290565b90506000815111612be95760405180602001604052806000815250611c54565b80612bf384612cff565b604051602001612c04929190613a0f565b6040516020818303038152906040529392505050565b6108e9838383612dfc565b612c2f8383612eb4565b612c3c6000848484612a36565b6108e95760405162461bcd60e51b81526004016107b390613b16565b6000612c638261149d565b9050612c7181600084612c1a565b612c7c600083611ec3565b6001600160a01b0381166000908152600560205260408120805460019290612ca5908490613ea8565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b606081612d235750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612d4d5780612d3781613f20565b9150612d469050600a83613d8a565b9150612d27565b6000816001600160401b03811115612d6757612d67613fa7565b6040519080825280601f01601f191660200182016040528015612d91576020820181803683370190505b5090505b84156120de57612da6600183613ea8565b9150612db3600a86613f3b565b612dbe906030613d72565b60f81b818381518110612dd357612dd3613f91565b60200101906001600160f81b031916908160001a905350612df5600a86613d8a565b9450612d95565b6001600160a01b038316612e5757612e5281600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b612e7a565b816001600160a01b0316836001600160a01b031614612e7a57612e7a8382612ff3565b6001600160a01b038216612e91576108e981613090565b826001600160a01b0316826001600160a01b0316146108e9576108e9828261313f565b6001600160a01b038216612f0a5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107b3565b612f1381611ea6565b15612f605760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107b3565b612f6c60008383612c1a565b6001600160a01b0382166000908152600560205260408120805460019290612f95908490613d72565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000600161300084611514565b61300a9190613ea8565b6000838152600a602052604090205490915080821461305d576001600160a01b03841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a602090815260408084208490556001600160a01b039094168352600981528383209183525290812055565b600b546000906130a290600190613ea8565b6000838152600c6020526040812054600b80549394509092849081106130ca576130ca613f91565b9060005260206000200154905080600b83815481106130eb576130eb613f91565b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b80548061312357613123613f7b565b6001900381819060005260206000200160009055905550505050565b600061314a83611514565b6001600160a01b0390931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b82805461318f90613eeb565b90600052602060002090601f0160209004810192826131b157600085556131f7565b82601f106131ca57805160ff19168380011785556131f7565b828001600101855582156131f7579182015b828111156131f75782518255916020019190600101906131dc565b5061320392915061323d565b5090565b50805461321390613eeb565b6000825580601f10613223575050565b601f016020900490600052602060002090810190611dcc91905b5b80821115613203576000815560010161323e565b60006001600160401b0383111561326b5761326b613fa7565b61327e601f8401601f1916602001613d42565b905082815283838301111561329257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146132c057600080fd5b919050565b600082601f8301126132d657600080fd5b611c5483833560208501613252565b6000606082840312156132f757600080fd5b604051606081018181106001600160401b038211171561331957613319613fa7565b6040529050806133298484613356565b81526133388460208501613356565b602082015261334a8460408501613356565b60408201525092915050565b60006020828403121561336857600080fd5b604051602081018181106001600160401b038211171561338a5761338a613fa7565b6040529135825250919050565b6000608082840312156133a957600080fd5b6133b1613d1a565b905081358152602082013560ff811681146133cb57600080fd5b80602083015250604082013560408201526060820135606082015292915050565b6000608082840312156133fe57600080fd5b613406613d1a565b905081356001600160401b038082111561341f57600080fd5b61342b858386016132c5565b8352602084013591508082111561344157600080fd5b5061344e848285016132c5565b602083015250604082013560408201526060820135606082015292915050565b60006020828403121561348057600080fd5b611c54826132a9565b6000806040838503121561349c57600080fd5b6134a5836132a9565b91506134b3602084016132a9565b90509250929050565b6000806000606084860312156134d157600080fd5b6134da846132a9565b92506134e8602085016132a9565b9150604084013590509250925092565b6000806000806080858703121561350e57600080fd5b613517856132a9565b9350613525602086016132a9565b92506040850135915060608501356001600160401b0381111561354757600080fd5b8501601f8101871361355857600080fd5b61356787823560208401613252565b91505092959194509250565b6000806040838503121561358657600080fd5b61358f836132a9565b9150602083013580151581146135a457600080fd5b809150509250929050565b60008060008061012085870312156135c657600080fd5b6135cf856132a9565b935060208501356001600160401b038111156135ea57600080fd5b6135f6878288016133ec565b93505061360686604087016132e5565b91506136158660a08701613397565b905092959194509250565b6000806040838503121561363357600080fd5b61363c836132a9565b946020939093013593505050565b600080600060c0848603121561365f57600080fd5b613668846132a9565b92506020840135915061367e8560408601613397565b90509250925092565b6000602080838503121561369a57600080fd5b82356001600160401b03808211156136b157600080fd5b818501915085601f8301126136c557600080fd5b8135818111156136d7576136d7613fa7565b8060051b6136e6858201613d42565b8281528581019085870183870188018b101561370157600080fd5b60009350835b8581101561373e5781358781111561371d578586fd5b61372b8d8b838c01016133ec565b8552509288019290880190600101613707565b50909a9950505050505050505050565b60006020828403121561376057600080fd5b8135611c5481613fbd565b60006020828403121561377d57600080fd5b8151611c5481613fbd565b6000806080838503121561379b57600080fd5b82356001600160401b038111156137b157600080fd5b6137bd858286016133ec565b9250506134b384602085016132e5565b6000602082840312156137df57600080fd5b5035919050565b600080604083850312156137f957600080fd5b823591506134b3602084016132a9565b60008060006040848603121561381e57600080fd5b8335925060208401356001600160401b038082111561383c57600080fd5b818601915086601f83011261385057600080fd5b81358181111561385f57600080fd5b87602082850101111561387157600080fd5b6020830194508093505050509250925092565b600080828403606081121561389857600080fd5b833592506040601f19820112156138ae57600080fd5b50604051604081018181106001600160401b03821117156138d1576138d1613fa7565b8060405250602084013581526138e9604085016132a9565b6020820152809150509250929050565b60008082840360c081121561390d57600080fd5b8335925060a0601f198201121561392357600080fd5b5060405160a081018181106001600160401b038211171561394657613946613fa7565b80604052506020840135815261395e604085016132a9565b602082015261396f606085016132a9565b6040820152613980608085016132a9565b60608201526139928560a08601613356565b6080820152809150509250929050565b600081518084526139ba816020860160208601613ebf565b601f01601f19169290920160200192915050565b805182526020808201516001600160a01b03908116918401919091526040808301518216908401526060808301519091169083015260809081015151910152565b60008351613a21818460208801613ebf565b835190830190613a35818360208801613ebf565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613a71908301846139a2565b9695505050505050565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b602081526000611c5460208301846139a2565b60208082526028908201527f4d656469613a20746f6b656e2077697468207468617420696420646f6573206e6040820152671bdd08195e1a5cdd60c21b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601d908201527f4d656469613a204f6e6c7920617070726f766564206f72206f776e6572000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526018908201527f4d656469613a206e6f6e6578697374656e7420746f6b656e0000000000000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526026908201527f4d656469613a2073706563696669656420757269206d757374206265206e6f6e6040820152652d656d70747960d01b606082015260800190565b82815260c08101611c5460208301846139ce565b83815260e08101613d0160208301856139ce565b6001600160a01b039290921660c0919091015292915050565b604051608081016001600160401b0381118282101715613d3c57613d3c613fa7565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613d6a57613d6a613fa7565b604052919050565b60008219821115613d8557613d85613f4f565b500190565b600082613d9957613d99613f65565b500490565b600181815b80851115613dd9578160001904821115613dbf57613dbf613f4f565b80851615613dcc57918102915b93841c9390800290613da3565b509250929050565b6000611c548383600082613df7575060016106b3565b81613e04575060006106b3565b8160018114613e1a5760028114613e2457613e40565b60019150506106b3565b60ff841115613e3557613e35613f4f565b50506001821b6106b3565b5060208310610133831016604e8410600b8410161715613e63575081810a6106b3565b613e6d8383613d9e565b8060001904821115613e8157613e81613f4f565b029392505050565b6000816000190483118215151615613ea357613ea3613f4f565b500290565b600082821015613eba57613eba613f4f565b500390565b60005b83811015613eda578181015183820152602001613ec2565b83811115611b995750506000910152565b600181811c90821680613eff57607f821691505b60208210811415610cb057634e487b7160e01b600052602260045260246000fd5b6000600019821415613f3457613f34613f4f565b5060010190565b600082613f4a57613f4a613f65565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114611dcc57600080fdfea2646970667358221220ad6cc1838e8ee440596e604a86daf628043fc88f38dffb915caa9c18936b6faf64736f6c63430008070033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b5fe28baad22578d3da379619da652975f21ab02000000000000000000000000282aa2c0fbd975da67361a91912b4c7ad7b01c63
-----Decoded View---------------
Arg [0] : marketContractAddr (address): 0xB5fe28bAAD22578d3DA379619da652975f21ab02
Arg [1] : tokenContractAddr (address): 0x282Aa2C0fbd975Da67361A91912B4c7AD7B01C63
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b5fe28baad22578d3da379619da652975f21ab02
Arg [1] : 000000000000000000000000282aa2c0fbd975da67361a91912b4c7ad7b01c63
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.