ERC-721
Overview
Max Total Supply
1,036 GRAIL
Holders
656
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 GRAILLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Grails
Compiler Version
v0.8.11+commit.d7f03943
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.9 <0.9.0; import "./IGrailsRevenues.sol"; import "./GrailsRevenues.sol"; import "@divergencetech/ethier/contracts/erc721/ERC721Common.sol"; import "@divergencetech/ethier/contracts/erc721/ERC721Redeemer.sol"; import "@divergencetech/ethier/contracts/utils/Monotonic.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** @author divergence */ contract Grails is ERC721Common { using Address for address payable; using ERC165Checker for address; using ERC721Redeemer for ERC721Redeemer.SingleClaims; using Monotonic for Monotonic.Increaser; using Strings for uint256; /** @notice Address of the PROOF collective token against which claims for this token can be redeemed. */ IERC721 public immutable PROOF; /** @notice Contract responsible for management of revenues from both primary and secondary sales. */ IGrailsRevenues internal revenues; constructor(IERC721 proof) ERC721Common("PROOF Collective Grails", "GRAIL") { PROOF = proof; revenues = new GrailsRevenues(msg.sender); } /** @notice Price of a single Grail. */ uint256 public constant PRICE = 0.05 ether; /** @dev BitMap of already-claimed tokens. */ ERC721Redeemer.SingleClaims internal claims; /** @notice Total number of tokens minted. */ Monotonic.Increaser public totalSupply; /** @notice Flag indicating that non-owner can st */ bool public publicMintingOpen = false; /** @notice Toggle whether non-owner addresses can start minting. */ function setPublicMinting(bool publicMinting) external onlyOwner { publicMintingOpen = publicMinting; } /** @dev Emitted when a PROOF token is used to mint a Grail. */ event PROOFTokenRedeemed(uint256 tokenId); /** @notice Allows PROOF tokens to be redeemed for Grails. @param proofTokenIds Tokens for which the caller MUST be either the owner or approved under ERC721 specifications. @param grailIds MUST be of the same length as `proofTokenIds`; the minter's Grail selections, 0-indexed. */ function mint(uint256[] calldata proofTokenIds, uint8[] calldata grailIds) external payable { require(publicMintingOpen, "Public minting closed"); require( proofTokenIds.length == grailIds.length, "Incorrect number of tokens" ); require(msg.value == proofTokenIds.length * PRICE, "Incorrect payment"); claims.redeem(msg.sender, PROOF, proofTokenIds); payable(address(revenues)).sendValue(msg.value); _mint(msg.sender, grailIds); for (uint256 i = 0; i < proofTokenIds.length; i++) { emit PROOFTokenRedeemed(proofTokenIds[i]); } } uint256 internal constant NUM_GRAILS = 20; /** @dev Each artist, as well as the development team, are allowed to choose two Grails to mint free of charge. */ uint256 public freeGrailsRemaining = (NUM_GRAILS + 1) * 2; /** @dev Each artist receives one of their own Grail, and PROOF receives one of each. */ uint256 public constant GENESIS_MINTS = 2 * NUM_GRAILS; /** @notice Flag indicating if the genesis mints have been claimed. */ bool public genesisMinted = false; /** @notice Allows the contract owner to mint the genesis pieces of each Grail. */ function mintGenesis(address to) external onlyOwner { require(!genesisMinted, "Already minted"); genesisMinted = true; uint8[] memory grailIds = new uint8[](GENESIS_MINTS); for (uint8 i = 0; i < NUM_GRAILS; i++) { uint256 idx = 2 * i; grailIds[idx] = i; grailIds[idx + 1] = i; } _mint(to, grailIds); } /** @notice Allows the contract owner to mint the gratis allocation for later distribution. */ function mintFree(address to, uint8[] calldata grailIds) external onlyOwner { require(grailIds.length <= freeGrailsRemaining, "Quota exceeded"); freeGrailsRemaining -= grailIds.length; _mint(to, grailIds); } /** @notice Flag indicating that no more minting is allowed, even for PROOF token redemptions. */ bool public mintingLocked = false; /** @notice Permanently lock minting for everyone. */ function lockMinting() external onlyOwner { mintingLocked = true; } /** @dev The Grail chosen for the respective token. */ uint8[] internal tokenGrails; /** @notice How many times each Grail has been minted. */ uint16[NUM_GRAILS] public grailMintCounts; /** @dev Emitted when the specific Grail is minted. */ event GrailMinted(uint8 indexed grailId); /** @dev Common internal minting logic. */ function _mint(address to, uint8[] memory grailIds) internal { require(!mintingLocked, "Minting locked"); uint256 firstTokenId = totalSupply.current(); for (uint256 i = 0; i < grailIds.length; i++) { uint8 grail = grailIds[i]; require(grail < NUM_GRAILS, "Invalid Grail ID"); tokenGrails.push(grail); grailMintCounts[grail]++; emit GrailMinted(grail); _safeMint(to, firstTokenId + i); } totalSupply.add(grailIds.length); // Contract invariant in place for testing, therefore assert. assert(totalSupply.current() == tokenGrails.length); } /** @notice Returns whether the PROOF token has already been used to claim a Grail. */ function proofClaimed(uint256 tokenId) external view returns (bool) { require(tokenId < 1000, "Token doesn't exist"); return claims.claimed(tokenId); } /** @notice Sets the contract responsible for revenue management. @dev Requires that the address supports the IGrailsRevenues interface. */ function setRevenuesContract(IGrailsRevenues _revenues) external onlyOwner { require( address(_revenues).supportsInterface( type(IGrailsRevenues).interfaceId ), "Not IGrailsRevenues" ); revenues = _revenues; } /** @notice Implementation of ERC2981 royalty standard. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address, uint256) { require(tokenId < totalSupply.current(), "Token doesn't exist"); uint8 grailId = tokenGrails[tokenId]; uint256 basisPoints = revenues.royaltyBasisPoints(grailId); return (revenues.receiver(grailId), (salePrice * basisPoints) / 1e4); } /** @notice Prefix for all URIs returned by tokenURI(). */ string public baseTokenURI; /** @notice Update the tokenURI() prefix. */ function setBaseTokenURI(string memory _baseTokenURI) external onlyOwner { baseTokenURI = _baseTokenURI; } /** @notice Returns the token's metadata URI. */ function tokenURI(uint256 tokenId) public view override returns (string memory) { uint256 grailId = uint256(tokenGrails[tokenId]); return string( abi.encodePacked( baseTokenURI, "/", grailId.toString(), "/", tokenId.toString() ) ); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9 <0.9.0; import "@openzeppelin/contracts/interfaces/IERC165.sol"; interface IGrailsRevenues is IERC165 { /** @notice Returns the address to which revenues for the specified Grail should be sent. */ function receiver(uint8 grailId) external view returns (address); /** @notice Returns the royalty basis points for the specified Grail. */ function royaltyBasisPoints(uint8 grailId) external view returns (uint256); /** @dev Single-word representation of a share of the balance to be disbursed. */ struct Disbursement { uint8 grailId; uint248 value; } /** @notice Disburses the revenues amongst artists based on the specified split. @dev This is a workaround because OpenSea doesn't support ERC2981 and also doesn't allow for multiple royalty recipients in a collection. As a result, there is some level of off-chain trust that is unavoidable, but can at least be audited. @param shares Individual values SHOULD sum to the current balance of the contract to allow for a clear audit trail. */ function disburseBalance(Disbursement[] calldata shares) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9 <0.9.0; import "./IGrailsRevenues.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; contract GrailsRevenues is AccessControlEnumerable, IGrailsRevenues { using Address for address payable; constructor(address admin) { _setupRole(DEFAULT_ADMIN_ROLE, admin); } /** @notice Role that is allowed to modify any and all artist addresses / royalty percentages, and also disburse funds. */ bytes32 public constant FUNDS_ADMIN = keccak256("FUNDS_ADMIN"); /** @dev Emitted when payment is received by the fallback function. */ event ValueReceived(address from, uint256 value); receive() external payable { emit ValueReceived(msg.sender, msg.value); } uint8 private constant NUM_GRAILS = 20; /** @dev Requires that the Grail ID is valid. */ modifier grailExists(uint8 grailId) { require(grailId < NUM_GRAILS, "Grail doesn't exist"); _; } /** @notice Primary addresses of each Grail's respective artist. */ address[NUM_GRAILS] public artists; /** @dev Requires that the caller is either the respective Grail artist, or an administrator. */ modifier onlyAdminOrArtist(uint8 grailId) { require( hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(FUNDS_ADMIN, msg.sender) || msg.sender == artists[grailId], "Not owner nor admin" ); _; } /** @dev Requires that the caller is an administrator; either DEFAULT_ADMIN_ROLE or FUNDS_ADMIN. */ modifier onlyAdmin() { require( hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(FUNDS_ADMIN, msg.sender), "Not funds admin" ); _; } /** @notice Optional override address for each Grail's respective artist to redirect payments to a different address to their own. For example, they may wish to automatically send all revenues to Coinbase and leave their primary address as zero, thereby relinquishing control if they're not comfortable with wallet security. */ mapping(uint8 => address) private receivers; /** @notice Sets the address of the artist for the associated Grail. */ function transferGrailControl(uint8 grailId, address to) external grailExists(grailId) onlyAdminOrArtist(grailId) { artists[grailId] = to; } /** @notice Sets the recipient of all funds associated with the specific Grail. If set to the zero address, the receiver defaults to the artist's address. If that too is the zero address, then this contract is the receiver and it holds the funds in escrow. */ function setReceiver(uint8 grailId, address rcv) external grailExists(grailId) onlyAdminOrArtist(grailId) { receivers[grailId] = rcv; } /** @notice Returns the address to which revenues for the specified Grail should be sent. */ function receiver(uint8 grailId) external view returns (address) { address rcv = _receiver(grailId); if (rcv == address(0)) { // Artist is yet to set their address so we'll distribute it for // them when they do. rcv = address(this); } return rcv; } /** @dev Internal implementation of receiver(), which has to be external as it's part of an interface, but is required internally too. */ function _receiver(uint8 grailId) internal view grailExists(grailId) returns (address) { address rcv = receivers[grailId]; if (rcv == address(0)) { rcv = artists[grailId]; } return rcv; } /** @dev The per-Grail basis points of royalties to be requested under ERC2981. As the unset value is zero, this is modified to DEFAULT_ROYALTY_BASIS_POINTS; to set an explicit zero royalty, set the Grail's value to >MAX_BASIS_POINTS. See royaltyBasisPointsFor(). */ mapping(uint8 => uint256) private _royaltyBasisPoints; uint256 public constant DEFAULT_ROYALTY_BASIS_POINTS = 10 * 100; uint256 private constant MAX_BASIS_POINTS = 100 * 100; /** @notice Sets the royalty basis points for the specified Grail. */ function setRoyaltyBasisPoints(uint8 grailId, uint256 basisPoints) external grailExists(grailId) onlyAdminOrArtist(grailId) { require(basisPoints <= MAX_BASIS_POINTS, "Over 100%"); if (basisPoints == 0) { // See royaltyBasisPoints() for differentiation between unset and // zero values. basisPoints = MAX_BASIS_POINTS + 1; } _royaltyBasisPoints[grailId] = basisPoints; } /** @notice Returns the royalty basis points for the specified Grail, or a DEFAULT_ROYALTY_BASIS_POINTS if none is set. */ function royaltyBasisPoints(uint8 grailId) external view grailExists(grailId) returns (uint256) { uint256 basisPoints = _royaltyBasisPoints[grailId]; // We can't differentiate between a missing value in the map and an // explicit zero, so we use an impossible value as a sentinel to signal // an explicit zero. if (basisPoints > MAX_BASIS_POINTS) { return 0; } if (basisPoints == 0) { return DEFAULT_ROYALTY_BASIS_POINTS; } return basisPoints; } /** @dev Emitted by disburseBalance() when revenues distributed. */ event BalanceShared(uint8 indexed grailId, address to, uint256 value); /** @notice Total balance shared to each Grail receiver, regardless of which address was used as the receiver at the time. @dev For more specific counts, see BalanceShared event logs. */ uint256[NUM_GRAILS] public disbursed; /** @notice Disburses the revenues amongst artists based on the specified split. @dev This is a workaround because OpenSea doesn't support ERC2981 and also doesn't allow for multiple royalty recipients in a collection. As a result, there is some level of off-chain trust that is unavoidable, but can at least be audited. Note that by nature of being onlyAdmin, this is non-reentrant. @param shares Individual values SHOULD sum to the current balance of the contract to allow for a clear audit trail. */ function disburseBalance(Disbursement[] calldata shares) external onlyAdmin { for (uint8 i = 0; i < shares.length; i++) { uint256 value = shares[i].value; if (value == 0) { continue; } address rcv = _receiver(shares[i].grailId); require(rcv != address(0), "Send to zero address"); payable(rcv).sendValue(value); emit BalanceShared(shares[i].grailId, rcv, value); disbursed[shares[i].grailId] += value; } } /** @notice Returns true iff interfaceId is that of IGrailsRevenues or IERC165. */ function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, IERC165) returns (bool) { return interfaceId == type(IGrailsRevenues).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/BitMaps.sol) pragma solidity ^0.8.0; /** * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential. * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor]. */ library BitMaps { struct BitMap { mapping(uint256 => uint256) _data; } /** * @dev Returns whether the bit at `index` is set. */ function get(BitMap storage bitmap, uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); return bitmap._data[bucket] & mask != 0; } /** * @dev Sets the bit at `index` to the boolean `value`. */ function setTo( BitMap storage bitmap, uint256 index, bool value ) internal { if (value) { set(bitmap, index); } else { unset(bitmap, index); } } /** * @dev Sets the bit at `index`. */ function set(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] |= mask; } /** * @dev Unsets the bit at `index`. */ function unset(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] &= ~mask; } }
// 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 v4.4.1 (utils/introspection/ERC165Checker.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Library used to query support of an interface declared via {IERC165}. * * Note that these functions return the actual result of the query: they do not * `revert` if an interface is not supported. It is up to the caller to decide * what to do in these cases. */ library ERC165Checker { // As per the EIP-165 spec, no interface should ever match 0xffffffff bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff; /** * @dev Returns true if `account` supports the {IERC165} interface, */ function supportsERC165(address account) internal view returns (bool) { // Any contract that implements ERC165 must explicitly indicate support of // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid return _supportsERC165Interface(account, type(IERC165).interfaceId) && !_supportsERC165Interface(account, _INTERFACE_ID_INVALID); } /** * @dev Returns true if `account` supports the interface defined by * `interfaceId`. Support for {IERC165} itself is queried automatically. * * See {IERC165-supportsInterface}. */ function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) { // query support of both ERC165 as per the spec and support of _interfaceId return supportsERC165(account) && _supportsERC165Interface(account, interfaceId); } /** * @dev Returns a boolean array where each value corresponds to the * interfaces passed in and whether they're supported or not. This allows * you to batch check interfaces for a contract where your expectation * is that some interfaces may not be supported. * * See {IERC165-supportsInterface}. * * _Available since v3.4._ */ function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) { // an array of booleans corresponding to interfaceIds and whether they're supported or not bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length); // query support of ERC165 itself if (supportsERC165(account)) { // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]); } } return interfaceIdsSupported; } /** * @dev Returns true if `account` supports all the interfaces defined in * `interfaceIds`. Support for {IERC165} itself is queried automatically. * * Batch-querying can lead to gas savings by skipping repeated checks for * {IERC165} support. * * See {IERC165-supportsInterface}. */ function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) { // query support of ERC165 itself if (!supportsERC165(account)) { return false; } // query support of each interface in _interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { if (!_supportsERC165Interface(account, interfaceIds[i])) { return false; } } // all interfaces supported return true; } /** * @notice Query if a contract implements an interface, does not check ERC165 support * @param account The address of the contract to query for support of an interface * @param interfaceId The interface identifier, as specified in ERC-165 * @return true if the contract at account indicates support of the interface with * identifier interfaceId, false otherwise * @dev Assumes that account contains a contract that supports ERC165, otherwise * the behavior of this method is undefined. This precondition can be checked * with {supportsERC165}. * Interface identification is specified in ERC-165. */ function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) { bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId); (bool success, bytes memory result) = account.staticcall{gas: 30000}(encodedParams); if (result.length < 32) return false; return success && abi.decode(result, (bool)); } }
// 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/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/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // 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 v4.4.1 (token/ERC721/extensions/ERC721Pausable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../security/Pausable.sol"; /** * @dev ERC721 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. */ abstract contract ERC721Pausable is ERC721, Pausable { /** * @dev See {ERC721-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); require(!paused(), "ERC721Pausable: token transfer while paused"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 `IERC721.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/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`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _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 || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev 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 {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol) pragma solidity ^0.8.0; import "../token/ERC721/IERC721.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol";
// 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 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; /// @notice A Pausable contract that can only be toggled by the Owner. contract OwnerPausable is Ownable, Pausable { /// @notice Pauses the contract. function pause() public onlyOwner { Pausable._pause(); } /// @notice Unpauses the contract. function unpause() public onlyOwner { Pausable._unpause(); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; /** @notice Provides monotonic increasing and decreasing values, similar to OpenZeppelin's Counter but (a) limited in direction, and (b) allowing for steps > 1. */ library Monotonic { /** @notice Holds a value that can only increase. @dev The internal value MUST NOT be accessed directly. Instead use current() and add(). */ struct Increaser { uint256 value; } /// @notice Returns the current value of the Increaser. function current(Increaser storage incr) internal view returns (uint256) { return incr.value; } /// @notice Adds x to the Increaser's value. function add(Increaser storage incr, uint256 x) internal { incr.value += x; } /** @notice Holds a value that can only decrease. @dev The internal value MUST NOT be accessed directly. Instead use current() and subtract(). */ struct Decreaser { uint256 value; } /// @notice Returns the current value of the Decreaser. function current(Decreaser storage decr) internal view returns (uint256) { return decr.value; } /// @notice Subtracts x from the Decreaser's value. function subtract(Decreaser storage decr, uint256 x) internal { decr.value -= x; } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; /// @notice A minimal interface describing OpenSea's Wyvern proxy registry. contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } /** @dev This pattern of using an empty contract is cargo-culted directly from OpenSea's example code. TODO: it's likely that the above mapping can be changed to address => address without affecting anything, but further investigation is needed (i.e. is there a subtle reason that OpenSea released it like this?). */ contract OwnableDelegateProxy { }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; // Inspired by BaseOpenSea by Simon Fremaux (@dievardump) but without the need // to pass specific addresses depending on deployment network. // https://gist.github.com/dievardump/483eb43bc6ed30b14f01e01842e3339b/ import "./ProxyRegistry.sol"; /// @notice Library to achieve gas-free listings on OpenSea. library OpenSeaGasFreeListing { /** @notice Returns whether the operator is an OpenSea proxy for the owner, thus allowing it to list without the token owner paying gas. @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if this function returns true. */ function isApprovedForAll(address owner, address operator) internal view returns (bool) { address proxy = proxyFor(owner); return proxy != address(0) && proxy == operator; } /** @notice Returns the OpenSea proxy address for the owner. */ function proxyFor(address owner) internal view returns (address) { address registry; uint256 chainId; assembly { chainId := chainid() switch chainId // Production networks are placed higher to minimise the number of // checks performed and therefore reduce gas. By the same rationale, // mainnet comes before Polygon as it's more expensive. case 1 { // mainnet registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1 } case 137 { // polygon registry := 0x58807baD0B376efc12F5AD86aAc70E78ed67deaE } case 4 { // rinkeby registry := 0xf57b2c51ded3a29e6891aba85459d600256cf317 } case 80001 { // mumbai registry := 0xff7Ca10aF37178BdD056628eF42fD7F799fAc77c } case 1337 { // The geth SimulatedBackend iff used with the ethier // openseatest package. This is mocked as a Wyvern proxy as it's // more complex than the 0x ones. registry := 0xE1a2bbc877b29ADBC56D2659DBcb0ae14ee62071 } } // Unlike Wyvern, the registry itself is the proxy for all owners on 0x // chains. if (registry == address(0) || chainId == 137 || chainId == 80001) { return registry; } return address(ProxyRegistry(registry).proxies(owner)); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2022 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/interfaces/IERC721.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/structs/BitMaps.sol"; /** @notice Allows holders of ERC721 tokens to redeem rights to some claim; for example, the right to mint a token of some other collection. */ library ERC721Redeemer { using BitMaps for BitMaps.BitMap; using Strings for uint256; /** @notice Storage value to track already-claimed redemptions for a specific token collection. */ struct Claims { /** @dev This field MUST NOT be considered part of the public API. Instead, prefer `using ERC721Redeemer for ERC721Redeemer.Claims` and utilise the provided functions. */ mapping(uint256 => uint256) _total; } /** @notice Storage value to track already-claimed redemptions for a specific token collection, given that there is only a single claim allowed per tokenId. */ struct SingleClaims { /** @dev This field MUST NOT be considered part of the public API. Instead, prefer `using ERC721Redeemer for ERC721Redeemer.SingleClaims` and utilise the provided functions. */ BitMaps.BitMap _claimed; } /** @notice Emitted when a token's claim is redeemed. */ event Redemption( IERC721 indexed token, address indexed redeemer, uint256 tokenId, uint256 n ); /** @notice Checks that the redeemer is allowed to redeem the claims for the tokenIds by being either the owner or approved address for all tokenIds, and updates the Claims to reflect this. @dev For more efficient gas usage, recurring values in tokenIds SHOULD be adjacent to one another as this will batch expensive operations. The simplest way to achieve this is by sorting tokenIds. @param tokenIds The token IDs for which the claims are being redeemed. If maxAllowance > 1 then identical tokenIds can be passed more than once; see dev comments. @return The number of redeemed claims; either 0 or tokenIds.length; */ function redeem( Claims storage claims, uint256 maxAllowance, address redeemer, IERC721 token, uint256[] calldata tokenIds ) internal returns (uint256) { if (maxAllowance == 0 || tokenIds.length == 0) { return 0; } // See comment for `endSameId`. bool multi = maxAllowance > 1; for ( uint256 i = 0; i < tokenIds.length; /* note increment at end */ ) { uint256 tokenId = tokenIds[i]; requireOwnerOrApproved(token, tokenId, redeemer); uint256 n = 1; if (multi) { // If allowed > 1 we can save on expensive operations like // checking ownership / remaining allowance by batching equal // tokenIds. The algorithm assumes that equal IDs are adjacent // in the array. uint256 endSameId; for ( endSameId = i + 1; endSameId < tokenIds.length && tokenIds[endSameId] == tokenId; endSameId++ ) {} n = endSameId - i; } claims._total[tokenId] += n; if (claims._total[tokenId] > maxAllowance) { revertWithTokenId( "ERC721Redeemer: over allowance for", tokenId ); } i += n; emit Redemption(token, redeemer, tokenId, n); } return tokenIds.length; } /** @notice Checks that the redeemer is allowed to redeem the single claim for each of the tokenIds by being either the owner or approved address for all tokenIds, and updates the SingleClaims to reflect this. @param tokenIds The token IDs for which the claims are being redeemed. Only a single claim can be made against a tokenId. @return The number of redeemed claims; either 0 or tokenIds.length; */ function redeem( SingleClaims storage claims, address redeemer, IERC721 token, uint256[] calldata tokenIds ) internal returns (uint256) { if (tokenIds.length == 0) { return 0; } for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; requireOwnerOrApproved(token, tokenId, redeemer); if (claims._claimed.get(tokenId)) { revertWithTokenId( "ERC721Redeemer: over allowance for", tokenId ); } claims._claimed.set(tokenId); emit Redemption(token, redeemer, tokenId, 1); } return tokenIds.length; } /** @dev Reverts if neither the owner nor approved for the tokenId. */ function requireOwnerOrApproved( IERC721 token, uint256 tokenId, address redeemer ) private view { if ( token.ownerOf(tokenId) != redeemer && token.getApproved(tokenId) != redeemer ) { revertWithTokenId( "ERC721Redeemer: not approved nor owner of", tokenId ); } } /** @notice Reverts with the concatenation of revertMsg and tokenId.toString(). @dev Used to save gas by constructing the revert message only as required, instead of passing it to require(). */ function revertWithTokenId(string memory revertMsg, uint256 tokenId) private pure { revert(string(abi.encodePacked(revertMsg, " ", tokenId.toString()))); } /** @notice Returns the number of claimed redemptions for the token. */ function claimed(Claims storage claims, uint256 tokenId) internal view returns (uint256) { return claims._total[tokenId]; } /** @notice Returns whether the token has had a claim made against it. */ function claimed(SingleClaims storage claims, uint256 tokenId) internal view returns (bool) { return claims._claimed.get(tokenId); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "../thirdparty/opensea/OpenSeaGasFreeListing.sol"; import "../utils/OwnerPausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; /** @notice An ERC721 contract with common functionality: - OpenSea gas-free listings - OpenZeppelin Pausable - OpenZeppelin Pausable with functions exposed to Owner only */ contract ERC721Common is Context, ERC721Pausable, OwnerPausable { constructor(string memory name, string memory symbol) ERC721(name, symbol) {} /// @notice Requires that the token exists. modifier tokenExists(uint256 tokenId) { require(ERC721._exists(tokenId), "ERC721Common: Token doesn't exist"); _; } /// @notice Requires that msg.sender owns or is approved for the token. modifier onlyApprovedOrOwner(uint256 tokenId) { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721Common: Not approved nor owner" ); _; } /// @notice Overrides _beforeTokenTransfer as required by inheritance. function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override(ERC721Pausable) { super._beforeTokenTransfer(from, to, tokenId); } /// @notice Overrides supportsInterface as required by inheritance. function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721) returns (bool) { return super.supportsInterface(interfaceId); } /** @notice Returns true if either standard isApprovedForAll() returns true or the operator is the OpenSea proxy for the owner. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return super.isApprovedForAll(owner, operator) || OpenSeaGasFreeListing.isApprovedForAll(owner, operator); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC721","name":"proof","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":"uint8","name":"grailId","type":"uint8"}],"name":"GrailMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"PROOFTokenRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"GENESIS_MINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROOF","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freeGrailsRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genesisMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"grailMintCounts","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"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":"lockMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"proofTokenIds","type":"uint256[]"},{"internalType":"uint8[]","name":"grailIds","type":"uint8[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint8[]","name":"grailIds","type":"uint8[]"}],"name":"mintFree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mintGenesis","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"proofClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintingOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseTokenURI","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"publicMinting","type":"bool"}],"name":"setPublicMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IGrailsRevenues","name":"_revenues","type":"address"}],"name":"setRevenuesContract","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":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a0604052600a805460ff191690556200001c60146001620002a1565b62000029906002620002bc565b600b55600c805461ffff191690553480156200004457600080fd5b5060405162004c0a38038062004c0a8339810160408190526200006791620002de565b604080518082018252601781527f50524f4f4620436f6c6c65637469766520477261696c7300000000000000000060208083019182528351808501909452600584526411d490525360da1b90840152815191929183918391620000cd91600091620001d7565b508051620000e3906001906020840190620001d7565b50505062000100620000fa6200018160201b60201c565b62000185565b50506006805460ff60a01b191690556001600160a01b03811660805260405133906200012c9062000266565b6001600160a01b039091168152602001604051809103906000f08015801562000159573d6000803e3d6000fd5b50600780546001600160a01b0319166001600160a01b0392909216919091179055506200034d565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001e59062000310565b90600052602060002090601f01602090048101928262000209576000855562000254565b82601f106200022457805160ff191683800117855562000254565b8280016001018555821562000254579182015b828111156200025457825182559160200191906001019062000237565b506200026292915062000274565b5090565b6117bc806200344e83390190565b5b8082111562000262576000815560010162000275565b634e487b7160e01b600052601160045260246000fd5b60008219821115620002b757620002b76200028b565b500190565b6000816000190483118215151615620002d957620002d96200028b565b500290565b600060208284031215620002f157600080fd5b81516001600160a01b03811681146200030957600080fd5b9392505050565b600181811c908216806200032557607f821691505b602082108114156200034757634e487b7160e01b600052602260045260246000fd5b50919050565b6080516130de62000370600039600081816103950152610d3701526130de6000f3fe6080604052600436106102255760003560e01c80636352211e1161012357806395d89b41116100ab578063c87b56dd1161006f578063c87b56dd1461065e578063d547cfb71461067e578063e985e9c514610693578063f0dff7d3146106b3578063f2fde38b146106cd57600080fd5b806395d89b41146105d35780639a38d2fc146105e8578063a22cb46514610608578063a424e70514610628578063b88d4fde1461063e57600080fd5b80637a7dfd02116100f25780637a7dfd02146105325780638456cb59146105655780638d859f3e1461057a5780638da5cb5b1461059557806394020392146105b357600080fd5b80636352211e146104bd5780636adca3a4146104dd57806370a08231146104fd578063715018a61461051d57600080fd5b80631d793318116101b15780632a64c5cc116101755780632a64c5cc1461043657806330176e13146104495780633f4ba83a1461046957806342842e0e1461047e5780635c975abb1461049e57600080fd5b80631d793318146103635780631e46e4d31461038357806323b872dd146103b7578063254a4737146103d75780632a55205a146103f757600080fd5b8063095ea7b3116101f8578063095ea7b3146102dc5780630d7982ad146102fe5780630fc50ebb14610313578063153de1431461033257806318160ddd1461034c57600080fd5b806301ffc9a71461022a57806306fdde031461025f578063081812fc146102815780630928b66c146102b9575b600080fd5b34801561023657600080fd5b5061024a6102453660046127c9565b6106ed565b60405190151581526020015b60405180910390f35b34801561026b57600080fd5b506102746106fe565b604051610256919061283e565b34801561028d57600080fd5b506102a161029c366004612851565b610790565b6040516001600160a01b039091168152602001610256565b3480156102c557600080fd5b506102ce61082a565b604051908152602001610256565b3480156102e857600080fd5b506102fc6102f736600461287f565b610839565b005b34801561030a57600080fd5b506102fc61094f565b34801561031f57600080fd5b50600c5461024a90610100900460ff1681565b34801561033e57600080fd5b50600c5461024a9060ff1681565b34801561035857600080fd5b506009546102ce9081565b34801561036f57600080fd5b506102fc61037e3660046128f0565b61098a565b34801561038f57600080fd5b506102a17f000000000000000000000000000000000000000000000000000000000000000081565b3480156103c357600080fd5b506102fc6103d2366004612945565b610a50565b3480156103e357600080fd5b506102fc6103f2366004612994565b610a81565b34801561040357600080fd5b506104176104123660046129b1565b610abe565b604080516001600160a01b039093168352602083019190915201610256565b6102fc6104443660046129d3565b610c43565b34801561045557600080fd5b506102fc610464366004612acb565b610e26565b34801561047557600080fd5b506102fc610e67565b34801561048a57600080fd5b506102fc610499366004612945565b610e9b565b3480156104aa57600080fd5b50600654600160a01b900460ff1661024a565b3480156104c957600080fd5b506102a16104d8366004612851565b610eb6565b3480156104e957600080fd5b5061024a6104f8366004612851565b610f2d565b34801561050957600080fd5b506102ce610518366004612b14565b610f81565b34801561052957600080fd5b506102fc611008565b34801561053e57600080fd5b5061055261054d366004612851565b61103c565b60405161ffff9091168152602001610256565b34801561057157600080fd5b506102fc61106a565b34801561058657600080fd5b506102ce66b1a2bc2ec5000081565b3480156105a157600080fd5b506006546001600160a01b03166102a1565b3480156105bf57600080fd5b506102fc6105ce366004612b14565b61109c565b3480156105df57600080fd5b506102746111fc565b3480156105f457600080fd5b506102fc610603366004612b14565b61120b565b34801561061457600080fd5b506102fc610623366004612b31565b6112b3565b34801561063457600080fd5b506102ce600b5481565b34801561064a57600080fd5b506102fc610659366004612b6a565b6112be565b34801561066a57600080fd5b50610274610679366004612851565b6112f6565b34801561068a57600080fd5b5061027461136c565b34801561069f57600080fd5b5061024a6106ae366004612bea565b6113fa565b3480156106bf57600080fd5b50600a5461024a9060ff1681565b3480156106d957600080fd5b506102fc6106e8366004612b14565b61143c565b60006106f8826114d7565b92915050565b60606000805461070d90612c18565b80601f016020809104026020016040519081016040528092919081815260200182805461073990612c18565b80156107865780601f1061075b57610100808354040283529160200191610786565b820191906000526020600020905b81548152906001019060200180831161076957829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661080e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b61083660146002612c69565b81565b600061084482610eb6565b9050806001600160a01b0316836001600160a01b031614156108b25760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610805565b336001600160a01b03821614806108ce57506108ce81336113fa565b6109405760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610805565b61094a8383611527565b505050565b6006546001600160a01b031633146109795760405162461bcd60e51b815260040161080590612c88565b600c805461ff001916610100179055565b6006546001600160a01b031633146109b45760405162461bcd60e51b815260040161080590612c88565b600b548111156109f75760405162461bcd60e51b815260206004820152600e60248201526d145d5bdd1848195e18d95959195960921b6044820152606401610805565b81819050600b6000828254610a0c9190612cbd565b9250508190555061094a8383838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061159592505050565b610a5a338261177c565b610a765760405162461bcd60e51b815260040161080590612cd4565b61094a838383611853565b6006546001600160a01b03163314610aab5760405162461bcd60e51b815260040161080590612c88565b600a805460ff1916911515919091179055565b600080610aca60095490565b8410610b0e5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b88191bd95cdb89dd08195e1a5cdd606a1b6044820152606401610805565b6000600d8581548110610b2357610b23612d25565b600091825260208083209082040154600754604051639f6a3ddd60e01b8152601f9093166101000a90910460ff166004830181905293506001600160a01b031690639f6a3ddd90602401602060405180830381865afa158015610b8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bae9190612d3b565b600754604051636f5d466960e01b815260ff851660048201529192506001600160a01b031690636f5d466990602401602060405180830381865afa158015610bfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1e9190612d54565b612710610c2b8388612c69565b610c359190612d87565b9350935050505b9250929050565b600a5460ff16610c8d5760405162461bcd60e51b8152602060048201526015602482015274141d589b1a58c81b5a5b9d1a5b99c818db1bdcd959605a1b6044820152606401610805565b828114610cdc5760405162461bcd60e51b815260206004820152601a60248201527f496e636f7272656374206e756d626572206f6620746f6b656e730000000000006044820152606401610805565b610ced66b1a2bc2ec5000084612c69565b3414610d2f5760405162461bcd60e51b8152602060048201526011602482015270125b98dbdc9c9958dd081c185e5b595b9d607a1b6044820152606401610805565b610d5d6008337f000000000000000000000000000000000000000000000000000000000000000087876119fe565b50600754610d74906001600160a01b031634611b0c565b610db13383838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061159592505050565b60005b83811015610e1f577f7989a16c887138ba13008c94f22750dfed1c33a7b5e6e3b46816540913154468858583818110610def57610def612d25565b90506020020135604051610e0591815260200190565b60405180910390a180610e1781612d9b565b915050610db4565b5050505050565b6006546001600160a01b03163314610e505760405162461bcd60e51b815260040161080590612c88565b8051610e6390601090602084019061271a565b5050565b6006546001600160a01b03163314610e915760405162461bcd60e51b815260040161080590612c88565b610e99611c25565b565b61094a838383604051806020016040528060008152506112be565b6000818152600260205260408120546001600160a01b0316806106f85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610805565b60006103e88210610f765760405162461bcd60e51b8152602060048201526013602482015272151bdad95b88191bd95cdb89dd08195e1a5cdd606a1b6044820152606401610805565b6106f8600883611cc2565b60006001600160a01b038216610fec5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610805565b506001600160a01b031660009081526003602052604090205490565b6006546001600160a01b031633146110325760405162461bcd60e51b815260040161080590612c88565b610e996000611ce5565b600e816014811061104c57600080fd5b60109182820401919006600202915054906101000a900461ffff1681565b6006546001600160a01b031633146110945760405162461bcd60e51b815260040161080590612c88565b610e99611d37565b6006546001600160a01b031633146110c65760405162461bcd60e51b815260040161080590612c88565b600c5460ff161561110a5760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b6044820152606401610805565b600c805460ff19166001179055600061112560146002612c69565b67ffffffffffffffff81111561113d5761113d612a3f565b604051908082528060200260200182016040528015611166578160200160208202803683370190505b50905060005b60148160ff1610156111f1576000611185826002612db6565b60ff1690508183828151811061119d5761119d612d25565b60ff9092166020928302919091019091015281836111bc836001612ddf565b815181106111cc576111cc612d25565b60ff9092166020928302919091019091015250806111e981612df7565b91505061116c565b50610e638282611595565b60606001805461070d90612c18565b6006546001600160a01b031633146112355760405162461bcd60e51b815260040161080590612c88565b61124f6001600160a01b038216635560a9ef60e11b611dbf565b6112915760405162461bcd60e51b81526020600482015260136024820152724e6f742049477261696c73526576656e75657360681b6044820152606401610805565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b610e63338383611ddb565b6112c8338361177c565b6112e45760405162461bcd60e51b815260040161080590612cd4565b6112f084848484611eaa565b50505050565b60606000600d838154811061130d5761130d612d25565b60009182526020918290209181049091015460ff601f9092166101000a9004169050601061133a82611edd565b61134385611edd565b60405160200161135593929190612e33565b604051602081830303815290604052915050919050565b6010805461137990612c18565b80601f01602080910402602001604051908101604052809291908181526020018280546113a590612c18565b80156113f25780601f106113c7576101008083540402835291602001916113f2565b820191906000526020600020905b8154815290600101906020018083116113d557829003601f168201915b505050505081565b6001600160a01b03808316600090815260056020908152604080832093851683529290529081205460ff168061143557506114358383611fdb565b9392505050565b6006546001600160a01b031633146114665760405162461bcd60e51b815260040161080590612c88565b6001600160a01b0381166114cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610805565b6114d481611ce5565b50565b60006001600160e01b031982166380ac58cd60e01b148061150857506001600160e01b03198216635b5e139f60e01b145b806106f857506301ffc9a760e01b6001600160e01b03198316146106f8565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061155c82610eb6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600c54610100900460ff16156115de5760405162461bcd60e51b815260206004820152600e60248201526d135a5b9d1a5b99c81b1bd8dad95960921b6044820152606401610805565b60006115e960095490565b905060005b825181101561175a57600083828151811061160b5761160b612d25565b6020026020010151905060148160ff161061165b5760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a590811dc985a5b08125160821b6044820152606401610805565b600d8054600181018255600091909152602081047fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb501805460ff808516601f9094166101000a848102910219909116179055600e90601481106116c0576116c0612d25565b6010918282040191900660020281819054906101000a900461ffff16809291906116e990612efa565b91906101000a81548161ffff021916908361ffff160217905550508060ff167fefdedd74df6766f24949ca9ed07fac6d7be3e715a43ae2e064bc381233a42f4160405160405180910390a2611747856117428486612ddf565b61201a565b508061175281612d9b565b9150506115ee565b50815161176990600990612034565b600d546009541461094a5761094a612f1c565b6000818152600260205260408120546001600160a01b03166117f55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610805565b600061180083610eb6565b9050806001600160a01b0316846001600160a01b0316148061183b5750836001600160a01b031661183084610790565b6001600160a01b0316145b8061184b575061184b81856113fa565b949350505050565b826001600160a01b031661186682610eb6565b6001600160a01b0316146118ce5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610805565b6001600160a01b0382166119305760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610805565b61193b838383612051565b611946600082611527565b6001600160a01b038316600090815260036020526040812080546001929061196f908490612cbd565b90915550506001600160a01b038216600090815260036020526040812080546001929061199d908490612ddf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600081611a0d57506000611b03565b60005b82811015611afe576000848483818110611a2c57611a2c612d25565b905060200201359050611a4086828961205c565b600881901c600090815260208990526040902054600160ff83161b1615611a8357611a836040518060600160405280602281526020016130876022913982612179565b600881901c60009081526020899052604090208054600160ff84161b17905560408051828152600160208201526001600160a01b03808a1692908916917fa28d80c9910787c0c058ed9b50c577f1389264bf61563fa45529e0771976f562910160405180910390a35080611af681612d9b565b915050611a10565b508190505b95945050505050565b80471015611b5c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610805565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611ba9576040519150601f19603f3d011682016040523d82523d6000602084013e611bae565b606091505b505090508061094a5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610805565b600654600160a01b900460ff16611c755760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610805565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600881901c600090815260208390526040812054600160ff84161b161515611435565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600654600160a01b900460ff1615611d845760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610805565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ca53390565b6000611dca836121ba565b8015611435575061143583836121ed565b816001600160a01b0316836001600160a01b03161415611e3d5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610805565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611eb5848484611853565b611ec1848484846122d6565b6112f05760405162461bcd60e51b815260040161080590612f32565b606081611f015750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611f2b5780611f1581612d9b565b9150611f249050600a83612d87565b9150611f05565b60008167ffffffffffffffff811115611f4657611f46612a3f565b6040519080825280601f01601f191660200182016040528015611f70576020820181803683370190505b5090505b841561184b57611f85600183612cbd565b9150611f92600a86612f84565b611f9d906030612ddf565b60f81b818381518110611fb257611fb2612d25565b60200101906001600160f81b031916908160001a905350611fd4600a86612d87565b9450611f74565b600080611fe7846123d4565b90506001600160a01b0381161580159061184b5750826001600160a01b0316816001600160a01b03161491505092915050565b610e6382826040518060200160405280600081525061252b565b808260000160008282546120489190612ddf565b90915550505050565b61094a83838361255e565b6040516331a9108f60e11b8152600481018390526001600160a01b038083169190851690636352211e90602401602060405180830381865afa1580156120a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ca9190612d54565b6001600160a01b031614158015612156575060405163020604bf60e21b8152600481018390526001600160a01b03808316919085169063081812fc90602401602060405180830381865afa158015612126573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214a9190612d54565b6001600160a01b031614155b1561094a5761094a60405180606001604052806029815260200161305e60299139835b8161218382611edd565b604051602001612194929190612f98565b60408051601f198184030181529082905262461bcd60e51b82526108059160040161283e565b60006121cd826301ffc9a760e01b6121ed565b80156106f857506121e6826001600160e01b03196121ed565b1592915050565b604080516001600160e01b0319831660248083019190915282518083039091018152604490910182526020810180516001600160e01b03166301ffc9a760e01b179052905160009190829081906001600160a01b0387169061753090612254908690612fd4565b6000604051808303818686fa925050503d8060008114612290576040519150601f19603f3d011682016040523d82523d6000602084013e612295565b606091505b50915091506020815110156122b057600093505050506106f8565b8180156122cc5750808060200190518101906122cc9190612ff0565b9695505050505050565b60006001600160a01b0384163b156123c957604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061231a90339089908890889060040161300d565b6020604051808303816000875af1925050508015612355575060408051601f3d908101601f1916820190925261235291810190613040565b60015b6123af573d808015612383576040519150601f19603f3d011682016040523d82523d6000602084013e612388565b606091505b5080516123a75760405162461bcd60e51b815260040161080590612f32565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061184b565b506001949350505050565b600080468060018114612409576089811461242557600481146124415762013881811461245d57610539811461247957612491565b73a5409ec958c83c3f309868babaca7c86dcb077c19250612491565b7358807bad0b376efc12f5ad86aac70e78ed67deae9250612491565b73f57b2c51ded3a29e6891aba85459d600256cf3179250612491565b73ff7ca10af37178bdd056628ef42fd7f799fac77c9250612491565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b03821615806124a85750806089145b806124b557508062013881145b156124c1575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa158015612507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184b9190612d54565b61253583836125cc565b61254260008484846122d6565b61094a5760405162461bcd60e51b815260040161080590612f32565b600654600160a01b900460ff161561094a5760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b6064820152608401610805565b6001600160a01b0382166126225760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610805565b6000818152600260205260409020546001600160a01b0316156126875760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610805565b61269360008383612051565b6001600160a01b03821660009081526003602052604081208054600192906126bc908490612ddf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461272690612c18565b90600052602060002090601f016020900481019282612748576000855561278e565b82601f1061276157805160ff191683800117855561278e565b8280016001018555821561278e579182015b8281111561278e578251825591602001919060010190612773565b5061279a92915061279e565b5090565b5b8082111561279a576000815560010161279f565b6001600160e01b0319811681146114d457600080fd5b6000602082840312156127db57600080fd5b8135611435816127b3565b60005b838110156128015781810151838201526020016127e9565b838111156112f05750506000910152565b6000815180845261282a8160208601602086016127e6565b601f01601f19169290920160200192915050565b6020815260006114356020830184612812565b60006020828403121561286357600080fd5b5035919050565b6001600160a01b03811681146114d457600080fd5b6000806040838503121561289257600080fd5b823561289d8161286a565b946020939093013593505050565b60008083601f8401126128bd57600080fd5b50813567ffffffffffffffff8111156128d557600080fd5b6020830191508360208260051b8501011115610c3c57600080fd5b60008060006040848603121561290557600080fd5b83356129108161286a565b9250602084013567ffffffffffffffff81111561292c57600080fd5b612938868287016128ab565b9497909650939450505050565b60008060006060848603121561295a57600080fd5b83356129658161286a565b925060208401356129758161286a565b929592945050506040919091013590565b80151581146114d457600080fd5b6000602082840312156129a657600080fd5b813561143581612986565b600080604083850312156129c457600080fd5b50508035926020909101359150565b600080600080604085870312156129e957600080fd5b843567ffffffffffffffff80821115612a0157600080fd5b612a0d888389016128ab565b90965094506020870135915080821115612a2657600080fd5b50612a33878288016128ab565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115612a7057612a70612a3f565b604051601f8501601f19908116603f01168101908282118183101715612a9857612a98612a3f565b81604052809350858152868686011115612ab157600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215612add57600080fd5b813567ffffffffffffffff811115612af457600080fd5b8201601f81018413612b0557600080fd5b61184b84823560208401612a55565b600060208284031215612b2657600080fd5b81356114358161286a565b60008060408385031215612b4457600080fd5b8235612b4f8161286a565b91506020830135612b5f81612986565b809150509250929050565b60008060008060808587031215612b8057600080fd5b8435612b8b8161286a565b93506020850135612b9b8161286a565b925060408501359150606085013567ffffffffffffffff811115612bbe57600080fd5b8501601f81018713612bcf57600080fd5b612bde87823560208401612a55565b91505092959194509250565b60008060408385031215612bfd57600080fd5b8235612c088161286a565b91506020830135612b5f8161286a565b600181811c90821680612c2c57607f821691505b60208210811415612c4d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615612c8357612c83612c53565b500290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082821015612ccf57612ccf612c53565b500390565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612d4d57600080fd5b5051919050565b600060208284031215612d6657600080fd5b81516114358161286a565b634e487b7160e01b600052601260045260246000fd5b600082612d9657612d96612d71565b500490565b6000600019821415612daf57612daf612c53565b5060010190565b600060ff821660ff84168160ff0481118215151615612dd757612dd7612c53565b029392505050565b60008219821115612df257612df2612c53565b500190565b600060ff821660ff811415612e0e57612e0e612c53565b60010192915050565b60008151612e298185602086016127e6565b9290920192915050565b600080855481600182811c915080831680612e4f57607f831692505b6020808410821415612e6f57634e487b7160e01b86526022600452602486fd5b818015612e835760018114612e9457612ec1565b60ff19861689528489019650612ec1565b60008c81526020902060005b86811015612eb95781548b820152908501908301612ea0565b505084890196505b5050505050506122cc612ef4612ee7612ee184602f60f81b815260010190565b88612e17565b602f60f81b815260010190565b85612e17565b600061ffff80831681811415612f1257612f12612c53565b6001019392505050565b634e487b7160e01b600052600160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082612f9357612f93612d71565b500690565b60008351612faa8184602088016127e6565b600160fd1b9083019081528351612fc88160018401602088016127e6565b01600101949350505050565b60008251612fe68184602087016127e6565b9190910192915050565b60006020828403121561300257600080fd5b815161143581612986565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906122cc90830184612812565b60006020828403121561305257600080fd5b8151611435816127b356fe45524337323152656465656d65723a206e6f7420617070726f766564206e6f72206f776e6572206f6645524337323152656465656d65723a206f76657220616c6c6f77616e636520666f72a264697066735822122013165286d25a244cb77d84387143446fdee1941e0f9c9b379fb4983ccd8f104964736f6c634300080b003360806040523480156200001157600080fd5b50604051620017bc380380620017bc8339810160408190526200003491620001ad565b6200004160008262000048565b50620001df565b62000054828262000058565b5050565b6200006f82826200009b60201b62000ae11760201c565b60008281526001602090815260409091206200009691839062000b656200013b821b17901c565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000054576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000f73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600062000152836001600160a01b0384166200015b565b90505b92915050565b6000818152600183016020526040812054620001a45750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000155565b50600062000155565b600060208284031215620001c057600080fd5b81516001600160a01b0381168114620001d857600080fd5b9392505050565b6115cd80620001ef6000396000f3fe6080604052600436106101185760003560e01c80639010d07c116100a0578063ca15c87311610064578063ca15c87314610354578063cd7e10c114610374578063d547741f14610394578063f1079d4f146103b4578063f3671e5f146103d657600080fd5b80639010d07c146102c957806391d14854146102e95780639f6a3ddd14610309578063a217fddf14610329578063b1c0c80a1461033e57600080fd5b80632f2ff15d116100e75780632f2ff15d1461021157806336568abe146102315780634cf8ebf1146102515780635af6286a146102715780636f5d46691461029157600080fd5b806301ffc9a71461015c578063219b52fe14610191578063248a9ca3146101b357806326457884146101f157600080fd5b3661015757604080513381523460208201527f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf736056664233493910160405180910390a1005b600080fd5b34801561016857600080fd5b5061017c61017736600461119d565b6103f6565b60405190151581526020015b60405180910390f35b34801561019d57600080fd5b506101b16101ac3660046111dd565b610421565b005b3480156101bf57600080fd5b506101e36101ce366004611207565b60009081526020819052604090206001015490565b604051908152602001610188565b3480156101fd57600080fd5b506101e361020c366004611207565b610529565b34801561021d57600080fd5b506101b161022c366004611237565b610540565b34801561023d57600080fd5b506101b161024c366004611237565b61056b565b34801561025d57600080fd5b506101b161026c366004611263565b6105e9565b34801561027d57600080fd5b506101b161028c36600461128d565b6106b2565b34801561029d57600080fd5b506102b16102ac366004611302565b6108e2565b6040516001600160a01b039091168152602001610188565b3480156102d557600080fd5b506102b16102e436600461131d565b610906565b3480156102f557600080fd5b5061017c610304366004611237565b610925565b34801561031557600080fd5b506101e3610324366004611302565b61094e565b34801561033557600080fd5b506101e3600081565b34801561034a57600080fd5b506101e36103e881565b34801561036057600080fd5b506101e361036f366004611207565b6109b4565b34801561038057600080fd5b506102b161038f366004611207565b6109cb565b3480156103a057600080fd5b506101b16103af366004611237565b6109eb565b3480156103c057600080fd5b506101e360008051602061157883398151915281565b3480156103e257600080fd5b506101b16103f1366004611263565b610a11565b60006001600160e01b03198216635560a9ef60e11b148061041b575061041b82610b7a565b92915050565b81601460ff82161061044e5760405162461bcd60e51b81526004016104459061133f565b60405180910390fd5b8261045a600033610925565b80610478575061047860008051602061157883398151915233610925565b806104a2575060028160ff16601481106104945761049461136c565b01546001600160a01b031633145b6104be5760405162461bcd60e51b815260040161044590611382565b6127108311156104fc5760405162461bcd60e51b81526020600482015260096024820152684f766572203130302560b81b6044820152606401610445565b826105115761050e61271060016113c5565b92505b505060ff909116600090815260176020526040902055565b6018816014811061053957600080fd5b0154905081565b60008281526020819052604090206001015461055c8133610b9f565b6105668383610c03565b505050565b6001600160a01b03811633146105db5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610445565b6105e58282610c25565b5050565b81601460ff82161061060d5760405162461bcd60e51b81526004016104459061133f565b82610619600033610925565b80610637575061063760008051602061157883398151915233610925565b80610661575060028160ff16601481106106535761065361136c565b01546001600160a01b031633145b61067d5760405162461bcd60e51b815260040161044590611382565b505060ff91909116600090815260166020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b6106bd600033610925565b806106db57506106db60008051602061157883398151915233610925565b6107195760405162461bcd60e51b815260206004820152600f60248201526e2737ba10333ab732399030b236b4b760891b6044820152606401610445565b60005b60ff811682111561056657600083838360ff1681811061073e5761073e61136c565b905060400201602001602081019061075691906113dd565b6001600160f81b031690508061076c57506108d0565b60006107a185858560ff168181106107865761078661136c565b61079c9260206040909202019081019150611302565b610c47565b90506001600160a01b0381166107f05760405162461bcd60e51b815260206004820152601460248201527353656e6420746f207a65726f206164647265737360601b6044820152606401610445565b6108036001600160a01b03821683610cb7565b84848460ff168181106108185761081861136c565b61082e9260206040909202019081019150611302565b604080516001600160a01b03841681526020810185905260ff92909216917f25b58b547e386f5b30a8041990a1edf36e53c9805d6f74a95ff2c04212cc58ac910160405180910390a281601886868660ff1681811061088f5761088f61136c565b6108a59260206040909202019081019150611302565b60ff16601481106108b8576108b861136c565b0160008282546108c891906113c5565b909155505050505b806108da81611406565b91505061071c565b6000806108ee83610c47565b90506001600160a01b03811661041b57503092915050565b600082815260016020526040812061091e9083610dd0565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600081601460ff8216106109745760405162461bcd60e51b81526004016104459061133f565b60ff831660009081526017602052604090205461271081111561099b5760009250506109ae565b806109ab576103e89250506109ae565b91505b50919050565b600081815260016020526040812061041b90610ddc565b600281601481106109db57600080fd5b01546001600160a01b0316905081565b600082815260208190526040902060010154610a078133610b9f565b6105668383610c25565b81601460ff821610610a355760405162461bcd60e51b81526004016104459061133f565b82610a41600033610925565b80610a5f5750610a5f60008051602061157883398151915233610925565b80610a89575060028160ff1660148110610a7b57610a7b61136c565b01546001600160a01b031633145b610aa55760405162461bcd60e51b815260040161044590611382565b8260028560ff1660148110610abc57610abc61136c565b0180546001600160a01b0319166001600160a01b039290921691909117905550505050565b610aeb8282610925565b6105e5576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610b213390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061091e836001600160a01b038416610de6565b60006001600160e01b03198216635a05180f60e01b148061041b575061041b82610e35565b610ba98282610925565b6105e557610bc1816001600160a01b03166014610e6a565b610bcc836020610e6a565b604051602001610bdd929190611456565b60408051601f198184030181529082905262461bcd60e51b8252610445916004016114cb565b610c0d8282610ae1565b60008281526001602052604090206105669082610b65565b610c2f8282611006565b6000828152600160205260409020610566908261106b565b600081601460ff821610610c6d5760405162461bcd60e51b81526004016104459061133f565b60ff83166000908152601660205260409020546001600160a01b0316806109ab5760028460ff1660148110610ca457610ca461136c565b01546001600160a01b0316949350505050565b80471015610d075760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610445565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610d54576040519150601f19603f3d011682016040523d82523d6000602084013e610d59565b606091505b50509050806105665760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610445565b600061091e8383611080565b600061041b825490565b6000818152600183016020526040812054610e2d5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561041b565b50600061041b565b60006001600160e01b03198216637965db0b60e01b148061041b57506301ffc9a760e01b6001600160e01b031983161461041b565b60606000610e798360026114fe565b610e849060026113c5565b67ffffffffffffffff811115610e9c57610e9c61151d565b6040519080825280601f01601f191660200182016040528015610ec6576020820181803683370190505b509050600360fc1b81600081518110610ee157610ee161136c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610f1057610f1061136c565b60200101906001600160f81b031916908160001a9053506000610f348460026114fe565b610f3f9060016113c5565b90505b6001811115610fb7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610f7357610f7361136c565b1a60f81b828281518110610f8957610f8961136c565b60200101906001600160f81b031916908160001a90535060049490941c93610fb081611533565b9050610f42565b50831561091e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610445565b6110108282610925565b156105e5576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061091e836001600160a01b0384166110aa565b60008260000182815481106110975761109761136c565b9060005260206000200154905092915050565b600081815260018301602052604081205480156111935760006110ce60018361154a565b85549091506000906110e29060019061154a565b90508181146111475760008660000182815481106111025761110261136c565b90600052602060002001549050808760000184815481106111255761112561136c565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061115857611158611561565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061041b565b600091505061041b565b6000602082840312156111af57600080fd5b81356001600160e01b03198116811461091e57600080fd5b803560ff811681146111d857600080fd5b919050565b600080604083850312156111f057600080fd5b6111f9836111c7565b946020939093013593505050565b60006020828403121561121957600080fd5b5035919050565b80356001600160a01b03811681146111d857600080fd5b6000806040838503121561124a57600080fd5b8235915061125a60208401611220565b90509250929050565b6000806040838503121561127657600080fd5b61127f836111c7565b915061125a60208401611220565b600080602083850312156112a057600080fd5b823567ffffffffffffffff808211156112b857600080fd5b818501915085601f8301126112cc57600080fd5b8135818111156112db57600080fd5b8660208260061b85010111156112f057600080fd5b60209290920196919550909350505050565b60006020828403121561131457600080fd5b61091e826111c7565b6000806040838503121561133057600080fd5b50508035926020909101359150565b60208082526013908201527211dc985a5b08191bd95cdb89dd08195e1a5cdd606a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252601390820152722737ba1037bbb732b9103737b91030b236b4b760691b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082198211156113d8576113d86113af565b500190565b6000602082840312156113ef57600080fd5b81356001600160f81b038116811461091e57600080fd5b600060ff821660ff81141561141d5761141d6113af565b60010192915050565b60005b83811015611441578181015183820152602001611429565b83811115611450576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161148e816017850160208801611426565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516114bf816028840160208801611426565b01602801949350505050565b60208152600082518060208401526114ea816040850160208701611426565b601f01601f19169190910160400192915050565b6000816000190483118215151615611518576115186113af565b500290565b634e487b7160e01b600052604160045260246000fd5b600081611542576115426113af565b506000190190565b60008282101561155c5761155c6113af565b500390565b634e487b7160e01b600052603160045260246000fdfe75456b37135373dd0d9c06da636f8afc8a433394d71309d732eb6fb591fba90ea2646970667358221220b1b943ede4272c688940524833bbfd9845ee76d7442472c68d0b08230b18da3a64736f6c634300080b003300000000000000000000000008d7c0242953446436f34b4c78fe9da38c73668d
Deployed Bytecode
0x6080604052600436106102255760003560e01c80636352211e1161012357806395d89b41116100ab578063c87b56dd1161006f578063c87b56dd1461065e578063d547cfb71461067e578063e985e9c514610693578063f0dff7d3146106b3578063f2fde38b146106cd57600080fd5b806395d89b41146105d35780639a38d2fc146105e8578063a22cb46514610608578063a424e70514610628578063b88d4fde1461063e57600080fd5b80637a7dfd02116100f25780637a7dfd02146105325780638456cb59146105655780638d859f3e1461057a5780638da5cb5b1461059557806394020392146105b357600080fd5b80636352211e146104bd5780636adca3a4146104dd57806370a08231146104fd578063715018a61461051d57600080fd5b80631d793318116101b15780632a64c5cc116101755780632a64c5cc1461043657806330176e13146104495780633f4ba83a1461046957806342842e0e1461047e5780635c975abb1461049e57600080fd5b80631d793318146103635780631e46e4d31461038357806323b872dd146103b7578063254a4737146103d75780632a55205a146103f757600080fd5b8063095ea7b3116101f8578063095ea7b3146102dc5780630d7982ad146102fe5780630fc50ebb14610313578063153de1431461033257806318160ddd1461034c57600080fd5b806301ffc9a71461022a57806306fdde031461025f578063081812fc146102815780630928b66c146102b9575b600080fd5b34801561023657600080fd5b5061024a6102453660046127c9565b6106ed565b60405190151581526020015b60405180910390f35b34801561026b57600080fd5b506102746106fe565b604051610256919061283e565b34801561028d57600080fd5b506102a161029c366004612851565b610790565b6040516001600160a01b039091168152602001610256565b3480156102c557600080fd5b506102ce61082a565b604051908152602001610256565b3480156102e857600080fd5b506102fc6102f736600461287f565b610839565b005b34801561030a57600080fd5b506102fc61094f565b34801561031f57600080fd5b50600c5461024a90610100900460ff1681565b34801561033e57600080fd5b50600c5461024a9060ff1681565b34801561035857600080fd5b506009546102ce9081565b34801561036f57600080fd5b506102fc61037e3660046128f0565b61098a565b34801561038f57600080fd5b506102a17f00000000000000000000000008d7c0242953446436f34b4c78fe9da38c73668d81565b3480156103c357600080fd5b506102fc6103d2366004612945565b610a50565b3480156103e357600080fd5b506102fc6103f2366004612994565b610a81565b34801561040357600080fd5b506104176104123660046129b1565b610abe565b604080516001600160a01b039093168352602083019190915201610256565b6102fc6104443660046129d3565b610c43565b34801561045557600080fd5b506102fc610464366004612acb565b610e26565b34801561047557600080fd5b506102fc610e67565b34801561048a57600080fd5b506102fc610499366004612945565b610e9b565b3480156104aa57600080fd5b50600654600160a01b900460ff1661024a565b3480156104c957600080fd5b506102a16104d8366004612851565b610eb6565b3480156104e957600080fd5b5061024a6104f8366004612851565b610f2d565b34801561050957600080fd5b506102ce610518366004612b14565b610f81565b34801561052957600080fd5b506102fc611008565b34801561053e57600080fd5b5061055261054d366004612851565b61103c565b60405161ffff9091168152602001610256565b34801561057157600080fd5b506102fc61106a565b34801561058657600080fd5b506102ce66b1a2bc2ec5000081565b3480156105a157600080fd5b506006546001600160a01b03166102a1565b3480156105bf57600080fd5b506102fc6105ce366004612b14565b61109c565b3480156105df57600080fd5b506102746111fc565b3480156105f457600080fd5b506102fc610603366004612b14565b61120b565b34801561061457600080fd5b506102fc610623366004612b31565b6112b3565b34801561063457600080fd5b506102ce600b5481565b34801561064a57600080fd5b506102fc610659366004612b6a565b6112be565b34801561066a57600080fd5b50610274610679366004612851565b6112f6565b34801561068a57600080fd5b5061027461136c565b34801561069f57600080fd5b5061024a6106ae366004612bea565b6113fa565b3480156106bf57600080fd5b50600a5461024a9060ff1681565b3480156106d957600080fd5b506102fc6106e8366004612b14565b61143c565b60006106f8826114d7565b92915050565b60606000805461070d90612c18565b80601f016020809104026020016040519081016040528092919081815260200182805461073990612c18565b80156107865780601f1061075b57610100808354040283529160200191610786565b820191906000526020600020905b81548152906001019060200180831161076957829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661080e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b61083660146002612c69565b81565b600061084482610eb6565b9050806001600160a01b0316836001600160a01b031614156108b25760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610805565b336001600160a01b03821614806108ce57506108ce81336113fa565b6109405760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610805565b61094a8383611527565b505050565b6006546001600160a01b031633146109795760405162461bcd60e51b815260040161080590612c88565b600c805461ff001916610100179055565b6006546001600160a01b031633146109b45760405162461bcd60e51b815260040161080590612c88565b600b548111156109f75760405162461bcd60e51b815260206004820152600e60248201526d145d5bdd1848195e18d95959195960921b6044820152606401610805565b81819050600b6000828254610a0c9190612cbd565b9250508190555061094a8383838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061159592505050565b610a5a338261177c565b610a765760405162461bcd60e51b815260040161080590612cd4565b61094a838383611853565b6006546001600160a01b03163314610aab5760405162461bcd60e51b815260040161080590612c88565b600a805460ff1916911515919091179055565b600080610aca60095490565b8410610b0e5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b88191bd95cdb89dd08195e1a5cdd606a1b6044820152606401610805565b6000600d8581548110610b2357610b23612d25565b600091825260208083209082040154600754604051639f6a3ddd60e01b8152601f9093166101000a90910460ff166004830181905293506001600160a01b031690639f6a3ddd90602401602060405180830381865afa158015610b8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bae9190612d3b565b600754604051636f5d466960e01b815260ff851660048201529192506001600160a01b031690636f5d466990602401602060405180830381865afa158015610bfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1e9190612d54565b612710610c2b8388612c69565b610c359190612d87565b9350935050505b9250929050565b600a5460ff16610c8d5760405162461bcd60e51b8152602060048201526015602482015274141d589b1a58c81b5a5b9d1a5b99c818db1bdcd959605a1b6044820152606401610805565b828114610cdc5760405162461bcd60e51b815260206004820152601a60248201527f496e636f7272656374206e756d626572206f6620746f6b656e730000000000006044820152606401610805565b610ced66b1a2bc2ec5000084612c69565b3414610d2f5760405162461bcd60e51b8152602060048201526011602482015270125b98dbdc9c9958dd081c185e5b595b9d607a1b6044820152606401610805565b610d5d6008337f00000000000000000000000008d7c0242953446436f34b4c78fe9da38c73668d87876119fe565b50600754610d74906001600160a01b031634611b0c565b610db13383838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061159592505050565b60005b83811015610e1f577f7989a16c887138ba13008c94f22750dfed1c33a7b5e6e3b46816540913154468858583818110610def57610def612d25565b90506020020135604051610e0591815260200190565b60405180910390a180610e1781612d9b565b915050610db4565b5050505050565b6006546001600160a01b03163314610e505760405162461bcd60e51b815260040161080590612c88565b8051610e6390601090602084019061271a565b5050565b6006546001600160a01b03163314610e915760405162461bcd60e51b815260040161080590612c88565b610e99611c25565b565b61094a838383604051806020016040528060008152506112be565b6000818152600260205260408120546001600160a01b0316806106f85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610805565b60006103e88210610f765760405162461bcd60e51b8152602060048201526013602482015272151bdad95b88191bd95cdb89dd08195e1a5cdd606a1b6044820152606401610805565b6106f8600883611cc2565b60006001600160a01b038216610fec5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610805565b506001600160a01b031660009081526003602052604090205490565b6006546001600160a01b031633146110325760405162461bcd60e51b815260040161080590612c88565b610e996000611ce5565b600e816014811061104c57600080fd5b60109182820401919006600202915054906101000a900461ffff1681565b6006546001600160a01b031633146110945760405162461bcd60e51b815260040161080590612c88565b610e99611d37565b6006546001600160a01b031633146110c65760405162461bcd60e51b815260040161080590612c88565b600c5460ff161561110a5760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b6044820152606401610805565b600c805460ff19166001179055600061112560146002612c69565b67ffffffffffffffff81111561113d5761113d612a3f565b604051908082528060200260200182016040528015611166578160200160208202803683370190505b50905060005b60148160ff1610156111f1576000611185826002612db6565b60ff1690508183828151811061119d5761119d612d25565b60ff9092166020928302919091019091015281836111bc836001612ddf565b815181106111cc576111cc612d25565b60ff9092166020928302919091019091015250806111e981612df7565b91505061116c565b50610e638282611595565b60606001805461070d90612c18565b6006546001600160a01b031633146112355760405162461bcd60e51b815260040161080590612c88565b61124f6001600160a01b038216635560a9ef60e11b611dbf565b6112915760405162461bcd60e51b81526020600482015260136024820152724e6f742049477261696c73526576656e75657360681b6044820152606401610805565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b610e63338383611ddb565b6112c8338361177c565b6112e45760405162461bcd60e51b815260040161080590612cd4565b6112f084848484611eaa565b50505050565b60606000600d838154811061130d5761130d612d25565b60009182526020918290209181049091015460ff601f9092166101000a9004169050601061133a82611edd565b61134385611edd565b60405160200161135593929190612e33565b604051602081830303815290604052915050919050565b6010805461137990612c18565b80601f01602080910402602001604051908101604052809291908181526020018280546113a590612c18565b80156113f25780601f106113c7576101008083540402835291602001916113f2565b820191906000526020600020905b8154815290600101906020018083116113d557829003601f168201915b505050505081565b6001600160a01b03808316600090815260056020908152604080832093851683529290529081205460ff168061143557506114358383611fdb565b9392505050565b6006546001600160a01b031633146114665760405162461bcd60e51b815260040161080590612c88565b6001600160a01b0381166114cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610805565b6114d481611ce5565b50565b60006001600160e01b031982166380ac58cd60e01b148061150857506001600160e01b03198216635b5e139f60e01b145b806106f857506301ffc9a760e01b6001600160e01b03198316146106f8565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061155c82610eb6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600c54610100900460ff16156115de5760405162461bcd60e51b815260206004820152600e60248201526d135a5b9d1a5b99c81b1bd8dad95960921b6044820152606401610805565b60006115e960095490565b905060005b825181101561175a57600083828151811061160b5761160b612d25565b6020026020010151905060148160ff161061165b5760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a590811dc985a5b08125160821b6044820152606401610805565b600d8054600181018255600091909152602081047fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb501805460ff808516601f9094166101000a848102910219909116179055600e90601481106116c0576116c0612d25565b6010918282040191900660020281819054906101000a900461ffff16809291906116e990612efa565b91906101000a81548161ffff021916908361ffff160217905550508060ff167fefdedd74df6766f24949ca9ed07fac6d7be3e715a43ae2e064bc381233a42f4160405160405180910390a2611747856117428486612ddf565b61201a565b508061175281612d9b565b9150506115ee565b50815161176990600990612034565b600d546009541461094a5761094a612f1c565b6000818152600260205260408120546001600160a01b03166117f55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610805565b600061180083610eb6565b9050806001600160a01b0316846001600160a01b0316148061183b5750836001600160a01b031661183084610790565b6001600160a01b0316145b8061184b575061184b81856113fa565b949350505050565b826001600160a01b031661186682610eb6565b6001600160a01b0316146118ce5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610805565b6001600160a01b0382166119305760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610805565b61193b838383612051565b611946600082611527565b6001600160a01b038316600090815260036020526040812080546001929061196f908490612cbd565b90915550506001600160a01b038216600090815260036020526040812080546001929061199d908490612ddf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600081611a0d57506000611b03565b60005b82811015611afe576000848483818110611a2c57611a2c612d25565b905060200201359050611a4086828961205c565b600881901c600090815260208990526040902054600160ff83161b1615611a8357611a836040518060600160405280602281526020016130876022913982612179565b600881901c60009081526020899052604090208054600160ff84161b17905560408051828152600160208201526001600160a01b03808a1692908916917fa28d80c9910787c0c058ed9b50c577f1389264bf61563fa45529e0771976f562910160405180910390a35080611af681612d9b565b915050611a10565b508190505b95945050505050565b80471015611b5c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610805565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611ba9576040519150601f19603f3d011682016040523d82523d6000602084013e611bae565b606091505b505090508061094a5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610805565b600654600160a01b900460ff16611c755760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610805565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600881901c600090815260208390526040812054600160ff84161b161515611435565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600654600160a01b900460ff1615611d845760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610805565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ca53390565b6000611dca836121ba565b8015611435575061143583836121ed565b816001600160a01b0316836001600160a01b03161415611e3d5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610805565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611eb5848484611853565b611ec1848484846122d6565b6112f05760405162461bcd60e51b815260040161080590612f32565b606081611f015750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611f2b5780611f1581612d9b565b9150611f249050600a83612d87565b9150611f05565b60008167ffffffffffffffff811115611f4657611f46612a3f565b6040519080825280601f01601f191660200182016040528015611f70576020820181803683370190505b5090505b841561184b57611f85600183612cbd565b9150611f92600a86612f84565b611f9d906030612ddf565b60f81b818381518110611fb257611fb2612d25565b60200101906001600160f81b031916908160001a905350611fd4600a86612d87565b9450611f74565b600080611fe7846123d4565b90506001600160a01b0381161580159061184b5750826001600160a01b0316816001600160a01b03161491505092915050565b610e6382826040518060200160405280600081525061252b565b808260000160008282546120489190612ddf565b90915550505050565b61094a83838361255e565b6040516331a9108f60e11b8152600481018390526001600160a01b038083169190851690636352211e90602401602060405180830381865afa1580156120a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ca9190612d54565b6001600160a01b031614158015612156575060405163020604bf60e21b8152600481018390526001600160a01b03808316919085169063081812fc90602401602060405180830381865afa158015612126573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214a9190612d54565b6001600160a01b031614155b1561094a5761094a60405180606001604052806029815260200161305e60299139835b8161218382611edd565b604051602001612194929190612f98565b60408051601f198184030181529082905262461bcd60e51b82526108059160040161283e565b60006121cd826301ffc9a760e01b6121ed565b80156106f857506121e6826001600160e01b03196121ed565b1592915050565b604080516001600160e01b0319831660248083019190915282518083039091018152604490910182526020810180516001600160e01b03166301ffc9a760e01b179052905160009190829081906001600160a01b0387169061753090612254908690612fd4565b6000604051808303818686fa925050503d8060008114612290576040519150601f19603f3d011682016040523d82523d6000602084013e612295565b606091505b50915091506020815110156122b057600093505050506106f8565b8180156122cc5750808060200190518101906122cc9190612ff0565b9695505050505050565b60006001600160a01b0384163b156123c957604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061231a90339089908890889060040161300d565b6020604051808303816000875af1925050508015612355575060408051601f3d908101601f1916820190925261235291810190613040565b60015b6123af573d808015612383576040519150601f19603f3d011682016040523d82523d6000602084013e612388565b606091505b5080516123a75760405162461bcd60e51b815260040161080590612f32565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061184b565b506001949350505050565b600080468060018114612409576089811461242557600481146124415762013881811461245d57610539811461247957612491565b73a5409ec958c83c3f309868babaca7c86dcb077c19250612491565b7358807bad0b376efc12f5ad86aac70e78ed67deae9250612491565b73f57b2c51ded3a29e6891aba85459d600256cf3179250612491565b73ff7ca10af37178bdd056628ef42fd7f799fac77c9250612491565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b03821615806124a85750806089145b806124b557508062013881145b156124c1575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa158015612507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184b9190612d54565b61253583836125cc565b61254260008484846122d6565b61094a5760405162461bcd60e51b815260040161080590612f32565b600654600160a01b900460ff161561094a5760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b6064820152608401610805565b6001600160a01b0382166126225760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610805565b6000818152600260205260409020546001600160a01b0316156126875760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610805565b61269360008383612051565b6001600160a01b03821660009081526003602052604081208054600192906126bc908490612ddf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461272690612c18565b90600052602060002090601f016020900481019282612748576000855561278e565b82601f1061276157805160ff191683800117855561278e565b8280016001018555821561278e579182015b8281111561278e578251825591602001919060010190612773565b5061279a92915061279e565b5090565b5b8082111561279a576000815560010161279f565b6001600160e01b0319811681146114d457600080fd5b6000602082840312156127db57600080fd5b8135611435816127b3565b60005b838110156128015781810151838201526020016127e9565b838111156112f05750506000910152565b6000815180845261282a8160208601602086016127e6565b601f01601f19169290920160200192915050565b6020815260006114356020830184612812565b60006020828403121561286357600080fd5b5035919050565b6001600160a01b03811681146114d457600080fd5b6000806040838503121561289257600080fd5b823561289d8161286a565b946020939093013593505050565b60008083601f8401126128bd57600080fd5b50813567ffffffffffffffff8111156128d557600080fd5b6020830191508360208260051b8501011115610c3c57600080fd5b60008060006040848603121561290557600080fd5b83356129108161286a565b9250602084013567ffffffffffffffff81111561292c57600080fd5b612938868287016128ab565b9497909650939450505050565b60008060006060848603121561295a57600080fd5b83356129658161286a565b925060208401356129758161286a565b929592945050506040919091013590565b80151581146114d457600080fd5b6000602082840312156129a657600080fd5b813561143581612986565b600080604083850312156129c457600080fd5b50508035926020909101359150565b600080600080604085870312156129e957600080fd5b843567ffffffffffffffff80821115612a0157600080fd5b612a0d888389016128ab565b90965094506020870135915080821115612a2657600080fd5b50612a33878288016128ab565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115612a7057612a70612a3f565b604051601f8501601f19908116603f01168101908282118183101715612a9857612a98612a3f565b81604052809350858152868686011115612ab157600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215612add57600080fd5b813567ffffffffffffffff811115612af457600080fd5b8201601f81018413612b0557600080fd5b61184b84823560208401612a55565b600060208284031215612b2657600080fd5b81356114358161286a565b60008060408385031215612b4457600080fd5b8235612b4f8161286a565b91506020830135612b5f81612986565b809150509250929050565b60008060008060808587031215612b8057600080fd5b8435612b8b8161286a565b93506020850135612b9b8161286a565b925060408501359150606085013567ffffffffffffffff811115612bbe57600080fd5b8501601f81018713612bcf57600080fd5b612bde87823560208401612a55565b91505092959194509250565b60008060408385031215612bfd57600080fd5b8235612c088161286a565b91506020830135612b5f8161286a565b600181811c90821680612c2c57607f821691505b60208210811415612c4d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615612c8357612c83612c53565b500290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082821015612ccf57612ccf612c53565b500390565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612d4d57600080fd5b5051919050565b600060208284031215612d6657600080fd5b81516114358161286a565b634e487b7160e01b600052601260045260246000fd5b600082612d9657612d96612d71565b500490565b6000600019821415612daf57612daf612c53565b5060010190565b600060ff821660ff84168160ff0481118215151615612dd757612dd7612c53565b029392505050565b60008219821115612df257612df2612c53565b500190565b600060ff821660ff811415612e0e57612e0e612c53565b60010192915050565b60008151612e298185602086016127e6565b9290920192915050565b600080855481600182811c915080831680612e4f57607f831692505b6020808410821415612e6f57634e487b7160e01b86526022600452602486fd5b818015612e835760018114612e9457612ec1565b60ff19861689528489019650612ec1565b60008c81526020902060005b86811015612eb95781548b820152908501908301612ea0565b505084890196505b5050505050506122cc612ef4612ee7612ee184602f60f81b815260010190565b88612e17565b602f60f81b815260010190565b85612e17565b600061ffff80831681811415612f1257612f12612c53565b6001019392505050565b634e487b7160e01b600052600160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082612f9357612f93612d71565b500690565b60008351612faa8184602088016127e6565b600160fd1b9083019081528351612fc88160018401602088016127e6565b01600101949350505050565b60008251612fe68184602087016127e6565b9190910192915050565b60006020828403121561300257600080fd5b815161143581612986565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906122cc90830184612812565b60006020828403121561305257600080fd5b8151611435816127b356fe45524337323152656465656d65723a206e6f7420617070726f766564206e6f72206f776e6572206f6645524337323152656465656d65723a206f76657220616c6c6f77616e636520666f72a264697066735822122013165286d25a244cb77d84387143446fdee1941e0f9c9b379fb4983ccd8f104964736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000008d7c0242953446436f34b4c78fe9da38c73668d
-----Decoded View---------------
Arg [0] : proof (address): 0x08D7C0242953446436F34b4C78Fe9da38c73668d
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000008d7c0242953446436f34b4c78fe9da38c73668d
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.