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
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
IlluviumNFT
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 800 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "./RoyalERC1155.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; /** * @title Illuvium ERC1155 NFT * * @dev This is the deployed smart contract that represents Illuvium's Promotional * NFTs collection using the multi-token standard (ERC1155) * * @dev UUPSUpgradeable (EIP1822) is used for upgradeability */ contract IlluviumNFT is Initializable, RoyalERC1155 { using StringsUpgradeable for uint256; /** * @dev Collection name */ string public constant name = "Illuvium Promo NFTs"; /** * @dev Collection token ticker (symbol) */ string public constant symbol = "ILV-NFT"; /** * @dev "Constructor replacement" for upgradeable, must be execute immediately after deployment * see https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializers * * @param uri_ collection uri (ERC1155) * @param _owner smart contract owner having full privileges */ function initialize(string memory uri_, address _owner) external initializer { __RoyalERC1155_init(uri_, _owner); } /** * @inheritdoc ERC1155Upgradeable */ function uri(uint256 _id) public view virtual override returns (string memory) { require(exists(_id), "URI query for nonexistent token"); string memory baseUri = super.uri(0); return string(abi.encodePacked(baseUri, _id.toString())); } /** * @dev Empty reserved space in storage. The size of the __gap array is calculated so that * the amount of storage used by a contract always adds up to the 50. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "./interfaces/IEIP2981.sol"; import "./UpgradeableERC1155.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @title Royal ERC1155 * * @dev Supports EIP-2981 royalties on NFT secondary sales * Supports OpenSea contract metadata royalties * Introduces fake "owner" to support OpenSea collections * */ abstract contract RoyalERC1155 is Initializable, IEIP2981, UpgradeableERC1155 { /** * @dev OpenSea expects NFTs to be "Ownable", that is having an "owner", * we introduce a fake "owner" here with no authority */ address public owner; /** * @notice Address to receive EIP-2981 royalties from secondary sales * see https://eips.ethereum.org/EIPS/eip-2981 */ address public royaltyReceiver; /** * @notice Percentage of token sale price to be used for EIP-2981 royalties from secondary sales * see https://eips.ethereum.org/EIPS/eip-2981 * * @dev Has 2 decimal precision. E.g. a value of 500 would result in a 5% royalty fee */ uint16 public royaltyPercentage; // default OpenSea value is 750 /** * @notice Contract level metadata to define collection name, description, and royalty fees. * see https://docs.opensea.io/docs/contract-level-metadata * * @dev Should be overwritten by inheriting contracts. By default only includes royalty information */ string public contractURI; /** * @notice Royalty manager is responsible for managing the EIP2981 royalty info * * @dev Role ROLE_ROYALTY_MANAGER allows updating the royalty information * (executing `setRoyaltyInfo` function) */ uint32 public constant ROLE_ROYALTY_MANAGER = 0x0010_0000; /** * @notice Owner manager is responsible for setting/updating an "owner" field * * @dev Role ROLE_OWNER_MANAGER allows updating the "owner" field * (executing `setOwner` function) */ uint32 public constant ROLE_OWNER_MANAGER = 0x0020_0000; /** * @dev Fired in setContractURI() * * @param _by an address which executed update * @param _value new contractURI value */ event ContractURIUpdated(address indexed _by, string _value); /** * @dev Fired in setRoyaltyInfo() * * @param _by an address which executed update * @param _receiver new royaltyReceiver value * @param _percentage new royaltyPercentage value */ event RoyaltyInfoUpdated(address indexed _by, address indexed _receiver, uint16 _percentage); /** * @dev Fired in setOwner() * * @param _by an address which set the new "owner" * @param _oldVal previous "owner" address * @param _newVal new "owner" address */ event OwnerUpdated(address indexed _by, address indexed _oldVal, address indexed _newVal); /** * @dev "Constructor replacement" for upgradeable, must be execute immediately after deployment * see https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializers * * @param uri_ collection uri (ERC1155) * @param _owner smart contract owner having full privileges */ function __RoyalERC1155_init(string memory uri_, address _owner) internal initializer { // execute all parent initializers in cascade __UpgradeableERC1155_init(uri_, _owner); // initialize the "owner" as a deployer account owner = msg.sender; } /** * @dev Restricted access function which updates the contract URI * * @dev Requires executor to have ROLE_URI_MANAGER permission * * @param _contractURI new contract URI to set */ function setContractURI(string memory _contractURI) public virtual { // verify the access permission require(isSenderInRole(ROLE_URI_MANAGER), "access denied"); // update the contract URI contractURI = _contractURI; // emit an event first emit ContractURIUpdated(msg.sender, _contractURI); } /** * @notice EIP-2981 function to calculate royalties for sales in secondary marketplaces. * see https://eips.ethereum.org/EIPS/eip-2981 * * @param _salePrice the price (in any unit, .e.g wei, ERC20 token, et.c.) of the token to be sold * * @return receiver the royalty receiver * @return royaltyAmount royalty amount in the same unit as _salePrice */ function royaltyInfo(uint256, uint256 _salePrice) external view virtual override returns (address receiver, uint256 royaltyAmount) { // simply calculate the values and return the result return (royaltyReceiver, (_salePrice * royaltyPercentage) / 100_00); } /** * @dev Restricted access function which updates the royalty info * * @dev Requires executor to have ROLE_ROYALTY_MANAGER permission * * @param _royaltyReceiver new royalty receiver to set * @param _royaltyPercentage new royalty percentage to set */ function setRoyaltyInfo(address _royaltyReceiver, uint16 _royaltyPercentage) public virtual { // verify the access permission require(isSenderInRole(ROLE_ROYALTY_MANAGER), "access denied"); // verify royalty percentage is zero if receiver is also zero require(_royaltyReceiver != address(0) || _royaltyPercentage == 0, "invalid receiver"); // update the values royaltyReceiver = _royaltyReceiver; royaltyPercentage = _royaltyPercentage; // emit an event first emit RoyaltyInfoUpdated(msg.sender, _royaltyReceiver, _royaltyPercentage); } /** * @notice Checks if the address supplied is an "owner" of the smart contract * Note: an "owner" doesn't have any authority on the smart contract and is "nominal" * * @return true if the caller is the current owner. */ function isOwner(address _addr) public view virtual returns (bool) { // just evaluate and return the result return _addr == owner; } /** * @dev Restricted access function to set smart contract "owner" * Note: an "owner" set doesn't have any authority, and cannot even update "owner" * * @dev Requires executor to have ROLE_OWNER_MANAGER permission * * @param _owner new "owner" of the smart contract */ function transferOwnership(address _owner) public virtual { // verify the access permission require(isSenderInRole(ROLE_OWNER_MANAGER), "access denied"); // emit an event first - to log both old and new values emit OwnerUpdated(msg.sender, owner, _owner); // update "owner" owner = _owner; } /** * @inheritdoc IERC165 */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, UpgradeableERC1155) returns (bool) { // construct the interface support from EIP-2981 and super interfaces return interfaceId == type(IEIP2981).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Empty reserved space in storage. The size of the __gap array is calculated so that * the amount of storage used by a contract always adds up to the 50. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[46] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; /** * @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() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal initializer { __ERC1967Upgrade_init_unchained(); __UUPSUpgradeable_init_unchained(); } function __UUPSUpgradeable_init_unchained() internal initializer { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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 pragma solidity 0.8.7; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /// /// @dev Interface for the NFT Royalty Standard /// interface IEIP2981 is IERC165 { /// ERC165 bytes to add to interface array - set in parent contract /// implementing this standard /// /// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a /// bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; /// _registerInterface(_INTERFACE_ID_ERC2981); /// @notice Called with the sale price to determine how much royalty // is owed and to whom. /// @param _tokenId - the NFT asset queried for royalty information /// @param _salePrice - the sale price of the NFT asset specified by _tokenId /// @return receiver - address of who should be sent the royalty payment /// @return royaltyAmount - the royalty payment amount for _salePrice function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "./interfaces/IERC20.sol"; import "./utils/UpgradeableAccessControl.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155SupplyUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @title Upgradeable ERC1155 Implementation * * @dev Open Zeppelin based ERC1155 implementation, supporting burning, minting * and total supply tracking per token id * * @dev Based on Open Zeppelin ERC1155BurnableUpgradeable and ERC1155SupplyUpgradeable */ abstract contract UpgradeableERC1155 is Initializable, ERC1155SupplyUpgradeable, UpgradeableAccessControl { /** * @notice Enables ERC1155 transfers of the tokens * (transfer by the token owner himself) * @dev Feature FEATURE_TRANSFERS must be enabled in order for * `transferFrom()` function to succeed when executed by token owner */ uint32 public constant FEATURE_TRANSFERS = 0x0000_0001; /** * @notice Enables ERC1155 transfers on behalf * (transfer by someone else on behalf of token owner) * @dev Feature FEATURE_TRANSFERS_ON_BEHALF must be enabled in order for * `transferFrom()` function to succeed whe executed by approved operator * @dev Token owner must call `approve()` or `setApprovalForAll()` * first to authorize the transfer on behalf */ uint32 public constant FEATURE_TRANSFERS_ON_BEHALF = 0x0000_0002; /** * @notice Enables token owners to burn their own tokens * * @dev Feature FEATURE_OWN_BURNS must be enabled in order for * `burn()` function to succeed when called by token owner */ uint32 public constant FEATURE_OWN_BURNS = 0x0000_0008; /** * @notice Enables approved operators to burn tokens on behalf of their owners * * @dev Feature FEATURE_BURNS_ON_BEHALF must be enabled in order for * `burn()` function to succeed when called by approved operator */ uint32 public constant FEATURE_BURNS_ON_BEHALF = 0x0000_0010; /** * @notice Token creator is responsible for creating (minting) * tokens to an arbitrary address * @dev Role ROLE_TOKEN_CREATOR allows minting tokens * (calling `mint` function) */ uint32 public constant ROLE_TOKEN_CREATOR = 0x0001_0000; /** * @notice Token destroyer is responsible for destroying (burning) * tokens owned by an arbitrary address * @dev Role ROLE_TOKEN_DESTROYER allows burning tokens * (calling `burn` function) */ uint32 public constant ROLE_TOKEN_DESTROYER = 0x0002_0000; /** * @notice URI manager is responsible for managing base URI * part of the token URI ERC1155Metadata interface * * @dev Role ROLE_URI_MANAGER allows updating the base URI * (executing `setBaseURI` function) */ uint32 public constant ROLE_URI_MANAGER = 0x0004_0000; /** * @notice People do mistakes and may send ERC20 tokens by mistake; since * NFT smart contract is not designed to accept and hold any ERC20 tokens, * it allows the rescue manager to "rescue" such lost tokens * * @notice Rescue manager is responsible for "rescuing" ERC20 tokens accidentally * sent to the smart contract * * @dev Role ROLE_RESCUE_MANAGER allows withdrawing any ERC20 tokens stored * on the smart contract balance */ uint32 public constant ROLE_RESCUE_MANAGER = 0x0008_0000; /** * @dev "Constructor replacement" for upgradeable, must be execute immediately after deployment * see https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializers * * @param uri_ collection uri (ERC1155) * @param _owner smart contract owner having full privileges */ function __UpgradeableERC1155_init(string memory uri_, address _owner) internal initializer { // execute all parent initializers in cascade __ERC1155_init(uri_); __ERC1155Supply_init_unchained(); __AccessControl_init(_owner); } /** * @inheritdoc IERC165Upgradeable */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return super.supportsInterface(interfaceId); } /** * @dev Restricted access function which updates base URI used to construct * IERC1155MetadataURIUpgradeable.uri * * @dev Requires executor to have ROLE_URI_MANAGER permission * * @param newuri new URI to set */ function setURI(string memory newuri) public virtual { // verify the access permission require(isSenderInRole(ROLE_URI_MANAGER), "access denied"); _setURI(newuri); } /** * @dev Creates `amount` new tokens for `to`, of token type `id`. * * See {ERC1155-_mint}. * * Requirements: * * - the caller must have the `ROLE_TOKEN_CREATOR`. */ function mint( address _to, uint256 _id, uint256 _amount, bytes memory _data ) public virtual { // check if caller has sufficient permissions to mint tokens require(isSenderInRole(ROLE_TOKEN_CREATOR), "access denied"); // mint token - delegate to `_mint` _mint(_to, _id, _amount, _data); } /** * @dev Destroys the token with token ID specified * * @dev Requires executor to have `ROLE_TOKEN_DESTROYER` permission * or FEATURE_OWN_BURNS/FEATURE_BURNS_ON_BEHALF features to be enabled * * @dev Can be disabled by the contract creator forever by disabling * FEATURE_OWN_BURNS/FEATURE_BURNS_ON_BEHALF features and then revoking * its own roles to burn tokens and to enable burning features * * @param _from address to burn the token from * @param _id ID of the token to burn * @param _amount number of tokens to burn */ function burn( address _from, uint256 _id, uint256 _amount ) public virtual { // check if caller has sufficient permissions to burn tokens // and if not - check for possibility to burn own tokens or to burn on behalf if (!isSenderInRole(ROLE_TOKEN_DESTROYER)) { // if `_from` is equal to sender, require own burns feature to be enabled // otherwise require burns on behalf feature to be enabled require( (_from == msg.sender && isFeatureEnabled(FEATURE_OWN_BURNS)) || (_from != msg.sender && isFeatureEnabled(FEATURE_BURNS_ON_BEHALF)), _from == msg.sender ? "burns are disabled" : "burns on behalf are disabled" ); // verify sender is either token owner, or approved by the token owner to burn tokens require(_from == msg.sender || isApprovedForAll(_from, msg.sender), "access denied"); } // delegate to the super implementation super._burn(_from, _id, _amount); } /** * @inheritdoc ERC1155Upgradeable */ 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); // for transfers only - verify if transfers are enabled require( _from == address(0) || _to == address(0) || // won't affect minting/burning (_from == msg.sender && isFeatureEnabled(FEATURE_TRANSFERS)) || (_from != msg.sender && isFeatureEnabled(FEATURE_TRANSFERS_ON_BEHALF)), _from == msg.sender ? "transfers are disabled" : "transfers on behalf are disabled" ); } /** * @dev Restricted access function to rescue accidentally sent ERC20 tokens, * the tokens are rescued via `transfer` function call on the * contract address specified and with the parameters specified: * `_contract.transfer(_to, _value)` * * @dev Requires executor to have `ROLE_RESCUE_MANAGER` permission * * @param _contract smart contract address to execute `transfer` function on * @param _to to address in `transfer(_to, _value)` * @param _value value to transfer in `transfer(_to, _value)` */ function rescueErc20( address _contract, address _to, uint256 _value ) public { // verify the access permission require(isSenderInRole(ROLE_RESCUE_MANAGER), "access denied"); // perform the transfer as requested, without any checks IERC20(_contract).transfer(_to, _value); } /** * @dev Empty reserved space in storage. The size of the __gap array is calculated so that * the amount of storage used by a contract always adds up to the 50. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; /** * @title EIP-20: ERC-20 Token Standard * * @notice The ERC-20 (Ethereum Request for Comments 20), proposed by Fabian Vogelsteller in November 2015, * is a Token Standard that implements an API for tokens within Smart Contracts. * * @notice It provides functionalities like to transfer tokens from one account to another, * to get the current token balance of an account and also the total supply of the token available on the network. * Besides these it also has some other functionalities like to approve that an amount of * token from an account can be spent by a third party account. * * @notice If a Smart Contract implements the following methods and events it can be called an ERC-20 Token * Contract and, once deployed, it will be responsible to keep track of the created tokens on Ethereum. * * @notice See https://ethereum.org/en/developers/docs/standards/tokens/erc-20/ * @notice See https://eips.ethereum.org/EIPS/eip-20 */ interface IERC20 { /** * @dev Fired in transfer(), transferFrom() to indicate that token transfer happened * * @param from an address tokens were consumed from * @param to an address tokens were sent to * @param value number of tokens transferred */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Fired in approve() to indicate an approval event happened * * @param owner an address which granted a permission to transfer * tokens on its behalf * @param spender an address which received a permission to transfer * tokens on behalf of the owner `_owner` * @param value amount of tokens granted to transfer on behalf */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @return name of the token (ex.: USD Coin) */ // OPTIONAL - This method can be used to improve usability, // but interfaces and other contracts MUST NOT expect these values to be present. // function name() external view returns (string memory); /** * @return symbol of the token (ex.: USDC) */ // OPTIONAL - This method can be used to improve usability, // but interfaces and other contracts MUST NOT expect these values to be present. // function symbol() external view returns (string memory); /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * @dev Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * @dev NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. * * @return token decimals */ // OPTIONAL - This method can be used to improve usability, // but interfaces and other contracts MUST NOT expect these values to be present. // function decimals() external view returns (uint8); /** * @return the amount of tokens in existence */ function totalSupply() external view returns (uint256); /** * @notice Gets the balance of a particular address * * @param _owner the address to query the the balance for * @return balance an amount of tokens owned by the address specified */ function balanceOf(address _owner) external view returns (uint256 balance); /** * @notice Transfers some tokens to an external address or a smart contract * * @dev Called by token owner (an address which has a * positive token balance tracked by this smart contract) * @dev Throws on any error like * * insufficient token balance or * * incorrect `_to` address: * * zero address or * * self address or * * smart contract which doesn't support ERC20 * * @param _to an address to transfer tokens to, * must be either an external address or a smart contract, * compliant with the ERC20 standard * @param _value amount of tokens to be transferred,, zero * value is allowed * @return success true on success, throws otherwise */ function transfer(address _to, uint256 _value) external returns (bool success); /** * @notice Transfers some tokens on behalf of address `_from' (token owner) * to some other address `_to` * * @dev Called by token owner on his own or approved address, * an address approved earlier by token owner to * transfer some amount of tokens on its behalf * @dev Throws on any error like * * insufficient token balance or * * incorrect `_to` address: * * zero address or * * same as `_from` address (self transfer) * * smart contract which doesn't support ERC20 * * @param _from token owner which approved caller (transaction sender) * to transfer `_value` of tokens on its behalf * @param _to an address to transfer tokens to, * must be either an external address or a smart contract, * compliant with the ERC20 standard * @param _value amount of tokens to be transferred,, zero * value is allowed * @return success true on success, throws otherwise */ function transferFrom( address _from, address _to, uint256 _value ) external returns (bool success); /** * @notice Approves address called `_spender` to transfer some amount * of tokens on behalf of the owner (transaction sender) * * @dev Transaction sender must not necessarily own any tokens to grant the permission * * @param _spender an address approved by the caller (token owner) * to spend some tokens on its behalf * @param _value an amount of tokens spender `_spender` is allowed to * transfer on behalf of the token owner * @return success true on success, throws otherwise */ function approve(address _spender, uint256 _value) external returns (bool success); /** * @notice Returns the amount which _spender is still allowed to withdraw from _owner. * * @dev A function to check an amount of tokens owner approved * to transfer on its behalf by some other address called "spender" * * @param _owner an address which approves transferring some tokens on its behalf * @param _spender an address approved to transfer some tokens on behalf * @return remaining an amount of tokens approved address `_spender` can transfer on behalf * of token owner `_owner` */ function allowance(address _owner, address _spender) external view returns (uint256 remaining); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; /** * @title Upgradeable Access Control List // ERC1967Proxy * * @notice Access control smart contract provides an API to check * if a specific operation is permitted globally and/or * if a particular user has a permission to execute it. * * @notice It deals with two main entities: features and roles. * * @notice Features are designed to be used to enable/disable public functions * of the smart contract (used by a wide audience). * @notice User roles are designed to control the access to restricted functions * of the smart contract (used by a limited set of maintainers). * * @notice Terms "role", "permissions" and "set of permissions" have equal meaning * in the documentation text and may be used interchangeably. * @notice Terms "permission", "single permission" implies only one permission bit set. * * @notice Access manager is a special role which allows to grant/revoke other roles. * Access managers can only grant/revoke permissions which they have themselves. * As an example, access manager with no other roles set can only grant/revoke its own * access manager permission and nothing else. * * @notice Access manager permission should be treated carefully, as a super admin permission: * Access manager with even no other permission can interfere with another account by * granting own access manager permission to it and effectively creating more powerful * permission set than its own. * * @dev Both current and OpenZeppelin AccessControl implementations feature a similar API * to check/know "who is allowed to do this thing". * @dev Zeppelin implementation is more flexible: * - it allows setting unlimited number of roles, while current is limited to 256 different roles * - it allows setting an admin for each role, while current allows having only one global admin * @dev Current implementation is more lightweight: * - it uses only 1 bit per role, while Zeppelin uses 256 bits * - it allows setting up to 256 roles at once, in a single transaction, while Zeppelin allows * setting only one role in a single transaction * * @dev This smart contract is designed to be inherited by other * smart contracts which require access control management capabilities. * * @dev Access manager permission has a bit 255 set. * This bit must not be used by inheriting contracts for any other permissions/features. * * @dev This is an upgradeable version of the ACL, based on Zeppelin implementation for ERC1967, * see https://docs.openzeppelin.com/contracts/4.x/upgradeable * see https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable * see https://forum.openzeppelin.com/t/uups-proxies-tutorial-solidity-javascript/7786 * * @author Basil Gorin */ abstract contract UpgradeableAccessControl is UUPSUpgradeable { /** * @notice Access manager is responsible for assigning the roles to users, * enabling/disabling global features of the smart contract * @notice Access manager can add, remove and update user roles, * remove and update global features * * @dev Role ROLE_ACCESS_MANAGER allows modifying user roles and global features * @dev Role ROLE_ACCESS_MANAGER has single bit at position 255 enabled */ uint256 public constant ROLE_ACCESS_MANAGER = 0x8000000000000000000000000000000000000000000000000000000000000000; /** * @notice Upgrade manager is responsible for smart contract upgrades, * see https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable * see https://docs.openzeppelin.com/contracts/4.x/upgradeable * * @dev Role ROLE_UPGRADE_MANAGER allows passing the _authorizeUpgrade() check * @dev Role ROLE_UPGRADE_MANAGER has single bit at position 254 enabled */ uint256 public constant ROLE_UPGRADE_MANAGER = 0x4000000000000000000000000000000000000000000000000000000000000000; /** * @dev Bitmask representing all the possible permissions (super admin role) * @dev Has all the bits are enabled (2^256 - 1 value) */ uint256 private constant FULL_PRIVILEGES_MASK = type(uint256).max; // before 0.8.0: uint256(-1) overflows to 0xFFFF... /** * @notice Privileged addresses with defined roles/permissions * @notice In the context of ERC20/ERC721 tokens these can be permissions to * allow minting or burning tokens, transferring on behalf and so on * * @dev Maps user address to the permissions bitmask (role), where each bit * represents a permission * @dev Bitmask 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF * represents all possible permissions * @dev 'This' address mapping represents global features of the smart contract */ mapping(address => uint256) public userRoles; /** * @dev Fired in updateRole() and updateFeatures() * * @param _by operator which called the function * @param _to address which was granted/revoked permissions * @param _requested permissions requested * @param _actual permissions effectively set */ event RoleUpdated(address indexed _by, address indexed _to, uint256 _requested, uint256 _actual); /** * @dev UUPS initializer, sets the contract owner to have full privileges * * @param _owner smart contract owner having full privileges */ function __AccessControl_init(address _owner) internal virtual initializer { // grant owner full privileges userRoles[_owner] = FULL_PRIVILEGES_MASK; } /** * @notice Returns an address of the implementation smart contract, * see ERC1967Upgrade._getImplementation() * * @return the current implementation address */ function getImplementation() public view virtual returns (address) { // delegate to `ERC1967Upgrade._getImplementation()` return _getImplementation(); } /** * @notice Retrieves globally set of features enabled * * @dev Effectively reads userRoles role for the contract itself * * @return 256-bit bitmask of the features enabled */ function features() public view returns (uint256) { // features are stored in 'this' address mapping of `userRoles` structure return userRoles[address(this)]; } /** * @notice Updates set of the globally enabled features (`features`), * taking into account sender's permissions * * @dev Requires transaction sender to have `ROLE_ACCESS_MANAGER` permission * @dev Function is left for backward compatibility with older versions * * @param _mask bitmask representing a set of features to enable/disable */ function updateFeatures(uint256 _mask) public { // delegate call to `updateRole` updateRole(address(this), _mask); } /** * @notice Updates set of permissions (role) for a given user, * taking into account sender's permissions. * * @dev Setting role to zero is equivalent to removing an all permissions * @dev Setting role to `FULL_PRIVILEGES_MASK` is equivalent to * copying senders' permissions (role) to the user * @dev Requires transaction sender to have `ROLE_ACCESS_MANAGER` permission * * @param operator address of a user to alter permissions for or zero * to alter global features of the smart contract * @param role bitmask representing a set of permissions to * enable/disable for a user specified */ function updateRole(address operator, uint256 role) public { // caller must have a permission to update user roles require(isSenderInRole(ROLE_ACCESS_MANAGER), "access denied"); // evaluate the role and reassign it userRoles[operator] = evaluateBy(msg.sender, userRoles[operator], role); // fire an event emit RoleUpdated(msg.sender, operator, role, userRoles[operator]); } /** * @notice Determines the permission bitmask an operator can set on the * target permission set * @notice Used to calculate the permission bitmask to be set when requested * in `updateRole` and `updateFeatures` functions * * @dev Calculated based on: * 1) operator's own permission set read from userRoles[operator] * 2) target permission set - what is already set on the target * 3) desired permission set - what do we want set target to * * @dev Corner cases: * 1) Operator is super admin and its permission set is `FULL_PRIVILEGES_MASK`: * `desired` bitset is returned regardless of the `target` permission set value * (what operator sets is what they get) * 2) Operator with no permissions (zero bitset): * `target` bitset is returned regardless of the `desired` value * (operator has no authority and cannot modify anything) * * @dev Example: * Consider an operator with the permissions bitmask 00001111 * is about to modify the target permission set 01010101 * Operator wants to set that permission set to 00110011 * Based on their role, an operator has the permissions * to update only lowest 4 bits on the target, meaning that * high 4 bits of the target set in this example is left * unchanged and low 4 bits get changed as desired: 01010011 * * @param operator address of the contract operator which is about to set the permissions * @param target input set of permissions to operator is going to modify * @param desired desired set of permissions operator would like to set * @return resulting set of permissions given operator will set */ function evaluateBy( address operator, uint256 target, uint256 desired ) public view returns (uint256) { // read operator's permissions uint256 p = userRoles[operator]; // taking into account operator's permissions, // 1) enable the permissions desired on the `target` target |= p & desired; // 2) disable the permissions desired on the `target` target &= FULL_PRIVILEGES_MASK ^ (p & (FULL_PRIVILEGES_MASK ^ desired)); // return calculated result return target; } /** * @notice Checks if requested set of features is enabled globally on the contract * * @param required set of features to check against * @return true if all the features requested are enabled, false otherwise */ function isFeatureEnabled(uint256 required) public view returns (bool) { // delegate call to `__hasRole`, passing `features` property return __hasRole(features(), required); } /** * @notice Checks if transaction sender `msg.sender` has all the permissions required * * @param required set of permissions (role) to check against * @return true if all the permissions requested are enabled, false otherwise */ function isSenderInRole(uint256 required) public view returns (bool) { // delegate call to `isOperatorInRole`, passing transaction sender return isOperatorInRole(msg.sender, required); } /** * @notice Checks if operator has all the permissions (role) required * * @param operator address of the user to check role for * @param required set of permissions (role) to check * @return true if all the permissions requested are enabled, false otherwise */ function isOperatorInRole(address operator, uint256 required) public view returns (bool) { // delegate call to `__hasRole`, passing operator's permissions (role) return __hasRole(userRoles[operator], required); } /** * @dev Checks if role `actual` contains all the permissions required `required` * * @param actual existent role * @param required required role * @return true if actual has required role (all permissions), false otherwise */ function __hasRole(uint256 actual, uint256 required) internal pure returns (bool) { // check the bitmask for the role required and return the result return actual & required == required; } /** * @inheritdoc UUPSUpgradeable */ function _authorizeUpgrade(address) internal virtual override { // caller must have a permission to upgrade the contract require(isSenderInRole(ROLE_UPGRADE_MANAGER), "access denied"); } /** * @dev Empty reserved space in storage. The size of the __gap array is calculated so that * the amount of storage used by a contract always adds up to the 50. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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 initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC1155Supply_init_unchained(); } function __ERC1155Supply_init_unchained() internal initializer { } 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.0 (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal initializer { __ERC1967Upgrade_init_unchained(); } function __ERC1967Upgrade_init_unchained() internal initializer { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallSecure( address newImplementation, bytes memory data, bool forceCall ) internal { address oldImplementation = _getImplementation(); // Initial upgrade and setup call _setImplementation(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } // Perform rollback test if not already in progress StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT); if (!rollbackTesting.value) { // Trigger rollback using upgradeTo from the new implementation rollbackTesting.value = true; _functionDelegateCall( newImplementation, abi.encodeWithSignature("upgradeTo(address)", oldImplementation) ); rollbackTesting.value = false; // Check rollback was effective require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades"); // Finally reset to the new implementation and log the upgrade _upgradeTo(newImplementation); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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.0 (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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 initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC1155_init_unchained(uri_); } function __ERC1155_init_unchained(string memory uri_) internal initializer { _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.0 (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.0 (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.0 (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.0 (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 initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } 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.0 (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 initializer { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal initializer { } /** * @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.0 (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); }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 800 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"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":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_by","type":"address"},{"indexed":false,"internalType":"string","name":"_value","type":"string"}],"name":"ContractURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_by","type":"address"},{"indexed":true,"internalType":"address","name":"_oldVal","type":"address"},{"indexed":true,"internalType":"address","name":"_newVal","type":"address"}],"name":"OwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_by","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_requested","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_actual","type":"uint256"}],"name":"RoleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_by","type":"address"},{"indexed":true,"internalType":"address","name":"_receiver","type":"address"},{"indexed":false,"internalType":"uint16","name":"_percentage","type":"uint16"}],"name":"RoyaltyInfoUpdated","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":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"FEATURE_BURNS_ON_BEHALF","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEATURE_OWN_BURNS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEATURE_TRANSFERS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEATURE_TRANSFERS_ON_BEHALF","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_ACCESS_MANAGER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_OWNER_MANAGER","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_RESCUE_MANAGER","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_ROYALTY_MANAGER","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_TOKEN_CREATOR","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_TOKEN_DESTROYER","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_UPGRADE_MANAGER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_URI_MANAGER","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":"_from","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"target","type":"uint256"},{"internalType":"uint256","name":"desired","type":"uint256"}],"name":"evaluateBy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"features","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"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":"uint256","name":"required","type":"uint256"}],"name":"isFeatureEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"isOperatorInRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"required","type":"uint256"}],"name":"isSenderInRole","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":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"rescueErc20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyPercentage","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"_contractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyReceiver","type":"address"},{"internalType":"uint16","name":"_royaltyPercentage","type":"uint16"}],"name":"setRoyaltyInfo","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mask","type":"uint256"}],"name":"updateFeatures","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"role","type":"uint256"}],"name":"updateRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRoles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a06040523060601b60805234801561001757600080fd5b5060805160601c613bc261004b60003960008181610db601528181610e3b0152818161106d01526110f20152613bc26000f3fe60806040526004361061031d5760003560e01c80638da5cb5b116101a5578063c0d6568d116100ec578063e985e9c511610095578063f5298aca1161006f578063f5298aca14610993578063f63c2f82146109b3578063f822d5aa146109c8578063fcc2c07814610a0f57600080fd5b8063e985e9c51461090a578063f242432a14610953578063f2fde38b1461097357600080fd5b8063d5bb7f67116100c6578063d5bb7f67146108be578063e62cac76146108de578063e8a3d485146108f557600080fd5b8063c0d6568d14610872578063c688d69314610887578063cc2da7ff146108a757600080fd5b8063aaf10f421161014e578063ae682e2e11610128578063ae682e2e14610816578063b29a2f441461082e578063bd85b0391461084557600080fd5b8063aaf10f42146107c9578063ae5b102e146107de578063ae60bda4146107fe57600080fd5b806395d89b411161017f57806395d89b411461073f5780639fbc871314610788578063a22cb465146107a957600080fd5b80638da5cb5b146106d15780638f6fba8c1461070a578063938e3d7b1461071f57600080fd5b80632f54bf6e11610269578063725f3626116102125780637ab4339d116101ec5780637ab4339d146106645780638a71bb2d146106845780638d4e57e6146106ba57600080fd5b8063725f3626146105f6578063731133e91461061657806374d5e1001461063657600080fd5b80634f1ef286116102435780634f1ef286146105945780634f558e79146105a757806372504a24146105d657600080fd5b80632f54bf6e146105175780633659cfe6146105475780634e1273f41461056757600080fd5b80631a0b04ea116102cb5780632b521416116102a55780632b521416146104bd5780632d17f8bc146104e05780632eb2c2d6146104f757600080fd5b80631a0b04ea14610449578063243feb991461045e5780632a55205a1461047e57600080fd5b806306fdde03116102fc57806306fdde03146103a75780630e89341c146103fd57806314b7b4e11461041d57600080fd5b8062fdd58e1461032257806301ffc9a71461035557806302fe530514610385575b600080fd5b34801561032e57600080fd5b5061034261033d3660046134f4565b610a2f565b6040519081526020015b60405180910390f35b34801561036157600080fd5b50610375610370366004613696565b610ada565b604051901515815260200161034c565b34801561039157600080fd5b506103a56103a03660046136d0565b610b05565b005b3480156103b357600080fd5b506103f06040518060400160405280601381526020017f496c6c757669756d2050726f6d6f204e4654730000000000000000000000000081525081565b60405161034c9190613910565b34801561040957600080fd5b506103f061041836600461374a565b610b59565b34801561042957600080fd5b506104346204000081565b60405163ffffffff909116815260200161034c565b34801561045557600080fd5b50610434600881565b34801561046a57600080fd5b506103a561047936600461339b565b610bf7565b34801561048a57600080fd5b5061049e610499366004613763565b610cc7565b604080516001600160a01b03909316835260208301919091520161034c565b3480156104c957600080fd5b5030600090815261012d6020526040902054610342565b3480156104ec57600080fd5b506104346208000081565b34801561050357600080fd5b506103a56105123660046132f1565b610d09565b34801561052357600080fd5b506103756105323660046132a3565b610192546001600160a01b0391821691161490565b34801561055357600080fd5b506103a56105623660046132a3565b610dab565b34801561057357600080fd5b506105876105823660046135b2565b610f24565b60405161034c91906138d8565b6103a56105a2366004613473565b611062565b3480156105b357600080fd5b506103756105c236600461374a565b600090815260976020526040902054151590565b3480156105e257600080fd5b506103a56105f13660046134c1565b6111cf565b34801561060257600080fd5b5061037561061136600461374a565b611300565b34801561062257600080fd5b506103a5610631366004613551565b61131a565b34801561064257600080fd5b506103426106513660046132a3565b61012d6020526000908152604090205481565b34801561067057600080fd5b506103a561067f366004613705565b61136e565b34801561069057600080fd5b50610193546106a790600160a01b900461ffff1681565b60405161ffff909116815260200161034c565b3480156106c657600080fd5b506104346201000081565b3480156106dd57600080fd5b50610192546106f2906001600160a01b031681565b6040516001600160a01b03909116815260200161034c565b34801561071657600080fd5b50610434600281565b34801561072b57600080fd5b506103a561073a3660046136d0565b61142d565b34801561074b57600080fd5b506103f06040518060400160405280600781526020017f494c562d4e46540000000000000000000000000000000000000000000000000081525081565b34801561079457600080fd5b50610193546106f2906001600160a01b031681565b3480156107b557600080fd5b506103a56107c436600461343c565b6114ce565b3480156107d557600080fd5b506106f26114d9565b3480156107ea57600080fd5b506103a56107f93660046134f4565b611511565b34801561080a57600080fd5b50610342600160fe1b81565b34801561082257600080fd5b50610342600160ff1b81565b34801561083a57600080fd5b506104346210000081565b34801561085157600080fd5b5061034261086036600461374a565b60009081526097602052604090205490565b34801561087e57600080fd5b50610434600181565b34801561089357600080fd5b506103756108a23660046134f4565b6115cc565b3480156108b357600080fd5b506104346220000081565b3480156108ca57600080fd5b506103a56108d936600461374a565b6115f2565b3480156108ea57600080fd5b506104346202000081565b34801561090157600080fd5b506103f06115fc565b34801561091657600080fd5b506103756109253660046132be565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b34801561095f57600080fd5b506103a561096e3660046133d7565b61168b565b34801561097f57600080fd5b506103a561098e3660046132a3565b611726565b34801561099f57600080fd5b506103a56109ae36600461351e565b6117db565b3480156109bf57600080fd5b50610434601081565b3480156109d457600080fd5b506103426109e336600461351e565b6001600160a01b0392909216600090815261012d60205260409020546000198084188216189216171690565b348015610a1b57600080fd5b50610375610a2a36600461374a565b61194e565b60006001600160a01b038316610ab25760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526065602090815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b0319821663152a902d60e11b1480610aff5750610aff8261195a565b92915050565b610b116204000061194e565b610b4d5760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b610b5681611965565b50565b600081815260976020526040902054606090610bb75760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610aa9565b6000610bc36000611978565b905080610bcf84611a0c565b604051602001610be0929190613808565b604051602081830303815290604052915050919050565b610c036208000061194e565b610c3f5760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b158015610c8957600080fd5b505af1158015610c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc19190613679565b50505050565b6101935460009081906001600160a01b0381169061271090610cf490600160a01b900461ffff1686613973565b610cfe919061395f565b915091509250929050565b6001600160a01b038516331480610d255750610d258533610925565b610d975760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f76656400000000000000000000000000006064820152608401610aa9565b610da48585858585611b2a565b5050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610e395760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610aa9565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e947f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614610eff5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608401610aa9565b610f0881611dae565b60408051600080825260208201909252610b5691839190611df7565b60608151835114610f9d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610aa9565b6000835167ffffffffffffffff811115610fb957610fb9613aae565b604051908082528060200260200182016040528015610fe2578160200160208202803683370190505b50905060005b845181101561105a5761102d85828151811061100657611006613a98565b602002602001015185838151811061102057611020613a98565b6020026020010151610a2f565b82828151811061103f5761103f613a98565b602090810291909101015261105381613a3d565b9050610fe8565b509392505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156110f05760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610aa9565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661114b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146111b65760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608401610aa9565b6111bf82611dae565b6111cb82826001611df7565b5050565b6111db6210000061194e565b6112175760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b6001600160a01b038216151580611230575061ffff8116155b61127c5760405162461bcd60e51b815260206004820152601060248201527f696e76616c6964207265636569766572000000000000000000000000000000006044820152606401610aa9565b61019380546001600160a01b0384167fffffffffffffffffffff000000000000000000000000000000000000000000009091168117600160a01b61ffff8516908102919091179092556040519182529033907f9ca088b6b695032bcd5d1fa450e8fa2773391294f09e3710ace940c4ae8cffac906020015b60405180910390a35050565b30600090815261012d602052604081205482168214610aff565b6113266201000061194e565b6113625760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b610cc184848484611f9b565b600054610100900460ff1680611387575060005460ff16155b6113ea5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff1615801561140c576000805461ffff19166101011790555b61141683836120ad565b8015611428576000805461ff00191690555b505050565b6114396204000061194e565b6114755760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b805161148990610194906020840190613103565b50336001600160a01b03167f1ca91f64ead03abb06ea28975dfbf18044ac06f9fa1cb62a54ccc905df1028ed826040516114c39190613910565b60405180910390a250565b6111cb33838361218b565b600061150c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b61151e600160ff1b61194e565b61155a5760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b6001600160a01b038216600081815261012d60209081526040808320805433808652838620549587905260001980891887161895881690911794909416908190558151868152928301527f5a10526456f5116c0b7b80582c217d666243fd51b6a2d92c8011e601c2462e5f91016112f4565b6001600160a01b038216600090815261012d6020526040812054821682145b9392505050565b610b563082611511565b610194805461160a906139d5565b80601f0160208091040260200160405190810160405280929190818152602001828054611636906139d5565b80156116835780601f1061165857610100808354040283529160200191611683565b820191906000526020600020905b81548152906001019060200180831161166657829003601f168201915b505050505081565b6001600160a01b0385163314806116a757506116a78533610925565b6117195760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f76656400000000000000000000000000000000000000000000006064820152608401610aa9565b610da48585858585612280565b6117326220000061194e565b61176e5760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b610192546040516001600160a01b0380841692169033907fb9312e2100469bd44e3f762c248f4dcc8d7788906fabf34f79db45920c37e26990600090a4610192805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6117e76202000061194e565b611943576001600160a01b0383163314801561180857506118086008611300565b8061182c57506001600160a01b038316331480159061182c575061182c6010611300565b6001600160a01b0384163314611877576040518060400160405280601c81526020017f6275726e73206f6e20626568616c66206172652064697361626c6564000000008152506118ae565b6040518060400160405280601281526020017f6275726e73206172652064697361626c656400000000000000000000000000008152505b906118cc5760405162461bcd60e51b8152600401610aa99190613910565b506001600160a01b03831633148061190757506001600160a01b038316600090815260666020908152604080832033845290915290205460ff165b6119435760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b611428838383612422565b6000610aff33836115cc565b6000610aff8261259f565b80516111cb906067906020840190613103565b606060678054611987906139d5565b80601f01602080910402602001604051908101604052809291908181526020018280546119b3906139d5565b8015611a005780601f106119d557610100808354040283529160200191611a00565b820191906000526020600020905b8154815290600101906020018083116119e357829003601f168201915b50505050509050919050565b606081611a305750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611a5a5780611a4481613a3d565b9150611a539050600a8361395f565b9150611a34565b60008167ffffffffffffffff811115611a7557611a75613aae565b6040519080825280601f01601f191660200182016040528015611a9f576020820181803683370190505b5090505b8415611b2257611ab4600183613992565b9150611ac1600a86613a58565b611acc906030613947565b60f81b818381518110611ae157611ae1613a98565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611b1b600a8661395f565b9450611aa3565b949350505050565b8151835114611ba15760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610aa9565b6001600160a01b038416611c055760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610aa9565b33611c148187878787876125ef565b60005b8451811015611d40576000858281518110611c3457611c34613a98565b602002602001015190506000858381518110611c5257611c52613a98565b60209081029190910181015160008481526065835260408082206001600160a01b038e168352909352919091205490915081811015611ce65760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610aa9565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611d25908490613947565b9250508190555050505080611d3990613a3d565b9050611c17565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611d909291906138eb565b60405180910390a4611da6818787878787612701565b505050505050565b611dbb600160fe1b61194e565b610b565760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b6000611e2a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611e35846128b6565b600083511180611e425750815b15611e5357611e518484612978565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff16610da457805460ff191660011781556040516001600160a01b0383166024820152611ee790869060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16631b2ce7f360e11b179052612978565b50805460ff191681557f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b03838116911614611f925760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201527f75727468657220757067726164657300000000000000000000000000000000006064820152608401610aa9565b610da485612a7a565b6001600160a01b038416611ffb5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610aa9565b3361201b8160008761200c88612aba565b61201588612aba565b876125ef565b60008481526065602090815260408083206001600160a01b03891684529091528120805485929061204d908490613947565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610da481600087878787612b05565b600054610100900460ff16806120c6575060005460ff16155b6121295760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff1615801561214b576000805461ffff19166101011790555b6121558383612c10565b610192805473ffffffffffffffffffffffffffffffffffffffff1916331790558015611428576000805461ff0019169055505050565b816001600160a01b0316836001600160a01b031614156122135760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610aa9565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166122e45760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610aa9565b336122f481878761200c88612aba565b60008481526065602090815260408083206001600160a01b038a1684529091529020548381101561237a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610aa9565b60008581526065602090815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906123b9908490613947565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612419828888888888612b05565b50505050505050565b6001600160a01b0383166124845760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610aa9565b336124b38185600061249587612aba565b61249e87612aba565b604051806020016040528060008152506125ef565b60008381526065602090815260408083206001600160a01b0388168452909152902054828110156125325760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610aa9565b60008481526065602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b60006001600160e01b03198216636cdb3d1360e11b14806125d057506001600160e01b031982166303a24d0760e21b145b80610aff57506301ffc9a760e01b6001600160e01b0319831614610aff565b6125fd868686868686612cc8565b6001600160a01b038516158061261a57506001600160a01b038416155b8061263d57506001600160a01b0385163314801561263d575061263d6001611300565b8061266157506001600160a01b038516331480159061266157506126616002611300565b6001600160a01b03861633146126ac576040518060400160405280602081526020017f7472616e7366657273206f6e20626568616c66206172652064697361626c65648152506126e3565b6040518060400160405280601681526020017f7472616e7366657273206172652064697361626c6564000000000000000000008152505b906124195760405162461bcd60e51b8152600401610aa99190613910565b6001600160a01b0384163b15611da65760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906127459089908990889088908890600401613837565b602060405180830381600087803b15801561275f57600080fd5b505af192505050801561278f575060408051601f3d908101601f1916820190925261278c918101906136b3565b60015b6128455761279b613ac4565b806308c379a014156127d557506127b0613ae0565b806127bb57506127d7565b8060405162461bcd60e51b8152600401610aa99190613910565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610aa9565b6001600160e01b0319811663bc197c8160e01b146124195760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610aa9565b803b61292a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610aa9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6060823b6129ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610aa9565b600080846001600160a01b031684604051612a0991906137ec565b600060405180830381855af49150503d8060008114612a44576040519150601f19603f3d011682016040523d82523d6000602084013e612a49565b606091505b5091509150612a718282604051806060016040528060278152602001613b8f60279139612dd4565b95945050505050565b612a83816128b6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612af457612af4613a98565b602090810291909101015292915050565b6001600160a01b0384163b15611da65760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612b499089908990889088908890600401613895565b602060405180830381600087803b158015612b6357600080fd5b505af1925050508015612b93575060408051601f3d908101601f19168201909252612b90918101906136b3565b60015b612b9f5761279b613ac4565b6001600160e01b0319811663f23a6e6160e01b146124195760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610aa9565b600054610100900460ff1680612c29575060005460ff16155b612c8c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff16158015612cae576000805461ffff19166101011790555b612cb783612e0d565b612cbf612ed9565b61141682612f8b565b6001600160a01b038516612d4f5760005b8351811015612d4d57828181518110612cf457612cf4613a98565b602002602001015160976000868481518110612d1257612d12613a98565b602002602001015181526020019081526020016000206000828254612d379190613947565b90915550612d46905081613a3d565b9050612cd9565b505b6001600160a01b038416611da65760005b835181101561241957828181518110612d7b57612d7b613a98565b602002602001015160976000868481518110612d9957612d99613a98565b602002602001015181526020019081526020016000206000828254612dbe9190613992565b90915550612dcd905081613a3d565b9050612d60565b60608315612de35750816115eb565b825115612df35782518084602001fd5b8160405162461bcd60e51b8152600401610aa99190613910565b600054610100900460ff1680612e26575060005460ff16155b612e895760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff16158015612eab576000805461ffff19166101011790555b612eb3612ed9565b612ebb612ed9565b612ec48261305c565b80156111cb576000805461ff00191690555050565b600054610100900460ff1680612ef2575060005460ff16155b612f555760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff16158015612f77576000805461ffff19166101011790555b8015610b56576000805461ff001916905550565b600054610100900460ff1680612fa4575060005460ff16155b6130075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff16158015613029576000805461ffff19166101011790555b6001600160a01b038216600090815261012d60205260409020600019905580156111cb576000805461ff00191690555050565b600054610100900460ff1680613075575060005460ff16155b6130d85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff161580156130fa576000805461ffff19166101011790555b612ec482611965565b82805461310f906139d5565b90600052602060002090601f0160209004810192826131315760008555613177565b82601f1061314a57805160ff1916838001178555613177565b82800160010185558215613177579182015b8281111561317757825182559160200191906001019061315c565b50613183929150613187565b5090565b5b808211156131835760008155600101613188565b80356001600160a01b03811681146131b357600080fd5b919050565b600082601f8301126131c957600080fd5b813560206131d682613923565b6040516131e38282613a10565b8381528281019150858301600585901b8701840188101561320357600080fd5b60005b8581101561322257813584529284019290840190600101613206565b5090979650505050505050565b600082601f83011261324057600080fd5b813567ffffffffffffffff81111561325a5761325a613aae565b604051613271601f8301601f191660200182613a10565b81815284602083860101111561328657600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156132b557600080fd5b6115eb8261319c565b600080604083850312156132d157600080fd5b6132da8361319c565b91506132e86020840161319c565b90509250929050565b600080600080600060a0868803121561330957600080fd5b6133128661319c565b94506133206020870161319c565b9350604086013567ffffffffffffffff8082111561333d57600080fd5b61334989838a016131b8565b9450606088013591508082111561335f57600080fd5b61336b89838a016131b8565b9350608088013591508082111561338157600080fd5b5061338e8882890161322f565b9150509295509295909350565b6000806000606084860312156133b057600080fd5b6133b98461319c565b92506133c76020850161319c565b9150604084013590509250925092565b600080600080600060a086880312156133ef57600080fd5b6133f88661319c565b94506134066020870161319c565b93506040860135925060608601359150608086013567ffffffffffffffff81111561343057600080fd5b61338e8882890161322f565b6000806040838503121561344f57600080fd5b6134588361319c565b9150602083013561346881613b6a565b809150509250929050565b6000806040838503121561348657600080fd5b61348f8361319c565b9150602083013567ffffffffffffffff8111156134ab57600080fd5b6134b78582860161322f565b9150509250929050565b600080604083850312156134d457600080fd5b6134dd8361319c565b9150602083013561ffff8116811461346857600080fd5b6000806040838503121561350757600080fd5b6135108361319c565b946020939093013593505050565b60008060006060848603121561353357600080fd5b61353c8461319c565b95602085013595506040909401359392505050565b6000806000806080858703121561356757600080fd5b6135708561319c565b93506020850135925060408501359150606085013567ffffffffffffffff81111561359a57600080fd5b6135a68782880161322f565b91505092959194509250565b600080604083850312156135c557600080fd5b823567ffffffffffffffff808211156135dd57600080fd5b818501915085601f8301126135f157600080fd5b813560206135fe82613923565b60405161360b8282613a10565b8381528281019150858301600585901b870184018b101561362b57600080fd5b600096505b84871015613655576136418161319c565b835260019690960195918301918301613630565b509650508601359250508082111561366c57600080fd5b506134b7858286016131b8565b60006020828403121561368b57600080fd5b81516115eb81613b6a565b6000602082840312156136a857600080fd5b81356115eb81613b78565b6000602082840312156136c557600080fd5b81516115eb81613b78565b6000602082840312156136e257600080fd5b813567ffffffffffffffff8111156136f957600080fd5b611b228482850161322f565b6000806040838503121561371857600080fd5b823567ffffffffffffffff81111561372f57600080fd5b61373b8582860161322f565b9250506132e86020840161319c565b60006020828403121561375c57600080fd5b5035919050565b6000806040838503121561377657600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b838110156137b557815187529582019590820190600101613799565b509495945050505050565b600081518084526137d88160208601602086016139a9565b601f01601f19169290920160200192915050565b600082516137fe8184602087016139a9565b9190910192915050565b6000835161381a8184602088016139a9565b83519083019061382e8183602088016139a9565b01949350505050565b60006001600160a01b03808816835280871660208401525060a0604083015261386360a0830186613785565b82810360608401526138758186613785565b9050828103608084015261388981856137c0565b98975050505050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526138cd60a08301846137c0565b979650505050505050565b6020815260006115eb6020830184613785565b6040815260006138fe6040830185613785565b8281036020840152612a718185613785565b6020815260006115eb60208301846137c0565b600067ffffffffffffffff82111561393d5761393d613aae565b5060051b60200190565b6000821982111561395a5761395a613a6c565b500190565b60008261396e5761396e613a82565b500490565b600081600019048311821515161561398d5761398d613a6c565b500290565b6000828210156139a4576139a4613a6c565b500390565b60005b838110156139c45781810151838201526020016139ac565b83811115610cc15750506000910152565b600181811c908216806139e957607f821691505b60208210811415613a0a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff81118282101715613a3657613a36613aae565b6040525050565b6000600019821415613a5157613a51613a6c565b5060010190565b600082613a6757613a67613a82565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115613add5760046000803e5060005160e01c5b90565b600060443d1015613aee5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715613b1e57505050505090565b8285019150815181811115613b365750505050505090565b843d8701016020828501011115613b505750505050505090565b613b5f60208286010187613a10565b509095945050505050565b8015158114610b5657600080fd5b6001600160e01b031981168114610b5657600080fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000807000a
Deployed Bytecode
0x60806040526004361061031d5760003560e01c80638da5cb5b116101a5578063c0d6568d116100ec578063e985e9c511610095578063f5298aca1161006f578063f5298aca14610993578063f63c2f82146109b3578063f822d5aa146109c8578063fcc2c07814610a0f57600080fd5b8063e985e9c51461090a578063f242432a14610953578063f2fde38b1461097357600080fd5b8063d5bb7f67116100c6578063d5bb7f67146108be578063e62cac76146108de578063e8a3d485146108f557600080fd5b8063c0d6568d14610872578063c688d69314610887578063cc2da7ff146108a757600080fd5b8063aaf10f421161014e578063ae682e2e11610128578063ae682e2e14610816578063b29a2f441461082e578063bd85b0391461084557600080fd5b8063aaf10f42146107c9578063ae5b102e146107de578063ae60bda4146107fe57600080fd5b806395d89b411161017f57806395d89b411461073f5780639fbc871314610788578063a22cb465146107a957600080fd5b80638da5cb5b146106d15780638f6fba8c1461070a578063938e3d7b1461071f57600080fd5b80632f54bf6e11610269578063725f3626116102125780637ab4339d116101ec5780637ab4339d146106645780638a71bb2d146106845780638d4e57e6146106ba57600080fd5b8063725f3626146105f6578063731133e91461061657806374d5e1001461063657600080fd5b80634f1ef286116102435780634f1ef286146105945780634f558e79146105a757806372504a24146105d657600080fd5b80632f54bf6e146105175780633659cfe6146105475780634e1273f41461056757600080fd5b80631a0b04ea116102cb5780632b521416116102a55780632b521416146104bd5780632d17f8bc146104e05780632eb2c2d6146104f757600080fd5b80631a0b04ea14610449578063243feb991461045e5780632a55205a1461047e57600080fd5b806306fdde03116102fc57806306fdde03146103a75780630e89341c146103fd57806314b7b4e11461041d57600080fd5b8062fdd58e1461032257806301ffc9a71461035557806302fe530514610385575b600080fd5b34801561032e57600080fd5b5061034261033d3660046134f4565b610a2f565b6040519081526020015b60405180910390f35b34801561036157600080fd5b50610375610370366004613696565b610ada565b604051901515815260200161034c565b34801561039157600080fd5b506103a56103a03660046136d0565b610b05565b005b3480156103b357600080fd5b506103f06040518060400160405280601381526020017f496c6c757669756d2050726f6d6f204e4654730000000000000000000000000081525081565b60405161034c9190613910565b34801561040957600080fd5b506103f061041836600461374a565b610b59565b34801561042957600080fd5b506104346204000081565b60405163ffffffff909116815260200161034c565b34801561045557600080fd5b50610434600881565b34801561046a57600080fd5b506103a561047936600461339b565b610bf7565b34801561048a57600080fd5b5061049e610499366004613763565b610cc7565b604080516001600160a01b03909316835260208301919091520161034c565b3480156104c957600080fd5b5030600090815261012d6020526040902054610342565b3480156104ec57600080fd5b506104346208000081565b34801561050357600080fd5b506103a56105123660046132f1565b610d09565b34801561052357600080fd5b506103756105323660046132a3565b610192546001600160a01b0391821691161490565b34801561055357600080fd5b506103a56105623660046132a3565b610dab565b34801561057357600080fd5b506105876105823660046135b2565b610f24565b60405161034c91906138d8565b6103a56105a2366004613473565b611062565b3480156105b357600080fd5b506103756105c236600461374a565b600090815260976020526040902054151590565b3480156105e257600080fd5b506103a56105f13660046134c1565b6111cf565b34801561060257600080fd5b5061037561061136600461374a565b611300565b34801561062257600080fd5b506103a5610631366004613551565b61131a565b34801561064257600080fd5b506103426106513660046132a3565b61012d6020526000908152604090205481565b34801561067057600080fd5b506103a561067f366004613705565b61136e565b34801561069057600080fd5b50610193546106a790600160a01b900461ffff1681565b60405161ffff909116815260200161034c565b3480156106c657600080fd5b506104346201000081565b3480156106dd57600080fd5b50610192546106f2906001600160a01b031681565b6040516001600160a01b03909116815260200161034c565b34801561071657600080fd5b50610434600281565b34801561072b57600080fd5b506103a561073a3660046136d0565b61142d565b34801561074b57600080fd5b506103f06040518060400160405280600781526020017f494c562d4e46540000000000000000000000000000000000000000000000000081525081565b34801561079457600080fd5b50610193546106f2906001600160a01b031681565b3480156107b557600080fd5b506103a56107c436600461343c565b6114ce565b3480156107d557600080fd5b506106f26114d9565b3480156107ea57600080fd5b506103a56107f93660046134f4565b611511565b34801561080a57600080fd5b50610342600160fe1b81565b34801561082257600080fd5b50610342600160ff1b81565b34801561083a57600080fd5b506104346210000081565b34801561085157600080fd5b5061034261086036600461374a565b60009081526097602052604090205490565b34801561087e57600080fd5b50610434600181565b34801561089357600080fd5b506103756108a23660046134f4565b6115cc565b3480156108b357600080fd5b506104346220000081565b3480156108ca57600080fd5b506103a56108d936600461374a565b6115f2565b3480156108ea57600080fd5b506104346202000081565b34801561090157600080fd5b506103f06115fc565b34801561091657600080fd5b506103756109253660046132be565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b34801561095f57600080fd5b506103a561096e3660046133d7565b61168b565b34801561097f57600080fd5b506103a561098e3660046132a3565b611726565b34801561099f57600080fd5b506103a56109ae36600461351e565b6117db565b3480156109bf57600080fd5b50610434601081565b3480156109d457600080fd5b506103426109e336600461351e565b6001600160a01b0392909216600090815261012d60205260409020546000198084188216189216171690565b348015610a1b57600080fd5b50610375610a2a36600461374a565b61194e565b60006001600160a01b038316610ab25760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526065602090815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b0319821663152a902d60e11b1480610aff5750610aff8261195a565b92915050565b610b116204000061194e565b610b4d5760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b610b5681611965565b50565b600081815260976020526040902054606090610bb75760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610aa9565b6000610bc36000611978565b905080610bcf84611a0c565b604051602001610be0929190613808565b604051602081830303815290604052915050919050565b610c036208000061194e565b610c3f5760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b158015610c8957600080fd5b505af1158015610c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc19190613679565b50505050565b6101935460009081906001600160a01b0381169061271090610cf490600160a01b900461ffff1686613973565b610cfe919061395f565b915091509250929050565b6001600160a01b038516331480610d255750610d258533610925565b610d975760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f76656400000000000000000000000000006064820152608401610aa9565b610da48585858585611b2a565b5050505050565b306001600160a01b037f000000000000000000000000b901614d588ef8db45045ffbb2145e1c36cbf8b9161415610e395760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610aa9565b7f000000000000000000000000b901614d588ef8db45045ffbb2145e1c36cbf8b96001600160a01b0316610e947f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614610eff5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608401610aa9565b610f0881611dae565b60408051600080825260208201909252610b5691839190611df7565b60608151835114610f9d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610aa9565b6000835167ffffffffffffffff811115610fb957610fb9613aae565b604051908082528060200260200182016040528015610fe2578160200160208202803683370190505b50905060005b845181101561105a5761102d85828151811061100657611006613a98565b602002602001015185838151811061102057611020613a98565b6020026020010151610a2f565b82828151811061103f5761103f613a98565b602090810291909101015261105381613a3d565b9050610fe8565b509392505050565b306001600160a01b037f000000000000000000000000b901614d588ef8db45045ffbb2145e1c36cbf8b91614156110f05760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610aa9565b7f000000000000000000000000b901614d588ef8db45045ffbb2145e1c36cbf8b96001600160a01b031661114b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146111b65760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608401610aa9565b6111bf82611dae565b6111cb82826001611df7565b5050565b6111db6210000061194e565b6112175760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b6001600160a01b038216151580611230575061ffff8116155b61127c5760405162461bcd60e51b815260206004820152601060248201527f696e76616c6964207265636569766572000000000000000000000000000000006044820152606401610aa9565b61019380546001600160a01b0384167fffffffffffffffffffff000000000000000000000000000000000000000000009091168117600160a01b61ffff8516908102919091179092556040519182529033907f9ca088b6b695032bcd5d1fa450e8fa2773391294f09e3710ace940c4ae8cffac906020015b60405180910390a35050565b30600090815261012d602052604081205482168214610aff565b6113266201000061194e565b6113625760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b610cc184848484611f9b565b600054610100900460ff1680611387575060005460ff16155b6113ea5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff1615801561140c576000805461ffff19166101011790555b61141683836120ad565b8015611428576000805461ff00191690555b505050565b6114396204000061194e565b6114755760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b805161148990610194906020840190613103565b50336001600160a01b03167f1ca91f64ead03abb06ea28975dfbf18044ac06f9fa1cb62a54ccc905df1028ed826040516114c39190613910565b60405180910390a250565b6111cb33838361218b565b600061150c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b61151e600160ff1b61194e565b61155a5760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b6001600160a01b038216600081815261012d60209081526040808320805433808652838620549587905260001980891887161895881690911794909416908190558151868152928301527f5a10526456f5116c0b7b80582c217d666243fd51b6a2d92c8011e601c2462e5f91016112f4565b6001600160a01b038216600090815261012d6020526040812054821682145b9392505050565b610b563082611511565b610194805461160a906139d5565b80601f0160208091040260200160405190810160405280929190818152602001828054611636906139d5565b80156116835780601f1061165857610100808354040283529160200191611683565b820191906000526020600020905b81548152906001019060200180831161166657829003601f168201915b505050505081565b6001600160a01b0385163314806116a757506116a78533610925565b6117195760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f76656400000000000000000000000000000000000000000000006064820152608401610aa9565b610da48585858585612280565b6117326220000061194e565b61176e5760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b610192546040516001600160a01b0380841692169033907fb9312e2100469bd44e3f762c248f4dcc8d7788906fabf34f79db45920c37e26990600090a4610192805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6117e76202000061194e565b611943576001600160a01b0383163314801561180857506118086008611300565b8061182c57506001600160a01b038316331480159061182c575061182c6010611300565b6001600160a01b0384163314611877576040518060400160405280601c81526020017f6275726e73206f6e20626568616c66206172652064697361626c6564000000008152506118ae565b6040518060400160405280601281526020017f6275726e73206172652064697361626c656400000000000000000000000000008152505b906118cc5760405162461bcd60e51b8152600401610aa99190613910565b506001600160a01b03831633148061190757506001600160a01b038316600090815260666020908152604080832033845290915290205460ff165b6119435760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b611428838383612422565b6000610aff33836115cc565b6000610aff8261259f565b80516111cb906067906020840190613103565b606060678054611987906139d5565b80601f01602080910402602001604051908101604052809291908181526020018280546119b3906139d5565b8015611a005780601f106119d557610100808354040283529160200191611a00565b820191906000526020600020905b8154815290600101906020018083116119e357829003601f168201915b50505050509050919050565b606081611a305750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611a5a5780611a4481613a3d565b9150611a539050600a8361395f565b9150611a34565b60008167ffffffffffffffff811115611a7557611a75613aae565b6040519080825280601f01601f191660200182016040528015611a9f576020820181803683370190505b5090505b8415611b2257611ab4600183613992565b9150611ac1600a86613a58565b611acc906030613947565b60f81b818381518110611ae157611ae1613a98565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611b1b600a8661395f565b9450611aa3565b949350505050565b8151835114611ba15760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610aa9565b6001600160a01b038416611c055760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610aa9565b33611c148187878787876125ef565b60005b8451811015611d40576000858281518110611c3457611c34613a98565b602002602001015190506000858381518110611c5257611c52613a98565b60209081029190910181015160008481526065835260408082206001600160a01b038e168352909352919091205490915081811015611ce65760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610aa9565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611d25908490613947565b9250508190555050505080611d3990613a3d565b9050611c17565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611d909291906138eb565b60405180910390a4611da6818787878787612701565b505050505050565b611dbb600160fe1b61194e565b610b565760405162461bcd60e51b815260206004820152600d60248201526c1858d8d95cdcc819195b9a5959609a1b6044820152606401610aa9565b6000611e2a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611e35846128b6565b600083511180611e425750815b15611e5357611e518484612978565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff16610da457805460ff191660011781556040516001600160a01b0383166024820152611ee790869060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16631b2ce7f360e11b179052612978565b50805460ff191681557f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b03838116911614611f925760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201527f75727468657220757067726164657300000000000000000000000000000000006064820152608401610aa9565b610da485612a7a565b6001600160a01b038416611ffb5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610aa9565b3361201b8160008761200c88612aba565b61201588612aba565b876125ef565b60008481526065602090815260408083206001600160a01b03891684529091528120805485929061204d908490613947565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610da481600087878787612b05565b600054610100900460ff16806120c6575060005460ff16155b6121295760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff1615801561214b576000805461ffff19166101011790555b6121558383612c10565b610192805473ffffffffffffffffffffffffffffffffffffffff1916331790558015611428576000805461ff0019169055505050565b816001600160a01b0316836001600160a01b031614156122135760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610aa9565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166122e45760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608401610aa9565b336122f481878761200c88612aba565b60008481526065602090815260408083206001600160a01b038a1684529091529020548381101561237a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608401610aa9565b60008581526065602090815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906123b9908490613947565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612419828888888888612b05565b50505050505050565b6001600160a01b0383166124845760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610aa9565b336124b38185600061249587612aba565b61249e87612aba565b604051806020016040528060008152506125ef565b60008381526065602090815260408083206001600160a01b0388168452909152902054828110156125325760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610aa9565b60008481526065602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b60006001600160e01b03198216636cdb3d1360e11b14806125d057506001600160e01b031982166303a24d0760e21b145b80610aff57506301ffc9a760e01b6001600160e01b0319831614610aff565b6125fd868686868686612cc8565b6001600160a01b038516158061261a57506001600160a01b038416155b8061263d57506001600160a01b0385163314801561263d575061263d6001611300565b8061266157506001600160a01b038516331480159061266157506126616002611300565b6001600160a01b03861633146126ac576040518060400160405280602081526020017f7472616e7366657273206f6e20626568616c66206172652064697361626c65648152506126e3565b6040518060400160405280601681526020017f7472616e7366657273206172652064697361626c6564000000000000000000008152505b906124195760405162461bcd60e51b8152600401610aa99190613910565b6001600160a01b0384163b15611da65760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906127459089908990889088908890600401613837565b602060405180830381600087803b15801561275f57600080fd5b505af192505050801561278f575060408051601f3d908101601f1916820190925261278c918101906136b3565b60015b6128455761279b613ac4565b806308c379a014156127d557506127b0613ae0565b806127bb57506127d7565b8060405162461bcd60e51b8152600401610aa99190613910565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610aa9565b6001600160e01b0319811663bc197c8160e01b146124195760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610aa9565b803b61292a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610aa9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6060823b6129ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610aa9565b600080846001600160a01b031684604051612a0991906137ec565b600060405180830381855af49150503d8060008114612a44576040519150601f19603f3d011682016040523d82523d6000602084013e612a49565b606091505b5091509150612a718282604051806060016040528060278152602001613b8f60279139612dd4565b95945050505050565b612a83816128b6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612af457612af4613a98565b602090810291909101015292915050565b6001600160a01b0384163b15611da65760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612b499089908990889088908890600401613895565b602060405180830381600087803b158015612b6357600080fd5b505af1925050508015612b93575060408051601f3d908101601f19168201909252612b90918101906136b3565b60015b612b9f5761279b613ac4565b6001600160e01b0319811663f23a6e6160e01b146124195760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b6064820152608401610aa9565b600054610100900460ff1680612c29575060005460ff16155b612c8c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff16158015612cae576000805461ffff19166101011790555b612cb783612e0d565b612cbf612ed9565b61141682612f8b565b6001600160a01b038516612d4f5760005b8351811015612d4d57828181518110612cf457612cf4613a98565b602002602001015160976000868481518110612d1257612d12613a98565b602002602001015181526020019081526020016000206000828254612d379190613947565b90915550612d46905081613a3d565b9050612cd9565b505b6001600160a01b038416611da65760005b835181101561241957828181518110612d7b57612d7b613a98565b602002602001015160976000868481518110612d9957612d99613a98565b602002602001015181526020019081526020016000206000828254612dbe9190613992565b90915550612dcd905081613a3d565b9050612d60565b60608315612de35750816115eb565b825115612df35782518084602001fd5b8160405162461bcd60e51b8152600401610aa99190613910565b600054610100900460ff1680612e26575060005460ff16155b612e895760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff16158015612eab576000805461ffff19166101011790555b612eb3612ed9565b612ebb612ed9565b612ec48261305c565b80156111cb576000805461ff00191690555050565b600054610100900460ff1680612ef2575060005460ff16155b612f555760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff16158015612f77576000805461ffff19166101011790555b8015610b56576000805461ff001916905550565b600054610100900460ff1680612fa4575060005460ff16155b6130075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff16158015613029576000805461ffff19166101011790555b6001600160a01b038216600090815261012d60205260409020600019905580156111cb576000805461ff00191690555050565b600054610100900460ff1680613075575060005460ff16155b6130d85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610aa9565b600054610100900460ff161580156130fa576000805461ffff19166101011790555b612ec482611965565b82805461310f906139d5565b90600052602060002090601f0160209004810192826131315760008555613177565b82601f1061314a57805160ff1916838001178555613177565b82800160010185558215613177579182015b8281111561317757825182559160200191906001019061315c565b50613183929150613187565b5090565b5b808211156131835760008155600101613188565b80356001600160a01b03811681146131b357600080fd5b919050565b600082601f8301126131c957600080fd5b813560206131d682613923565b6040516131e38282613a10565b8381528281019150858301600585901b8701840188101561320357600080fd5b60005b8581101561322257813584529284019290840190600101613206565b5090979650505050505050565b600082601f83011261324057600080fd5b813567ffffffffffffffff81111561325a5761325a613aae565b604051613271601f8301601f191660200182613a10565b81815284602083860101111561328657600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156132b557600080fd5b6115eb8261319c565b600080604083850312156132d157600080fd5b6132da8361319c565b91506132e86020840161319c565b90509250929050565b600080600080600060a0868803121561330957600080fd5b6133128661319c565b94506133206020870161319c565b9350604086013567ffffffffffffffff8082111561333d57600080fd5b61334989838a016131b8565b9450606088013591508082111561335f57600080fd5b61336b89838a016131b8565b9350608088013591508082111561338157600080fd5b5061338e8882890161322f565b9150509295509295909350565b6000806000606084860312156133b057600080fd5b6133b98461319c565b92506133c76020850161319c565b9150604084013590509250925092565b600080600080600060a086880312156133ef57600080fd5b6133f88661319c565b94506134066020870161319c565b93506040860135925060608601359150608086013567ffffffffffffffff81111561343057600080fd5b61338e8882890161322f565b6000806040838503121561344f57600080fd5b6134588361319c565b9150602083013561346881613b6a565b809150509250929050565b6000806040838503121561348657600080fd5b61348f8361319c565b9150602083013567ffffffffffffffff8111156134ab57600080fd5b6134b78582860161322f565b9150509250929050565b600080604083850312156134d457600080fd5b6134dd8361319c565b9150602083013561ffff8116811461346857600080fd5b6000806040838503121561350757600080fd5b6135108361319c565b946020939093013593505050565b60008060006060848603121561353357600080fd5b61353c8461319c565b95602085013595506040909401359392505050565b6000806000806080858703121561356757600080fd5b6135708561319c565b93506020850135925060408501359150606085013567ffffffffffffffff81111561359a57600080fd5b6135a68782880161322f565b91505092959194509250565b600080604083850312156135c557600080fd5b823567ffffffffffffffff808211156135dd57600080fd5b818501915085601f8301126135f157600080fd5b813560206135fe82613923565b60405161360b8282613a10565b8381528281019150858301600585901b870184018b101561362b57600080fd5b600096505b84871015613655576136418161319c565b835260019690960195918301918301613630565b509650508601359250508082111561366c57600080fd5b506134b7858286016131b8565b60006020828403121561368b57600080fd5b81516115eb81613b6a565b6000602082840312156136a857600080fd5b81356115eb81613b78565b6000602082840312156136c557600080fd5b81516115eb81613b78565b6000602082840312156136e257600080fd5b813567ffffffffffffffff8111156136f957600080fd5b611b228482850161322f565b6000806040838503121561371857600080fd5b823567ffffffffffffffff81111561372f57600080fd5b61373b8582860161322f565b9250506132e86020840161319c565b60006020828403121561375c57600080fd5b5035919050565b6000806040838503121561377657600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b838110156137b557815187529582019590820190600101613799565b509495945050505050565b600081518084526137d88160208601602086016139a9565b601f01601f19169290920160200192915050565b600082516137fe8184602087016139a9565b9190910192915050565b6000835161381a8184602088016139a9565b83519083019061382e8183602088016139a9565b01949350505050565b60006001600160a01b03808816835280871660208401525060a0604083015261386360a0830186613785565b82810360608401526138758186613785565b9050828103608084015261388981856137c0565b98975050505050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526138cd60a08301846137c0565b979650505050505050565b6020815260006115eb6020830184613785565b6040815260006138fe6040830185613785565b8281036020840152612a718185613785565b6020815260006115eb60208301846137c0565b600067ffffffffffffffff82111561393d5761393d613aae565b5060051b60200190565b6000821982111561395a5761395a613a6c565b500190565b60008261396e5761396e613a82565b500490565b600081600019048311821515161561398d5761398d613a6c565b500290565b6000828210156139a4576139a4613a6c565b500390565b60005b838110156139c45781810151838201526020016139ac565b83811115610cc15750506000910152565b600181811c908216806139e957607f821691505b60208210811415613a0a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff81118282101715613a3657613a36613aae565b6040525050565b6000600019821415613a5157613a51613a6c565b5060010190565b600082613a6757613a67613a82565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115613add5760046000803e5060005160e01c5b90565b600060443d1015613aee5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715613b1e57505050505090565b8285019150815181811115613b365750505050505090565b843d8701016020828501011115613b505750505050505090565b613b5f60208286010187613a10565b509095945050505050565b8015158114610b5657600080fd5b6001600160e01b031981168114610b5657600080fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000807000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 29 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.