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
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
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 Source Code Verified (Exact Match)
Contract Name:
Tokens
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {Clones} from "openzeppelin-contracts/proxy/Clones.sol"; import {Emint1155} from "./tokens/Emint1155.sol"; import {Controllable} from "./abstract/Controllable.sol"; import {Pausable} from "./abstract/Pausable.sol"; import {IControllable} from "./interfaces/IControllable.sol"; import {IPausable} from "./interfaces/IPausable.sol"; import {ITokens} from "./interfaces/ITokens.sol"; import {IMetadata} from "./interfaces/IMetadata.sol"; import {IRoyalties} from "./interfaces/IRoyalties.sol"; import {IEmint1155} from "./interfaces/IEmint1155.sol"; contract Tokens is ITokens, Controllable, Pausable { string public constant NAME = "Tokens"; string public constant VERSION = "0.0.1"; address public minter; address public deployer; address public metadata; address public royalties; address public emint1155; // tokenId => Emint1155 token address mapping(uint256 => address) public tokens; constructor(address _controller) Controllable(_controller) { Emint1155 tokenImplementation = new Emint1155(); emint1155 = address(tokenImplementation); } modifier onlyMinter() { if (msg.sender != minter) { revert Forbidden(); } _; } modifier onlyDeployer() { if (msg.sender != deployer) { revert Forbidden(); } _; } function deploy() external override onlyDeployer whenNotPaused returns (address _token) { _token = Clones.clone(emint1155); IEmint1155(_token).initialize(address(this)); } function register(uint256 id, address _token) external override onlyDeployer whenNotPaused { tokens[id] = _token; } function updateTokenImplementation(address implementation) external override onlyController { emit UpdateTokenImplementation(emint1155, implementation); emint1155 = implementation; } function token(uint256 id) public view override returns (IEmint1155) { return IEmint1155(tokens[id]); } /// @inheritdoc ITokens function mint(address to, uint256 id, uint256 amount, bytes memory data) external override onlyMinter whenNotPaused { token(id).mint(to, id, amount, data); } /// @inheritdoc IPausable function pause() external override onlyController { _pause(); } /// @inheritdoc IPausable function unpause() external override onlyController { _unpause(); } /// @inheritdoc IControllable function setDependency(bytes32 _name, address _contract) external override (Controllable, IControllable) onlyController { if (_contract == address(0)) revert ZeroAddress(); else if (_name == "minter") _setMinter(_contract); else if (_name == "deployer") _setDeployer(_contract); else if (_name == "metadata") _setMetadata(_contract); else if (_name == "royalties") _setRoyalties(_contract); else revert InvalidDependency(_name); } function _setMinter(address _minter) internal { emit SetMinter(minter, _minter); minter = _minter; } function _setDeployer(address _deployer) internal { emit SetDeployer(deployer, _deployer); deployer = _deployer; } function _setMetadata(address _metadata) internal { emit SetMetadata(metadata, _metadata); metadata = _metadata; } function _setRoyalties(address _royalties) internal { emit SetRoyalties(royalties, _royalties); royalties = _royalties; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/Clones.sol) pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create(0, 0x09, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create2(0, 0x09, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(add(ptr, 0x38), deployer) mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff) mstore(add(ptr, 0x14), implementation) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73) mstore(add(ptr, 0x58), salt) mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37)) predicted := keccak256(add(ptr, 0x43), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of 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. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * 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 prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 onlyInitializing { __ERC1155_init_unchained(uri_); } function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC1155Upgradeable).interfaceId || interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); 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 token owner or 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: caller is not token owner or 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(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, 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); _afterTokenTransfer(operator, from, to, ids, amounts, data); _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); _afterTokenTransfer(operator, from, to, ids, amounts, data); _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(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * 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 _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); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * 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(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); 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); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * 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); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {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 `ids` and `amounts` 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 {} /** * @dev Hook that is called after 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 _afterTokenTransfer( 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; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[47] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.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. * * NOTE: 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. * * NOTE: 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 (last updated v4.7.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 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 (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155BurnableUpgradeable is Initializable, ERC1155Upgradeable { function __ERC1155Burnable_init() internal onlyInitializing { } function __ERC1155Burnable_init_unchained() internal onlyInitializing { } function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner or approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner or approved" ); _burnBatch(account, ids, values); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155Upgradeable.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators(address registrant, address[] calldata operators, bool filtered) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFiltererUpgradeable} from "./OperatorFiltererUpgradeable.sol"; abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); function __DefaultOperatorFilterer_init() internal onlyInitializing { OperatorFiltererUpgradeable.__OperatorFilterer_init(DEFAULT_SUBSCRIPTION, true); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "../IOperatorFilterRegistry.sol"; import {Initializable} from "openzeppelin-contracts-upgradeable/proxy/utils/Initializable.sol"; abstract contract OperatorFiltererUpgradeable is Initializable { error OperatorNotAllowed(address operator); IOperatorFilterRegistry constant operatorFilterRegistry = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); function __OperatorFilterer_init(address subscriptionOrRegistrantToCopy, bool subscribe) internal onlyInitializing { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(operatorFilterRegistry).code.length > 0) { if (!operatorFilterRegistry.isRegistered(address(this))) { if (subscribe) { operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { operatorFilterRegistry.register(address(this)); } } } } } modifier onlyAllowedOperator(address from) virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(operatorFilterRegistry).code.length > 0) { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from == msg.sender) { _; return; } if (!operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)) { revert OperatorNotAllowed(msg.sender); } } _; } modifier onlyAllowedOperatorApproval(address operator) virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(operatorFilterRegistry).code.length > 0) { if (!operatorFilterRegistry.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } _; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IControllable} from "../interfaces/IControllable.sol"; /// @title Controllable - Controller management functions /// @notice An abstract base contract for contracts managed by the Controller. abstract contract Controllable is IControllable { address public controller; modifier onlyController() { if (msg.sender != controller) { revert Forbidden(); } _; } constructor(address _controller) { if (_controller == address(0)) { revert ZeroAddress(); } controller = _controller; } /// @inheritdoc IControllable function setDependency(bytes32 _name, address) external virtual onlyController { revert InvalidDependency(_name); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {Pausable as OZPausable} from "openzeppelin-contracts/security/Pausable.sol"; import {IPausable} from "../interfaces/IPausable.sol"; /// @title Pausable - Pause and unpause functionality /// @notice Wraps OZ Pausable and adds an IPausable interface. abstract contract Pausable is IPausable, OZPausable {}
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IAnnotated { /// @notice Get contract name. /// @return Contract name. function NAME() external returns (string memory); /// @notice Get contract version. /// @return Contract version. function VERSION() external returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface ICommonErrors { /// @notice The provided address is the zero address. error ZeroAddress(); /// @notice The attempted action is not allowed. error Forbidden(); /// @notice The requested entity cannot be found. error NotFound(); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ICommonErrors} from "./ICommonErrors.sol"; interface IControllable is ICommonErrors { /// @notice The dependency with the given `name` is invalid. error InvalidDependency(bytes32 name); /// @notice Get controller address. /// @return Controller address. function controller() external returns (address); /// @notice Set a named dependency to the given contract address. /// @param _name bytes32 name of the dependency to set. /// @param _contract address of the dependency. function setDependency(bytes32 _name, address _contract) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IERC1155MetadataURIUpgradeable} from "openzeppelin-contracts-upgradeable/token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.sol"; import {IERC2981Upgradeable} from "openzeppelin-contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import {IAnnotated} from "./IAnnotated.sol"; import {ICommonErrors} from "./ICommonErrors.sol"; interface IEmint1155 is IERC1155MetadataURIUpgradeable, IERC2981Upgradeable, IAnnotated, ICommonErrors { /// @notice Initialize the cloned Emint1155 token contract. /// @param tokens address of tokens module. function initialize(address tokens) external; /// @notice Get address of metadata module. /// @return address of metadata module. function metadata() external view returns (address); /// @notice Get address of royalties module. /// @return address of royalties module. function royalties() external view returns (address); /// @notice Get address of collection owner. This address has no special /// permissions at the contract level, but will be authorized to manage this /// token's collection on storefronts like OpenSea. /// @return address of collection owner. function owner() external view returns (address); /// @notice Get contract metadata URI. Used by marketplaces like OpenSea to /// retrieve information about the token contract/collection. /// @return URI of contract metadata. function contractURI() external view returns (string memory); /// @notice Mint `amount` tokens with ID `id` to `to` address, passing `data`. /// @param to address of token reciever. /// @param id uint256 token ID. /// @param amount uint256 quantity of tokens to mint. /// @param data bytes of data to pass to ERC1155 mint function. function mint(address to, uint256 id, uint256 amount, bytes memory data) external; /// @notice Batch mint tokens to `to` address, passing `data`. /// @param to address of token reciever. /// @param ids uint256[] array of token IDs. /// @param amounts uint256[] array of quantities to mint. /// @param data bytes of data to pass to ERC1155 mint function. function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) external; /// @notice Burn `amount` of tokens with ID `id` from `account` /// @param account address of token owner. /// @param id uint256 token ID. /// @param amount uint256 quantity of tokens to mint. function burn(address account, uint256 id, uint256 amount) external; /// @notice Batch burn tokens from `account` address. /// @param account address of token owner. /// @param ids uint256[] array of token IDs. /// @param amounts uint256[] array of quantities to burn. function burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IControllable} from "./IControllable.sol"; import {IMetadataResolver} from "./IMetadataResolver.sol"; import {IAnnotated} from "./IAnnotated.sol"; import {ICommonErrors} from "./ICommonErrors.sol"; import {IPausable} from "./IPausable.sol"; interface IMetadata is IMetadataResolver, IPausable, IControllable, IAnnotated { event SetCustomURI(uint256 indexed tokenId, string customURI); event SetCustomResolver(uint256 indexed tokenId, IMetadataResolver customResolver); event SetCollectionOwner(address collection, address owner); event SetCreators(address oldCreators, address newCreators); event SetTokenURIBase(string oldBaseURI, string newBaseURI); event SetContractURIBase(string oldBaseURI, string newBaseURI); event SetDefaultCollectionOwner(address oldOwner, address newOwner); /// @notice Contract metadata URI for the given contract address. /// @param _contract address of contract. /// @return Metadata URI string. function contractURI(address _contract) external view returns (string memory); /// @notice Metadata URI for the given token ID. /// @param tokenId uint256 token ID. /// @return Metadata URI string. function uri(uint256 tokenId) external view returns (string memory); /// @notice Set a custom metadata URI for the given token ID. May only be /// called by `creators` contract. /// @param tokenId uint256 token ID. /// @param customURI string metadata URI. function setCustomURI(uint256 tokenId, string memory customURI) external; /// @notice Set a custom metadata resolver contract for the given token ID. /// May only be called by `creators` contract. /// @param tokenId uint256 token ID. /// @param customResolver IMetadataResolver address of a contract /// implementing IMetadataResolver interface. function setCustomResolver(uint256 tokenId, IMetadataResolver customResolver) external; /// @notice Set the token metadata base URI. Base URI will be concatenated /// with token ID and '.json' to produce a full metadata URI. /// May only be called by `controller` contract. /// @param _tokenURIBase Default URI string. function setTokenURIBase(string memory _tokenURIBase) external; /// @notice Set the contract metadata base URI. Base URI will be concatenated /// with contract address in hex and '.json' to produce a full metadata URI. /// May only be called by `controller` contract. /// @param _contractURIBase Default URI string. function setContractURIBase(string memory _contractURIBase) external; /// @notice Set the default collection owner. Emint1155 tokens will return /// this address as their owner by default. The owner address has no special /// permissions at the contract level, but may manage the collection on /// storefronts like OpenSea. May only be called by `controller` contract. /// @param _owner address of default owner. function setDefaultCollectionOwner(address _owner) external; /// @notice Set the collection owner for a specific collection by address. /// Used to override the default owner if necessary. May only be called by /// `controller` contract. /// @param collection address of token contract. /// @param _owner address of owner. function setCollectionOwner(address collection, address _owner) external; /// @notice Get the owner of a collection by address. /// @param collection address of token contract. /// @return address of owner. function owner(address collection) external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IMetadataResolver { /// @notice Metadata URI for the given token ID. /// @param tokenId uint256 token ID. /// @return Metadata URI string. function uri(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IPausable { /// @notice Pause the contract. function pause() external; /// @notice Unpause the contract. function unpause() external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IAnnotated} from "./IAnnotated.sol"; import {IControllable} from "./IControllable.sol"; import {CustomRoyalty, RoyaltySchedule} from "../structs/Royalty.sol"; interface IRoyalties is IControllable, IAnnotated { error InvalidReceiver(); error InvalidRoyalty(); event SetReceiver(address oldReceiver, address newReceiver); event SetRoyaltySchedule(RoyaltySchedule oldRoyaltySchedule, RoyaltySchedule newRoyaltySchedule); event SetCustomRoyalty(uint256 indexed tokenId, CustomRoyalty customRoyalty); /// @notice Returns how much royalty is owed and to whom, based on a sale /// price that may be denominated in any unit of exchange. The royalty /// amount is denominated and should be paid in the same unit of exchange. /// @param tokenId uint256 Token ID. /// @param salePrice uint256 Sale price (in any unit of exchange).[] /// @return receiver address of royalty recipient. /// @return royaltyAmount amount of royalty. function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); /// @notice Set a custom royalty by tokenId. May only be called by controller. /// @param tokenId uint256 Token ID. /// @param customRoyalty CustomRoyalty struct including recipient address and /// royalty amount in basis points. function setCustomRoyalty(uint256 tokenId, CustomRoyalty calldata customRoyalty) external; /// @notice Set the default royalty schedule for tokens that do not have a /// custom royalty. May only be called by controller. /// @param newRoyaltySchedule RoyaltySchedule struct including fan token and /// brand token royalties in basis points. function setRoyaltySchedule(RoyaltySchedule calldata newRoyaltySchedule) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IAnnotated} from "./IAnnotated.sol"; import {IControllable} from "./IControllable.sol"; import {IPausable} from "./IPausable.sol"; import {IEmint1155} from "./IEmint1155.sol"; interface ITokens is IControllable, IAnnotated { event SetMinter(address oldMinter, address newMinter); event SetDeployer(address oldDeployer, address newDeployer); event SetMetadata(address oldMetadata, address newMetadata); event SetRoyalties(address oldRoyalties, address newRoyalties); event UpdateTokenImplementation(address oldImpl, address newImpl); /// @notice Get address of metadata module. /// @return address of metadata module. function metadata() external view returns (address); /// @notice Get address of royalties module. /// @return address of royalties module. function royalties() external view returns (address); /// @notice Get deployed token for given token ID. /// @param tokenId uint256 token ID. /// @return IEmint1155 interface to deployed Emint1155 token contract. function token(uint256 tokenId) external view returns (IEmint1155); /// @notice Deploy an Emint1155 token. May only be called by token deployer. /// @return address of deployed Emint1155 token contract. function deploy() external returns (address); /// @notice Register a deployed token's address by token ID. /// May only be called by token deployer. /// @param tokenId uint256 token ID /// @param token address of deployed Emint1155 token contract. function register(uint256 tokenId, address token) external; /// @notice Update Emint1155 token implementation contract. Bytecode of this /// implementation contract will be cloned when deploying a new Emint1155. /// May only be called by controller. /// @param implementation address of implementation contract. function updateTokenImplementation(address implementation) external; /// @notice Mint `amount` tokens with ID `id` to `to` address, passing `data`. /// @param to address of token reciever. /// @param id uint256 token ID. /// @param amount uint256 quantity of tokens to mint. /// @param data bytes of data to pass to ERC1155 mint function. function mint(address to, uint256 id, uint256 amount, bytes memory data) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /// @param receiver Custom royalty recipient address /// @param royaltyBps Royalty in basis points struct CustomRoyalty { address receiver; uint16 royaltyBps; } /// @param fanRoyalty Fan token royalty in basis points /// @param brandRoyalty Brand token royalty in basis points struct RoyaltySchedule { uint16 fanRoyalty; uint16 brandRoyalty; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ERC1155Upgradeable} from "openzeppelin-contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; import {IERC1155Upgradeable} from "openzeppelin-contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol"; import {ERC1155BurnableUpgradeable} from "openzeppelin-contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol"; import {IERC1155MetadataURIUpgradeable} from "openzeppelin-contracts-upgradeable/token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.sol"; import {IERC2981Upgradeable} from "openzeppelin-contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import {IERC165Upgradeable} from "openzeppelin-contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import {DefaultOperatorFiltererUpgradeable} from "operator-filter-registry/upgradeable/DefaultOperatorFiltererUpgradeable.sol"; import {IEmint1155} from "../interfaces/IEmint1155.sol"; import {ITokens} from "../interfaces/ITokens.sol"; import {IMetadata} from "../interfaces/IMetadata.sol"; import {IRoyalties} from "../interfaces/IRoyalties.sol"; contract Emint1155 is IEmint1155, ERC1155BurnableUpgradeable, DefaultOperatorFiltererUpgradeable { string public constant NAME = "Emint1155"; string public constant VERSION = "0.0.1"; address public tokens; modifier onlyTokens() { if (msg.sender != tokens) { revert Forbidden(); } _; } constructor() { // Prevent initialization of the implementation contract. _disableInitializers(); } /// @inheritdoc IEmint1155 function initialize(address _tokens) external override initializer { __ERC1155_init(""); __DefaultOperatorFilterer_init(); tokens = _tokens; } /// @inheritdoc IEmint1155 function metadata() public view override returns (address) { return ITokens(tokens).metadata(); } /// @inheritdoc IEmint1155 function royalties() public view override returns (address) { return ITokens(tokens).royalties(); } /// @inheritdoc IEmint1155 function owner() public view override returns (address) { return IMetadata(metadata()).owner(address(this)); } /// @inheritdoc IEmint1155 function contractURI() public view override returns (string memory) { return IMetadata(metadata()).contractURI(address(this)); } /// @inheritdoc IERC1155MetadataURIUpgradeable function uri(uint256 tokenId) public view override (ERC1155Upgradeable, IERC1155MetadataURIUpgradeable) returns (string memory) { return IMetadata(metadata()).uri(tokenId); } /// @inheritdoc IERC2981Upgradeable function royaltyInfo(uint256 tokenId, uint256 salePrice) public view override returns (address, uint256) { return IRoyalties(royalties()).royaltyInfo(tokenId, salePrice); } /// @inheritdoc IEmint1155 function mint(address to, uint256 id, uint256 amount, bytes memory data) external override onlyTokens { _mint(to, id, amount, data); } /// @inheritdoc IEmint1155 function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) external override onlyTokens { _mintBatch(to, ids, amounts, data); } function burn(address account, uint256 id, uint256 value) public override (ERC1155BurnableUpgradeable, IEmint1155) { super.burn(account, id, value); } function burnBatch(address account, uint256[] memory ids, uint256[] memory values) public override (ERC1155BurnableUpgradeable, IEmint1155) { super.burnBatch(account, ids, values); } function setApprovalForAll(address operator, bool approved) public override (ERC1155Upgradeable, IERC1155Upgradeable) onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function safeTransferFrom(address from, address to, uint256 tokenId, uint256 amount, bytes memory data) public override (ERC1155Upgradeable, IERC1155Upgradeable) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, amount, data); } function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override (ERC1155Upgradeable, IERC1155Upgradeable) onlyAllowedOperator(from) { super.safeBatchTransferFrom(from, to, ids, amounts, data); } function supportsInterface(bytes4 interfaceId) public view override (ERC1155Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId); } }
{ "remappings": [ "ds-test/=lib/ds-test/src/", "erc4626-tests/=lib/operator-filter-registry/lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/", "operator-filter-registry/=lib/operator-filter-registry/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Forbidden","type":"error"},{"inputs":[{"internalType":"bytes32","name":"name","type":"bytes32"}],"name":"InvalidDependency","type":"error"},{"inputs":[],"name":"NotFound","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldDeployer","type":"address"},{"indexed":false,"internalType":"address","name":"newDeployer","type":"address"}],"name":"SetDeployer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldMetadata","type":"address"},{"indexed":false,"internalType":"address","name":"newMetadata","type":"address"}],"name":"SetMetadata","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldMinter","type":"address"},{"indexed":false,"internalType":"address","name":"newMinter","type":"address"}],"name":"SetMinter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldRoyalties","type":"address"},{"indexed":false,"internalType":"address","name":"newRoyalties","type":"address"}],"name":"SetRoyalties","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldImpl","type":"address"},{"indexed":false,"internalType":"address","name":"newImpl","type":"address"}],"name":"UpdateTokenImplementation","type":"event"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deploy","outputs":[{"internalType":"address","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emint1155","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadata","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"_token","type":"address"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royalties","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_name","type":"bytes32"},{"internalType":"address","name":"_contract","type":"address"}],"name":"setDependency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"token","outputs":[{"internalType":"contract IEmint1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"updateTokenImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161365538038061365583398101604081905261002f916100d4565b806001600160a01b0381166100575760405163d92e233d60e01b815260040160405180910390fd5b600080546001600160a81b0319166001600160a01b03909216919091178155604051610082906100c7565b604051809103906000f08015801561009e573d6000803e3d6000fd5b50600580546001600160a01b0319166001600160a01b0392909216919091179055506101049050565b61292e80610d2783390190565b6000602082840312156100e657600080fd5b81516001600160a01b03811681146100fd57600080fd5b9392505050565b610c14806101136000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063775c300c116100a2578063d5f3948811610071578063d5f3948814610265578063dbbdf08314610278578063f053dc5c1461028b578063f77c47911461029e578063ffa1ad74146102b157600080fd5b8063775c300c146102105780638456cb5914610218578063a3f4df7e14610220578063d20dd3491461025257600080fd5b80633f4ba83a116100e95780633f4ba83a1461019a5780634f64b2be146101a45780635c975abb146101cd5780637238695e146101ea578063731133e9146101fd57600080fd5b8063044215c61461011b57806307546172146101615780630d29c6b314610174578063392f37e914610187575b600080fd5b6101446101293660046109e5565b6000908152600660205260409020546001600160a01b031690565b6040516001600160a01b0390911681526020015b60405180910390f35b600154610144906001600160a01b031681565b600554610144906001600160a01b031681565b600354610144906001600160a01b031681565b6101a26102d5565b005b6101446101b23660046109e5565b6006602052600090815260409020546001600160a01b031681565b600054600160a01b900460ff166040519015158152602001610158565b6101a26101f8366004610a15565b61030a565b6101a261020b366004610a57565b6103ec565b6101446104a0565b6101a261054a565b61024560405180604001604052806006815260200165546f6b656e7360d01b81525081565b6040516101589190610b72565b6101a2610260366004610b8c565b61057d565b600254610144906001600160a01b031681565b6101a2610286366004610a15565b610611565b600454610144906001600160a01b031681565b600054610144906001600160a01b031681565b61024560405180604001604052806005815260200164302e302e3160d81b81525081565b6000546001600160a01b0316331461030057604051631dd2188d60e31b815260040160405180910390fd5b610308610672565b565b6000546001600160a01b0316331461033557604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b03811661035c5760405163d92e233d60e01b815260040160405180910390fd5b816536b4b73a32b960d11b0361037957610375816106c7565b5050565b81673232b83637bcb2b960c11b036103945761037581610730565b81676d6574616461746160c01b036103af5761037581610799565b8168726f79616c7469657360b81b036103cb5761037581610802565b60405163580aaaa560e11b8152600481018390526024015b60405180910390fd5b6001546001600160a01b0316331461041757604051631dd2188d60e31b815260040160405180910390fd5b61041f61086b565b6000838152600660205260409020546001600160a01b03166001600160a01b031663731133e9858585856040518563ffffffff1660e01b81526004016104689493929190610ba7565b600060405180830381600087803b15801561048257600080fd5b505af1158015610496573d6000803e3d6000fd5b5050505050505050565b6002546000906001600160a01b031633146104ce57604051631dd2188d60e31b815260040160405180910390fd5b6104d661086b565b6005546104eb906001600160a01b03166108b8565b60405163189acdbd60e31b81523060048201529091506001600160a01b0382169063c4d66de890602401600060405180830381600087803b15801561052f57600080fd5b505af1158015610543573d6000803e3d6000fd5b5050505090565b6000546001600160a01b0316331461057557604051631dd2188d60e31b815260040160405180910390fd5b610308610952565b6000546001600160a01b031633146105a857604051631dd2188d60e31b815260040160405180910390fd5b600554604080516001600160a01b03928316815291831660208301527f1cc4f8e20b0cd3e5109eb156cadcfd3a5496ac0794c6085ca02afd7d710dd566910160405180910390a1600580546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b0316331461063c57604051631dd2188d60e31b815260040160405180910390fd5b61064461086b565b60009182526006602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b61067a610995565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600154604080516001600160a01b03928316815291831660208301527fe490d3138e32f1f66ef3971a3c73c7f7704ba0c1d1000f1e2c3df6fc0376610b910160405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b600254604080516001600160a01b03928316815291831660208301527f5536ce762e2750493749a93a0d6a7b91115bb73d2bd6f45cae892f965fc79e68910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600354604080516001600160a01b03928316815291831660208301527f87ed93f537758240d16d90608dd86ef83a16738018ee0439a2352d65ad1116c5910160405180910390a1600380546001600160a01b0319166001600160a01b0392909216919091179055565b600454604080516001600160a01b03928316815291831660208301527f7c2df674a1615f4e09b14c12a6becb4b8e8294ec1adef12ceb31eeefe4c722ce910160405180910390a1600480546001600160a01b0319166001600160a01b0392909216919091179055565b600054600160a01b900460ff16156103085760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016103e3565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b03811661094d5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b60448201526064016103e3565b919050565b61095a61086b565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586106aa3390565b600054600160a01b900460ff166103085760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016103e3565b6000602082840312156109f757600080fd5b5035919050565b80356001600160a01b038116811461094d57600080fd5b60008060408385031215610a2857600080fd5b82359150610a38602084016109fe565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215610a6d57600080fd5b610a76856109fe565b93506020850135925060408501359150606085013567ffffffffffffffff80821115610aa157600080fd5b818701915087601f830112610ab557600080fd5b813581811115610ac757610ac7610a41565b604051601f8201601f19908116603f01168101908382118183101715610aef57610aef610a41565b816040528281528a6020848701011115610b0857600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000815180845260005b81811015610b5257602081850181015186830182015201610b36565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610b856020830184610b2c565b9392505050565b600060208284031215610b9e57600080fd5b610b85826109fe565b60018060a01b0385168152836020820152826040820152608060608201526000610bd46080830184610b2c565b969550505050505056fea2646970667358221220678655cfba8db57f85a2132e1c2f1af59b963d9babdbce05e82d5691688a471864736f6c6343000811003360806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61283a80620000f46000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80638da5cb5b116100b8578063e8a3d4851161007c578063e8a3d485146102cd578063e985e9c5146102d5578063f053dc5c14610311578063f242432a14610319578063f5298aca1461032c578063ffa1ad741461033f57600080fd5b80638da5cb5b146102645780639d63848a1461026c578063a22cb4651461027f578063a3f4df7e14610292578063c4d66de8146102ba57600080fd5b80632eb2c2d6116100ff5780632eb2c2d6146101eb578063392f37e9146101fe5780634e1273f41461021e5780636b20c4541461023e578063731133e91461025157600080fd5b8062fdd58e1461013b57806301ffc9a7146101615780630e89341c146101845780631f7fdffa146101a45780632a55205a146101b9575b600080fd5b61014e610149366004611ab9565b610363565b6040519081526020015b60405180910390f35b61017461016f366004611afb565b6103fe565b6040519015158152602001610158565b610197610192366004611b1f565b610423565b6040516101589190611b88565b6101b76101b2366004611cf4565b61049f565b005b6101cc6101c7366004611d8e565b6104dc565b604080516001600160a01b039093168352602083019190915201610158565b6101b76101f9366004611db0565b610563565b610206610642565b6040516001600160a01b039091168152602001610158565b61023161022c366004611e5d565b6106b5565b6040516101589190611f64565b6101b761024c366004611f77565b6107de565b6101b761025f366004611fec565b6107ee565b610206610825565b60c954610206906001600160a01b031681565b6101b761028d366004612050565b610875565b61019760405180604001604052806009815260200168456d696e743131353560b81b81525081565b6101b76102c8366004612089565b610939565b610197610a7e565b6101746102e33660046120a6565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b610206610af4565b6101b76103273660046120d4565b610b3e565b6101b761033a36600461213c565b610c10565b61019760405180604001604052806005815260200164302e302e3160d81b81525081565b60006001600160a01b0383166103d35760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b0319821663152a902d60e11b14806103f857506103f882610c1b565b606061042d610642565b6001600160a01b0316630e89341c836040518263ffffffff1660e01b815260040161045a91815260200190565b600060405180830381865afa158015610477573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103f89190810190612171565b60c9546001600160a01b031633146104ca57604051631dd2188d60e31b815260040160405180910390fd5b6104d684848484610c6b565b50505050565b6000806104e7610af4565b60405163152a902d60e11b815260048101869052602481018590526001600160a01b039190911690632a55205a906044016040805180830381865afa158015610534573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055891906121f2565b915091509250929050565b846daaeb6d7670e522a718067333cd4e3b1561062d57336001600160a01b0382160361059b576105968686868686610dbe565b61063a565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e9190612220565b61062d57604051633b79c77360e21b81523360048201526024016103ca565b61063a8686868686610dbe565b505050505050565b60c9546040805163392f37e960e01b815290516000926001600160a01b03169163392f37e99160048083019260209291908290030181865afa15801561068c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b0919061223d565b905090565b6060815183511461071a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016103ca565b600083516001600160401b0381111561073557610735611b9b565b60405190808252806020026020018201604052801561075e578160200160208202803683370190505b50905060005b84518110156107d6576107a98582815181106107825761078261225a565b602002602001015185838151811061079c5761079c61225a565b6020026020010151610363565b8282815181106107bb576107bb61225a565b60209081029190910101526107cf81612286565b9050610764565b509392505050565b6107e9838383610e03565b505050565b60c9546001600160a01b0316331461081957604051631dd2188d60e31b815260040160405180910390fd5b6104d684848484610e46565b600061082f610642565b60405163666e1b3960e01b81523060048201526001600160a01b03919091169063666e1b3990602401602060405180830381865afa15801561068c573d6000803e3d6000fd5b816daaeb6d7670e522a718067333cd4e3b1561092f57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190612220565b61092f57604051633b79c77360e21b81526001600160a01b03821660048201526024016103ca565b6107e98383610f22565b600054610100900460ff16158080156109595750600054600160ff909116105b806109735750303b158015610973575060005460ff166001145b6109d65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103ca565b6000805460ff1916600117905580156109f9576000805461ff0019166101001790555b610a1160405180602001604052806000815250610f2d565b610a19610f60565b60c980546001600160a01b0319166001600160a01b0384161790558015610a7a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6060610a88610642565b60405162844d1360e01b81523060048201526001600160a01b03919091169062844d1390602401600060405180830381865afa158015610acc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106b09190810190612171565b60c95460408051633c14f71760e21b815290516000926001600160a01b03169163f053dc5c9160048083019260209291908290030181865afa15801561068c573d6000803e3d6000fd5b846daaeb6d7670e522a718067333cd4e3b15610c0357336001600160a01b03821603610b71576105968686868686610fa8565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610bc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be49190612220565b610c0357604051633b79c77360e21b81523360048201526024016103ca565b61063a8686868686610fa8565b6107e9838383610fed565b60006001600160e01b03198216636cdb3d1360e11b1480610c4c57506001600160e01b031982166303a24d0760e21b145b806103f857506301ffc9a760e01b6001600160e01b03198316146103f8565b6001600160a01b038416610c915760405162461bcd60e51b81526004016103ca9061229f565b8151835114610cb25760405162461bcd60e51b81526004016103ca906122e0565b3360005b8451811015610d4f57838181518110610cd157610cd161225a565b602002602001015160656000878481518110610cef57610cef61225a565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254610d379190612328565b90915550819050610d4781612286565b915050610cb6565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610da092919061233b565b60405180910390a4610db781600087878787611030565b5050505050565b6001600160a01b038516331480610dda5750610dda85336102e3565b610df65760405162461bcd60e51b81526004016103ca90612369565b610db7858585858561118b565b6001600160a01b038316331480610e1f5750610e1f83336102e3565b610e3b5760405162461bcd60e51b81526004016103ca90612369565b6107e9838383611322565b6001600160a01b038416610e6c5760405162461bcd60e51b81526004016103ca9061229f565b336000610e78856114ae565b90506000610e85856114ae565b905060008681526065602090815260408083206001600160a01b038b16845290915281208054879290610eb9908490612328565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610f19836000898989896114f9565b50505050505050565b610a7a3383836115b4565b600054610100900460ff16610f545760405162461bcd60e51b81526004016103ca906123b7565b610f5d81611694565b50565b600054610100900460ff16610f875760405162461bcd60e51b81526004016103ca906123b7565b610fa6733cc6cdda760b79bafa08df41ecfa224f810dceb660016116c4565b565b6001600160a01b038516331480610fc45750610fc485336102e3565b610fe05760405162461bcd60e51b81526004016103ca90612369565b610db78585858585611863565b6001600160a01b038316331480611009575061100983336102e3565b6110255760405162461bcd60e51b81526004016103ca90612369565b6107e9838383611991565b6001600160a01b0384163b1561063a5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906110749089908990889088908890600401612402565b6020604051808303816000875af19250505080156110af575060408051601f3d908101601f191682019092526110ac91810190612460565b60015b61115b576110bb61247d565b806308c379a0036110f457506110cf612499565b806110da57506110f6565b8060405162461bcd60e51b81526004016103ca9190611b88565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016103ca565b6001600160e01b0319811663bc197c8160e01b14610f195760405162461bcd60e51b81526004016103ca90612522565b81518351146111ac5760405162461bcd60e51b81526004016103ca906122e0565b6001600160a01b0384166111d25760405162461bcd60e51b81526004016103ca9061256a565b3360005b84518110156112bc5760008582815181106111f3576111f361225a565b6020026020010151905060008583815181106112115761121161225a565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156112625760405162461bcd60e51b81526004016103ca906125af565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906112a1908490612328565b92505081905550505050806112b590612286565b90506111d6565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161130c92919061233b565b60405180910390a461063a818787878787611030565b6001600160a01b0383166113485760405162461bcd60e51b81526004016103ca906125f9565b80518251146113695760405162461bcd60e51b81526004016103ca906122e0565b6040805160208101909152600090523360005b83518110156114415760008482815181106113995761139961225a565b6020026020010151905060008483815181106113b7576113b761225a565b60209081029190910181015160008481526065835260408082206001600160a01b038c1683529093529190912054909150818110156114085760405162461bcd60e51b81526004016103ca9061263c565b60009283526065602090815260408085206001600160a01b038b168652909152909220910390558061143981612286565b91505061137c565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161149292919061233b565b60405180910390a46040805160208101909152600090526104d6565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106114e8576114e861225a565b602090810291909101015292915050565b6001600160a01b0384163b1561063a5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061153d9089908990889088908890600401612680565b6020604051808303816000875af1925050508015611578575060408051601f3d908101601f1916820190925261157591810190612460565b60015b611584576110bb61247d565b6001600160e01b0319811663f23a6e6160e01b14610f195760405162461bcd60e51b81526004016103ca90612522565b816001600160a01b0316836001600160a01b0316036116275760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016103ca565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600054610100900460ff166116bb5760405162461bcd60e51b81526004016103ca906123b7565b610f5d81611a98565b600054610100900460ff166116eb5760405162461bcd60e51b81526004016103ca906123b7565b6daaeb6d7670e522a718067333cd4e3b15610a7a5760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af115801561174b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176f9190612220565b610a7a5780156117e357604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156117cf57600080fd5b505af115801561063a573d6000803e3d6000fd5b6001600160a01b038216156118325760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af2903906044016117b5565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e486906024016117b5565b6001600160a01b0384166118895760405162461bcd60e51b81526004016103ca9061256a565b336000611895856114ae565b905060006118a2856114ae565b905060008681526065602090815260408083206001600160a01b038c168452909152902054858110156118e75760405162461bcd60e51b81526004016103ca906125af565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611926908490612328565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611986848a8a8a8a8a6114f9565b505050505050505050565b6001600160a01b0383166119b75760405162461bcd60e51b81526004016103ca906125f9565b3360006119c3846114ae565b905060006119d0846114ae565b6040805160208082018352600091829052888252606581528282206001600160a01b038b1683529052205490915084811015611a1e5760405162461bcd60e51b81526004016103ca9061263c565b60008681526065602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052610f19565b6067610a7a8282612745565b6001600160a01b0381168114610f5d57600080fd5b60008060408385031215611acc57600080fd5b8235611ad781611aa4565b946020939093013593505050565b6001600160e01b031981168114610f5d57600080fd5b600060208284031215611b0d57600080fd5b8135611b1881611ae5565b9392505050565b600060208284031215611b3157600080fd5b5035919050565b60005b83811015611b53578181015183820152602001611b3b565b50506000910152565b60008151808452611b74816020860160208601611b38565b601f01601f19169290920160200192915050565b602081526000611b186020830184611b5c565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715611bd657611bd6611b9b565b6040525050565b60006001600160401b03821115611bf657611bf6611b9b565b5060051b60200190565b600082601f830112611c1157600080fd5b81356020611c1e82611bdd565b604051611c2b8282611bb1565b83815260059390931b8501820192828101915086841115611c4b57600080fd5b8286015b84811015611c665780358352918301918301611c4f565b509695505050505050565b60006001600160401b03821115611c8a57611c8a611b9b565b50601f01601f191660200190565b600082601f830112611ca957600080fd5b8135611cb481611c71565b604051611cc18282611bb1565b828152856020848701011115611cd657600080fd5b82602086016020830137600092810160200192909252509392505050565b60008060008060808587031215611d0a57600080fd5b8435611d1581611aa4565b935060208501356001600160401b0380821115611d3157600080fd5b611d3d88838901611c00565b94506040870135915080821115611d5357600080fd5b611d5f88838901611c00565b93506060870135915080821115611d7557600080fd5b50611d8287828801611c98565b91505092959194509250565b60008060408385031215611da157600080fd5b50508035926020909101359150565b600080600080600060a08688031215611dc857600080fd5b8535611dd381611aa4565b94506020860135611de381611aa4565b935060408601356001600160401b0380821115611dff57600080fd5b611e0b89838a01611c00565b94506060880135915080821115611e2157600080fd5b611e2d89838a01611c00565b93506080880135915080821115611e4357600080fd5b50611e5088828901611c98565b9150509295509295909350565b60008060408385031215611e7057600080fd5b82356001600160401b0380821115611e8757600080fd5b818501915085601f830112611e9b57600080fd5b81356020611ea882611bdd565b604051611eb58282611bb1565b83815260059390931b8501820192828101915089841115611ed557600080fd5b948201945b83861015611efc578535611eed81611aa4565b82529482019490820190611eda565b96505086013592505080821115611f1257600080fd5b50611f1f85828601611c00565b9150509250929050565b600081518084526020808501945080840160005b83811015611f5957815187529582019590820190600101611f3d565b509495945050505050565b602081526000611b186020830184611f29565b600080600060608486031215611f8c57600080fd5b8335611f9781611aa4565b925060208401356001600160401b0380821115611fb357600080fd5b611fbf87838801611c00565b93506040860135915080821115611fd557600080fd5b50611fe286828701611c00565b9150509250925092565b6000806000806080858703121561200257600080fd5b843561200d81611aa4565b9350602085013592506040850135915060608501356001600160401b0381111561203657600080fd5b611d8287828801611c98565b8015158114610f5d57600080fd5b6000806040838503121561206357600080fd5b823561206e81611aa4565b9150602083013561207e81612042565b809150509250929050565b60006020828403121561209b57600080fd5b8135611b1881611aa4565b600080604083850312156120b957600080fd5b82356120c481611aa4565b9150602083013561207e81611aa4565b600080600080600060a086880312156120ec57600080fd5b85356120f781611aa4565b9450602086013561210781611aa4565b9350604086013592506060860135915060808601356001600160401b0381111561213057600080fd5b611e5088828901611c98565b60008060006060848603121561215157600080fd5b833561215c81611aa4565b95602085013595506040909401359392505050565b60006020828403121561218357600080fd5b81516001600160401b0381111561219957600080fd5b8201601f810184136121aa57600080fd5b80516121b581611c71565b6040516121c28282611bb1565b8281528660208486010111156121d757600080fd5b6121e8836020830160208701611b38565b9695505050505050565b6000806040838503121561220557600080fd5b825161221081611aa4565b6020939093015192949293505050565b60006020828403121561223257600080fd5b8151611b1881612042565b60006020828403121561224f57600080fd5b8151611b1881611aa4565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161229857612298612270565b5060010190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b808201808211156103f8576103f8612270565b60408152600061234e6040830185611f29565b82810360208401526123608185611f29565b95945050505050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061242e90830186611f29565b82810360608401526124408186611f29565b905082810360808401526124548185611b5c565b98975050505050505050565b60006020828403121561247257600080fd5b8151611b1881611ae5565b600060033d11156124965760046000803e5060005160e01c5b90565b600060443d10156124a75790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156124d657505050505090565b82850191508151818111156124ee5750505050505090565b843d87010160208285010111156125085750505050505090565b61251760208286010187611bb1565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906126ba90830184611b5c565b979650505050505050565b600181811c908216806126d957607f821691505b6020821081036126f957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156107e957600081815260208120601f850160051c810160208610156127265750805b601f850160051c820191505b8181101561063a57828155600101612732565b81516001600160401b0381111561275e5761275e611b9b565b6127728161276c84546126c5565b846126ff565b602080601f8311600181146127a7576000841561278f5750858301515b600019600386901b1c1916600185901b17855561063a565b600085815260208120601f198616915b828110156127d6578886015182559484019460019091019084016127b7565b50858210156127f45787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fea264697066735822122046de95e4b3feacb6918d850045b808cc6a97e077bc00b41e5f8f24ab052022cd64736f6c6343000811003300000000000000000000000011fbbcf6e33913f22d4763731188df806e7bc8b1
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063775c300c116100a2578063d5f3948811610071578063d5f3948814610265578063dbbdf08314610278578063f053dc5c1461028b578063f77c47911461029e578063ffa1ad74146102b157600080fd5b8063775c300c146102105780638456cb5914610218578063a3f4df7e14610220578063d20dd3491461025257600080fd5b80633f4ba83a116100e95780633f4ba83a1461019a5780634f64b2be146101a45780635c975abb146101cd5780637238695e146101ea578063731133e9146101fd57600080fd5b8063044215c61461011b57806307546172146101615780630d29c6b314610174578063392f37e914610187575b600080fd5b6101446101293660046109e5565b6000908152600660205260409020546001600160a01b031690565b6040516001600160a01b0390911681526020015b60405180910390f35b600154610144906001600160a01b031681565b600554610144906001600160a01b031681565b600354610144906001600160a01b031681565b6101a26102d5565b005b6101446101b23660046109e5565b6006602052600090815260409020546001600160a01b031681565b600054600160a01b900460ff166040519015158152602001610158565b6101a26101f8366004610a15565b61030a565b6101a261020b366004610a57565b6103ec565b6101446104a0565b6101a261054a565b61024560405180604001604052806006815260200165546f6b656e7360d01b81525081565b6040516101589190610b72565b6101a2610260366004610b8c565b61057d565b600254610144906001600160a01b031681565b6101a2610286366004610a15565b610611565b600454610144906001600160a01b031681565b600054610144906001600160a01b031681565b61024560405180604001604052806005815260200164302e302e3160d81b81525081565b6000546001600160a01b0316331461030057604051631dd2188d60e31b815260040160405180910390fd5b610308610672565b565b6000546001600160a01b0316331461033557604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b03811661035c5760405163d92e233d60e01b815260040160405180910390fd5b816536b4b73a32b960d11b0361037957610375816106c7565b5050565b81673232b83637bcb2b960c11b036103945761037581610730565b81676d6574616461746160c01b036103af5761037581610799565b8168726f79616c7469657360b81b036103cb5761037581610802565b60405163580aaaa560e11b8152600481018390526024015b60405180910390fd5b6001546001600160a01b0316331461041757604051631dd2188d60e31b815260040160405180910390fd5b61041f61086b565b6000838152600660205260409020546001600160a01b03166001600160a01b031663731133e9858585856040518563ffffffff1660e01b81526004016104689493929190610ba7565b600060405180830381600087803b15801561048257600080fd5b505af1158015610496573d6000803e3d6000fd5b5050505050505050565b6002546000906001600160a01b031633146104ce57604051631dd2188d60e31b815260040160405180910390fd5b6104d661086b565b6005546104eb906001600160a01b03166108b8565b60405163189acdbd60e31b81523060048201529091506001600160a01b0382169063c4d66de890602401600060405180830381600087803b15801561052f57600080fd5b505af1158015610543573d6000803e3d6000fd5b5050505090565b6000546001600160a01b0316331461057557604051631dd2188d60e31b815260040160405180910390fd5b610308610952565b6000546001600160a01b031633146105a857604051631dd2188d60e31b815260040160405180910390fd5b600554604080516001600160a01b03928316815291831660208301527f1cc4f8e20b0cd3e5109eb156cadcfd3a5496ac0794c6085ca02afd7d710dd566910160405180910390a1600580546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b0316331461063c57604051631dd2188d60e31b815260040160405180910390fd5b61064461086b565b60009182526006602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b61067a610995565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600154604080516001600160a01b03928316815291831660208301527fe490d3138e32f1f66ef3971a3c73c7f7704ba0c1d1000f1e2c3df6fc0376610b910160405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b600254604080516001600160a01b03928316815291831660208301527f5536ce762e2750493749a93a0d6a7b91115bb73d2bd6f45cae892f965fc79e68910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600354604080516001600160a01b03928316815291831660208301527f87ed93f537758240d16d90608dd86ef83a16738018ee0439a2352d65ad1116c5910160405180910390a1600380546001600160a01b0319166001600160a01b0392909216919091179055565b600454604080516001600160a01b03928316815291831660208301527f7c2df674a1615f4e09b14c12a6becb4b8e8294ec1adef12ceb31eeefe4c722ce910160405180910390a1600480546001600160a01b0319166001600160a01b0392909216919091179055565b600054600160a01b900460ff16156103085760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016103e3565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b03811661094d5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b60448201526064016103e3565b919050565b61095a61086b565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586106aa3390565b600054600160a01b900460ff166103085760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016103e3565b6000602082840312156109f757600080fd5b5035919050565b80356001600160a01b038116811461094d57600080fd5b60008060408385031215610a2857600080fd5b82359150610a38602084016109fe565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215610a6d57600080fd5b610a76856109fe565b93506020850135925060408501359150606085013567ffffffffffffffff80821115610aa157600080fd5b818701915087601f830112610ab557600080fd5b813581811115610ac757610ac7610a41565b604051601f8201601f19908116603f01168101908382118183101715610aef57610aef610a41565b816040528281528a6020848701011115610b0857600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000815180845260005b81811015610b5257602081850181015186830182015201610b36565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610b856020830184610b2c565b9392505050565b600060208284031215610b9e57600080fd5b610b85826109fe565b60018060a01b0385168152836020820152826040820152608060608201526000610bd46080830184610b2c565b969550505050505056fea2646970667358221220678655cfba8db57f85a2132e1c2f1af59b963d9babdbce05e82d5691688a471864736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000011fbBCF6e33913F22D4763731188Df806e7Bc8B1
-----Decoded View---------------
Arg [0] : _controller (address): 0x11fbBCF6e33913F22D4763731188Df806e7Bc8B1
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000011fbBCF6e33913F22D4763731188Df806e7Bc8B1
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.