Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 14754182 | 926 days ago | IN | 0 ETH | 0.3475035 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
BottoRetroactiveRewardV2
Compiler Version
v0.8.13+commit.abaa5c0e
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 BottoRetroactiveRewardV2 is ERC1155PresetMinterPauserUpgradeable, ERC1155SupplyUpgradeable, EIP712Upgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; // 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 = "Ceci n\u0027est pas un Botto"; /// Role to call setURI method bytes32 public constant URI_SETTER_ROLE = keccak256("URI_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("BottoNFT", "1.0.0"); _grantRole(URI_SETTER_ROLE, _msgSender()); } function setURI(string memory newuri_) external virtual { require( hasRole(URI_SETTER_ROLE, _msgSender()), "BottoRetroactiveReward: must have uri setter role" ); _setURI(newuri_); } /** * @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()), "BottoRetroactiveReward: 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), "BottoRetroactiveReward: signature invalid" ); // Check if permit is revoked require( permit_.nonce >= _mintPermitMinimumNonces[permit_.tokenId], "BottoRetroactiveReward: permit revoked" ); // Check if permit is expired require( permit_.kickoff <= block.timestamp && permit_.deadline >= block.timestamp, "BottoRetroactiveReward: permit expired" ); // Check if recipient matches permit if (permit_.recipient != address(0)) { require( recipient_ == permit_.recipient, "BottoRetroactiveReward: recipient does not match permit" ); } // Check if to pay using Ether or ERC20 if (permit_.minimumPrice != 0) { if (permit_.currency == address(0)) { require( msg.value >= permit_.minimumPrice, "BottoRetroactiveReward: transaction value under minimum price" ); (bool success, ) = permit_.payee.call{value: msg.value}(""); require(success, "BottoRetroactiveReward: transfer failed."); } else { IERC20Upgradeable token = IERC20Upgradeable(permit_.currency); token.safeTransferFrom( _msgSender(), permit_.payee, permit_.minimumPrice ); } } // 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()), "BottoRetroactiveReward: must have admin role" ); require(amount_ > 0, "BottoRetroactiveReward: 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, should never exceed one. require( totalSupply(ids[i]) <= 1, "BottoRetroactiveReward: 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":"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 BottoRetroactiveRewardV2.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":"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
608060405234801561001057600080fd5b50614c6a806100206000396000f3fe6080604052600436106102335760003560e01c80637f34571011610138578063bd85b039116100b0578063e63ab1e91161007f578063f242432a11610064578063f242432a14610750578063f5298aca14610770578063f62d18881461079057600080fd5b8063e63ab1e9146106d3578063e985e9c51461070757600080fd5b8063bd85b03914610631578063ca15c8731461065f578063d53913931461067f578063d547741f146106b357600080fd5b80639010d07c11610107578063a217fddf116100ec578063a217fddf146105dc578063a22cb465146105f1578063bb5a9b581461061157600080fd5b80639010d07c1461055e57806391d148541461059657600080fd5b80637f345710146104c15780638456cb59146104f55780638d108ef11461050a5780638e5116bc1461053e57600080fd5b80632f2ff15d116101cb5780634f558e791161019a5780635c975abb1161017f5780635c975abb146104685780636b20c45414610481578063731133e9146104a157600080fd5b80634f558e79146104255780635b844d9d1461045557600080fd5b80632f2ff15d146103a357806336568abe146103c35780633f4ba83a146103e35780634e1273f4146103f857600080fd5b80630e89341c116102075780630e89341c146103135780631f7fdffa14610333578063248a9ca3146103535780632eb2c2d61461038357600080fd5b8062fdd58e1461023857806301ffc9a71461026b57806302fe53051461029b57806306fdde03146102bd575b600080fd5b34801561024457600080fd5b50610258610253366004614026565b6107b0565b6040519081526020015b60405180910390f35b34801561027757600080fd5b5061028b610286366004614068565b61085e565b6040519015158152602001610262565b3480156102a757600080fd5b506102bb6102b6366004614150565b610869565b005b3480156102c957600080fd5b506103066040518060400160405280601781526020017f43656369206e276573742070617320756e20426f74746f00000000000000000081525081565b60405161026291906141f1565b34801561031f57600080fd5b5061030661032e366004614204565b610911565b34801561033f57600080fd5b506102bb61034e3660046142d2565b6109a5565b34801561035f57600080fd5b5061025861036e366004614204565b60009081526065602052604090206001015490565b34801561038f57600080fd5b506102bb61039e36600461436d565b610a53565b3480156103af57600080fd5b506102bb6103be36600461441b565b610af5565b3480156103cf57600080fd5b506102bb6103de36600461441b565b610b20565b3480156103ef57600080fd5b506102bb610bac565b34801561040457600080fd5b5061041861041336600461444b565b610c52565b6040516102629190614553565b34801561043157600080fd5b5061028b610440366004614204565b60009081526101c36020526040902054151590565b6102bb610463366004614566565b610d90565b34801561047457600080fd5b5061012d5460ff1661028b565b34801561048d57600080fd5b506102bb61049c3660046145e7565b61122e565b3480156104ad57600080fd5b506102bb6104bc366004614653565b6112b3565b3480156104cd57600080fd5b506102587f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c81565b34801561050157600080fd5b506102bb61135b565b34801561051657600080fd5b506102587fda62c861f1dc3cd7839650ce8ed1b5930f1bada8f6cc8046a5ad3075ec4396f181565b34801561054a57600080fd5b506102bb6105593660046146aa565b6113ff565b34801561056a57600080fd5b5061057e6105793660046146ec565b611507565b6040516001600160a01b039091168152602001610262565b3480156105a257600080fd5b5061028b6105b136600461441b565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156105e857600080fd5b50610258600081565b3480156105fd57600080fd5b506102bb61060c36600461471c565b611526565b34801561061d57600080fd5b506102bb61062c3660046146ec565b611531565b34801561063d57600080fd5b5061025861064c366004614204565b60009081526101c3602052604090205490565b34801561066b57600080fd5b5061025861067a366004614204565b6115ef565b34801561068b57600080fd5b506102587f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b3480156106bf57600080fd5b506102bb6106ce36600461441b565b611606565b3480156106df57600080fd5b506102587f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b34801561071357600080fd5b5061028b61072236600461474a565b6001600160a01b03918216600090815260ca6020908152604080832093909416825291909152205460ff1690565b34801561075c57600080fd5b506102bb61076b366004614778565b61162c565b34801561077c57600080fd5b506102bb61078b3660046147e1565b6116b3565b34801561079c57600080fd5b506102bb6107ab366004614150565b611738565b60006001600160a01b0383166108335760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b50600081815260c9602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610858826118af565b6108937f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c336105b1565b6109055760405162461bcd60e51b815260206004820152603160248201527f426f74746f526574726f6163746976655265776172643a206d7573742068617660448201527f65207572692073657474657220726f6c65000000000000000000000000000000606482015260840161082a565b61090e816118ba565b50565b606060cb805461092090614816565b80601f016020809104026020016040519081016040528092919081815260200182805461094c90614816565b80156109995780601f1061096e57610100808354040283529160200191610999565b820191906000526020600020905b81548152906001019060200180831161097c57829003601f168201915b50505050509050919050565b6109cf7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105b1565b610a415760405162461bcd60e51b815260206004820152603860248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000606482015260840161082a565b610a4d848484846118cd565b50505050565b6001600160a01b038516331480610a6f5750610a6f8533610722565b610ae15760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606482015260840161082a565b610aee8585858585611aa3565b5050505050565b600082815260656020526040902060010154610b118133611d25565b610b1b8383611da5565b505050565b6001600160a01b0381163314610b9e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161082a565b610ba88282611dc7565b5050565b610bd67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336105b1565b610c485760405162461bcd60e51b815260206004820152603b60248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f20756e70617573650000000000606482015260840161082a565b610c50611de9565b565b60608151835114610ccb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161082a565b6000835167ffffffffffffffff811115610ce757610ce7614085565b604051908082528060200260200182016040528015610d10578160200160208202803683370190505b50905060005b8451811015610d8857610d5b858281518110610d3457610d34614850565b6020026020010151858381518110610d4e57610d4e614850565b60200260200101516107b0565b828281518110610d6d57610d6d614850565b6020908102919091010152610d818161487c565b9050610d16565b509392505050565b6000610dac610da6610da186614895565b611e87565b83611f62565b6001600160a01b03811660009081527fa0f6cebec7fb889cc5ac88647269c4c0108fb926abd2111b551f234b348876df602052604090205490915060ff16610e5c5760405162461bcd60e51b815260206004820152602960248201527f426f74746f526574726f6163746976655265776172643a207369676e6174757260448201527f6520696e76616c69640000000000000000000000000000000000000000000000606482015260840161082a565b833560009081526102296020908152604090912054908501351015610ee95760405162461bcd60e51b815260206004820152602660248201527f426f74746f526574726f6163746976655265776172643a207065726d6974207260448201527f65766f6b65640000000000000000000000000000000000000000000000000000606482015260840161082a565b428460a0013511158015610f015750428460c0013510155b610f735760405162461bcd60e51b815260206004820152602660248201527f426f74746f526574726f6163746976655265776172643a207065726d6974206560448201527f7870697265640000000000000000000000000000000000000000000000000000606482015260840161082a565b6000610f86610100860160e08701614945565b6001600160a01b03161461102b57610fa5610100850160e08601614945565b6001600160a01b0316836001600160a01b03161461102b5760405162461bcd60e51b815260206004820152603760248201527f426f74746f526574726f6163746976655265776172643a20726563697069656e60448201527f7420646f6573206e6f74206d61746368207065726d6974000000000000000000606482015260840161082a565b6060840135156111ed5760006110476060860160408701614945565b6001600160a01b0316036111ad5783606001353410156110cf5760405162461bcd60e51b815260206004820152603d60248201527f426f74746f526574726f6163746976655265776172643a207472616e7361637460448201527f696f6e2076616c756520756e646572206d696e696d756d207072696365000000606482015260840161082a565b60006110e160a0860160808701614945565b6001600160a01b03163460405160006040518083038185875af1925050503d806000811461112b576040519150601f19603f3d011682016040523d82523d6000602084013e611130565b606091505b50509050806111a75760405162461bcd60e51b815260206004820152602860248201527f426f74746f526574726f6163746976655265776172643a207472616e7366657260448201527f206661696c65642e000000000000000000000000000000000000000000000000606482015260840161082a565b506111ed565b60006111bf6060860160408701614945565b90506111eb336111d560a0880160808901614945565b6001600160a01b03841691906060890135611f6e565b505b61120d818560000135600160405180602001604052806000815250612007565b610a4d81848660000135600160405180602001604052806000815250612119565b6001600160a01b03831633148061124a575061124a8333610722565b6112a85760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b606482015260840161082a565b610b1b8383836122ce565b6112dd7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105b1565b61134f5760405162461bcd60e51b815260206004820152603860248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000606482015260840161082a565b610a4d84848484612007565b6113857f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336105b1565b6113f75760405162461bcd60e51b815260206004820152603960248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f20706175736500000000000000606482015260840161082a565b610c50612518565b61140a6000336105b1565b61147c5760405162461bcd60e51b815260206004820152602c60248201527f426f74746f526574726f6163746976655265776172643a206d7573742068617660448201527f652061646d696e20726f6c650000000000000000000000000000000000000000606482015260840161082a565b600082116114f25760405162461bcd60e51b815260206004820152602660248201527f426f74746f526574726f6163746976655265776172643a20696e76616c69642060448201527f616d6f756e740000000000000000000000000000000000000000000000000000606482015260840161082a565b82610a4d6001600160a01b03821683856125a2565b600082815260976020526040812061151f90836125eb565b9392505050565b610ba83383836125f7565b61155b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105b1565b6115cd5760405162461bcd60e51b815260206004820152602d60248201527f426f74746f526574726f6163746976655265776172643a206d7573742068617660448201527f65206d696e74657220726f6c6500000000000000000000000000000000000000606482015260840161082a565b6115d8816001614962565b600092835261022960205260409092209190915550565b6000818152609760205260408120610858906126eb565b6000828152606560205260409020600101546116228133611d25565b610b1b8383611dc7565b6001600160a01b03851633148061164857506116488533610722565b6116a65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b606482015260840161082a565b610aee8585858585612119565b6001600160a01b0383163314806116cf57506116cf8333610722565b61172d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b606482015260840161082a565b610b1b8383836126f5565b600054610100900460ff166117535760005460ff1615611757565b303b155b6117c95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161082a565b600054610100900460ff161580156117eb576000805461ffff19166101011790555b6117f482612872565b6117fc61292e565b6118706040518060400160405280600881526020017f426f74746f4e46540000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f312e302e30000000000000000000000000000000000000000000000000000000815250612999565b61189a7f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c33611da5565b8015610ba8576000805461ff00191690555050565b600061085882612a0e565b8051610ba89060cb906020840190613f68565b6001600160a01b03841661192d5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161082a565b815183511461198f5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b606482015260840161082a565b3361199f81600087878787612a80565b60005b8451811015611a3b578381815181106119bd576119bd614850565b602002602001015160c960008784815181106119db576119db614850565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254611a239190614962565b90915550819050611a338161487c565b9150506119a2565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611a8c92919061497a565b60405180910390a4610aee81600087878787612b5e565b8151835114611b055760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b606482015260840161082a565b6001600160a01b038416611b695760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161082a565b33611b78818787878787612a80565b60005b8451811015611cb7576000858281518110611b9857611b98614850565b602002602001015190506000858381518110611bb657611bb6614850565b602090810291909101810151600084815260c9835260408082206001600160a01b038e168352909352919091205490915081811015611c5d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161082a565b600083815260c9602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611c9c908490614962565b9250508190555050505080611cb09061487c565b9050611b7b565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611d0792919061497a565b60405180910390a4611d1d818787878787612b5e565b505050505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610ba857611d63816001600160a01b03166014612d18565b611d6e836020612d18565b604051602001611d7f9291906149a8565b60408051601f198184030181529082905262461bcd60e51b825261082a916004016141f1565b611daf8282612f41565b6000828152609760205260409020610b1b9082612fe3565b611dd18282612ff8565b6000828152609760205260409020610b1b908261307b565b61012d5460ff16611e3c5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161082a565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60006108587fda62c861f1dc3cd7839650ce8ed1b5930f1bada8f6cc8046a5ad3075ec4396f1836000015184602001518560400151866060015187608001518860a001518960c001518a60e001518b610100015180519060200120604051602001611f479a99989796959493929190998a5260208a019890985260408901969096526001600160a01b039485166060890152608088019390935290831660a087015260c086015260e0850152166101008301526101208201526101400190565b60405160208183030381529060405280519060200120613090565b600061151f83836130f9565b6040516001600160a01b0380851660248301528316604482015260648101829052610a4d9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152613115565b6001600160a01b0384166120675760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161082a565b3361208781600087612078886131fa565b612081886131fa565b87612a80565b600084815260c9602090815260408083206001600160a01b0389168452909152812080548592906120b9908490614962565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610aee81600087878787613245565b6001600160a01b03841661217d5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161082a565b3361218d818787612078886131fa565b600084815260c9602090815260408083206001600160a01b038a168452909152902054838110156122265760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161082a565b600085815260c9602090815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290612265908490614962565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46122c5828888888888613245565b50505050505050565b6001600160a01b0383166123305760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161082a565b80518251146123925760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b606482015260840161082a565b60003390506123b581856000868660405180602001604052806000815250612a80565b60005b83518110156124b95760008482815181106123d5576123d5614850565b6020026020010151905060008483815181106123f3576123f3614850565b602090810291909101810151600084815260c9835260408082206001600160a01b038c1683529093529190912054909150818110156124805760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161082a565b600092835260c9602090815260408085206001600160a01b038b16865290915290922091039055806124b18161487c565b9150506123b8565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161250a92919061497a565b60405180910390a450505050565b61012d5460ff161561256c5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161082a565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611e6a3390565b6040516001600160a01b038316602482015260448101829052610b1b9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611fbb565b600061151f8383613356565b816001600160a01b0316836001600160a01b03160361267e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161082a565b6001600160a01b03838116600081815260ca6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000610858825490565b6001600160a01b0383166127575760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161082a565b3361278681856000612768876131fa565b612771876131fa565b60405180602001604052806000815250612a80565b600083815260c9602090815260408083206001600160a01b0388168452909152902054828110156128055760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161082a565b600084815260c9602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b600054610100900460ff1661288d5760005460ff1615612891565b303b155b6129035760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161082a565b600054610100900460ff16158015612925576000805461ffff19166101011790555b61189a82613380565b600054610100900460ff16610c505760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b600054610100900460ff16612a045760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b610ba88282613435565b60006001600160e01b031982167fd9b67a26000000000000000000000000000000000000000000000000000000001480612a7157506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b806108585750610858826134bc565b612a8e8686868686866134fa565b6001600160a01b038516611d1d5760005b83518110156122c5576001612ada858381518110612abf57612abf614850565b602002602001015160009081526101c3602052604090205490565b1115612b4e5760405162461bcd60e51b815260206004820152603260248201527f426f74746f526574726f6163746976655265776172643a20657863656564696e60448201527f6720746f74616c20737570706c79206361700000000000000000000000000000606482015260840161082a565b612b578161487c565b9050612a9f565b6001600160a01b0384163b15611d1d5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612ba29089908990889088908890600401614a29565b6020604051808303816000875af1925050508015612bdd575060408051601f3d908101601f19168201909252612bda91810190614a87565b60015b612c9257612be9614aa4565b806308c379a003612c225750612bfd614ac0565b80612c085750612c24565b8060405162461bcd60e51b815260040161082a91906141f1565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161082a565b6001600160e01b0319811663bc197c8160e01b146122c55760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161082a565b60606000612d27836002614b4a565b612d32906002614962565b67ffffffffffffffff811115612d4a57612d4a614085565b6040519080825280601f01601f191660200182016040528015612d74576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612dab57612dab614850565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612e0e57612e0e614850565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612e4a846002614b4a565b612e55906001614962565b90505b6001811115612ef2577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612e9657612e96614850565b1a60f81b828281518110612eac57612eac614850565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612eeb81614b69565b9050612e58565b50831561151f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161082a565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610ba85760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612f9f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061151f836001600160a01b038416613616565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610ba85760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061151f836001600160a01b038416613665565b600061085861309d613758565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061310885856137da565b91509150610d8881613848565b600061316a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166139fe9092919063ffffffff16565b805190915015610b1b57808060200190518101906131889190614b80565b610b1b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161082a565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061323457613234614850565b602090810291909101015292915050565b6001600160a01b0384163b15611d1d5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906132899089908990889088908890600401614b9d565b6020604051808303816000875af19250505080156132c4575060408051601f3d908101601f191682019092526132c191810190614a87565b60015b6132d057612be9614aa4565b6001600160e01b0319811663f23a6e6160e01b146122c55760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161082a565b600082600001828154811061336d5761336d614850565b9060005260206000200154905092915050565b600054610100900460ff166133eb5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b6133f361292e565b6133fb61292e565b61340361292e565b61340b61292e565b61341481613a15565b61341c61292e565b613424613a80565b61342c61292e565b61090e81613af8565b600054610100900460ff166134a05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b8151602092830120815191909201206101f5919091556101f655565b60006001600160e01b031982167f5a05180f000000000000000000000000000000000000000000000000000000001480610858575061085882613bc2565b613508868686868686613c29565b6001600160a01b0385166135905760005b835181101561358e5782818151811061353457613534614850565b60200260200101516101c3600086848151811061355357613553614850565b6020026020010151815260200190815260200160002060008282546135789190614962565b9091555061358790508161487c565b9050613519565b505b6001600160a01b038416611d1d5760005b83518110156122c5578281815181106135bc576135bc614850565b60200260200101516101c360008684815181106135db576135db614850565b6020026020010151815260200190815260200160002060008282546136009190614bd5565b9091555061360f90508161487c565b90506135a1565b600081815260018301602052604081205461365d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610858565b506000610858565b6000818152600183016020526040812054801561374e576000613689600183614bd5565b855490915060009061369d90600190614bd5565b90508181146137025760008660000182815481106136bd576136bd614850565b90600052602060002001549050808760000184815481106136e0576136e0614850565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061371357613713614bec565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610858565b6000915050610858565b60006137d57f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6137886101f55490565b6101f6546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b905090565b60008082516041036138105760208301516040840151606085015160001a61380487828585613c37565b94509450505050613841565b8251604003613839576020830151604084015161382e868383613d24565b935093505050613841565b506000905060025b9250929050565b600081600481111561385c5761385c614c02565b036138645750565b600181600481111561387857613878614c02565b036138c55760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161082a565b60028160048111156138d9576138d9614c02565b036139265760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161082a565b600381600481111561393a5761393a614c02565b036139925760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161082a565b60048160048111156139a6576139a6614c02565b0361090e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161082a565b6060613a0d8484600085613d6c565b949350505050565b600054610100900460ff166109055760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b600054610100900460ff16613aeb5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b61012d805460ff19169055565b600054610100900460ff16613b635760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b613b6e600033613eab565b613b987f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633613eab565b61090e7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33613eab565b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061085857507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610858565b611d1d868686868686613eb5565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613c6e5750600090506003613d1b565b8460ff16601b14158015613c8657508460ff16601c14155b15613c975750600090506004613d1b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613ceb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613d1457600060019250925050613d1b565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b01613d5e87828885613c37565b935093505050935093915050565b606082471015613de45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161082a565b843b613e325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161082a565b600080866001600160a01b03168587604051613e4e9190614c18565b60006040518083038185875af1925050503d8060008114613e8b576040519150601f19603f3d011682016040523d82523d6000602084013e613e90565b606091505b5091509150613ea0828286613f2f565b979650505050505050565b610ba88282611da5565b61012d5460ff1615611d1d5760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201527f7768696c65207061757365640000000000000000000000000000000000000000606482015260840161082a565b60608315613f3e57508161151f565b825115613f4e5782518084602001fd5b8160405162461bcd60e51b815260040161082a91906141f1565b828054613f7490614816565b90600052602060002090601f016020900481019282613f965760008555613fdc565b82601f10613faf57805160ff1916838001178555613fdc565b82800160010185558215613fdc579182015b82811115613fdc578251825591602001919060010190613fc1565b50613fe8929150613fec565b5090565b5b80821115613fe85760008155600101613fed565b6001600160a01b038116811461090e57600080fd5b803561402181614001565b919050565b6000806040838503121561403957600080fd5b823561404481614001565b946020939093013593505050565b6001600160e01b03198116811461090e57600080fd5b60006020828403121561407a57600080fd5b813561151f81614052565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff811182821017156140c1576140c1614085565b6040525050565b604051610120810167ffffffffffffffff811182821017156140ec576140ec614085565b60405290565b600067ffffffffffffffff83111561410c5761410c614085565b604051614123601f8501601f19166020018261409b565b80915083815284848401111561413857600080fd5b83836020830137600060208583010152509392505050565b60006020828403121561416257600080fd5b813567ffffffffffffffff81111561417957600080fd5b8201601f8101841361418a57600080fd5b613a0d848235602084016140f2565b60005b838110156141b457818101518382015260200161419c565b83811115610a4d5750506000910152565b600081518084526141dd816020860160208601614199565b601f01601f19169290920160200192915050565b60208152600061151f60208301846141c5565b60006020828403121561421657600080fd5b5035919050565b600067ffffffffffffffff82111561423757614237614085565b5060051b60200190565b600082601f83011261425257600080fd5b8135602061425f8261421d565b60405161426c828261409b565b83815260059390931b850182019282810191508684111561428c57600080fd5b8286015b848110156142a75780358352918301918301614290565b509695505050505050565b600082601f8301126142c357600080fd5b61151f838335602085016140f2565b600080600080608085870312156142e857600080fd5b84356142f381614001565b9350602085013567ffffffffffffffff8082111561431057600080fd5b61431c88838901614241565b9450604087013591508082111561433257600080fd5b61433e88838901614241565b9350606087013591508082111561435457600080fd5b50614361878288016142b2565b91505092959194509250565b600080600080600060a0868803121561438557600080fd5b853561439081614001565b945060208601356143a081614001565b9350604086013567ffffffffffffffff808211156143bd57600080fd5b6143c989838a01614241565b945060608801359150808211156143df57600080fd5b6143eb89838a01614241565b9350608088013591508082111561440157600080fd5b5061440e888289016142b2565b9150509295509295909350565b6000806040838503121561442e57600080fd5b82359150602083013561444081614001565b809150509250929050565b6000806040838503121561445e57600080fd5b823567ffffffffffffffff8082111561447657600080fd5b818501915085601f83011261448a57600080fd5b813560206144978261421d565b6040516144a4828261409b565b83815260059390931b85018201928281019150898411156144c457600080fd5b948201945b838610156144eb5785356144dc81614001565b825294820194908201906144c9565b9650508601359250508082111561450157600080fd5b5061450e85828601614241565b9150509250929050565b600081518084526020808501945080840160005b838110156145485781518752958201959082019060010161452c565b509495945050505050565b60208152600061151f6020830184614518565b60008060006060848603121561457b57600080fd5b833567ffffffffffffffff8082111561459357600080fd5b9085019061012082880312156145a857600080fd5b9093506020850135906145ba82614001565b909250604085013590808211156145d057600080fd5b506145dd868287016142b2565b9150509250925092565b6000806000606084860312156145fc57600080fd5b833561460781614001565b9250602084013567ffffffffffffffff8082111561462457600080fd5b61463087838801614241565b9350604086013591508082111561464657600080fd5b506145dd86828701614241565b6000806000806080858703121561466957600080fd5b843561467481614001565b93506020850135925060408501359150606085013567ffffffffffffffff81111561469e57600080fd5b614361878288016142b2565b6000806000606084860312156146bf57600080fd5b83356146ca81614001565b92506020840135915060408401356146e181614001565b809150509250925092565b600080604083850312156146ff57600080fd5b50508035926020909101359150565b801515811461090e57600080fd5b6000806040838503121561472f57600080fd5b823561473a81614001565b915060208301356144408161470e565b6000806040838503121561475d57600080fd5b823561476881614001565b9150602083013561444081614001565b600080600080600060a0868803121561479057600080fd5b853561479b81614001565b945060208601356147ab81614001565b93506040860135925060608601359150608086013567ffffffffffffffff8111156147d557600080fd5b61440e888289016142b2565b6000806000606084860312156147f657600080fd5b833561480181614001565b95602085013595506040909401359392505050565b600181811c9082168061482a57607f821691505b60208210810361484a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161488e5761488e614866565b5060010190565b600061012082360312156148a857600080fd5b6148b06140c8565b82358152602083013560208201526148ca60408401614016565b6040820152606083013560608201526148e560808401614016565b608082015260a083013560a082015260c083013560c082015261490a60e08401614016565b60e08201526101008084013567ffffffffffffffff81111561492b57600080fd5b614937368287016142b2565b918301919091525092915050565b60006020828403121561495757600080fd5b813561151f81614001565b6000821982111561497557614975614866565b500190565b60408152600061498d6040830185614518565b828103602084015261499f8185614518565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516149e0816017850160208801614199565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614a1d816028840160208801614199565b01602801949350505050565b60006001600160a01b03808816835280871660208401525060a06040830152614a5560a0830186614518565b8281036060840152614a678186614518565b90508281036080840152614a7b81856141c5565b98975050505050505050565b600060208284031215614a9957600080fd5b815161151f81614052565b600060033d1115614abd5760046000803e5060005160e01c5b90565b600060443d1015614ace5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715614afe57505050505090565b8285019150815181811115614b165750505050505090565b843d8701016020828501011115614b305750505050505090565b614b3f6020828601018761409b565b509095945050505050565b6000816000190483118215151615614b6457614b64614866565b500290565b600081614b7857614b78614866565b506000190190565b600060208284031215614b9257600080fd5b815161151f8161470e565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152613ea060a08301846141c5565b600082821015614be757614be7614866565b500390565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60008251614c2a818460208701614199565b919091019291505056fea2646970667358221220341d20e495943c16219c98d2eaf7023fdf9b381051e3d6fac7c29f6233c5f4a164736f6c634300080d0033
Deployed Bytecode
0x6080604052600436106102335760003560e01c80637f34571011610138578063bd85b039116100b0578063e63ab1e91161007f578063f242432a11610064578063f242432a14610750578063f5298aca14610770578063f62d18881461079057600080fd5b8063e63ab1e9146106d3578063e985e9c51461070757600080fd5b8063bd85b03914610631578063ca15c8731461065f578063d53913931461067f578063d547741f146106b357600080fd5b80639010d07c11610107578063a217fddf116100ec578063a217fddf146105dc578063a22cb465146105f1578063bb5a9b581461061157600080fd5b80639010d07c1461055e57806391d148541461059657600080fd5b80637f345710146104c15780638456cb59146104f55780638d108ef11461050a5780638e5116bc1461053e57600080fd5b80632f2ff15d116101cb5780634f558e791161019a5780635c975abb1161017f5780635c975abb146104685780636b20c45414610481578063731133e9146104a157600080fd5b80634f558e79146104255780635b844d9d1461045557600080fd5b80632f2ff15d146103a357806336568abe146103c35780633f4ba83a146103e35780634e1273f4146103f857600080fd5b80630e89341c116102075780630e89341c146103135780631f7fdffa14610333578063248a9ca3146103535780632eb2c2d61461038357600080fd5b8062fdd58e1461023857806301ffc9a71461026b57806302fe53051461029b57806306fdde03146102bd575b600080fd5b34801561024457600080fd5b50610258610253366004614026565b6107b0565b6040519081526020015b60405180910390f35b34801561027757600080fd5b5061028b610286366004614068565b61085e565b6040519015158152602001610262565b3480156102a757600080fd5b506102bb6102b6366004614150565b610869565b005b3480156102c957600080fd5b506103066040518060400160405280601781526020017f43656369206e276573742070617320756e20426f74746f00000000000000000081525081565b60405161026291906141f1565b34801561031f57600080fd5b5061030661032e366004614204565b610911565b34801561033f57600080fd5b506102bb61034e3660046142d2565b6109a5565b34801561035f57600080fd5b5061025861036e366004614204565b60009081526065602052604090206001015490565b34801561038f57600080fd5b506102bb61039e36600461436d565b610a53565b3480156103af57600080fd5b506102bb6103be36600461441b565b610af5565b3480156103cf57600080fd5b506102bb6103de36600461441b565b610b20565b3480156103ef57600080fd5b506102bb610bac565b34801561040457600080fd5b5061041861041336600461444b565b610c52565b6040516102629190614553565b34801561043157600080fd5b5061028b610440366004614204565b60009081526101c36020526040902054151590565b6102bb610463366004614566565b610d90565b34801561047457600080fd5b5061012d5460ff1661028b565b34801561048d57600080fd5b506102bb61049c3660046145e7565b61122e565b3480156104ad57600080fd5b506102bb6104bc366004614653565b6112b3565b3480156104cd57600080fd5b506102587f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c81565b34801561050157600080fd5b506102bb61135b565b34801561051657600080fd5b506102587fda62c861f1dc3cd7839650ce8ed1b5930f1bada8f6cc8046a5ad3075ec4396f181565b34801561054a57600080fd5b506102bb6105593660046146aa565b6113ff565b34801561056a57600080fd5b5061057e6105793660046146ec565b611507565b6040516001600160a01b039091168152602001610262565b3480156105a257600080fd5b5061028b6105b136600461441b565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156105e857600080fd5b50610258600081565b3480156105fd57600080fd5b506102bb61060c36600461471c565b611526565b34801561061d57600080fd5b506102bb61062c3660046146ec565b611531565b34801561063d57600080fd5b5061025861064c366004614204565b60009081526101c3602052604090205490565b34801561066b57600080fd5b5061025861067a366004614204565b6115ef565b34801561068b57600080fd5b506102587f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b3480156106bf57600080fd5b506102bb6106ce36600461441b565b611606565b3480156106df57600080fd5b506102587f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b34801561071357600080fd5b5061028b61072236600461474a565b6001600160a01b03918216600090815260ca6020908152604080832093909416825291909152205460ff1690565b34801561075c57600080fd5b506102bb61076b366004614778565b61162c565b34801561077c57600080fd5b506102bb61078b3660046147e1565b6116b3565b34801561079c57600080fd5b506102bb6107ab366004614150565b611738565b60006001600160a01b0383166108335760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b50600081815260c9602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610858826118af565b6108937f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c336105b1565b6109055760405162461bcd60e51b815260206004820152603160248201527f426f74746f526574726f6163746976655265776172643a206d7573742068617660448201527f65207572692073657474657220726f6c65000000000000000000000000000000606482015260840161082a565b61090e816118ba565b50565b606060cb805461092090614816565b80601f016020809104026020016040519081016040528092919081815260200182805461094c90614816565b80156109995780601f1061096e57610100808354040283529160200191610999565b820191906000526020600020905b81548152906001019060200180831161097c57829003601f168201915b50505050509050919050565b6109cf7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105b1565b610a415760405162461bcd60e51b815260206004820152603860248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000606482015260840161082a565b610a4d848484846118cd565b50505050565b6001600160a01b038516331480610a6f5750610a6f8533610722565b610ae15760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606482015260840161082a565b610aee8585858585611aa3565b5050505050565b600082815260656020526040902060010154610b118133611d25565b610b1b8383611da5565b505050565b6001600160a01b0381163314610b9e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161082a565b610ba88282611dc7565b5050565b610bd67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336105b1565b610c485760405162461bcd60e51b815260206004820152603b60248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f20756e70617573650000000000606482015260840161082a565b610c50611de9565b565b60608151835114610ccb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161082a565b6000835167ffffffffffffffff811115610ce757610ce7614085565b604051908082528060200260200182016040528015610d10578160200160208202803683370190505b50905060005b8451811015610d8857610d5b858281518110610d3457610d34614850565b6020026020010151858381518110610d4e57610d4e614850565b60200260200101516107b0565b828281518110610d6d57610d6d614850565b6020908102919091010152610d818161487c565b9050610d16565b509392505050565b6000610dac610da6610da186614895565b611e87565b83611f62565b6001600160a01b03811660009081527fa0f6cebec7fb889cc5ac88647269c4c0108fb926abd2111b551f234b348876df602052604090205490915060ff16610e5c5760405162461bcd60e51b815260206004820152602960248201527f426f74746f526574726f6163746976655265776172643a207369676e6174757260448201527f6520696e76616c69640000000000000000000000000000000000000000000000606482015260840161082a565b833560009081526102296020908152604090912054908501351015610ee95760405162461bcd60e51b815260206004820152602660248201527f426f74746f526574726f6163746976655265776172643a207065726d6974207260448201527f65766f6b65640000000000000000000000000000000000000000000000000000606482015260840161082a565b428460a0013511158015610f015750428460c0013510155b610f735760405162461bcd60e51b815260206004820152602660248201527f426f74746f526574726f6163746976655265776172643a207065726d6974206560448201527f7870697265640000000000000000000000000000000000000000000000000000606482015260840161082a565b6000610f86610100860160e08701614945565b6001600160a01b03161461102b57610fa5610100850160e08601614945565b6001600160a01b0316836001600160a01b03161461102b5760405162461bcd60e51b815260206004820152603760248201527f426f74746f526574726f6163746976655265776172643a20726563697069656e60448201527f7420646f6573206e6f74206d61746368207065726d6974000000000000000000606482015260840161082a565b6060840135156111ed5760006110476060860160408701614945565b6001600160a01b0316036111ad5783606001353410156110cf5760405162461bcd60e51b815260206004820152603d60248201527f426f74746f526574726f6163746976655265776172643a207472616e7361637460448201527f696f6e2076616c756520756e646572206d696e696d756d207072696365000000606482015260840161082a565b60006110e160a0860160808701614945565b6001600160a01b03163460405160006040518083038185875af1925050503d806000811461112b576040519150601f19603f3d011682016040523d82523d6000602084013e611130565b606091505b50509050806111a75760405162461bcd60e51b815260206004820152602860248201527f426f74746f526574726f6163746976655265776172643a207472616e7366657260448201527f206661696c65642e000000000000000000000000000000000000000000000000606482015260840161082a565b506111ed565b60006111bf6060860160408701614945565b90506111eb336111d560a0880160808901614945565b6001600160a01b03841691906060890135611f6e565b505b61120d818560000135600160405180602001604052806000815250612007565b610a4d81848660000135600160405180602001604052806000815250612119565b6001600160a01b03831633148061124a575061124a8333610722565b6112a85760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b606482015260840161082a565b610b1b8383836122ce565b6112dd7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105b1565b61134f5760405162461bcd60e51b815260206004820152603860248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000606482015260840161082a565b610a4d84848484612007565b6113857f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336105b1565b6113f75760405162461bcd60e51b815260206004820152603960248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f20706175736500000000000000606482015260840161082a565b610c50612518565b61140a6000336105b1565b61147c5760405162461bcd60e51b815260206004820152602c60248201527f426f74746f526574726f6163746976655265776172643a206d7573742068617660448201527f652061646d696e20726f6c650000000000000000000000000000000000000000606482015260840161082a565b600082116114f25760405162461bcd60e51b815260206004820152602660248201527f426f74746f526574726f6163746976655265776172643a20696e76616c69642060448201527f616d6f756e740000000000000000000000000000000000000000000000000000606482015260840161082a565b82610a4d6001600160a01b03821683856125a2565b600082815260976020526040812061151f90836125eb565b9392505050565b610ba83383836125f7565b61155b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336105b1565b6115cd5760405162461bcd60e51b815260206004820152602d60248201527f426f74746f526574726f6163746976655265776172643a206d7573742068617660448201527f65206d696e74657220726f6c6500000000000000000000000000000000000000606482015260840161082a565b6115d8816001614962565b600092835261022960205260409092209190915550565b6000818152609760205260408120610858906126eb565b6000828152606560205260409020600101546116228133611d25565b610b1b8383611dc7565b6001600160a01b03851633148061164857506116488533610722565b6116a65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b606482015260840161082a565b610aee8585858585612119565b6001600160a01b0383163314806116cf57506116cf8333610722565b61172d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b606482015260840161082a565b610b1b8383836126f5565b600054610100900460ff166117535760005460ff1615611757565b303b155b6117c95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161082a565b600054610100900460ff161580156117eb576000805461ffff19166101011790555b6117f482612872565b6117fc61292e565b6118706040518060400160405280600881526020017f426f74746f4e46540000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f312e302e30000000000000000000000000000000000000000000000000000000815250612999565b61189a7f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c33611da5565b8015610ba8576000805461ff00191690555050565b600061085882612a0e565b8051610ba89060cb906020840190613f68565b6001600160a01b03841661192d5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161082a565b815183511461198f5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b606482015260840161082a565b3361199f81600087878787612a80565b60005b8451811015611a3b578381815181106119bd576119bd614850565b602002602001015160c960008784815181106119db576119db614850565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254611a239190614962565b90915550819050611a338161487c565b9150506119a2565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611a8c92919061497a565b60405180910390a4610aee81600087878787612b5e565b8151835114611b055760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b606482015260840161082a565b6001600160a01b038416611b695760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161082a565b33611b78818787878787612a80565b60005b8451811015611cb7576000858281518110611b9857611b98614850565b602002602001015190506000858381518110611bb657611bb6614850565b602090810291909101810151600084815260c9835260408082206001600160a01b038e168352909352919091205490915081811015611c5d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161082a565b600083815260c9602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611c9c908490614962565b9250508190555050505080611cb09061487c565b9050611b7b565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611d0792919061497a565b60405180910390a4611d1d818787878787612b5e565b505050505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610ba857611d63816001600160a01b03166014612d18565b611d6e836020612d18565b604051602001611d7f9291906149a8565b60408051601f198184030181529082905262461bcd60e51b825261082a916004016141f1565b611daf8282612f41565b6000828152609760205260409020610b1b9082612fe3565b611dd18282612ff8565b6000828152609760205260409020610b1b908261307b565b61012d5460ff16611e3c5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161082a565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60006108587fda62c861f1dc3cd7839650ce8ed1b5930f1bada8f6cc8046a5ad3075ec4396f1836000015184602001518560400151866060015187608001518860a001518960c001518a60e001518b610100015180519060200120604051602001611f479a99989796959493929190998a5260208a019890985260408901969096526001600160a01b039485166060890152608088019390935290831660a087015260c086015260e0850152166101008301526101208201526101400190565b60405160208183030381529060405280519060200120613090565b600061151f83836130f9565b6040516001600160a01b0380851660248301528316604482015260648101829052610a4d9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152613115565b6001600160a01b0384166120675760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161082a565b3361208781600087612078886131fa565b612081886131fa565b87612a80565b600084815260c9602090815260408083206001600160a01b0389168452909152812080548592906120b9908490614962565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610aee81600087878787613245565b6001600160a01b03841661217d5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161082a565b3361218d818787612078886131fa565b600084815260c9602090815260408083206001600160a01b038a168452909152902054838110156122265760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161082a565b600085815260c9602090815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290612265908490614962565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46122c5828888888888613245565b50505050505050565b6001600160a01b0383166123305760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161082a565b80518251146123925760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b606482015260840161082a565b60003390506123b581856000868660405180602001604052806000815250612a80565b60005b83518110156124b95760008482815181106123d5576123d5614850565b6020026020010151905060008483815181106123f3576123f3614850565b602090810291909101810151600084815260c9835260408082206001600160a01b038c1683529093529190912054909150818110156124805760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161082a565b600092835260c9602090815260408085206001600160a01b038b16865290915290922091039055806124b18161487c565b9150506123b8565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161250a92919061497a565b60405180910390a450505050565b61012d5460ff161561256c5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161082a565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611e6a3390565b6040516001600160a01b038316602482015260448101829052610b1b9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611fbb565b600061151f8383613356565b816001600160a01b0316836001600160a01b03160361267e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161082a565b6001600160a01b03838116600081815260ca6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000610858825490565b6001600160a01b0383166127575760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161082a565b3361278681856000612768876131fa565b612771876131fa565b60405180602001604052806000815250612a80565b600083815260c9602090815260408083206001600160a01b0388168452909152902054828110156128055760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161082a565b600084815260c9602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b600054610100900460ff1661288d5760005460ff1615612891565b303b155b6129035760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161082a565b600054610100900460ff16158015612925576000805461ffff19166101011790555b61189a82613380565b600054610100900460ff16610c505760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b600054610100900460ff16612a045760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b610ba88282613435565b60006001600160e01b031982167fd9b67a26000000000000000000000000000000000000000000000000000000001480612a7157506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b806108585750610858826134bc565b612a8e8686868686866134fa565b6001600160a01b038516611d1d5760005b83518110156122c5576001612ada858381518110612abf57612abf614850565b602002602001015160009081526101c3602052604090205490565b1115612b4e5760405162461bcd60e51b815260206004820152603260248201527f426f74746f526574726f6163746976655265776172643a20657863656564696e60448201527f6720746f74616c20737570706c79206361700000000000000000000000000000606482015260840161082a565b612b578161487c565b9050612a9f565b6001600160a01b0384163b15611d1d5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612ba29089908990889088908890600401614a29565b6020604051808303816000875af1925050508015612bdd575060408051601f3d908101601f19168201909252612bda91810190614a87565b60015b612c9257612be9614aa4565b806308c379a003612c225750612bfd614ac0565b80612c085750612c24565b8060405162461bcd60e51b815260040161082a91906141f1565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161082a565b6001600160e01b0319811663bc197c8160e01b146122c55760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161082a565b60606000612d27836002614b4a565b612d32906002614962565b67ffffffffffffffff811115612d4a57612d4a614085565b6040519080825280601f01601f191660200182016040528015612d74576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612dab57612dab614850565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612e0e57612e0e614850565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612e4a846002614b4a565b612e55906001614962565b90505b6001811115612ef2577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612e9657612e96614850565b1a60f81b828281518110612eac57612eac614850565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612eeb81614b69565b9050612e58565b50831561151f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161082a565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610ba85760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612f9f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061151f836001600160a01b038416613616565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610ba85760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061151f836001600160a01b038416613665565b600061085861309d613758565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061310885856137da565b91509150610d8881613848565b600061316a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166139fe9092919063ffffffff16565b805190915015610b1b57808060200190518101906131889190614b80565b610b1b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161082a565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061323457613234614850565b602090810291909101015292915050565b6001600160a01b0384163b15611d1d5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906132899089908990889088908890600401614b9d565b6020604051808303816000875af19250505080156132c4575060408051601f3d908101601f191682019092526132c191810190614a87565b60015b6132d057612be9614aa4565b6001600160e01b0319811663f23a6e6160e01b146122c55760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161082a565b600082600001828154811061336d5761336d614850565b9060005260206000200154905092915050565b600054610100900460ff166133eb5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b6133f361292e565b6133fb61292e565b61340361292e565b61340b61292e565b61341481613a15565b61341c61292e565b613424613a80565b61342c61292e565b61090e81613af8565b600054610100900460ff166134a05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b8151602092830120815191909201206101f5919091556101f655565b60006001600160e01b031982167f5a05180f000000000000000000000000000000000000000000000000000000001480610858575061085882613bc2565b613508868686868686613c29565b6001600160a01b0385166135905760005b835181101561358e5782818151811061353457613534614850565b60200260200101516101c3600086848151811061355357613553614850565b6020026020010151815260200190815260200160002060008282546135789190614962565b9091555061358790508161487c565b9050613519565b505b6001600160a01b038416611d1d5760005b83518110156122c5578281815181106135bc576135bc614850565b60200260200101516101c360008684815181106135db576135db614850565b6020026020010151815260200190815260200160002060008282546136009190614bd5565b9091555061360f90508161487c565b90506135a1565b600081815260018301602052604081205461365d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610858565b506000610858565b6000818152600183016020526040812054801561374e576000613689600183614bd5565b855490915060009061369d90600190614bd5565b90508181146137025760008660000182815481106136bd576136bd614850565b90600052602060002001549050808760000184815481106136e0576136e0614850565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061371357613713614bec565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610858565b6000915050610858565b60006137d57f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6137886101f55490565b6101f6546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b905090565b60008082516041036138105760208301516040840151606085015160001a61380487828585613c37565b94509450505050613841565b8251604003613839576020830151604084015161382e868383613d24565b935093505050613841565b506000905060025b9250929050565b600081600481111561385c5761385c614c02565b036138645750565b600181600481111561387857613878614c02565b036138c55760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161082a565b60028160048111156138d9576138d9614c02565b036139265760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161082a565b600381600481111561393a5761393a614c02565b036139925760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161082a565b60048160048111156139a6576139a6614c02565b0361090e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161082a565b6060613a0d8484600085613d6c565b949350505050565b600054610100900460ff166109055760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b600054610100900460ff16613aeb5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b61012d805460ff19169055565b600054610100900460ff16613b635760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161082a565b613b6e600033613eab565b613b987f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633613eab565b61090e7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33613eab565b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061085857507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610858565b611d1d868686868686613eb5565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613c6e5750600090506003613d1b565b8460ff16601b14158015613c8657508460ff16601c14155b15613c975750600090506004613d1b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613ceb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613d1457600060019250925050613d1b565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b01613d5e87828885613c37565b935093505050935093915050565b606082471015613de45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161082a565b843b613e325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161082a565b600080866001600160a01b03168587604051613e4e9190614c18565b60006040518083038185875af1925050503d8060008114613e8b576040519150601f19603f3d011682016040523d82523d6000602084013e613e90565b606091505b5091509150613ea0828286613f2f565b979650505050505050565b610ba88282611da5565b61012d5460ff1615611d1d5760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201527f7768696c65207061757365640000000000000000000000000000000000000000606482015260840161082a565b60608315613f3e57508161151f565b825115613f4e5782518084602001fd5b8160405162461bcd60e51b815260040161082a91906141f1565b828054613f7490614816565b90600052602060002090601f016020900481019282613f965760008555613fdc565b82601f10613faf57805160ff1916838001178555613fdc565b82800160010185558215613fdc579182015b82811115613fdc578251825591602001919060010190613fc1565b50613fe8929150613fec565b5090565b5b80821115613fe85760008155600101613fed565b6001600160a01b038116811461090e57600080fd5b803561402181614001565b919050565b6000806040838503121561403957600080fd5b823561404481614001565b946020939093013593505050565b6001600160e01b03198116811461090e57600080fd5b60006020828403121561407a57600080fd5b813561151f81614052565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff811182821017156140c1576140c1614085565b6040525050565b604051610120810167ffffffffffffffff811182821017156140ec576140ec614085565b60405290565b600067ffffffffffffffff83111561410c5761410c614085565b604051614123601f8501601f19166020018261409b565b80915083815284848401111561413857600080fd5b83836020830137600060208583010152509392505050565b60006020828403121561416257600080fd5b813567ffffffffffffffff81111561417957600080fd5b8201601f8101841361418a57600080fd5b613a0d848235602084016140f2565b60005b838110156141b457818101518382015260200161419c565b83811115610a4d5750506000910152565b600081518084526141dd816020860160208601614199565b601f01601f19169290920160200192915050565b60208152600061151f60208301846141c5565b60006020828403121561421657600080fd5b5035919050565b600067ffffffffffffffff82111561423757614237614085565b5060051b60200190565b600082601f83011261425257600080fd5b8135602061425f8261421d565b60405161426c828261409b565b83815260059390931b850182019282810191508684111561428c57600080fd5b8286015b848110156142a75780358352918301918301614290565b509695505050505050565b600082601f8301126142c357600080fd5b61151f838335602085016140f2565b600080600080608085870312156142e857600080fd5b84356142f381614001565b9350602085013567ffffffffffffffff8082111561431057600080fd5b61431c88838901614241565b9450604087013591508082111561433257600080fd5b61433e88838901614241565b9350606087013591508082111561435457600080fd5b50614361878288016142b2565b91505092959194509250565b600080600080600060a0868803121561438557600080fd5b853561439081614001565b945060208601356143a081614001565b9350604086013567ffffffffffffffff808211156143bd57600080fd5b6143c989838a01614241565b945060608801359150808211156143df57600080fd5b6143eb89838a01614241565b9350608088013591508082111561440157600080fd5b5061440e888289016142b2565b9150509295509295909350565b6000806040838503121561442e57600080fd5b82359150602083013561444081614001565b809150509250929050565b6000806040838503121561445e57600080fd5b823567ffffffffffffffff8082111561447657600080fd5b818501915085601f83011261448a57600080fd5b813560206144978261421d565b6040516144a4828261409b565b83815260059390931b85018201928281019150898411156144c457600080fd5b948201945b838610156144eb5785356144dc81614001565b825294820194908201906144c9565b9650508601359250508082111561450157600080fd5b5061450e85828601614241565b9150509250929050565b600081518084526020808501945080840160005b838110156145485781518752958201959082019060010161452c565b509495945050505050565b60208152600061151f6020830184614518565b60008060006060848603121561457b57600080fd5b833567ffffffffffffffff8082111561459357600080fd5b9085019061012082880312156145a857600080fd5b9093506020850135906145ba82614001565b909250604085013590808211156145d057600080fd5b506145dd868287016142b2565b9150509250925092565b6000806000606084860312156145fc57600080fd5b833561460781614001565b9250602084013567ffffffffffffffff8082111561462457600080fd5b61463087838801614241565b9350604086013591508082111561464657600080fd5b506145dd86828701614241565b6000806000806080858703121561466957600080fd5b843561467481614001565b93506020850135925060408501359150606085013567ffffffffffffffff81111561469e57600080fd5b614361878288016142b2565b6000806000606084860312156146bf57600080fd5b83356146ca81614001565b92506020840135915060408401356146e181614001565b809150509250925092565b600080604083850312156146ff57600080fd5b50508035926020909101359150565b801515811461090e57600080fd5b6000806040838503121561472f57600080fd5b823561473a81614001565b915060208301356144408161470e565b6000806040838503121561475d57600080fd5b823561476881614001565b9150602083013561444081614001565b600080600080600060a0868803121561479057600080fd5b853561479b81614001565b945060208601356147ab81614001565b93506040860135925060608601359150608086013567ffffffffffffffff8111156147d557600080fd5b61440e888289016142b2565b6000806000606084860312156147f657600080fd5b833561480181614001565b95602085013595506040909401359392505050565b600181811c9082168061482a57607f821691505b60208210810361484a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161488e5761488e614866565b5060010190565b600061012082360312156148a857600080fd5b6148b06140c8565b82358152602083013560208201526148ca60408401614016565b6040820152606083013560608201526148e560808401614016565b608082015260a083013560a082015260c083013560c082015261490a60e08401614016565b60e08201526101008084013567ffffffffffffffff81111561492b57600080fd5b614937368287016142b2565b918301919091525092915050565b60006020828403121561495757600080fd5b813561151f81614001565b6000821982111561497557614975614866565b500190565b60408152600061498d6040830185614518565b828103602084015261499f8185614518565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516149e0816017850160208801614199565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614a1d816028840160208801614199565b01602801949350505050565b60006001600160a01b03808816835280871660208401525060a06040830152614a5560a0830186614518565b8281036060840152614a678186614518565b90508281036080840152614a7b81856141c5565b98975050505050505050565b600060208284031215614a9957600080fd5b815161151f81614052565b600060033d1115614abd5760046000803e5060005160e01c5b90565b600060443d1015614ace5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715614afe57505050505090565b8285019150815181811115614b165750505050505090565b843d8701016020828501011115614b305750505050505090565b614b3f6020828601018761409b565b509095945050505050565b6000816000190483118215151615614b6457614b64614866565b500290565b600081614b7857614b78614866565b506000190190565b600060208284031215614b9257600080fd5b815161151f8161470e565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152613ea060a08301846141c5565b600082821015614be757614be7614866565b500390565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60008251614c2a818460208701614199565b919091019291505056fea2646970667358221220341d20e495943c16219c98d2eaf7023fdf9b381051e3d6fac7c29f6233c5f4a164736f6c634300080d0033
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.