Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 15127209 | 864 days ago | IN | 0 ETH | 0.06675542 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
BottoAccessPasses
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 1500 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/presets/ERC1155PresetMinterPauserUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155SupplyUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; contract BottoAccessPasses is ERC1155PresetMinterPauserUpgradeable, ERC1155SupplyUpgradeable, EIP712Upgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; // Mapping from token ID to redeem cap per address. 0 is considered unlimited. mapping(uint256 => uint256) private _tokenAddressRedeemCap; // Mapping from address to # times redeemed per token id mapping(address => mapping(uint256 => uint256)) private _redeemedTokens; // Mapping from token ID to total max supply. 0 is considered unlimited. mapping(uint256 => uint256) private _totalCap; // Mapping from token ID to minimum nonce accepted for MintPermits to mint this token mapping(uint256 => uint256) private _mintPermitMinimumNonces; /// The collection name string public constant name = "Botto Access Passes"; /// Role to call setURI method bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE"); /// Role to call setSupply method bytes32 public constant SUPPLY_SETTER_ROLE = keccak256("SUPPLY_SETTER_ROLE"); struct RedeemPermit { uint256 tokenId; // the id of the token to be minted uint256 nonce; // address currency; // using the zero address means Ether uint256 minimumPrice; // price in wei address payee; // address that receives the transfered funds uint256 kickoff; // block epoch timestamp in seconds when the permit is valid uint256 deadline; // block epoch timestamp in seconds when the permit is expired address recipient; // using the zero address means anyone can claim bytes data; } bytes32 public constant REDEEM_PERMIT_TYPEHASH = keccak256( "RedeemPermit(uint256 tokenId,uint256 nonce,address currency,uint256 minimumPrice,address payee,uint256 kickoff,uint256 deadline,address recipient,bytes data)" ); function initialize(string memory uri_) public virtual override initializer { ERC1155PresetMinterPauserUpgradeable.initialize(uri_); ERC1155SupplyUpgradeable.__ERC1155Supply_init_unchained(); EIP712Upgradeable.__EIP712_init("BottoNFTAccessPasses", "1.0.0"); _grantRole(URI_SETTER_ROLE, _msgSender()); _grantRole(SUPPLY_SETTER_ROLE, _msgSender()); } function setURI(string memory newuri_) external virtual { require( hasRole(URI_SETTER_ROLE, _msgSender()), "BottoAccessPasses: must have uri setter role" ); _setURI(newuri_); } /** * @dev set the total available supply and cap per wallet address for `tokenId_` * @param tokenId_ the token ID for which to set limits * @param totalSupply_ the total available tokens. 0 is considered unlimited * @param redeemCap_ the maximum number of tokens that can be redeemed per wallet address. 0 is considered unlimited */ function setSupply( uint256 tokenId_, uint256 totalSupply_, uint256 redeemCap_ ) external virtual { require( hasRole(SUPPLY_SETTER_ROLE, _msgSender()), "BottoAccessPasses: must have supply setter role" ); _totalCap[tokenId_] = totalSupply_; _tokenAddressRedeemCap[tokenId_] = redeemCap_; } /** * @dev revoke all RedeemPermits issued for token ID `tokenId_` with nonce lower than `nonce_` * @param tokenId_ the token ID for which to revoke permits * @param nonce_ to cancel a permit for a given tokenId we suggest passing the account transaction count as `nonce_` */ function revokePermitsUnderNonce(uint256 tokenId_, uint256 nonce_) external virtual { require( hasRole(MINTER_ROLE, _msgSender()), "BottoAccessPasses: must have minter role" ); _mintPermitMinimumNonces[tokenId_] = nonce_ + 1; } /** * @dev redeem a NFT using a valid permit * @param permit_ The RedeemPermit signed by user with `MINTER_ROLE` * @param recipient_ The address that will receive the newly minted NFT * @param signature_ The secp256k1 permit signature */ function redeem( RedeemPermit calldata permit_, address recipient_, bytes memory signature_ ) external payable virtual { address signer = _verify(_hash(permit_), signature_); // Make sure that the signer is authorized to mint NFTs and permit is valid require( hasRole(MINTER_ROLE, signer), "BottoAccessPasses: signature invalid" ); // Check if permit is revoked require( permit_.nonce >= _mintPermitMinimumNonces[permit_.tokenId], "BottoAccessPasses: permit revoked" ); // Check if permit is expired require( permit_.kickoff <= block.timestamp && permit_.deadline >= block.timestamp, "BottoAccessPasses: permit expired" ); // Check if recipient matches permit if (permit_.recipient != address(0)) { require( recipient_ == permit_.recipient, "BottoAccessPasses: recipient does not match permit" ); } // Check address token cap require( _tokenAddressRedeemCap[permit_.tokenId] == 0 || _redeemedTokens[recipient_][permit_.tokenId] < _tokenAddressRedeemCap[permit_.tokenId], "BottoAccessPasses: redeem cap reached for this address" ); // Check if to pay using Ether or ERC20 if (permit_.minimumPrice != 0) { if (permit_.currency == address(0)) { require( msg.value >= permit_.minimumPrice, "BottoAccessPasses: transaction value under minimum price" ); (bool success, ) = permit_.payee.call{value: msg.value}(""); require(success, "BottoAccessPasses: transfer failed."); } else { IERC20Upgradeable token = IERC20Upgradeable(permit_.currency); token.safeTransferFrom( _msgSender(), permit_.payee, permit_.minimumPrice ); } } _redeemedTokens[recipient_][permit_.tokenId] += 1; // first assign the token to the signer, to establish provenance on-chain _mint(signer, permit_.tokenId, 1, ""); _safeTransferFrom(signer, recipient_, permit_.tokenId, 1, ""); } /** * @dev recover ERC20 tokens * @param token_ The ERC20 token contract address * @param amount_ The amount to recover * @param recipient_ The recipient of the recovered tokens */ function recover( address token_, uint256 amount_, address payable recipient_ ) external virtual { require( hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "BottoAccessPasses: must have admin role" ); require(amount_ > 0, "BottoAccessPasses: invalid amount"); IERC20Upgradeable token = IERC20Upgradeable(token_); token.safeTransfer(recipient_, amount_); } /** * @dev see https://eips.ethereum.org/EIPS/eip-712#definition-of-encodedata */ function _hash(RedeemPermit memory permit_) internal view returns (bytes32) { return _hashTypedDataV4( keccak256( abi.encode( REDEEM_PERMIT_TYPEHASH, permit_.tokenId, permit_.nonce, permit_.currency, permit_.minimumPrice, permit_.payee, permit_.kickoff, permit_.deadline, permit_.recipient, keccak256(permit_.data) ) ) ); } /** * @dev recover signer from `signature_` */ function _verify(bytes32 digest_, bytes memory signature_) internal pure returns (address) { return ECDSAUpgradeable.recover(digest_, signature_); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155Upgradeable, ERC1155PresetMinterPauserUpgradeable) returns (bool) { return super.supportsInterface(interfaceId); } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override(ERC1155PresetMinterPauserUpgradeable, ERC1155SupplyUpgradeable) { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (from == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { // Check total cap when minting require( _totalCap[ids[i]] == 0 || totalSupply(ids[i]) <= _totalCap[ids[i]], "BottoAccessPasses: exceeding total supply cap" ); } } } }
// 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 EnumerableSetUpgradeable { // 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/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 IERC165Upgradeable { /** * @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/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; import "./ECDSAUpgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712Upgradeable is Initializable { /* solhint-disable var-name-mixedcase */ bytes32 private _HASHED_NAME; bytes32 private _HASHED_VERSION; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal onlyInitializing { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712NameHash() internal virtual view returns (bytes32) { return _HASHED_NAME; } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712VersionHash() internal virtual view returns (bytes32) { return _HASHED_VERSION; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../StringsUpgradeable.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { 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; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { __Context_init_unchained(); } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
// 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 AddressUpgradeable { /** * @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 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/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; import "../../../utils/AddressUpgradeable.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20Upgradeable { using AddressUpgradeable for address; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20Upgradeable token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20Upgradeable token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/presets/ERC1155PresetMinterPauser.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../extensions/ERC1155BurnableUpgradeable.sol"; import "../extensions/ERC1155PausableUpgradeable.sol"; import "../../../access/AccessControlEnumerableUpgradeable.sol"; import "../../../utils/ContextUpgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev {ERC1155} token, including: * * - ability for holders to burn (destroy) their tokens * - a minter role that allows for token minting (creation) * - a pauser role that allows to stop all token transfers * * This contract uses {AccessControl} to lock permissioned functions using the * different roles - head to its documentation for details. * * The account that deploys the contract will be granted the minter and pauser * roles, as well as the default admin role, which will let it grant both minter * and pauser roles to other accounts. */ contract ERC1155PresetMinterPauserUpgradeable is Initializable, ContextUpgradeable, AccessControlEnumerableUpgradeable, ERC1155BurnableUpgradeable, ERC1155PausableUpgradeable { function initialize(string memory uri) public virtual initializer { __ERC1155PresetMinterPauser_init(uri); } bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, and `PAUSER_ROLE` to the account that * deploys the contract. */ function __ERC1155PresetMinterPauser_init(string memory uri) internal onlyInitializing { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); __AccessControlEnumerable_init_unchained(); __ERC1155_init_unchained(uri); __ERC1155Burnable_init_unchained(); __Pausable_init_unchained(); __ERC1155Pausable_init_unchained(); __ERC1155PresetMinterPauser_init_unchained(uri); } function __ERC1155PresetMinterPauser_init_unchained(string memory uri) internal onlyInitializing { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); _setupRole(PAUSER_ROLE, _msgSender()); } /** * @dev Creates `amount` new tokens for `to`, of token type `id`. * * See {ERC1155-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`. */ function mint( address to, uint256 id, uint256 amount, bytes memory data ) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have minter role to mint"); _mint(to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] variant of {mint}. */ function mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have minter role to mint"); _mintBatch(to, ids, amounts, data); } /** * @dev Pauses all token transfers. * * See {ERC1155Pausable} and {Pausable-_pause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function pause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have pauser role to pause"); _pause(); } /** * @dev Unpauses all token transfers. * * See {ERC1155Pausable} and {Pausable-_unpause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function unpause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have pauser role to unpause"); _unpause(); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerableUpgradeable, ERC1155Upgradeable) returns (bool) { return super.supportsInterface(interfaceId); } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override(ERC1155Upgradeable, ERC1155PausableUpgradeable) { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155Upgradeable.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Supply.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. */ abstract contract ERC1155SupplyUpgradeable is Initializable, ERC1155Upgradeable { function __ERC1155Supply_init() internal onlyInitializing { __Context_init_unchained(); __ERC165_init_unchained(); __ERC1155Supply_init_unchained(); } function __ERC1155Supply_init_unchained() internal onlyInitializing { } mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates whether any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return ERC1155SupplyUpgradeable.totalSupply(id) > 0; } /** * @dev See {ERC1155-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (from == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } if (to == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] -= amounts[i]; } } } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../security/PausableUpgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev ERC1155 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. * * _Available since v3.1._ */ abstract contract ERC1155PausableUpgradeable is Initializable, ERC1155Upgradeable, PausableUpgradeable { function __ERC1155Pausable_init() internal onlyInitializing { __Context_init_unchained(); __ERC165_init_unchained(); __Pausable_init_unchained(); __ERC1155Pausable_init_unchained(); } function __ERC1155Pausable_init_unchained() internal onlyInitializing { } /** * @dev See {ERC1155-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); require(!paused(), "ERC1155Pausable: token transfer while paused"); } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155BurnableUpgradeable is Initializable, ERC1155Upgradeable { function __ERC1155Burnable_init() internal onlyInitializing { __Context_init_unchained(); __ERC165_init_unchained(); __ERC1155Burnable_init_unchained(); } function __ERC1155Burnable_init_unchained() internal onlyInitializing { } function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burnBatch(account, ids, values); } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155ReceiverUpgradeable is IERC165Upgradeable { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector). @param operator The address which initiated the transfer (i.e. msg.sender) @param from The address which previously owned the token @param id The ID of the token being transferred @param value The amount of tokens being transferred @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector). @param operator The address which initiated the batch transfer (i.e. msg.sender) @param from The address which previously owned the token @param ids An array containing ids of each token being transferred (order and length must match values array) @param values An array containing amounts of each token being transferred (order and length must match ids array) @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155Upgradeable.sol"; import "./IERC1155ReceiverUpgradeable.sol"; import "./extensions/IERC1155MetadataURIUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable { using AddressUpgradeable for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ function __ERC1155_init(string memory uri_) internal onlyInitializing { __Context_init_unchained(); __ERC165_init_unchained(); __ERC1155_init_unchained(uri_); } function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC1155Upgradeable).interfaceId || interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); } /** * @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, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } uint256[47] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable { /** * @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. */ function __Pausable_init() internal onlyInitializing { __Context_init_unchained(); __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _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()); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// 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 IAccessControlUpgradeable { /** * @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/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @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/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal onlyInitializing { } 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(IAccessControlUpgradeable).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 ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.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()); } } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal onlyInitializing { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); __AccessControlEnumerable_init_unchained(); } function __AccessControlEnumerable_init_unchained() internal onlyInitializing { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).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); } uint256[49] private __gap; }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 1500 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REDEEM_PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SUPPLY_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"URI_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address payable","name":"recipient_","type":"address"}],"name":"recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"minimumPrice","type":"uint256"},{"internalType":"address","name":"payee","type":"address"},{"internalType":"uint256","name":"kickoff","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct BottoAccessPasses.RedeemPermit","name":"permit_","type":"tuple"},{"internalType":"address","name":"recipient_","type":"address"},{"internalType":"bytes","name":"signature_","type":"bytes"}],"name":"redeem","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"nonce_","type":"uint256"}],"name":"revokePermitsUnderNonce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"totalSupply_","type":"uint256"},{"internalType":"uint256","name":"redeemCap_","type":"uint256"}],"name":"setSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri_","type":"string"}],"name":"setURI","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":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50614f94806100206000396000f3fe6080604052600436106102695760003560e01c80638456cb5911610153578063bd85b039116100cb578063e985e9c51161007f578063f5298aca11610064578063f5298aca146107c6578063f5e4ce3e146107e6578063f62d18881461081a57600080fd5b8063e985e9c51461075d578063f242432a146107a657600080fd5b8063d5391393116100b0578063d5391393146106d5578063d547741f14610709578063e63ab1e91461072957600080fd5b8063bd85b03914610687578063ca15c873146106b557600080fd5b806391d1485411610122578063a22cb46511610107578063a22cb46514610627578063b8d217f114610647578063bb5a9b581461066757600080fd5b806391d14854146105cc578063a217fddf1461061257600080fd5b80638456cb591461052b5780638d108ef1146105405780638e5116bc146105745780639010d07c1461059457600080fd5b806336568abe116101e65780635b844d9d116101b55780636b20c4541161019a5780636b20c454146104b7578063731133e9146104d75780637f345710146104f757600080fd5b80635b844d9d1461048b5780635c975abb1461049e57600080fd5b806336568abe146103f95780633f4ba83a146104195780634e1273f41461042e5780634f558e791461045b57600080fd5b80630e89341c1161023d578063248a9ca311610222578063248a9ca3146103895780632eb2c2d6146103b95780632f2ff15d146103d957600080fd5b80630e89341c146103495780631f7fdffa1461036957600080fd5b8062fdd58e1461026e57806301ffc9a7146102a157806302fe5305146102d157806306fdde03146102f3575b600080fd5b34801561027a57600080fd5b5061028e61028936600461421e565b61083a565b6040519081526020015b60405180910390f35b3480156102ad57600080fd5b506102c16102bc366004614260565b6108e8565b6040519015158152602001610298565b3480156102dd57600080fd5b506102f16102ec366004614348565b6108f3565b005b3480156102ff57600080fd5b5061033c6040518060400160405280601381526020017f426f74746f20416363657373205061737365730000000000000000000000000081525081565b60405161029891906143e9565b34801561035557600080fd5b5061033c6103643660046143fc565b61099b565b34801561037557600080fd5b506102f16103843660046144ca565b610a2f565b34801561039557600080fd5b5061028e6103a43660046143fc565b60009081526065602052604090206001015490565b3480156103c557600080fd5b506102f16103d4366004614565565b610add565b3480156103e557600080fd5b506102f16103f4366004614613565b610b7f565b34801561040557600080fd5b506102f1610414366004614613565b610baa565b34801561042557600080fd5b506102f1610c36565b34801561043a57600080fd5b5061044e610449366004614643565b610cdc565b604051610298919061474b565b34801561046757600080fd5b506102c16104763660046143fc565b60009081526101c36020526040902054151590565b6102f161049936600461475e565b610e1a565b3480156104aa57600080fd5b5061012d5460ff166102c1565b3480156104c357600080fd5b506102f16104d23660046147df565b61137c565b3480156104e357600080fd5b506102f16104f236600461484b565b611401565b34801561050357600080fd5b5061028e7f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c81565b34801561053757600080fd5b506102f16114a9565b34801561054c57600080fd5b5061028e7fda62c861f1dc3cd7839650ce8ed1b5930f1bada8f6cc8046a5ad3075ec4396f181565b34801561058057600080fd5b506102f161058f3660046148a2565b61154d565b3480156105a057600080fd5b506105b46105af3660046148e4565b611655565b6040516001600160a01b039091168152602001610298565b3480156105d857600080fd5b506102c16105e7366004614613565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561061e57600080fd5b5061028e600081565b34801561063357600080fd5b506102f1610642366004614914565b611674565b34801561065357600080fd5b506102f1610662366004614942565b61167f565b34801561067357600080fd5b506102f16106823660046148e4565b61173b565b34801561069357600080fd5b5061028e6106a23660046143fc565b60009081526101c3602052604090205490565b3480156106c157600080fd5b5061028e6106d03660046143fc565b6117f9565b3480156106e157600080fd5b5061028e7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b34801561071557600080fd5b506102f1610724366004614613565b611810565b34801561073557600080fd5b5061028e7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b34801561076957600080fd5b506102c161077836600461496e565b6001600160a01b03918216600090815260ca6020908152604080832093909416825291909152205460ff1690565b3480156107b257600080fd5b506102f16107c136600461499c565b611836565b3480156107d257600080fd5b506102f16107e1366004614a05565b6118bd565b3480156107f257600080fd5b5061028e7fb5a2d99279c0fce9f611d52b835a7bd1d0b03856182f811f188245e164c60d6d81565b34801561082657600080fd5b506102f1610835366004614348565b611942565b60006001600160a01b0383166108bd5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b50600081815260c9602090815260408083206001600160a01b03861684529091529020545b92915050565b60006108e282611ae3565b61091d7f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c336105e7565b61098f5760405162461bcd60e51b815260206004820152602c60248201527f426f74746f4163636573735061737365733a206d75737420686176652075726960448201527f2073657474657220726f6c65000000000000000000000000000000000000000060648201526084016108b4565b61099881611aee565b50565b606060cb80546109aa90614a3a565b80601f01602080910402602001604051908101604052809291908181526020018280546109d690614a3a565b8015610a235780601f106109f857610100808354040283529160200191610a23565b820191906000526020600020905b815481529060010190602001808311610a0657829003601f168201915b50505050509050919050565b610a597f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105e7565b610acb5760405162461bcd60e51b815260206004820152603860248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f68617665206d696e74657220726f6c6520746f206d696e74000000000000000060648201526084016108b4565b610ad784848484611afa565b50505050565b6001600160a01b038516331480610af95750610af98533610778565b610b6b5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016108b4565b610b788585858585611cd0565b5050505050565b600082815260656020526040902060010154610b9b8133611f52565b610ba58383611fd2565b505050565b6001600160a01b0381163314610c285760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016108b4565b610c328282611ff4565b5050565b610c607f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336105e7565b610cd25760405162461bcd60e51b815260206004820152603b60248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f20756e7061757365000000000060648201526084016108b4565b610cda612016565b565b60608151835114610d555760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016108b4565b6000835167ffffffffffffffff811115610d7157610d7161427d565b604051908082528060200260200182016040528015610d9a578160200160208202803683370190505b50905060005b8451811015610e1257610de5858281518110610dbe57610dbe614a74565b6020026020010151858381518110610dd857610dd8614a74565b602002602001015161083a565b828281518110610df757610df7614a74565b6020908102919091010152610e0b81614aa0565b9050610da0565b509392505050565b6000610e36610e30610e2b86614ab9565b6120b4565b8361218f565b6001600160a01b03811660009081527fa0f6cebec7fb889cc5ac88647269c4c0108fb926abd2111b551f234b348876df602052604090205490915060ff16610ee55760405162461bcd60e51b8152602060048201526024808201527f426f74746f4163636573735061737365733a207369676e617475726520696e7660448201527f616c69640000000000000000000000000000000000000000000000000000000060648201526084016108b4565b8335600090815261022c6020908152604090912054908501351015610f565760405162461bcd60e51b815260206004820152602160248201527f426f74746f4163636573735061737365733a207065726d6974207265766f6b656044820152601960fa1b60648201526084016108b4565b428460a0013511158015610f6e5750428460c0013510155b610fc45760405162461bcd60e51b815260206004820152602160248201527f426f74746f4163636573735061737365733a207065726d6974206578706972656044820152601960fa1b60648201526084016108b4565b6000610fd7610100860160e08701614b69565b6001600160a01b03161461107c57610ff6610100850160e08601614b69565b6001600160a01b0316836001600160a01b03161461107c5760405162461bcd60e51b815260206004820152603260248201527f426f74746f4163636573735061737365733a20726563697069656e7420646f6560448201527f73206e6f74206d61746368207065726d6974000000000000000000000000000060648201526084016108b4565b83356000908152610229602052604090205415806110ca57508335600081815261022960209081526040808320546001600160a01b038816845261022a835281842094845293909152902054105b61113c5760405162461bcd60e51b815260206004820152603660248201527f426f74746f4163636573735061737365733a2072656465656d2063617020726560448201527f616368656420666f72207468697320616464726573730000000000000000000060648201526084016108b4565b6060840135156112fe5760006111586060860160408701614b69565b6001600160a01b0316036112be5783606001353410156111e05760405162461bcd60e51b815260206004820152603860248201527f426f74746f4163636573735061737365733a207472616e73616374696f6e207660448201527f616c756520756e646572206d696e696d756d207072696365000000000000000060648201526084016108b4565b60006111f260a0860160808701614b69565b6001600160a01b03163460405160006040518083038185875af1925050503d806000811461123c576040519150601f19603f3d011682016040523d82523d6000602084013e611241565b606091505b50509050806112b85760405162461bcd60e51b815260206004820152602360248201527f426f74746f4163636573735061737365733a207472616e73666572206661696c60448201527f65642e000000000000000000000000000000000000000000000000000000000060648201526084016108b4565b506112fe565b60006112d06060860160408701614b69565b90506112fc336112e660a0880160808901614b69565b6001600160a01b0384169190606089013561219b565b505b6001600160a01b038316600090815261022a60209081526040808320873584529091528120805460019290611334908490614b86565b9250508190555061135b818560000135600160405180602001604052806000815250612234565b610ad781848660000135600160405180602001604052806000815250612346565b6001600160a01b03831633148061139857506113988333610778565b6113f65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108b4565b610ba58383836124fb565b61142b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105e7565b61149d5760405162461bcd60e51b815260206004820152603860248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f68617665206d696e74657220726f6c6520746f206d696e74000000000000000060648201526084016108b4565b610ad784848484612234565b6114d37f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336105e7565b6115455760405162461bcd60e51b815260206004820152603960248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f2070617573650000000000000060648201526084016108b4565b610cda612745565b6115586000336105e7565b6115ca5760405162461bcd60e51b815260206004820152602760248201527f426f74746f4163636573735061737365733a206d75737420686176652061646d60448201527f696e20726f6c650000000000000000000000000000000000000000000000000060648201526084016108b4565b600082116116405760405162461bcd60e51b815260206004820152602160248201527f426f74746f4163636573735061737365733a20696e76616c696420616d6f756e60448201527f740000000000000000000000000000000000000000000000000000000000000060648201526084016108b4565b82610ad76001600160a01b03821683856127cf565b600082815260976020526040812061166d9083612818565b9392505050565b610c32338383612824565b6116a97fb5a2d99279c0fce9f611d52b835a7bd1d0b03856182f811f188245e164c60d6d336105e7565b61171b5760405162461bcd60e51b815260206004820152602f60248201527f426f74746f4163636573735061737365733a206d75737420686176652073757060448201527f706c792073657474657220726f6c65000000000000000000000000000000000060648201526084016108b4565b600092835261022b60209081526040808520939093556102299052912055565b6117657f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105e7565b6117d75760405162461bcd60e51b815260206004820152602860248201527f426f74746f4163636573735061737365733a206d7573742068617665206d696e60448201527f74657220726f6c6500000000000000000000000000000000000000000000000060648201526084016108b4565b6117e2816001614b86565b600092835261022c60205260409092209190915550565b60008181526097602052604081206108e290612918565b60008281526065602052604090206001015461182c8133611f52565b610ba58383611ff4565b6001600160a01b03851633148061185257506118528533610778565b6118b05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108b4565b610b788585858585612346565b6001600160a01b0383163314806118d957506118d98333610778565b6119375760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108b4565b610ba5838383612922565b600054610100900460ff1661195d5760005460ff1615611961565b303b155b6119d35760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108b4565b600054610100900460ff161580156119f5576000805461ffff19166101011790555b6119fe82612a9f565b611a06612b5b565b611a7a6040518060400160405280601481526020017f426f74746f4e46544163636573735061737365730000000000000000000000008152506040518060400160405280600581526020017f312e302e30000000000000000000000000000000000000000000000000000000815250612bc6565b611aa47f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c33611fd2565b611ace7fb5a2d99279c0fce9f611d52b835a7bd1d0b03856182f811f188245e164c60d6d33611fd2565b8015610c32576000805461ff00191690555050565b60006108e282612c3b565b60cb610c328282614be4565b6001600160a01b038416611b5a5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016108b4565b8151835114611bbc5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108b4565b33611bcc81600087878787612cad565b60005b8451811015611c6857838181518110611bea57611bea614a74565b602002602001015160c96000878481518110611c0857611c08614a74565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254611c509190614b86565b90915550819050611c6081614aa0565b915050611bcf565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611cb9929190614ca4565b60405180910390a4610b7881600087878787612def565b8151835114611d325760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108b4565b6001600160a01b038416611d965760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108b4565b33611da5818787878787612cad565b60005b8451811015611ee4576000858281518110611dc557611dc5614a74565b602002602001015190506000858381518110611de357611de3614a74565b602090810291909101810151600084815260c9835260408082206001600160a01b038e168352909352919091205490915081811015611e8a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016108b4565b600083815260c9602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611ec9908490614b86565b9250508190555050505080611edd90614aa0565b9050611da8565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611f34929190614ca4565b60405180910390a4611f4a818787878787612def565b505050505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610c3257611f90816001600160a01b03166014612fa9565b611f9b836020612fa9565b604051602001611fac929190614cd2565b60408051601f198184030181529082905262461bcd60e51b82526108b4916004016143e9565b611fdc82826131d2565b6000828152609760205260409020610ba59082613274565b611ffe8282613289565b6000828152609760205260409020610ba5908261330c565b61012d5460ff166120695760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016108b4565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60006108e27fda62c861f1dc3cd7839650ce8ed1b5930f1bada8f6cc8046a5ad3075ec4396f1836000015184602001518560400151866060015187608001518860a001518960c001518a60e001518b6101000151805190602001206040516020016121749a99989796959493929190998a5260208a019890985260408901969096526001600160a01b039485166060890152608088019390935290831660a087015260c086015260e0850152166101008301526101208201526101400190565b60405160208183030381529060405280519060200120613321565b600061166d838361338a565b6040516001600160a01b0380851660248301528316604482015260648101829052610ad79085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909316929092179091526133a6565b6001600160a01b0384166122945760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016108b4565b336122b4816000876122a58861348b565b6122ae8861348b565b87612cad565b600084815260c9602090815260408083206001600160a01b0389168452909152812080548592906122e6908490614b86565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b78816000878787876134d6565b6001600160a01b0384166123aa5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108b4565b336123ba8187876122a58861348b565b600084815260c9602090815260408083206001600160a01b038a168452909152902054838110156124535760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016108b4565b600085815260c9602090815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290612492908490614b86565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46124f28288888888886134d6565b50505050505050565b6001600160a01b03831661255d5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016108b4565b80518251146125bf5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108b4565b60003390506125e281856000868660405180602001604052806000815250612cad565b60005b83518110156126e657600084828151811061260257612602614a74565b60200260200101519050600084838151811061262057612620614a74565b602090810291909101810151600084815260c9835260408082206001600160a01b038c1683529093529190912054909150818110156126ad5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016108b4565b600092835260c9602090815260408085206001600160a01b038b16865290915290922091039055806126de81614aa0565b9150506125e5565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612737929190614ca4565b60405180910390a450505050565b61012d5460ff16156127995760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016108b4565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120973390565b6040516001600160a01b038316602482015260448101829052610ba59084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064016121e8565b600061166d83836135e7565b816001600160a01b0316836001600160a01b0316036128ab5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016108b4565b6001600160a01b03838116600081815260ca6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60006108e2825490565b6001600160a01b0383166129845760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016108b4565b336129b3818560006129958761348b565b61299e8761348b565b60405180602001604052806000815250612cad565b600083815260c9602090815260408083206001600160a01b038816845290915290205482811015612a325760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016108b4565b600084815260c9602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b600054610100900460ff16612aba5760005460ff1615612abe565b303b155b612b305760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108b4565b600054610100900460ff16158015612b52576000805461ffff19166101011790555b611ace82613611565b600054610100900460ff16610cda5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b600054610100900460ff16612c315760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b610c3282826136c6565b60006001600160e01b031982167fd9b67a26000000000000000000000000000000000000000000000000000000001480612c9e57506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b806108e257506108e28261374d565b612cbb86868686868661378b565b6001600160a01b038516611f4a5760005b83518110156124f25761022b6000858381518110612cec57612cec614a74565b602002602001015181526020019081526020016000205460001480612d6d575061022b6000858381518110612d2357612d23614a74565b6020026020010151815260200190815260200160002054612d6a858381518110612d4f57612d4f614a74565b602002602001015160009081526101c3602052604090205490565b11155b612ddf5760405162461bcd60e51b815260206004820152602d60248201527f426f74746f4163636573735061737365733a20657863656564696e6720746f7460448201527f616c20737570706c79206361700000000000000000000000000000000000000060648201526084016108b4565b612de881614aa0565b9050612ccc565b6001600160a01b0384163b15611f4a5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612e339089908990889088908890600401614d53565b6020604051808303816000875af1925050508015612e6e575060408051601f3d908101601f19168201909252612e6b91810190614db1565b60015b612f2357612e7a614dce565b806308c379a003612eb35750612e8e614dea565b80612e995750612eb5565b8060405162461bcd60e51b81526004016108b491906143e9565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016108b4565b6001600160e01b0319811663bc197c8160e01b146124f25760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016108b4565b60606000612fb8836002614e74565b612fc3906002614b86565b67ffffffffffffffff811115612fdb57612fdb61427d565b6040519080825280601f01601f191660200182016040528015613005576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061303c5761303c614a74565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061309f5761309f614a74565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006130db846002614e74565b6130e6906001614b86565b90505b6001811115613183577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061312757613127614a74565b1a60f81b82828151811061313d5761313d614a74565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361317c81614e93565b90506130e9565b50831561166d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108b4565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610c325760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556132303390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061166d836001600160a01b0384166138a7565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610c325760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061166d836001600160a01b0384166138f6565b60006108e261332e6139e9565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006133998585613a6b565b91509150610e1281613ad9565b60006133fb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c8f9092919063ffffffff16565b805190915015610ba557808060200190518101906134199190614eaa565b610ba55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016108b4565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106134c5576134c5614a74565b602090810291909101015292915050565b6001600160a01b0384163b15611f4a5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061351a9089908990889088908890600401614ec7565b6020604051808303816000875af1925050508015613555575060408051601f3d908101601f1916820190925261355291810190614db1565b60015b61356157612e7a614dce565b6001600160e01b0319811663f23a6e6160e01b146124f25760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016108b4565b60008260000182815481106135fe576135fe614a74565b9060005260206000200154905092915050565b600054610100900460ff1661367c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b613684612b5b565b61368c612b5b565b613694612b5b565b61369c612b5b565b6136a581613ca6565b6136ad612b5b565b6136b5613d11565b6136bd612b5b565b61099881613d89565b600054610100900460ff166137315760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b8151602092830120815191909201206101f5919091556101f655565b60006001600160e01b031982167f5a05180f0000000000000000000000000000000000000000000000000000000014806108e257506108e282613e53565b613799868686868686613eba565b6001600160a01b0385166138215760005b835181101561381f578281815181106137c5576137c5614a74565b60200260200101516101c360008684815181106137e4576137e4614a74565b6020026020010151815260200190815260200160002060008282546138099190614b86565b90915550613818905081614aa0565b90506137aa565b505b6001600160a01b038416611f4a5760005b83518110156124f25782818151811061384d5761384d614a74565b60200260200101516101c3600086848151811061386c5761386c614a74565b6020026020010151815260200190815260200160002060008282546138919190614eff565b909155506138a0905081614aa0565b9050613832565b60008181526001830160205260408120546138ee575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108e2565b5060006108e2565b600081815260018301602052604081205480156139df57600061391a600183614eff565b855490915060009061392e90600190614eff565b905081811461399357600086600001828154811061394e5761394e614a74565b906000526020600020015490508087600001848154811061397157613971614a74565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806139a4576139a4614f16565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108e2565b60009150506108e2565b6000613a667f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f613a196101f55490565b6101f6546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b905090565b6000808251604103613aa15760208301516040840151606085015160001a613a9587828585613ec8565b94509450505050613ad2565b8251604003613aca5760208301516040840151613abf868383613fb5565b935093505050613ad2565b506000905060025b9250929050565b6000816004811115613aed57613aed614f2c565b03613af55750565b6001816004811115613b0957613b09614f2c565b03613b565760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108b4565b6002816004811115613b6a57613b6a614f2c565b03613bb75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108b4565b6003816004811115613bcb57613bcb614f2c565b03613c235760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108b4565b6004816004811115613c3757613c37614f2c565b036109985760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108b4565b6060613c9e8484600085613ffd565b949350505050565b600054610100900460ff1661098f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b600054610100900460ff16613d7c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b61012d805460ff19169055565b600054610100900460ff16613df45760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b613dff60003361413c565b613e297f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a63361413c565b6109987f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a3361413c565b60006001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806108e257507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146108e2565b611f4a868686868686614146565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613eff5750600090506003613fac565b8460ff16601b14158015613f1757508460ff16601c14155b15613f285750600090506004613fac565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613f7c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613fa557600060019250925050613fac565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b01613fef87828885613ec8565b935093505050935093915050565b6060824710156140755760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016108b4565b843b6140c35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108b4565b600080866001600160a01b031685876040516140df9190614f42565b60006040518083038185875af1925050503d806000811461411c576040519150601f19603f3d011682016040523d82523d6000602084013e614121565b606091505b50915091506141318282866141c0565b979650505050505050565b610c328282611fd2565b61012d5460ff1615611f4a5760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201527f7768696c6520706175736564000000000000000000000000000000000000000060648201526084016108b4565b606083156141cf57508161166d565b8251156141df5782518084602001fd5b8160405162461bcd60e51b81526004016108b491906143e9565b6001600160a01b038116811461099857600080fd5b8035614219816141f9565b919050565b6000806040838503121561423157600080fd5b823561423c816141f9565b946020939093013593505050565b6001600160e01b03198116811461099857600080fd5b60006020828403121561427257600080fd5b813561166d8161424a565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff811182821017156142b9576142b961427d565b6040525050565b604051610120810167ffffffffffffffff811182821017156142e4576142e461427d565b60405290565b600067ffffffffffffffff8311156143045761430461427d565b60405161431b601f8501601f191660200182614293565b80915083815284848401111561433057600080fd5b83836020830137600060208583010152509392505050565b60006020828403121561435a57600080fd5b813567ffffffffffffffff81111561437157600080fd5b8201601f8101841361438257600080fd5b613c9e848235602084016142ea565b60005b838110156143ac578181015183820152602001614394565b83811115610ad75750506000910152565b600081518084526143d5816020860160208601614391565b601f01601f19169290920160200192915050565b60208152600061166d60208301846143bd565b60006020828403121561440e57600080fd5b5035919050565b600067ffffffffffffffff82111561442f5761442f61427d565b5060051b60200190565b600082601f83011261444a57600080fd5b8135602061445782614415565b6040516144648282614293565b83815260059390931b850182019282810191508684111561448457600080fd5b8286015b8481101561449f5780358352918301918301614488565b509695505050505050565b600082601f8301126144bb57600080fd5b61166d838335602085016142ea565b600080600080608085870312156144e057600080fd5b84356144eb816141f9565b9350602085013567ffffffffffffffff8082111561450857600080fd5b61451488838901614439565b9450604087013591508082111561452a57600080fd5b61453688838901614439565b9350606087013591508082111561454c57600080fd5b50614559878288016144aa565b91505092959194509250565b600080600080600060a0868803121561457d57600080fd5b8535614588816141f9565b94506020860135614598816141f9565b9350604086013567ffffffffffffffff808211156145b557600080fd5b6145c189838a01614439565b945060608801359150808211156145d757600080fd5b6145e389838a01614439565b935060808801359150808211156145f957600080fd5b50614606888289016144aa565b9150509295509295909350565b6000806040838503121561462657600080fd5b823591506020830135614638816141f9565b809150509250929050565b6000806040838503121561465657600080fd5b823567ffffffffffffffff8082111561466e57600080fd5b818501915085601f83011261468257600080fd5b8135602061468f82614415565b60405161469c8282614293565b83815260059390931b85018201928281019150898411156146bc57600080fd5b948201945b838610156146e35785356146d4816141f9565b825294820194908201906146c1565b965050860135925050808211156146f957600080fd5b5061470685828601614439565b9150509250929050565b600081518084526020808501945080840160005b8381101561474057815187529582019590820190600101614724565b509495945050505050565b60208152600061166d6020830184614710565b60008060006060848603121561477357600080fd5b833567ffffffffffffffff8082111561478b57600080fd5b9085019061012082880312156147a057600080fd5b9093506020850135906147b2826141f9565b909250604085013590808211156147c857600080fd5b506147d5868287016144aa565b9150509250925092565b6000806000606084860312156147f457600080fd5b83356147ff816141f9565b9250602084013567ffffffffffffffff8082111561481c57600080fd5b61482887838801614439565b9350604086013591508082111561483e57600080fd5b506147d586828701614439565b6000806000806080858703121561486157600080fd5b843561486c816141f9565b93506020850135925060408501359150606085013567ffffffffffffffff81111561489657600080fd5b614559878288016144aa565b6000806000606084860312156148b757600080fd5b83356148c2816141f9565b92506020840135915060408401356148d9816141f9565b809150509250925092565b600080604083850312156148f757600080fd5b50508035926020909101359150565b801515811461099857600080fd5b6000806040838503121561492757600080fd5b8235614932816141f9565b9150602083013561463881614906565b60008060006060848603121561495757600080fd5b505081359360208301359350604090920135919050565b6000806040838503121561498157600080fd5b823561498c816141f9565b91506020830135614638816141f9565b600080600080600060a086880312156149b457600080fd5b85356149bf816141f9565b945060208601356149cf816141f9565b93506040860135925060608601359150608086013567ffffffffffffffff8111156149f957600080fd5b614606888289016144aa565b600080600060608486031215614a1a57600080fd5b8335614a25816141f9565b95602085013595506040909401359392505050565b600181811c90821680614a4e57607f821691505b602082108103614a6e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614ab257614ab2614a8a565b5060010190565b60006101208236031215614acc57600080fd5b614ad46142c0565b8235815260208301356020820152614aee6040840161420e565b604082015260608301356060820152614b096080840161420e565b608082015260a083013560a082015260c083013560c0820152614b2e60e0840161420e565b60e08201526101008084013567ffffffffffffffff811115614b4f57600080fd5b614b5b368287016144aa565b918301919091525092915050565b600060208284031215614b7b57600080fd5b813561166d816141f9565b60008219821115614b9957614b99614a8a565b500190565b601f821115610ba557600081815260208120601f850160051c81016020861015614bc55750805b601f850160051c820191505b81811015611f4a57828155600101614bd1565b815167ffffffffffffffff811115614bfe57614bfe61427d565b614c1281614c0c8454614a3a565b84614b9e565b602080601f831160018114614c475760008415614c2f5750858301515b600019600386901b1c1916600185901b178555611f4a565b600085815260208120601f198616915b82811015614c7657888601518255948401946001909101908401614c57565b5085821015614c945787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000614cb76040830185614710565b8281036020840152614cc98185614710565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614d0a816017850160208801614391565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614d47816028840160208801614391565b01602801949350505050565b60006001600160a01b03808816835280871660208401525060a06040830152614d7f60a0830186614710565b8281036060840152614d918186614710565b90508281036080840152614da581856143bd565b98975050505050505050565b600060208284031215614dc357600080fd5b815161166d8161424a565b600060033d1115614de75760046000803e5060005160e01c5b90565b600060443d1015614df85790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715614e2857505050505090565b8285019150815181811115614e405750505050505090565b843d8701016020828501011115614e5a5750505050505090565b614e6960208286010187614293565b509095945050505050565b6000816000190483118215151615614e8e57614e8e614a8a565b500290565b600081614ea257614ea2614a8a565b506000190190565b600060208284031215614ebc57600080fd5b815161166d81614906565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261413160a08301846143bd565b600082821015614f1157614f11614a8a565b500390565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60008251614f54818460208701614391565b919091019291505056fea2646970667358221220e372d30379820180a0d4acf94f82a0a55bfa842be1c8d57bb0a0fe479f608bd564736f6c634300080f0033
Deployed Bytecode
0x6080604052600436106102695760003560e01c80638456cb5911610153578063bd85b039116100cb578063e985e9c51161007f578063f5298aca11610064578063f5298aca146107c6578063f5e4ce3e146107e6578063f62d18881461081a57600080fd5b8063e985e9c51461075d578063f242432a146107a657600080fd5b8063d5391393116100b0578063d5391393146106d5578063d547741f14610709578063e63ab1e91461072957600080fd5b8063bd85b03914610687578063ca15c873146106b557600080fd5b806391d1485411610122578063a22cb46511610107578063a22cb46514610627578063b8d217f114610647578063bb5a9b581461066757600080fd5b806391d14854146105cc578063a217fddf1461061257600080fd5b80638456cb591461052b5780638d108ef1146105405780638e5116bc146105745780639010d07c1461059457600080fd5b806336568abe116101e65780635b844d9d116101b55780636b20c4541161019a5780636b20c454146104b7578063731133e9146104d75780637f345710146104f757600080fd5b80635b844d9d1461048b5780635c975abb1461049e57600080fd5b806336568abe146103f95780633f4ba83a146104195780634e1273f41461042e5780634f558e791461045b57600080fd5b80630e89341c1161023d578063248a9ca311610222578063248a9ca3146103895780632eb2c2d6146103b95780632f2ff15d146103d957600080fd5b80630e89341c146103495780631f7fdffa1461036957600080fd5b8062fdd58e1461026e57806301ffc9a7146102a157806302fe5305146102d157806306fdde03146102f3575b600080fd5b34801561027a57600080fd5b5061028e61028936600461421e565b61083a565b6040519081526020015b60405180910390f35b3480156102ad57600080fd5b506102c16102bc366004614260565b6108e8565b6040519015158152602001610298565b3480156102dd57600080fd5b506102f16102ec366004614348565b6108f3565b005b3480156102ff57600080fd5b5061033c6040518060400160405280601381526020017f426f74746f20416363657373205061737365730000000000000000000000000081525081565b60405161029891906143e9565b34801561035557600080fd5b5061033c6103643660046143fc565b61099b565b34801561037557600080fd5b506102f16103843660046144ca565b610a2f565b34801561039557600080fd5b5061028e6103a43660046143fc565b60009081526065602052604090206001015490565b3480156103c557600080fd5b506102f16103d4366004614565565b610add565b3480156103e557600080fd5b506102f16103f4366004614613565b610b7f565b34801561040557600080fd5b506102f1610414366004614613565b610baa565b34801561042557600080fd5b506102f1610c36565b34801561043a57600080fd5b5061044e610449366004614643565b610cdc565b604051610298919061474b565b34801561046757600080fd5b506102c16104763660046143fc565b60009081526101c36020526040902054151590565b6102f161049936600461475e565b610e1a565b3480156104aa57600080fd5b5061012d5460ff166102c1565b3480156104c357600080fd5b506102f16104d23660046147df565b61137c565b3480156104e357600080fd5b506102f16104f236600461484b565b611401565b34801561050357600080fd5b5061028e7f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c81565b34801561053757600080fd5b506102f16114a9565b34801561054c57600080fd5b5061028e7fda62c861f1dc3cd7839650ce8ed1b5930f1bada8f6cc8046a5ad3075ec4396f181565b34801561058057600080fd5b506102f161058f3660046148a2565b61154d565b3480156105a057600080fd5b506105b46105af3660046148e4565b611655565b6040516001600160a01b039091168152602001610298565b3480156105d857600080fd5b506102c16105e7366004614613565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561061e57600080fd5b5061028e600081565b34801561063357600080fd5b506102f1610642366004614914565b611674565b34801561065357600080fd5b506102f1610662366004614942565b61167f565b34801561067357600080fd5b506102f16106823660046148e4565b61173b565b34801561069357600080fd5b5061028e6106a23660046143fc565b60009081526101c3602052604090205490565b3480156106c157600080fd5b5061028e6106d03660046143fc565b6117f9565b3480156106e157600080fd5b5061028e7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b34801561071557600080fd5b506102f1610724366004614613565b611810565b34801561073557600080fd5b5061028e7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b34801561076957600080fd5b506102c161077836600461496e565b6001600160a01b03918216600090815260ca6020908152604080832093909416825291909152205460ff1690565b3480156107b257600080fd5b506102f16107c136600461499c565b611836565b3480156107d257600080fd5b506102f16107e1366004614a05565b6118bd565b3480156107f257600080fd5b5061028e7fb5a2d99279c0fce9f611d52b835a7bd1d0b03856182f811f188245e164c60d6d81565b34801561082657600080fd5b506102f1610835366004614348565b611942565b60006001600160a01b0383166108bd5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b50600081815260c9602090815260408083206001600160a01b03861684529091529020545b92915050565b60006108e282611ae3565b61091d7f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c336105e7565b61098f5760405162461bcd60e51b815260206004820152602c60248201527f426f74746f4163636573735061737365733a206d75737420686176652075726960448201527f2073657474657220726f6c65000000000000000000000000000000000000000060648201526084016108b4565b61099881611aee565b50565b606060cb80546109aa90614a3a565b80601f01602080910402602001604051908101604052809291908181526020018280546109d690614a3a565b8015610a235780601f106109f857610100808354040283529160200191610a23565b820191906000526020600020905b815481529060010190602001808311610a0657829003601f168201915b50505050509050919050565b610a597f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105e7565b610acb5760405162461bcd60e51b815260206004820152603860248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f68617665206d696e74657220726f6c6520746f206d696e74000000000000000060648201526084016108b4565b610ad784848484611afa565b50505050565b6001600160a01b038516331480610af95750610af98533610778565b610b6b5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016108b4565b610b788585858585611cd0565b5050505050565b600082815260656020526040902060010154610b9b8133611f52565b610ba58383611fd2565b505050565b6001600160a01b0381163314610c285760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016108b4565b610c328282611ff4565b5050565b610c607f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336105e7565b610cd25760405162461bcd60e51b815260206004820152603b60248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f20756e7061757365000000000060648201526084016108b4565b610cda612016565b565b60608151835114610d555760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016108b4565b6000835167ffffffffffffffff811115610d7157610d7161427d565b604051908082528060200260200182016040528015610d9a578160200160208202803683370190505b50905060005b8451811015610e1257610de5858281518110610dbe57610dbe614a74565b6020026020010151858381518110610dd857610dd8614a74565b602002602001015161083a565b828281518110610df757610df7614a74565b6020908102919091010152610e0b81614aa0565b9050610da0565b509392505050565b6000610e36610e30610e2b86614ab9565b6120b4565b8361218f565b6001600160a01b03811660009081527fa0f6cebec7fb889cc5ac88647269c4c0108fb926abd2111b551f234b348876df602052604090205490915060ff16610ee55760405162461bcd60e51b8152602060048201526024808201527f426f74746f4163636573735061737365733a207369676e617475726520696e7660448201527f616c69640000000000000000000000000000000000000000000000000000000060648201526084016108b4565b8335600090815261022c6020908152604090912054908501351015610f565760405162461bcd60e51b815260206004820152602160248201527f426f74746f4163636573735061737365733a207065726d6974207265766f6b656044820152601960fa1b60648201526084016108b4565b428460a0013511158015610f6e5750428460c0013510155b610fc45760405162461bcd60e51b815260206004820152602160248201527f426f74746f4163636573735061737365733a207065726d6974206578706972656044820152601960fa1b60648201526084016108b4565b6000610fd7610100860160e08701614b69565b6001600160a01b03161461107c57610ff6610100850160e08601614b69565b6001600160a01b0316836001600160a01b03161461107c5760405162461bcd60e51b815260206004820152603260248201527f426f74746f4163636573735061737365733a20726563697069656e7420646f6560448201527f73206e6f74206d61746368207065726d6974000000000000000000000000000060648201526084016108b4565b83356000908152610229602052604090205415806110ca57508335600081815261022960209081526040808320546001600160a01b038816845261022a835281842094845293909152902054105b61113c5760405162461bcd60e51b815260206004820152603660248201527f426f74746f4163636573735061737365733a2072656465656d2063617020726560448201527f616368656420666f72207468697320616464726573730000000000000000000060648201526084016108b4565b6060840135156112fe5760006111586060860160408701614b69565b6001600160a01b0316036112be5783606001353410156111e05760405162461bcd60e51b815260206004820152603860248201527f426f74746f4163636573735061737365733a207472616e73616374696f6e207660448201527f616c756520756e646572206d696e696d756d207072696365000000000000000060648201526084016108b4565b60006111f260a0860160808701614b69565b6001600160a01b03163460405160006040518083038185875af1925050503d806000811461123c576040519150601f19603f3d011682016040523d82523d6000602084013e611241565b606091505b50509050806112b85760405162461bcd60e51b815260206004820152602360248201527f426f74746f4163636573735061737365733a207472616e73666572206661696c60448201527f65642e000000000000000000000000000000000000000000000000000000000060648201526084016108b4565b506112fe565b60006112d06060860160408701614b69565b90506112fc336112e660a0880160808901614b69565b6001600160a01b0384169190606089013561219b565b505b6001600160a01b038316600090815261022a60209081526040808320873584529091528120805460019290611334908490614b86565b9250508190555061135b818560000135600160405180602001604052806000815250612234565b610ad781848660000135600160405180602001604052806000815250612346565b6001600160a01b03831633148061139857506113988333610778565b6113f65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108b4565b610ba58383836124fb565b61142b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105e7565b61149d5760405162461bcd60e51b815260206004820152603860248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f68617665206d696e74657220726f6c6520746f206d696e74000000000000000060648201526084016108b4565b610ad784848484612234565b6114d37f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336105e7565b6115455760405162461bcd60e51b815260206004820152603960248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f2070617573650000000000000060648201526084016108b4565b610cda612745565b6115586000336105e7565b6115ca5760405162461bcd60e51b815260206004820152602760248201527f426f74746f4163636573735061737365733a206d75737420686176652061646d60448201527f696e20726f6c650000000000000000000000000000000000000000000000000060648201526084016108b4565b600082116116405760405162461bcd60e51b815260206004820152602160248201527f426f74746f4163636573735061737365733a20696e76616c696420616d6f756e60448201527f740000000000000000000000000000000000000000000000000000000000000060648201526084016108b4565b82610ad76001600160a01b03821683856127cf565b600082815260976020526040812061166d9083612818565b9392505050565b610c32338383612824565b6116a97fb5a2d99279c0fce9f611d52b835a7bd1d0b03856182f811f188245e164c60d6d336105e7565b61171b5760405162461bcd60e51b815260206004820152602f60248201527f426f74746f4163636573735061737365733a206d75737420686176652073757060448201527f706c792073657474657220726f6c65000000000000000000000000000000000060648201526084016108b4565b600092835261022b60209081526040808520939093556102299052912055565b6117657f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105e7565b6117d75760405162461bcd60e51b815260206004820152602860248201527f426f74746f4163636573735061737365733a206d7573742068617665206d696e60448201527f74657220726f6c6500000000000000000000000000000000000000000000000060648201526084016108b4565b6117e2816001614b86565b600092835261022c60205260409092209190915550565b60008181526097602052604081206108e290612918565b60008281526065602052604090206001015461182c8133611f52565b610ba58383611ff4565b6001600160a01b03851633148061185257506118528533610778565b6118b05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108b4565b610b788585858585612346565b6001600160a01b0383163314806118d957506118d98333610778565b6119375760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108b4565b610ba5838383612922565b600054610100900460ff1661195d5760005460ff1615611961565b303b155b6119d35760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108b4565b600054610100900460ff161580156119f5576000805461ffff19166101011790555b6119fe82612a9f565b611a06612b5b565b611a7a6040518060400160405280601481526020017f426f74746f4e46544163636573735061737365730000000000000000000000008152506040518060400160405280600581526020017f312e302e30000000000000000000000000000000000000000000000000000000815250612bc6565b611aa47f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c33611fd2565b611ace7fb5a2d99279c0fce9f611d52b835a7bd1d0b03856182f811f188245e164c60d6d33611fd2565b8015610c32576000805461ff00191690555050565b60006108e282612c3b565b60cb610c328282614be4565b6001600160a01b038416611b5a5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016108b4565b8151835114611bbc5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108b4565b33611bcc81600087878787612cad565b60005b8451811015611c6857838181518110611bea57611bea614a74565b602002602001015160c96000878481518110611c0857611c08614a74565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254611c509190614b86565b90915550819050611c6081614aa0565b915050611bcf565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611cb9929190614ca4565b60405180910390a4610b7881600087878787612def565b8151835114611d325760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108b4565b6001600160a01b038416611d965760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108b4565b33611da5818787878787612cad565b60005b8451811015611ee4576000858281518110611dc557611dc5614a74565b602002602001015190506000858381518110611de357611de3614a74565b602090810291909101810151600084815260c9835260408082206001600160a01b038e168352909352919091205490915081811015611e8a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016108b4565b600083815260c9602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611ec9908490614b86565b9250508190555050505080611edd90614aa0565b9050611da8565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611f34929190614ca4565b60405180910390a4611f4a818787878787612def565b505050505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610c3257611f90816001600160a01b03166014612fa9565b611f9b836020612fa9565b604051602001611fac929190614cd2565b60408051601f198184030181529082905262461bcd60e51b82526108b4916004016143e9565b611fdc82826131d2565b6000828152609760205260409020610ba59082613274565b611ffe8282613289565b6000828152609760205260409020610ba5908261330c565b61012d5460ff166120695760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016108b4565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60006108e27fda62c861f1dc3cd7839650ce8ed1b5930f1bada8f6cc8046a5ad3075ec4396f1836000015184602001518560400151866060015187608001518860a001518960c001518a60e001518b6101000151805190602001206040516020016121749a99989796959493929190998a5260208a019890985260408901969096526001600160a01b039485166060890152608088019390935290831660a087015260c086015260e0850152166101008301526101208201526101400190565b60405160208183030381529060405280519060200120613321565b600061166d838361338a565b6040516001600160a01b0380851660248301528316604482015260648101829052610ad79085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909316929092179091526133a6565b6001600160a01b0384166122945760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016108b4565b336122b4816000876122a58861348b565b6122ae8861348b565b87612cad565b600084815260c9602090815260408083206001600160a01b0389168452909152812080548592906122e6908490614b86565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b78816000878787876134d6565b6001600160a01b0384166123aa5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108b4565b336123ba8187876122a58861348b565b600084815260c9602090815260408083206001600160a01b038a168452909152902054838110156124535760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016108b4565b600085815260c9602090815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290612492908490614b86565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46124f28288888888886134d6565b50505050505050565b6001600160a01b03831661255d5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016108b4565b80518251146125bf5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108b4565b60003390506125e281856000868660405180602001604052806000815250612cad565b60005b83518110156126e657600084828151811061260257612602614a74565b60200260200101519050600084838151811061262057612620614a74565b602090810291909101810151600084815260c9835260408082206001600160a01b038c1683529093529190912054909150818110156126ad5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016108b4565b600092835260c9602090815260408085206001600160a01b038b16865290915290922091039055806126de81614aa0565b9150506125e5565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612737929190614ca4565b60405180910390a450505050565b61012d5460ff16156127995760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016108b4565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120973390565b6040516001600160a01b038316602482015260448101829052610ba59084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064016121e8565b600061166d83836135e7565b816001600160a01b0316836001600160a01b0316036128ab5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016108b4565b6001600160a01b03838116600081815260ca6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60006108e2825490565b6001600160a01b0383166129845760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016108b4565b336129b3818560006129958761348b565b61299e8761348b565b60405180602001604052806000815250612cad565b600083815260c9602090815260408083206001600160a01b038816845290915290205482811015612a325760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016108b4565b600084815260c9602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b600054610100900460ff16612aba5760005460ff1615612abe565b303b155b612b305760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108b4565b600054610100900460ff16158015612b52576000805461ffff19166101011790555b611ace82613611565b600054610100900460ff16610cda5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b600054610100900460ff16612c315760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b610c3282826136c6565b60006001600160e01b031982167fd9b67a26000000000000000000000000000000000000000000000000000000001480612c9e57506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b806108e257506108e28261374d565b612cbb86868686868661378b565b6001600160a01b038516611f4a5760005b83518110156124f25761022b6000858381518110612cec57612cec614a74565b602002602001015181526020019081526020016000205460001480612d6d575061022b6000858381518110612d2357612d23614a74565b6020026020010151815260200190815260200160002054612d6a858381518110612d4f57612d4f614a74565b602002602001015160009081526101c3602052604090205490565b11155b612ddf5760405162461bcd60e51b815260206004820152602d60248201527f426f74746f4163636573735061737365733a20657863656564696e6720746f7460448201527f616c20737570706c79206361700000000000000000000000000000000000000060648201526084016108b4565b612de881614aa0565b9050612ccc565b6001600160a01b0384163b15611f4a5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612e339089908990889088908890600401614d53565b6020604051808303816000875af1925050508015612e6e575060408051601f3d908101601f19168201909252612e6b91810190614db1565b60015b612f2357612e7a614dce565b806308c379a003612eb35750612e8e614dea565b80612e995750612eb5565b8060405162461bcd60e51b81526004016108b491906143e9565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016108b4565b6001600160e01b0319811663bc197c8160e01b146124f25760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016108b4565b60606000612fb8836002614e74565b612fc3906002614b86565b67ffffffffffffffff811115612fdb57612fdb61427d565b6040519080825280601f01601f191660200182016040528015613005576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061303c5761303c614a74565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061309f5761309f614a74565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006130db846002614e74565b6130e6906001614b86565b90505b6001811115613183577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061312757613127614a74565b1a60f81b82828151811061313d5761313d614a74565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361317c81614e93565b90506130e9565b50831561166d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108b4565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610c325760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556132303390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061166d836001600160a01b0384166138a7565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610c325760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061166d836001600160a01b0384166138f6565b60006108e261332e6139e9565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006133998585613a6b565b91509150610e1281613ad9565b60006133fb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c8f9092919063ffffffff16565b805190915015610ba557808060200190518101906134199190614eaa565b610ba55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016108b4565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106134c5576134c5614a74565b602090810291909101015292915050565b6001600160a01b0384163b15611f4a5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061351a9089908990889088908890600401614ec7565b6020604051808303816000875af1925050508015613555575060408051601f3d908101601f1916820190925261355291810190614db1565b60015b61356157612e7a614dce565b6001600160e01b0319811663f23a6e6160e01b146124f25760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016108b4565b60008260000182815481106135fe576135fe614a74565b9060005260206000200154905092915050565b600054610100900460ff1661367c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b613684612b5b565b61368c612b5b565b613694612b5b565b61369c612b5b565b6136a581613ca6565b6136ad612b5b565b6136b5613d11565b6136bd612b5b565b61099881613d89565b600054610100900460ff166137315760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b8151602092830120815191909201206101f5919091556101f655565b60006001600160e01b031982167f5a05180f0000000000000000000000000000000000000000000000000000000014806108e257506108e282613e53565b613799868686868686613eba565b6001600160a01b0385166138215760005b835181101561381f578281815181106137c5576137c5614a74565b60200260200101516101c360008684815181106137e4576137e4614a74565b6020026020010151815260200190815260200160002060008282546138099190614b86565b90915550613818905081614aa0565b90506137aa565b505b6001600160a01b038416611f4a5760005b83518110156124f25782818151811061384d5761384d614a74565b60200260200101516101c3600086848151811061386c5761386c614a74565b6020026020010151815260200190815260200160002060008282546138919190614eff565b909155506138a0905081614aa0565b9050613832565b60008181526001830160205260408120546138ee575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108e2565b5060006108e2565b600081815260018301602052604081205480156139df57600061391a600183614eff565b855490915060009061392e90600190614eff565b905081811461399357600086600001828154811061394e5761394e614a74565b906000526020600020015490508087600001848154811061397157613971614a74565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806139a4576139a4614f16565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108e2565b60009150506108e2565b6000613a667f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f613a196101f55490565b6101f6546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b905090565b6000808251604103613aa15760208301516040840151606085015160001a613a9587828585613ec8565b94509450505050613ad2565b8251604003613aca5760208301516040840151613abf868383613fb5565b935093505050613ad2565b506000905060025b9250929050565b6000816004811115613aed57613aed614f2c565b03613af55750565b6001816004811115613b0957613b09614f2c565b03613b565760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108b4565b6002816004811115613b6a57613b6a614f2c565b03613bb75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108b4565b6003816004811115613bcb57613bcb614f2c565b03613c235760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108b4565b6004816004811115613c3757613c37614f2c565b036109985760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108b4565b6060613c9e8484600085613ffd565b949350505050565b600054610100900460ff1661098f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b600054610100900460ff16613d7c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b61012d805460ff19169055565b600054610100900460ff16613df45760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108b4565b613dff60003361413c565b613e297f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a63361413c565b6109987f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a3361413c565b60006001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806108e257507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146108e2565b611f4a868686868686614146565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613eff5750600090506003613fac565b8460ff16601b14158015613f1757508460ff16601c14155b15613f285750600090506004613fac565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613f7c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613fa557600060019250925050613fac565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b01613fef87828885613ec8565b935093505050935093915050565b6060824710156140755760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016108b4565b843b6140c35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108b4565b600080866001600160a01b031685876040516140df9190614f42565b60006040518083038185875af1925050503d806000811461411c576040519150601f19603f3d011682016040523d82523d6000602084013e614121565b606091505b50915091506141318282866141c0565b979650505050505050565b610c328282611fd2565b61012d5460ff1615611f4a5760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201527f7768696c6520706175736564000000000000000000000000000000000000000060648201526084016108b4565b606083156141cf57508161166d565b8251156141df5782518084602001fd5b8160405162461bcd60e51b81526004016108b491906143e9565b6001600160a01b038116811461099857600080fd5b8035614219816141f9565b919050565b6000806040838503121561423157600080fd5b823561423c816141f9565b946020939093013593505050565b6001600160e01b03198116811461099857600080fd5b60006020828403121561427257600080fd5b813561166d8161424a565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff811182821017156142b9576142b961427d565b6040525050565b604051610120810167ffffffffffffffff811182821017156142e4576142e461427d565b60405290565b600067ffffffffffffffff8311156143045761430461427d565b60405161431b601f8501601f191660200182614293565b80915083815284848401111561433057600080fd5b83836020830137600060208583010152509392505050565b60006020828403121561435a57600080fd5b813567ffffffffffffffff81111561437157600080fd5b8201601f8101841361438257600080fd5b613c9e848235602084016142ea565b60005b838110156143ac578181015183820152602001614394565b83811115610ad75750506000910152565b600081518084526143d5816020860160208601614391565b601f01601f19169290920160200192915050565b60208152600061166d60208301846143bd565b60006020828403121561440e57600080fd5b5035919050565b600067ffffffffffffffff82111561442f5761442f61427d565b5060051b60200190565b600082601f83011261444a57600080fd5b8135602061445782614415565b6040516144648282614293565b83815260059390931b850182019282810191508684111561448457600080fd5b8286015b8481101561449f5780358352918301918301614488565b509695505050505050565b600082601f8301126144bb57600080fd5b61166d838335602085016142ea565b600080600080608085870312156144e057600080fd5b84356144eb816141f9565b9350602085013567ffffffffffffffff8082111561450857600080fd5b61451488838901614439565b9450604087013591508082111561452a57600080fd5b61453688838901614439565b9350606087013591508082111561454c57600080fd5b50614559878288016144aa565b91505092959194509250565b600080600080600060a0868803121561457d57600080fd5b8535614588816141f9565b94506020860135614598816141f9565b9350604086013567ffffffffffffffff808211156145b557600080fd5b6145c189838a01614439565b945060608801359150808211156145d757600080fd5b6145e389838a01614439565b935060808801359150808211156145f957600080fd5b50614606888289016144aa565b9150509295509295909350565b6000806040838503121561462657600080fd5b823591506020830135614638816141f9565b809150509250929050565b6000806040838503121561465657600080fd5b823567ffffffffffffffff8082111561466e57600080fd5b818501915085601f83011261468257600080fd5b8135602061468f82614415565b60405161469c8282614293565b83815260059390931b85018201928281019150898411156146bc57600080fd5b948201945b838610156146e35785356146d4816141f9565b825294820194908201906146c1565b965050860135925050808211156146f957600080fd5b5061470685828601614439565b9150509250929050565b600081518084526020808501945080840160005b8381101561474057815187529582019590820190600101614724565b509495945050505050565b60208152600061166d6020830184614710565b60008060006060848603121561477357600080fd5b833567ffffffffffffffff8082111561478b57600080fd5b9085019061012082880312156147a057600080fd5b9093506020850135906147b2826141f9565b909250604085013590808211156147c857600080fd5b506147d5868287016144aa565b9150509250925092565b6000806000606084860312156147f457600080fd5b83356147ff816141f9565b9250602084013567ffffffffffffffff8082111561481c57600080fd5b61482887838801614439565b9350604086013591508082111561483e57600080fd5b506147d586828701614439565b6000806000806080858703121561486157600080fd5b843561486c816141f9565b93506020850135925060408501359150606085013567ffffffffffffffff81111561489657600080fd5b614559878288016144aa565b6000806000606084860312156148b757600080fd5b83356148c2816141f9565b92506020840135915060408401356148d9816141f9565b809150509250925092565b600080604083850312156148f757600080fd5b50508035926020909101359150565b801515811461099857600080fd5b6000806040838503121561492757600080fd5b8235614932816141f9565b9150602083013561463881614906565b60008060006060848603121561495757600080fd5b505081359360208301359350604090920135919050565b6000806040838503121561498157600080fd5b823561498c816141f9565b91506020830135614638816141f9565b600080600080600060a086880312156149b457600080fd5b85356149bf816141f9565b945060208601356149cf816141f9565b93506040860135925060608601359150608086013567ffffffffffffffff8111156149f957600080fd5b614606888289016144aa565b600080600060608486031215614a1a57600080fd5b8335614a25816141f9565b95602085013595506040909401359392505050565b600181811c90821680614a4e57607f821691505b602082108103614a6e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614ab257614ab2614a8a565b5060010190565b60006101208236031215614acc57600080fd5b614ad46142c0565b8235815260208301356020820152614aee6040840161420e565b604082015260608301356060820152614b096080840161420e565b608082015260a083013560a082015260c083013560c0820152614b2e60e0840161420e565b60e08201526101008084013567ffffffffffffffff811115614b4f57600080fd5b614b5b368287016144aa565b918301919091525092915050565b600060208284031215614b7b57600080fd5b813561166d816141f9565b60008219821115614b9957614b99614a8a565b500190565b601f821115610ba557600081815260208120601f850160051c81016020861015614bc55750805b601f850160051c820191505b81811015611f4a57828155600101614bd1565b815167ffffffffffffffff811115614bfe57614bfe61427d565b614c1281614c0c8454614a3a565b84614b9e565b602080601f831160018114614c475760008415614c2f5750858301515b600019600386901b1c1916600185901b178555611f4a565b600085815260208120601f198616915b82811015614c7657888601518255948401946001909101908401614c57565b5085821015614c945787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000614cb76040830185614710565b8281036020840152614cc98185614710565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614d0a816017850160208801614391565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614d47816028840160208801614391565b01602801949350505050565b60006001600160a01b03808816835280871660208401525060a06040830152614d7f60a0830186614710565b8281036060840152614d918186614710565b90508281036080840152614da581856143bd565b98975050505050505050565b600060208284031215614dc357600080fd5b815161166d8161424a565b600060033d1115614de75760046000803e5060005160e01c5b90565b600060443d1015614df85790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715614e2857505050505090565b8285019150815181811115614e405750505050505090565b843d8701016020828501011115614e5a5750505050505090565b614e6960208286010187614293565b509095945050505050565b6000816000190483118215151615614e8e57614e8e614a8a565b500290565b600081614ea257614ea2614a8a565b506000190190565b600060208284031215614ebc57600080fd5b815161166d81614906565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261413160a08301846143bd565b600082821015614f1157614f11614a8a565b500390565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60008251614f54818460208701614391565b919091019291505056fea2646970667358221220e372d30379820180a0d4acf94f82a0a55bfa842be1c8d57bb0a0fe479f608bd564736f6c634300080f0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.