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
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 16785404 | 629 days ago | IN | 0 ETH | 0.21824243 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ERC1155TL
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 2000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 /// @title ERC1155TL.sol /// @notice Transient Labs ERC-1155 Creator Contract /// @dev features include /// - batch minting /// - airdrops /// - ability to hook in external mint contracts /// - ability to set multiple admins /// - Story Contract /// - BlockList /// - individual token royalties /// @author transientlabs.xyz /* ____ _ __ __ ____ _ ________ __ / __ )__ __(_) /___/ / / __ \(_) __/ __/__ ________ ____ / /_ / __ / / / / / / __ / / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/ / /_/ / /_/ / / / /_/ / / /_/ / / __/ __/ __/ / / __/ / / / /__ /_____/\__,_/_/_/\__,_/ /_____/_/_/ /_/ \___/_/ \___/_/ /_/\__(_)*/ pragma solidity 0.8.17; import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; import { ERC1155Upgradeable, IERC1155Upgradeable, ERC165Upgradeable } from "openzeppelin-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; import {EIP2981TLUpgradeable} from "tl-sol-tools/upgradeable/royalties/EIP2981TLUpgradeable.sol"; import {OwnableAccessControlUpgradeable} from "tl-sol-tools/upgradeable/access/OwnableAccessControlUpgradeable.sol"; import {StoryContractUpgradeable} from "tl-story/upgradeable/StoryContractUpgradeable.sol"; import {BlockListUpgradeable} from "tl-blocklist/BlockListUpgradeable.sol"; /*////////////////////////////////////////////////////////////////////////// Custom Errors //////////////////////////////////////////////////////////////////////////*/ /// @dev token uri is an empty string error EmptyTokenURI(); /// @dev batch size too small error BatchSizeTooSmall(); /// @dev mint to zero addresses error MintToZeroAddresses(); /// @dev array length mismatch error ArrayLengthMismatch(); /// @dev token not owned by the owner of the contract error TokenNotOwnedByOwner(); /// @dev caller is not approved or owner error CallerNotApprovedOrOwner(); /// @dev token does not exist error TokenDoesntExist(); /// @dev burning zero tokens error BurnZeroTokens(); /*////////////////////////////////////////////////////////////////////////// ERC1155TL //////////////////////////////////////////////////////////////////////////*/ contract ERC1155TL is ERC1155Upgradeable, EIP2981TLUpgradeable, OwnableAccessControlUpgradeable, StoryContractUpgradeable, BlockListUpgradeable { /*////////////////////////////////////////////////////////////////////////// Custom Types //////////////////////////////////////////////////////////////////////////*/ /// @dev struct defining a token struct Token { bool created; string uri; } /*////////////////////////////////////////////////////////////////////////// State Variables //////////////////////////////////////////////////////////////////////////*/ uint256 public constant VERSION = 1; bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant APPROVED_MINT_CONTRACT = keccak256("APPROVED_MINT_CONTRACT"); uint256 private _counter; string public name; string public symbol; mapping(uint256 => Token) private _tokens; /*////////////////////////////////////////////////////////////////////////// Constructor //////////////////////////////////////////////////////////////////////////*/ /// @param disable: boolean to disable initialization for the implementation contract constructor(bool disable) { if (disable) _disableInitializers(); } /*////////////////////////////////////////////////////////////////////////// Initializer //////////////////////////////////////////////////////////////////////////*/ /// @param name_: the name of the 1155 contract /// @param symbol_: the symbol for the 1155 contract /// @param defaultRoyaltyRecipient: the default address for royalty payments /// @param defaultRoyaltyPercentage: the default royalty percentage of basis points (out of 10,000) /// @param initOwner: the owner of the contract /// @param admins: array of admin addresses to add to the contract /// @param enableStory: a bool deciding whether to add story fuctionality or not /// @param blockListRegistry: address of the blocklist registry to use function initialize( string memory name_, string memory symbol_, address defaultRoyaltyRecipient, uint256 defaultRoyaltyPercentage, address initOwner, address[] memory admins, bool enableStory, address blockListRegistry ) external initializer { // initialize parent contracts __ERC1155_init(""); __EIP2981TL_init(defaultRoyaltyRecipient, defaultRoyaltyPercentage); __OwnableAccessControl_init(initOwner); __StoryContractUpgradeable_init(enableStory); __BlockList_init(blockListRegistry); // add admins _setRole(ADMIN_ROLE, admins, true); // set name & symbol name = name_; symbol = symbol_; } /*////////////////////////////////////////////////////////////////////////// General Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to get token creation details /// @param tokenId: the token to lookup function getTokenDetails(uint256 tokenId) external view returns (Token memory) { return _tokens[tokenId]; } /*////////////////////////////////////////////////////////////////////////// Access Control Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to set approved mint contracts /// @dev access to owner or admin /// @param minters: array of minters to grant approval to /// @param status: status for the minters function setApprovedMintContracts(address[] calldata minters, bool status) external onlyRoleOrOwner(ADMIN_ROLE) { _setRole(APPROVED_MINT_CONTRACT, minters, status); } /*////////////////////////////////////////////////////////////////////////// Creation Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to create a token that can be minted to creator or airdropped /// @dev requires owner or admin /// @param newUri: the uri for the token to create /// @param addresses: the addresses to mint the new token to /// @param amounts: the amount of the new token to mint to each address function createToken(string calldata newUri, address[] calldata addresses, uint256[] calldata amounts) external onlyRoleOrOwner(ADMIN_ROLE) { _createToken(newUri, addresses, amounts); } /// @notice function to create a token that can be minted to creator or airdropped /// @dev overloaded function where you can set the token royalty config in this tx /// @dev requires owner or admin /// @param newUri: the uri for the token to create /// @param addresses: the addresses to mint the new token to /// @param amounts: the amount of the new token to mint to each address /// @param royaltyAddress: royalty payout address for the created token /// @param royaltyPercent: royalty percentage for this token function createToken(string calldata newUri, address[] calldata addresses, uint256[] calldata amounts, address royaltyAddress, uint256 royaltyPercent) external onlyRoleOrOwner(ADMIN_ROLE) { uint256 tokenId = _createToken(newUri, addresses, amounts); _overrideTokenRoyaltyInfo(tokenId, royaltyAddress, royaltyPercent); } /// @notice function to batch create tokens that can be minted to creator or airdropped /// @dev requires owner or admin /// @param newUris: the uris for the tokens to create /// @param addresses: 2d dynamic array holding the addresses to mint the new tokens to /// @param amounts: 2d dynamic array holding the amounts of the new tokens to mint to each address function batchCreateToken(string[] calldata newUris, address[][] calldata addresses, uint256[][] calldata amounts) external onlyRoleOrOwner(ADMIN_ROLE) { if (newUris.length == 0) revert EmptyTokenURI(); for (uint256 i = 0; i < newUris.length; i++) { _createToken(newUris[i], addresses[i], amounts[i]); } } /// @notice function to batch create tokens that can be minted to creator or airdropped /// @dev overloaded function where you can set the token royalty config in this tx /// @dev requires owner or admin /// @param newUris: the uris for the tokens to create /// @param addresses: 2d dynamic array holding the addresses to mint the new tokens to /// @param amounts: 2d dynamic array holding the amounts of the new tokens to mint to each address /// @param royaltyAddresses: royalty payout addresses for the tokens /// @param royaltyPercents: royalty payout percents for the tokens function batchCreateToken(string[] calldata newUris, address[][] calldata addresses, uint256[][] calldata amounts, address[] calldata royaltyAddresses, uint256[] calldata royaltyPercents) external onlyRoleOrOwner(ADMIN_ROLE) { if (newUris.length == 0) revert EmptyTokenURI(); for (uint256 i = 0; i < newUris.length; i++) { uint256 tokenId = _createToken(newUris[i], addresses[i], amounts[i]); _overrideTokenRoyaltyInfo(tokenId, royaltyAddresses[i], royaltyPercents[i]); } } /// @notice private helper function to create a new token /// @param newUri: the uri for the token to create /// @param addresses: the addresses to mint the new token to /// @param amounts: the amount of the new token to mint to each address /// @return _counter: token id created function _createToken(string memory newUri, address[] memory addresses, uint256[] memory amounts) private returns(uint256) { if (bytes(newUri).length == 0) revert EmptyTokenURI(); if (addresses.length == 0) revert MintToZeroAddresses(); if (addresses.length != amounts.length) revert ArrayLengthMismatch(); _counter++; _tokens[_counter] = Token(true, newUri); for (uint256 i = 0; i < addresses.length; i++) { _mint(addresses[i], _counter, amounts[i], ""); } return _counter; } /// @notice private helper function to verify a token exists /// @param tokenId: the token to check existence for function _exists(uint256 tokenId) private view returns (bool) { return _tokens[tokenId].created; } /*////////////////////////////////////////////////////////////////////////// Mint Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to mint existing token to recipients /// @dev requires owner or admin /// @param tokenId: the token to mint /// @param addresses: the addresses to mint to /// @param amounts: amounts of the token to mint to each address function mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) external onlyRoleOrOwner(ADMIN_ROLE) { _mintToken(tokenId, addresses, amounts); } /// @notice external mint function /// @dev requires caller to be an approved mint contract /// @param tokenId: the token to mint /// @param addresses: the addresses to mint to /// @param amounts: amounts of the token to mint to each address function externalMint(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) external onlyRole(APPROVED_MINT_CONTRACT) { _mintToken(tokenId, addresses, amounts); } /// @notice private helper function /// @param tokenId: the token to mint /// @param addresses: the addresses to mint to /// @param amounts: amounts of the token to mint to each address function _mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) private { if (!_exists(tokenId)) revert TokenDoesntExist(); if (addresses.length == 0) revert MintToZeroAddresses(); if (addresses.length != amounts.length) revert ArrayLengthMismatch(); for (uint256 i = 0; i < addresses.length; i++) { _mint(addresses[i], tokenId, amounts[i], ""); } } /*////////////////////////////////////////////////////////////////////////// Burn Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to burn tokens from an account /// @dev msg.sender must be owner or operator /// @dev if this function is called from another contract as part of a burn/redeem, /// the contract must ensure that no amount is '0' or if it is, that it isn't a vulnerability. /// @param from: address to burn from /// @param tokenIds: array of tokens to burn /// @param amounts: amount of each token to burn function burn(address from, uint256[] calldata tokenIds, uint256[] calldata amounts) external { if (tokenIds.length == 0) revert BurnZeroTokens(); if (msg.sender != from && !isApprovedForAll(from, msg.sender)) revert CallerNotApprovedOrOwner(); _burnBatch(from, tokenIds, amounts); } /*////////////////////////////////////////////////////////////////////////// Royalty Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to set the default royalty specification /// @dev requires owner /// @param newRecipient: the new royalty payout address /// @param newPercentage: the new royalty percentage in basis (out of 10,000) function setDefaultRoyalty(address newRecipient, uint256 newPercentage) external onlyOwner { _setDefaultRoyaltyInfo(newRecipient, newPercentage); } /// @notice function to override a token's royalty info /// @dev requires owner /// @param tokenId: the token to override royalty for /// @param newRecipient: the new royalty payout address for the token id /// @param newPercentage: the new royalty percentage in basis (out of 10,000) for the token id function setTokenRoyalty(uint256 tokenId, address newRecipient, uint256 newPercentage) external onlyOwner { _overrideTokenRoyaltyInfo(tokenId, newRecipient, newPercentage); } /*////////////////////////////////////////////////////////////////////////// Token Uri Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to set token Uri for a token /// @dev requires owner or admin /// @param tokenId: token to set a uri for /// @param newUri: the new uri for the token function setTokenUri(uint256 tokenId, string calldata newUri) external onlyRoleOrOwner(ADMIN_ROLE) { if (!_exists(tokenId)) revert TokenDoesntExist(); if (bytes(newUri).length == 0) revert EmptyTokenURI(); _tokens[tokenId].uri = newUri; emit IERC1155Upgradeable.URI(newUri, tokenId); } /// @notice function for token uris /// @param tokenId: token for which to get the uri function uri(uint256 tokenId) public view override(ERC1155Upgradeable) returns (string memory) { if (!_exists(tokenId)) revert TokenDoesntExist(); return _tokens[tokenId].uri; } /*////////////////////////////////////////////////////////////////////////// Story Contract Hooks //////////////////////////////////////////////////////////////////////////*/ /// @inheritdoc StoryContractUpgradeable /// @dev restricted to the owner of the contract function _isStoryAdmin(address potentialAdmin) internal view override(StoryContractUpgradeable) returns (bool) { return potentialAdmin == owner(); } /// @inheritdoc StoryContractUpgradeable function _tokenExists(uint256 tokenId) internal view override(StoryContractUpgradeable) returns (bool) { return _exists(tokenId); } /// @inheritdoc StoryContractUpgradeable function _isTokenOwner(address potentialOwner, uint256 tokenId) internal view override(StoryContractUpgradeable) returns (bool) { return balanceOf(potentialOwner, tokenId) > 0; } /// @inheritdoc StoryContractUpgradeable /// @dev restricted to the owner of the contract function _isCreator(address potentialCreator, uint256 /* tokenId */ ) internal view override(StoryContractUpgradeable) returns (bool) { return potentialCreator == owner(); } /*////////////////////////////////////////////////////////////////////////// BlockList Functions //////////////////////////////////////////////////////////////////////////*/ /// @inheritdoc BlockListUpgradeable /// @dev restricted to the owner of the contract function isBlockListAdmin(address potentialAdmin) public view override(BlockListUpgradeable) returns (bool) { return potentialAdmin == owner(); } /// @inheritdoc ERC1155Upgradeable /// @dev added the `notBlocked` modifier for blocklist function setApprovalForAll(address operator, bool approved) public override(ERC1155Upgradeable) notBlocked(operator) { ERC1155Upgradeable.setApprovalForAll(operator, approved); } /*////////////////////////////////////////////////////////////////////////// ERC-165 Support //////////////////////////////////////////////////////////////////////////*/ /// @inheritdoc ERC165Upgradeable function supportsInterface(bytes4 interfaceId) public view override(ERC1155Upgradeable, EIP2981TLUpgradeable, StoryContractUpgradeable) returns (bool) { return ( ERC1155Upgradeable.supportsInterface(interfaceId) || EIP2981TLUpgradeable.supportsInterface(interfaceId) || StoryContractUpgradeable.supportsInterface(interfaceId) ); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.17; /// @title BlockList /// @author transientlabs.xyz /** * ____ _ __ __ ____ _ ________ __ * / __ )__ __(_) /___/ / / __ \(_) __/ __/__ ________ ____ / /_ * / __ / / / / / / __ / / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/ * / /_/ / /_/ / / / /_/ / / /_/ / / __/ __/ __/ / / __/ / / / /_ * /_____/\__,_/_/_/\__,_/ /_____/_/_/ /_/ \___/_/ \___/_/ /_/\__/ */ import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; import {BlockedOperator, Unauthorized, IBlockList} from "./IBlockList.sol"; import {IBlockListRegistry} from "./IBlockListRegistry.sol"; /// @notice abstract contract that can be inherited to block /// approvals from non-royalty paying marketplaces abstract contract BlockListUpgradeable is Initializable, IBlockList { /*////////////////////////////////////////////////////////////////////////// Public State Variables //////////////////////////////////////////////////////////////////////////*/ IBlockListRegistry public blockListRegistry; /*////////////////////////////////////////////////////////////////////////// Events //////////////////////////////////////////////////////////////////////////*/ event BlockListRegistryUpdated(address indexed caller, address indexed oldRegistry, address indexed newRegistry); /*////////////////////////////////////////////////////////////////////////// Modifiers //////////////////////////////////////////////////////////////////////////*/ /// @dev modifier that can be applied to approval functions in order to block listings on marketplaces modifier notBlocked(address operator) { if (getBlockListStatus(operator)) { revert BlockedOperator(); } _; } /*////////////////////////////////////////////////////////////////////////// Initializer //////////////////////////////////////////////////////////////////////////*/ /// @param blockListRegistryAddr - the initial BlockList Registry Address function __BlockList_init(address blockListRegistryAddr) internal onlyInitializing { __BlockList_init_unchained(blockListRegistryAddr); } /// @param blockListRegistryAddr - the initial BlockList Registry Address function __BlockList_init_unchained(address blockListRegistryAddr) internal onlyInitializing { blockListRegistry = IBlockListRegistry(blockListRegistryAddr); emit BlockListRegistryUpdated(msg.sender, address(0), blockListRegistryAddr); } /*////////////////////////////////////////////////////////////////////////// Admin Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to transfer ownership of the blockList /// @dev requires blockList owner /// @dev can be transferred to the ZERO_ADDRESS if desired /// @dev BE VERY CAREFUL USING THIS /// @param newBlockListRegistry - the address of the new BlockList registry function updateBlockListRegistry(address newBlockListRegistry) public { if (!isBlockListAdmin(msg.sender)) revert Unauthorized(); address oldRegistry = address(blockListRegistry); blockListRegistry = IBlockListRegistry(newBlockListRegistry); emit BlockListRegistryUpdated(msg.sender, oldRegistry, newBlockListRegistry); } /*////////////////////////////////////////////////////////////////////////// Public Read Functions //////////////////////////////////////////////////////////////////////////*/ /// @inheritdoc IBlockList function getBlockListStatus(address operator) public view override returns (bool) { if (address(blockListRegistry).code.length == 0) return false; try blockListRegistry.getBlockListStatus(operator) returns (bool isBlocked) { return isBlocked; } catch { return false; } } /// @notice Abstract function to determine if the operator is a blocklist admin. /// @param potentialAdmin - the potential admin address to check function isBlockListAdmin(address potentialAdmin) public view virtual returns (bool); /*////////////////////////////////////////////////////////////////////////// Upgradeability Gap //////////////////////////////////////////////////////////////////////////*/ /// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps uint256[50] private _gap; }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.17; /*////////////////////////////////////////////////////////////////////////// Custom Errors //////////////////////////////////////////////////////////////////////////*/ /// @dev blocked operator error error BlockedOperator(); /// @dev unauthorized to call fn method error Unauthorized(); interface IBlockList { /// @notice function to get blocklist status with True meaning that the operator is blocked /// @dev must return false if the blocklist registry is an EOA or an incompatible contract, true/false if compatible /// @param operator - operator to check against for blocking function getBlockListStatus(address operator) external view returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.17; /** * ____ _ __ __ ____ _ ________ __ * / __ )__ __(_) /___/ / / __ \(_) __/ __/__ ________ ____ / /_ * / __ / / / / / / __ / / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/ * / /_/ / /_/ / / / /_/ / / /_/ / / __/ __/ __/ / / __/ / / / /_ * /_____/\__,_/_/_/\__,_/ /_____/_/_/ /_/ \___/_/ \___/_/ /_/\__/ */ /// @title BlockList Registry /// @notice interface for the BlockListRegistry Contract /// @author transientlabs.xyz interface IBlockListRegistry { /*////////////////////////////////////////////////////////////////////////// Events //////////////////////////////////////////////////////////////////////////*/ event BlockListStatusChange(address indexed user, address indexed operator, bool indexed status); event BlockListCleared(address indexed user); /*////////////////////////////////////////////////////////////////////////// Public Read Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to get blocklist status with True meaning that the operator is blocked function getBlockListStatus(address operator) external view returns (bool); /*////////////////////////////////////////////////////////////////////////// Public Write Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to set the block list status for multiple operators /// @dev must be called by the blockList owner function setBlockListStatus(address[] calldata operators, bool status) external; /// @notice function to clear the block list status /// @dev must be called by the blockList owner function clearBlockList() external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @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[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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.8.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 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.8.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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return 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 // OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: Apache-2.0 /// @title Story Contract Interface /// @author transientlabs.xyz /// @version 2.3.0 /* ____ _ __ __ ____ _ ________ __ / __ )__ __(_) /___/ / / __ \(_) __/ __/__ ________ ____ / /_ / __ / / / / / / __ / / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/ / /_/ / /_/ / / / /_/ / / /_/ / / __/ __/ __/ / / __/ / / / /__ /_____/\__,_/_/_/\__,_/ /_____/_/_/ /_/ \___/_/ \___/_/ /_/\__(_)*/ pragma solidity 0.8.17; /*////////////////////////////////////////////////////////////////////////// Custom Errors //////////////////////////////////////////////////////////////////////////*/ /// @dev story additions are not enabled error StoryNotEnabled(); /// @dev token does not exist error TokenDoesNotExist(); /// @dev caller is not the token owner error NotTokenOwner(); /// @dev caller is not the token creator error NotTokenCreator(); /// @dev caller is not a story admin error NotStoryAdmin(); /*////////////////////////////////////////////////////////////////////////// IStory //////////////////////////////////////////////////////////////////////////*/ interface IStory { /*////////////////////////////////////////////////////////////////////////// Events //////////////////////////////////////////////////////////////////////////*/ /// @notice event describing a creator story getting added to a token /// @dev this events stores creator stories on chain in the event log /// @param tokenId - the token id to which the story is attached /// @param creatorAddress - the address of the creator of the token /// @param creatorName - string representation of the creator's name /// @param story - the story written and attached to the token id event CreatorStory(uint256 indexed tokenId, address indexed creatorAddress, string creatorName, string story); /// @notice event describing a collector story getting added to a token /// @dev this events stores collector stories on chain in the event log /// @param tokenId - the token id to which the story is attached /// @param collectorAddress - the address of the collector of the token /// @param collectorName - string representation of the collectors's name /// @param story - the story written and attached to the token id event Story(uint256 indexed tokenId, address indexed collectorAddress, string collectorName, string story); /*////////////////////////////////////////////////////////////////////////// Story Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to let the creator add a story to any token they have created /// @dev depending on the implementation, this function may be restricted in various ways, such as /// limiting the number of times the creator may write a story. /// @dev this function MUST emit the CreatorStory event each time it is called /// @dev this function MUST implement logic to restrict access to only the creator /// @dev this function MUST revert if a story is written to a non-existent token /// @param tokenId - the token id to which the story is attached /// @param creatorName - string representation of the creator's name /// @param story - the story written and attached to the token id function addCreatorStory(uint256 tokenId, string calldata creatorName, string calldata story) external; /// @notice function to let collectors add a story to any token they own /// @dev depending on the implementation, this function may be restricted in various ways, such as /// limiting the number of times a collector may write a story. /// @dev this function MUST emit the Story event each time it is called /// @dev this function MUST implement logic to restrict access to only the owner of the token /// @dev this function MUST revert if a story is written to a non-existent token /// @param tokenId - the token id to which the story is attached /// @param collectorName - string representation of the collectors's name /// @param story - the story written and attached to the token id function addStory(uint256 tokenId, string calldata collectorName, string calldata story) external; }
// SPDX-License-Identifier: Apache-2.0 /// @title Story Contract /// @dev upgradeable, inheritable abstract contract implementing the Story Contract interface /// @author transientlabs.xyz /// Version 2.3.0 /* ____ _ __ __ ____ _ ________ __ / __ )__ __(_) /___/ / / __ \(_) __/ __/__ ________ ____ / /_ / __ / / / / / / __ / / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/ / /_/ / /_/ / / / /_/ / / /_/ / / __/ __/ __/ / / __/ / / / /__ /_____/\__,_/_/_/\__,_/ /_____/_/_/ /_/ \___/_/ \___/_/ /_/\__(_)*/ pragma solidity 0.8.17; /*////////////////////////////////////////////////////////////////////////// Imports //////////////////////////////////////////////////////////////////////////*/ import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; import {ERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import { IStory, StoryNotEnabled, TokenDoesNotExist, NotTokenOwner, NotTokenCreator, NotStoryAdmin } from "../IStory.sol"; /*////////////////////////////////////////////////////////////////////////// Story Contract //////////////////////////////////////////////////////////////////////////*/ abstract contract StoryContractUpgradeable is Initializable, IStory, ERC165Upgradeable { /*////////////////////////////////////////////////////////////////////////// State Variables //////////////////////////////////////////////////////////////////////////*/ bool public storyEnabled; /*////////////////////////////////////////////////////////////////////////// Modifiers //////////////////////////////////////////////////////////////////////////*/ modifier storyMustBeEnabled() { if (!storyEnabled) revert StoryNotEnabled(); _; } /*////////////////////////////////////////////////////////////////////////// Initializer //////////////////////////////////////////////////////////////////////////*/ /// @param enabled - a bool to enable or disable Story addition function __StoryContractUpgradeable_init(bool enabled) internal { __StoryContractUpgradeable_init_unchained(enabled); } /// @param enabled - a bool to enable or disable Story addition function __StoryContractUpgradeable_init_unchained(bool enabled) internal { storyEnabled = enabled; } /*////////////////////////////////////////////////////////////////////////// Story Functions //////////////////////////////////////////////////////////////////////////*/ /// @dev function to set story enabled/disabled /// @dev requires story admin /// @param enabled - a boolean setting to enable or disable Story additions function setStoryEnabled(bool enabled) external { if (!_isStoryAdmin(msg.sender)) revert NotStoryAdmin(); storyEnabled = enabled; } /// @inheritdoc IStory function addCreatorStory(uint256 tokenId, string calldata creatorName, string calldata story) external storyMustBeEnabled { if (!_tokenExists(tokenId)) revert TokenDoesNotExist(); if (!_isCreator(msg.sender, tokenId)) revert NotTokenCreator(); emit CreatorStory(tokenId, msg.sender, creatorName, story); } /// @inheritdoc IStory function addStory(uint256 tokenId, string calldata collectorName, string calldata story) external storyMustBeEnabled { if (!_tokenExists(tokenId)) revert TokenDoesNotExist(); if (!_isTokenOwner(msg.sender, tokenId)) revert NotTokenOwner(); emit Story(tokenId, msg.sender, collectorName, story); } /*////////////////////////////////////////////////////////////////////////// Hooks //////////////////////////////////////////////////////////////////////////*/ /// @dev function to allow access to enabling/disabling story /// @param potentialAdmin - the address to check for admin priviledges function _isStoryAdmin(address potentialAdmin) internal view virtual returns (bool); /// @dev function to check if a token exists on the token contract /// @param tokenId - the token id to check for existence function _tokenExists(uint256 tokenId) internal view virtual returns (bool); /// @dev function to check ownership of a token /// @param potentialOwner - the address to check for ownership of `tokenId` /// @param tokenId - the token id to check ownership against function _isTokenOwner(address potentialOwner, uint256 tokenId) internal view virtual returns (bool); /// @dev function to check creatorship of a token /// @param potentialCreator - the address to check creatorship of `tokenId` /// @param tokenId - the token id to check creatorship against function _isCreator(address potentialCreator, uint256 tokenId) internal view virtual returns (bool); /*////////////////////////////////////////////////////////////////////////// Overrides //////////////////////////////////////////////////////////////////////////*/ /// @inheritdoc ERC165Upgradeable function supportsInterface(bytes4 interfaceId) public view virtual override (ERC165Upgradeable) returns (bool) { return interfaceId == type(IStory).interfaceId || ERC165Upgradeable.supportsInterface(interfaceId); } /*////////////////////////////////////////////////////////////////////////// Upgradeability Gap //////////////////////////////////////////////////////////////////////////*/ /// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps uint256[50] private _gap; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /// /// @dev Interface for the NFT Royalty Standard /// interface IEIP2981 { /// ERC165 bytes to add to interface array - set in parent contract /// implementing this standard /// /// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a /// @notice Called with the sale price to determine how much royalty // is owed and to whom. /// @param tokenId - the NFT asset queried for royalty information /// @param salePrice - the sale price of the NFT asset specified by tokenId /// @return receiver - address of who should be sent the royalty payment /// @return royaltyAmount - the royalty payment amount for salePrice function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: Apache-2.0 /// @title OwnableAccessControl.sol /// @notice single owner, flexible access control mechanics /// @dev can easily be extended by inheriting and applying additional roles /// @dev by default, only the owner can grant roles but by inheriting, but you /// may allow other roles to grant roles by using the internal helper. /// @author transientlabs.xyz /// https://github.com/Transient-Labs/tl-sol-tools /// Version 1.0.0 /* ____ _ __ __ ____ _ ________ __ / __ )__ __(_) /___/ / / __ \(_) __/ __/__ ________ ____ / /_ / __ / / / / / / __ / / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/ / /_/ / /_/ / / / /_/ / / /_/ / / __/ __/ __/ / / __/ / / / /__ /_____/\__,_/_/_/\__,_/ /_____/_/_/ /_/ \___/_/ \___/_/ /_/\__(_)*/ pragma solidity 0.8.17; /*////////////////////////////////////////////////////////////////////////// Imports //////////////////////////////////////////////////////////////////////////*/ import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; import {EnumerableSetUpgradeable} from "openzeppelin-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import {OwnableUpgradeable} from "openzeppelin-upgradeable/access/OwnableUpgradeable.sol"; /*////////////////////////////////////////////////////////////////////////// Custom Errors //////////////////////////////////////////////////////////////////////////*/ /// @dev does not have specified role error NotSpecifiedRole(bytes32 role); /// @dev is not specified role or owner error NotRoleOrOwner(bytes32 role); /*////////////////////////////////////////////////////////////////////////// OwnableAccessControl //////////////////////////////////////////////////////////////////////////*/ abstract contract OwnableAccessControlUpgradeable is Initializable, OwnableUpgradeable { /*////////////////////////////////////////////////////////////////////////// State Variables //////////////////////////////////////////////////////////////////////////*/ using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; uint256 private _c; // counter to be able to revoke all priviledges mapping(uint256 => mapping(bytes32 => mapping(address => bool))) private _roleStatus; mapping(uint256 => mapping(bytes32 => EnumerableSetUpgradeable.AddressSet)) private _roleMembers; /*////////////////////////////////////////////////////////////////////////// Events //////////////////////////////////////////////////////////////////////////*/ /// @param from - address that authorized the role change /// @param user - the address who's role has been changed /// @param approved - boolean indicating the user's status in role /// @param role - the bytes32 role created in the inheriting contract event RoleChange(address indexed from, address indexed user, bool indexed approved, bytes32 role); /// @param from - address that authorized the revoke event AllRolesRevoked(address indexed from); /*////////////////////////////////////////////////////////////////////////// Modifiers //////////////////////////////////////////////////////////////////////////*/ modifier onlyRole(bytes32 role) { if (!hasRole(role, msg.sender)) { revert NotSpecifiedRole(role); } _; } modifier onlyRoleOrOwner(bytes32 role) { if (!hasRole(role, msg.sender) && owner() != msg.sender) { revert NotRoleOrOwner(role); } _; } /*////////////////////////////////////////////////////////////////////////// Initializer //////////////////////////////////////////////////////////////////////////*/ /// @param initOwner - the address of the initial owner function __OwnableAccessControl_init(address initOwner) internal onlyInitializing { __Ownable_init(); _transferOwnership(initOwner); __OwnableAccessControl_init_unchained(); } function __OwnableAccessControl_init_unchained() internal onlyInitializing {} /*////////////////////////////////////////////////////////////////////////// External Role Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to revoke all roles currently present /// @dev increments the `_c` variables /// @dev requires owner privileges function revokeAllRoles() external onlyOwner { _c++; emit AllRolesRevoked(msg.sender); } /// @notice function to renounce role /// @param role - bytes32 role created in inheriting contracts function renounceRole(bytes32 role) external { address[] memory members = new address[](1); members[0] = msg.sender; _setRole(role, members, false); } /// @notice function to grant/revoke a role to an address /// @dev requires owner to call this function but this may be further /// extended using the internal helper function in inheriting contracts /// @param role - bytes32 role created in inheriting contracts /// @param roleMembers - list of addresses that should have roles attached to them based on `status` /// @param status - bool whether to remove or add `roleMembers` to the `role` function setRole(bytes32 role, address[] memory roleMembers, bool status) external onlyOwner { _setRole(role, roleMembers, status); } /*////////////////////////////////////////////////////////////////////////// External View Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to see if an address is the owner /// @param role - bytes32 role created in inheriting contracts /// @param potentialRoleMember - address to check for role membership function hasRole(bytes32 role, address potentialRoleMember) public view returns (bool) { return _roleStatus[_c][role][potentialRoleMember]; } /// @notice function to get role members /// @param role - bytes32 role created in inheriting contracts function getRoleMembers(bytes32 role) public view returns (address[] memory) { return _roleMembers[_c][role].values(); } /*////////////////////////////////////////////////////////////////////////// Internal Helper Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice helper function to set addresses for a role /// @param role - bytes32 role created in inheriting contracts /// @param roleMembers - list of addresses that should have roles attached to them based on `status` /// @param status - bool whether to remove or add `roleMembers` to the `role` function _setRole(bytes32 role, address[] memory roleMembers, bool status) internal { for (uint256 i = 0; i < roleMembers.length; i++) { _roleStatus[_c][role][roleMembers[i]] = status; if (status) { _roleMembers[_c][role].add(roleMembers[i]); } else { _roleMembers[_c][role].remove(roleMembers[i]); } emit RoleChange(msg.sender, roleMembers[i], status, role); } } /*////////////////////////////////////////////////////////////////////////// Upgradeability Gap //////////////////////////////////////////////////////////////////////////*/ /// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps uint256[50] private _gap; }
// SPDX-License-Identifier: Apache-2.0 /// @title EIP2981TLUpgradeable.sol /// @notice abstract contract to define a default royalty spec /// while allowing for specific token overrides /// @dev follows EIP-2981 (https://eips.ethereum.org/EIPS/eip-2981) /// @author transientlabs.xyz /// https://github.com/Transient-Labs/tl-sol-tools /// Version 1.0.0 /* ____ _ __ __ ____ _ ________ __ / __ )__ __(_) /___/ / / __ \(_) __/ __/__ ________ ____ / /_ / __ / / / / / / __ / / / / / / /_/ /_/ _ \/ ___/ _ \/ __ \/ __/ / /_/ / /_/ / / / /_/ / / /_/ / / __/ __/ __/ / / __/ / / / /__ /_____/\__,_/_/_/\__,_/ /_____/_/_/ /_/ \___/_/ \___/_/ /_/\__(_)*/ pragma solidity 0.8.17; /*////////////////////////////////////////////////////////////////////////// Imports //////////////////////////////////////////////////////////////////////////*/ import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; import {ERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import {IEIP2981} from "../../royalties/IEIP2981.sol"; /*////////////////////////////////////////////////////////////////////////// Custom Errors //////////////////////////////////////////////////////////////////////////*/ /// @dev error if the recipient is set to address(0) error ZeroAddressError(); /// @dev error if the royalty percentage is greater than to 100% error MaxRoyaltyError(); /*////////////////////////////////////////////////////////////////////////// EIP2981TL //////////////////////////////////////////////////////////////////////////*/ abstract contract EIP2981TLUpgradeable is IEIP2981, Initializable, ERC165Upgradeable { /*////////////////////////////////////////////////////////////////////////// Royalty Struct //////////////////////////////////////////////////////////////////////////*/ struct RoyaltySpec { address recipient; uint256 percentage; } /*////////////////////////////////////////////////////////////////////////// State Variables //////////////////////////////////////////////////////////////////////////*/ address private _defaultRecipient; uint256 private _defaultPercentage; mapping(uint256 => RoyaltySpec) private _tokenOverrides; /*////////////////////////////////////////////////////////////////////////// Initializer //////////////////////////////////////////////////////////////////////////*/ /// @notice function to initialize the contract /// @param defaultRecipient - the default royalty payout address /// @param defaultPercentage - the deafult royalty percentage, out of 10,000 function __EIP2981TL_init(address defaultRecipient, uint256 defaultPercentage) internal onlyInitializing { __EIP2981TL_init_unchained(defaultRecipient, defaultPercentage); } /// @notice unchained function to initialize the contract /// @param defaultRecipient - the default royalty payout address /// @param defaultPercentage - the deafult royalty percentage, out of 10,000 function __EIP2981TL_init_unchained(address defaultRecipient, uint256 defaultPercentage) internal onlyInitializing { _setDefaultRoyaltyInfo(defaultRecipient, defaultPercentage); } /*////////////////////////////////////////////////////////////////////////// Royalty Changing Functions //////////////////////////////////////////////////////////////////////////*/ /// @notice function to set default royalty info /// @param newRecipient - the new default royalty payout address /// @param newPercentage - the new default royalty percentage, out of 10,000 function _setDefaultRoyaltyInfo(address newRecipient, uint256 newPercentage) internal { if (newRecipient == address(0)) revert ZeroAddressError(); if (newPercentage > 10_000) revert MaxRoyaltyError(); _defaultRecipient = newRecipient; _defaultPercentage = newPercentage; } /// @notice function to override royalty spec on a specific token /// @param tokenId - the token id to override royalty for /// @param newRecipient - the new royalty payout address /// @param newPercentage - the new royalty percentage, out of 10,000 function _overrideTokenRoyaltyInfo(uint256 tokenId, address newRecipient, uint256 newPercentage) internal { if (newRecipient == address(0)) revert ZeroAddressError(); if (newPercentage > 10_000) revert MaxRoyaltyError(); _tokenOverrides[tokenId].recipient = newRecipient; _tokenOverrides[tokenId].percentage = newPercentage; } /*////////////////////////////////////////////////////////////////////////// Royalty Info //////////////////////////////////////////////////////////////////////////*/ /// @inheritdoc IEIP2981 function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount) { address recipient = _defaultRecipient; uint256 percentage = _defaultPercentage; if (_tokenOverrides[tokenId].recipient != address(0)) { recipient = _tokenOverrides[tokenId].recipient; percentage = _tokenOverrides[tokenId].percentage; } return (recipient, salePrice / 10_000 * percentage); // divide first to avoid overflow } /*////////////////////////////////////////////////////////////////////////// ERC-165 Override //////////////////////////////////////////////////////////////////////////*/ /// @inheritdoc ERC165Upgradeable function supportsInterface(bytes4 interfaceId) public view virtual override (ERC165Upgradeable) returns (bool) { return interfaceId == type(IEIP2981).interfaceId || ERC165Upgradeable.supportsInterface(interfaceId); } /*////////////////////////////////////////////////////////////////////////// Upgradeability Gap //////////////////////////////////////////////////////////////////////////*/ /// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps uint256[50] private _gap; }
{ "remappings": [ "blocklist/=lib/blocklist/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "openzeppelin/=lib/openzeppelin-contracts/contracts/", "story-contract/=lib/story-contract/src/", "tl-blocklist/=lib/blocklist/src/", "tl-sol-tools/=lib/tl-sol-tools/src/", "tl-story/=lib/story-contract/src/" ], "optimizer": { "enabled": true, "runs": 2000 }, "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":"bool","name":"disable","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"BlockedOperator","type":"error"},{"inputs":[],"name":"BurnZeroTokens","type":"error"},{"inputs":[],"name":"CallerNotApprovedOrOwner","type":"error"},{"inputs":[],"name":"EmptyTokenURI","type":"error"},{"inputs":[],"name":"MaxRoyaltyError","type":"error"},{"inputs":[],"name":"MintToZeroAddresses","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"NotRoleOrOwner","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"NotSpecifiedRole","type":"error"},{"inputs":[],"name":"NotStoryAdmin","type":"error"},{"inputs":[],"name":"NotTokenCreator","type":"error"},{"inputs":[],"name":"NotTokenOwner","type":"error"},{"inputs":[],"name":"StoryNotEnabled","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TokenDoesntExist","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ZeroAddressError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"}],"name":"AllRolesRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"oldRegistry","type":"address"},{"indexed":true,"internalType":"address","name":"newRegistry","type":"address"}],"name":"BlockListRegistryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"creatorAddress","type":"address"},{"indexed":false,"internalType":"string","name":"creatorName","type":"string"},{"indexed":false,"internalType":"string","name":"story","type":"string"}],"name":"CreatorStory","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"bool","name":"approved","type":"bool"},{"indexed":false,"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"RoleChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"collectorAddress","type":"address"},{"indexed":false,"internalType":"string","name":"collectorName","type":"string"},{"indexed":false,"internalType":"string","name":"story","type":"string"}],"name":"Story","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APPROVED_MINT_CONTRACT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"creatorName","type":"string"},{"internalType":"string","name":"story","type":"string"}],"name":"addCreatorStory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"collectorName","type":"string"},{"internalType":"string","name":"story","type":"string"}],"name":"addStory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"newUris","type":"string[]"},{"internalType":"address[][]","name":"addresses","type":"address[][]"},{"internalType":"uint256[][]","name":"amounts","type":"uint256[][]"},{"internalType":"address[]","name":"royaltyAddresses","type":"address[]"},{"internalType":"uint256[]","name":"royaltyPercents","type":"uint256[]"}],"name":"batchCreateToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"newUris","type":"string[]"},{"internalType":"address[][]","name":"addresses","type":"address[][]"},{"internalType":"uint256[][]","name":"amounts","type":"uint256[][]"}],"name":"batchCreateToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blockListRegistry","outputs":[{"internalType":"contract IBlockListRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newUri","type":"string"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"royaltyAddress","type":"address"},{"internalType":"uint256","name":"royaltyPercent","type":"uint256"}],"name":"createToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newUri","type":"string"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"createToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"externalMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"getBlockListStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMembers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenDetails","outputs":[{"components":[{"internalType":"bool","name":"created","type":"bool"},{"internalType":"string","name":"uri","type":"string"}],"internalType":"struct ERC1155TL.Token","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"potentialRoleMember","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"defaultRoyaltyRecipient","type":"address"},{"internalType":"uint256","name":"defaultRoyaltyPercentage","type":"uint256"},{"internalType":"address","name":"initOwner","type":"address"},{"internalType":"address[]","name":"admins","type":"address[]"},{"internalType":"bool","name":"enableStory","type":"bool"},{"internalType":"address","name":"blockListRegistry","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"potentialAdmin","type":"address"}],"name":"isBlockListAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeAllRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"minters","type":"address[]"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setApprovedMintContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRecipient","type":"address"},{"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address[]","name":"roleMembers","type":"address[]"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setStoryEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"newRecipient","type":"address"},{"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"newUri","type":"string"}],"name":"setTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"storyEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newBlockListRegistry","type":"address"}],"name":"updateBlockListRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162004d8738038062004d8783398101604081905262000034916200010e565b80156200004557620000456200004c565b5062000139565b600054610100900460ff1615620000b95760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156200010c576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012157600080fd5b815180151581146200013257600080fd5b9392505050565b614c3e80620001496000396000f3fe608060405234801561001057600080fd5b50600436106102e85760003560e01c806351dc02f211610191578063a22cb465116100e3578063d8c3a27411610097578063f242432a11610071578063f242432a146106c1578063f2fde38b146106d4578063ffa1ad74146106e757600080fd5b8063d8c3a2741461065f578063d8d045b414610672578063e985e9c51461068557600080fd5b8063a3246ad3116100c8578063a3246ad31461060c578063c1e037281461062c578063d4bf502a1461064c57600080fd5b8063a22cb465146105e5578063a25a3393146105f857600080fd5b806375b238fc1161014557806391d148541161011f57806391d148541461058657806395d89b41146105ca5780639713c807146105d257600080fd5b806375b238fc146105275780638bb9c5bf1461054e5780638da5cb5b1461056157600080fd5b806357f7789e1161017657806357f7789e146104f95780635b23e3ce1461050c578063715018a61461051f57600080fd5b806351dc02f2146104d357806356000f77146104e657600080fd5b80632d28c08b1161024a5780633db0f8ab116101fe578063485d3c07116101d8578063485d3c07146104925780634a597065146104a55780634e1273f4146104b357600080fd5b80633db0f8ab146104595780633f2bc9661461046c57806346317db71461047f57600080fd5b8063319210231161022f578063319210231461042b578063334980a51461043e57806333aa4fb31461045157600080fd5b80632d28c08b146104055780632eb2c2d61461041857600080fd5b80631fbd2402116102a1578063249fde3b11610286578063249fde3b146103ad57806324f029c3146103c05780632a55205a146103d357600080fd5b80631fbd2402146103735780631ff7f0bc1461038657600080fd5b806306fdde03116102d257806306fdde03146103365780630e89341c1461034b5780631258e8871461035e57600080fd5b8062fdd58e146102ed57806301ffc9a714610313575b600080fd5b6103006102fb366004613aa3565b6106ef565b6040519081526020015b60405180910390f35b610326610321366004613ae3565b61079d565b604051901515815260200161030a565b61033e6107c6565b60405161030a9190613b46565b61033e610359366004613b59565b610855565b61037161036c366004613b72565b61092a565b005b610371610381366004613cf9565b6109cb565b6103007ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af581565b6103716103bb366004613e13565b610b7d565b6103716103ce366004613e8d565b610c23565b6103e66103e1366004613eaa565b610c76565b604080516001600160a01b03909316835260208301919091520161030a565b610371610413366004613f0e565b610cee565b610371610426366004614028565b610e3b565b6103716104393660046140d2565b610edd565b61032661044c366004613b72565b61111a565b6103716111ca565b6103716104673660046141c3565b611214565b61032661047a366004613b72565b611331565b61037161048d366004614201565b611360565b6103716104a036600461429b565b611503565b610133546103269060ff1681565b6104c66104c13660046142d8565b611635565b60405161030a9190614377565b6103716104e136600461438a565b611773565b6103716104f43660046143e1565b611869565b61037161050736600461444a565b611974565b61037161051a3660046143e1565b611ab5565b610371611bb1565b6103007fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b61037161055c366004613b59565b611bc5565b60cc546001600160a01b03165b6040516001600160a01b03909116815260200161030a565b610326610594366004614496565b60fe54600090815260ff6020818152604080842086855282528084206001600160a01b0386168552909152909120541692915050565b61033e611c2b565b6103716105e03660046144c2565b611c39565b6103716105f33660046144f7565b611c51565b6101665461056e906001600160a01b031681565b61061f61061a366004613b59565b611c9c565b60405161030a919061452e565b61063f61063a366004613b59565b611cc5565b60405161030a919061457b565b61037161065a3660046145aa565b611d9b565b61037161066d366004613e13565b611dae565b610371610680366004613aa3565b611e30565b6103266106933660046145fa565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b6103716106cf366004614624565b611e42565b6103716106e2366004613b72565b611edd565b610300600181565b60006001600160a01b0383166107725760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006107a882611f6d565b806107b757506107b782611fef565b8061079757506107978261203d565b61019a80546107d490614689565b80601f016020809104026020016040519081016040528092919081815260200182805461080090614689565b801561084d5780601f106108225761010080835404028352916020019161084d565b820191906000526020600020905b81548152906001019060200180831161083057829003601f168201915b505050505081565b600081815261019c602052604090205460609060ff1661088857604051631d6fa32560e31b815260040160405180910390fd5b600082815261019c6020526040902060010180546108a590614689565b80601f01602080910402602001604051908101604052809291908181526020018280546108d190614689565b801561091e5780601f106108f35761010080835404028352916020019161091e565b820191906000526020600020905b81548152906001019060200180831161090157829003601f168201915b50505050509050919050565b61093333611331565b610969576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61016680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff198316811790935560405191169190829033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f90600090a45050565b600054610100900460ff16158080156109eb5750600054600160ff909116105b80610a055750303b158015610a05575060005460ff166001145b610a775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610769565b6000805460ff191660011790558015610a9a576000805461ff0019166101001790555b610ab26040518060200160405280600081525061208b565b610abc87876120ff565b610ac585612174565b610adb83610133805460ff191682151517905550565b610ae4826121f8565b610b107fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177585600161226c565b61019a610b1d8a82614709565b5061019b610b2b8982614709565b508015610b72576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610bed575033610be160cc546001600160a01b031690565b6001600160a01b031614155b15610c0e576040516376c1743160e01b815260048101829052602401610769565b610c1b86868686866123f9565b505050505050565b610c2c33611331565b610c62576040517f4701b18c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610133805460ff1916911515919091179055565b609754609854600084815260996020526040812054909283926001600160a01b039182169290911615610cc8575050600084815260996020526040902080546001909101546001600160a01b03909116905b8181610cd6612710886147df565b610ce09190614801565b9350935050505b9250929050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610d5e575033610d5260cc546001600160a01b031690565b6001600160a01b031614155b15610d7f576040516376c1743160e01b815260048101829052602401610769565b6000610e228a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525061251392505050565b9050610e2f81858561268b565b50505050505050505050565b6001600160a01b038516331480610e575750610e578533610693565b610ec95760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610769565b610ed68585858585612747565b5050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610f4d575033610f4160cc546001600160a01b031690565b6001600160a01b031614155b15610f6e576040516376c1743160e01b815260048101829052602401610769565b60008a9003610f90576040516317314b6160e01b815260040160405180910390fd5b60005b8a81101561110c5760006110ae8d8d84818110610fb257610fb2614818565b9050602002810190610fc4919061482e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e915086905081811061100d5761100d614818565b905060200281019061101f9190614875565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508e92508d915087905081811061106557611065614818565b90506020028101906110779190614875565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061251392505050565b90506110f9818888858181106110c6576110c6614818565b90506020020160208101906110db9190613b72565b8787868181106110ed576110ed614818565b9050602002013561268b565b5080611104816148bf565b915050610f93565b505050505050505050505050565b610166546000906001600160a01b03163b810361113957506000919050565b610166546040517f334980a50000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529091169063334980a590602401602060405180830381865afa9250505080156111b9575060408051601f3d908101601f191682019092526111b6918101906148d9565b60015b61079757506000919050565b919050565b6111d26129e0565b60fe80549060006111e2836148bf565b909155505060405133907fdf1eaea754aea6dc7d083377ed7366dd7405e3fb0f16ddfb9448770520e4427990600090a2565b600083900361124f576040517f3fb001d600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0386161480159061128c57506001600160a01b038516600090815260666020908152604080832033845290915290205460ff16155b156112c3576040517fc9c1cf1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ed68585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612a3a92505050565b600061134560cc546001600160a01b031690565b6001600160a01b0316826001600160a01b0316149050919050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156113d05750336113c460cc546001600160a01b031690565b6001600160a01b031614155b156113f1576040516376c1743160e01b815260048101829052602401610769565b6000869003611413576040516317314b6160e01b815260040160405180910390fd5b60005b868110156114f9576114e688888381811061143357611433614818565b9050602002810190611445919061482e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a925089915085905081811061148e5761148e614818565b90506020028101906114a09190614875565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525089925088915086905081811061106557611065614818565b50806114f1816148bf565b915050611416565b5050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775808652908352818520338652909252909220541615801561157357503361156760cc546001600160a01b031690565b6001600160a01b031614155b15611594576040516376c1743160e01b815260048101829052602401610769565b6114f987878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525061251392505050565b606081518351146116ae5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610769565b6000835167ffffffffffffffff8111156116ca576116ca613b8d565b6040519080825280602002602001820160405280156116f3578160200160208202803683370190505b50905060005b845181101561176b5761173e85828151811061171757611717614818565b602002602001015185838151811061173157611731614818565b60200260200101516106ef565b82828151811061175057611750614818565b6020908102919091010152611764816148bf565b90506116f9565b509392505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156117e35750336117d760cc546001600160a01b031690565b6001600160a01b031614155b15611804576040516376c1743160e01b815260048101829052602401610769565b6118637ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525087925061226c915050565b50505050565b6101335460ff166118a6576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118af85612cc8565b6118e5576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118ef3386612ce0565b611925576040517f57deb26a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f5c0564b4237730adb947143019acb5addfdbf1be3ad1edf72e24a8f9d02fd2c1868686866040516119659493929190614921565b60405180910390a35050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156119e45750336119d860cc546001600160a01b031690565b6001600160a01b031614155b15611a05576040516376c1743160e01b815260048101829052602401610769565b600084815261019c602052604090205460ff16611a3557604051631d6fa32560e31b815260040160405180910390fd5b6000829003611a57576040516317314b6160e01b815260040160405180910390fd5b600084815261019c60205260409020600101611a74838583614953565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051611aa7929190614a13565b60405180910390a250505050565b6101335460ff16611af2576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611afb85612cc8565b611b31576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b3b3386612d10565b611b71576040517f59dc379f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f40ebea9c3c7603a5d233a0bec01e483338737b6bed01bed2ac09ccbaa3d4b7ac868686866040516119659493929190614921565b611bb96129e0565b611bc36000612d25565b565b604080516001808252818301909252600091602080830190803683370190505090503381600081518110611bfb57611bfb614818565b60200260200101906001600160a01b031690816001600160a01b031681525050611c278282600061226c565b5050565b61019b80546107d490614689565b611c416129e0565b611c4c83838361268b565b505050565b81611c5b8161111a565b15611c92576040517fe0574fb800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c4c8383612d84565b60fe54600090815261010060209081526040808320848452909152902060609061079790612d8f565b604080518082019091526000815260606020820152600082815261019c60209081526040918290208251808401909352805460ff16151583526001810180549192840191611d1290614689565b80601f0160208091040260200160405190810160405280929190818152602001828054611d3e90614689565b8015611d8b5780601f10611d6057610100808354040283529160200191611d8b565b820191906000526020600020905b815481529060010190602001808311611d6e57829003601f168201915b5050505050815250509050919050565b611da36129e0565b611c4c83838361226c565b60fe54600090815260ff602081815260408084207ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af58086529083528185203386529092529092205416610c0e576040517fee074e7400000000000000000000000000000000000000000000000000000000815260048101829052602401610769565b611e386129e0565b611c278282612da3565b6001600160a01b038516331480611e5e5750611e5e8533610693565b611ed05760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610769565b610ed68585858585612e52565b611ee56129e0565b6001600160a01b038116611f615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610769565b611f6a81612d25565b50565b60006001600160e01b031982167fd9b67a26000000000000000000000000000000000000000000000000000000001480611fd057506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061079757506301ffc9a760e01b6001600160e01b0319831614610797565b60006001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061079757506301ffc9a760e01b6001600160e01b0319831614610797565b60006001600160e01b031982167f0d23ecb900000000000000000000000000000000000000000000000000000000148061079757506301ffc9a760e01b6001600160e01b0319831614610797565b600054610100900460ff166120f65760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f6a81613021565b600054610100900460ff1661216a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611c278282613095565b600054610100900460ff166121df5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b6121e7613100565b6121f081612d25565b611f6a613173565b600054610100900460ff166122635760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f6a816131de565b60005b82518110156118635760fe54600090815260ff60209081526040808320878452909152812084518492908690859081106122ab576122ab614818565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555081156123395761233383828151811061230557612305614818565b60209081029190910181015160fe5460009081526101008352604080822089835290935291909120906132a5565b5061237e565b61237c83828151811061234e5761234e614818565b60209081029190910181015160fe5460009081526101008352604080822089835290935291909120906132ba565b505b81151583828151811061239357612393614818565b60200260200101516001600160a01b0316336001600160a01b03167fc9f6f69b3c19bd2b7eb8273129bbca5e3db0e3be63ca9903e140122a5bbb556e876040516123df91815260200190565b60405180910390a4806123f1816148bf565b91505061226f565b600085815261019c602052604090205460ff1661242957604051631d6fa32560e31b815260040160405180910390fd5b6000839003612464576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82811461249d576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015610c1b576125018585838181106124bd576124bd614818565b90506020020160208101906124d29190613b72565b878585858181106124e5576124e5614818565b90506020020135604051806020016040528060008152506132cf565b8061250b816148bf565b9150506124a0565b60008351600003612537576040516317314b6160e01b815260040160405180910390fd5b8251600003612572576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81518351146125ad576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61019980549060006125be836148bf565b90915550506040805180820182526001808252602080830188815261019954600090815261019c9092529390208251815460ff191690151517815592519192919082019061260c9082614709565b5090505060005b835181101561267e5761266c84828151811061263157612631614818565b60200260200101516101995485848151811061264f5761264f614818565b6020026020010151604051806020016040528060008152506132cf565b80612676816148bf565b915050612613565b5050610199549392505050565b6001600160a01b0382166126cb576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710811115612707576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600092835260996020526040909220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117815560010155565b81518351146127be5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610769565b6001600160a01b03841661283a5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610769565b3360005b845181101561297a57600085828151811061285b5761285b614818565b60200260200101519050600085838151811061287957612879614818565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156129205760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610769565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061295f908490614a27565b9250508190555050505080612973906148bf565b905061283e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516129ca929190614a3a565b60405180910390a4610c1b818787878787613401565b60cc546001600160a01b03163314611bc35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610769565b6001600160a01b038316612ab65760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610769565b8051825114612b2d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610769565b604080516020810190915260009081905233905b8351811015612c5b576000848281518110612b5e57612b5e614818565b602002602001015190506000848381518110612b7c57612b7c614818565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015612c225760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152608401610769565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612c53816148bf565b915050612b41565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612cac929190614a3a565b60405180910390a4604080516020810190915260009052611863565b600081815261019c602052604081205460ff16610797565b6000612cf460cc546001600160a01b031690565b6001600160a01b0316836001600160a01b031614905092915050565b600080612d1d84846106ef565b119392505050565b60cc80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611c273383836135ed565b60606000612d9c836136e1565b9392505050565b6001600160a01b038216612de3576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710811115612e1f576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6097805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609855565b6001600160a01b038416612ece5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610769565b336000612eda8561373c565b90506000612ee78561373c565b905060008681526065602090815260408083206001600160a01b038c16845290915290205485811015612f825760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610769565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612fc1908490614a27565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b72848a8a8a8a8a613787565b600054610100900460ff1661308c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f6a816138ca565b600054610100900460ff16611e385760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b600054610100900460ff1661316b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611bc36138d6565b600054610100900460ff16611bc35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b600054610100900460ff166132495760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b610166805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405160009033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f908390a450565b6000612d9c836001600160a01b03841661394a565b6000612d9c836001600160a01b038416613999565b6001600160a01b03841661334b5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610769565b3360006133578561373c565b905060006133648561373c565b905060008681526065602090815260408083206001600160a01b038b16845290915281208054879290613398908490614a27565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46133f883600089898989613787565b50505050505050565b6001600160a01b0384163b15610c1b576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c819061345e9089908990889088908890600401614a68565b6020604051808303816000875af1925050508015613499575060408051601f3d908101601f1916820190925261349691810190614ac6565b60015b61354e576134a5614ae3565b806308c379a0036134de57506134b9614aff565b806134c457506134e0565b8060405162461bcd60e51b81526004016107699190613b46565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610769565b6001600160e01b031981167fbc197c8100000000000000000000000000000000000000000000000000000000146133f85760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610769565b816001600160a01b0316836001600160a01b0316036136745760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610769565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561091e57602002820191906000526020600020905b81548152602001906001019080831161371d5750505050509050919050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061377657613776614818565b602090810291909101015292915050565b6001600160a01b0384163b15610c1b576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906137e49089908990889088908890600401614ba7565b6020604051808303816000875af192505050801561381f575060408051601f3d908101601f1916820190925261381c91810190614ac6565b60015b61382b576134a5614ae3565b6001600160e01b031981167ff23a6e6100000000000000000000000000000000000000000000000000000000146133f85760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610769565b6067611c278282614709565b600054610100900460ff166139415760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611bc333612d25565b600081815260018301602052604081205461399157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610797565b506000610797565b60008181526001830160205260408120548015613a825760006139bd600183614bdf565b85549091506000906139d190600190614bdf565b9050818114613a365760008660000182815481106139f1576139f1614818565b9060005260206000200154905080876000018481548110613a1457613a14614818565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a4757613a47614bf2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610797565b6000915050610797565b80356001600160a01b03811681146111c557600080fd5b60008060408385031215613ab657600080fd5b613abf83613a8c565b946020939093013593505050565b6001600160e01b031981168114611f6a57600080fd5b600060208284031215613af557600080fd5b8135612d9c81613acd565b6000815180845260005b81811015613b2657602081850181015186830182015201613b0a565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000612d9c6020830184613b00565b600060208284031215613b6b57600080fd5b5035919050565b600060208284031215613b8457600080fd5b612d9c82613a8c565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613bc957613bc9613b8d565b6040525050565b600082601f830112613be157600080fd5b813567ffffffffffffffff811115613bfb57613bfb613b8d565b604051613c126020601f19601f8501160182613ba3565b818152846020838601011115613c2757600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff821115613c5e57613c5e613b8d565b5060051b60200190565b600082601f830112613c7957600080fd5b81356020613c8682613c44565b604051613c938282613ba3565b83815260059390931b8501820192828101915086841115613cb357600080fd5b8286015b84811015613cd557613cc881613a8c565b8352918301918301613cb7565b509695505050505050565b8015158114611f6a57600080fd5b80356111c581613ce0565b600080600080600080600080610100898b031215613d1657600080fd5b883567ffffffffffffffff80821115613d2e57600080fd5b613d3a8c838d01613bd0565b995060208b0135915080821115613d5057600080fd5b613d5c8c838d01613bd0565b9850613d6a60408c01613a8c565b975060608b01359650613d7f60808c01613a8c565b955060a08b0135915080821115613d9557600080fd5b50613da28b828c01613c68565b935050613db160c08a01613cee565b9150613dbf60e08a01613a8c565b90509295985092959890939650565b60008083601f840112613de057600080fd5b50813567ffffffffffffffff811115613df857600080fd5b6020830191508360208260051b8501011115610ce757600080fd5b600080600080600060608688031215613e2b57600080fd5b85359450602086013567ffffffffffffffff80821115613e4a57600080fd5b613e5689838a01613dce565b90965094506040880135915080821115613e6f57600080fd5b50613e7c88828901613dce565b969995985093965092949392505050565b600060208284031215613e9f57600080fd5b8135612d9c81613ce0565b60008060408385031215613ebd57600080fd5b50508035926020909101359150565b60008083601f840112613ede57600080fd5b50813567ffffffffffffffff811115613ef657600080fd5b602083019150836020828501011115610ce757600080fd5b60008060008060008060008060a0898b031215613f2a57600080fd5b883567ffffffffffffffff80821115613f4257600080fd5b613f4e8c838d01613ecc565b909a50985060208b0135915080821115613f6757600080fd5b613f738c838d01613dce565b909850965060408b0135915080821115613f8c57600080fd5b50613f998b828c01613dce565b9095509350613fac905060608a01613a8c565b9150608089013590509295985092959890939650565b600082601f830112613fd357600080fd5b81356020613fe082613c44565b604051613fed8282613ba3565b83815260059390931b850182019282810191508684111561400d57600080fd5b8286015b84811015613cd55780358352918301918301614011565b600080600080600060a0868803121561404057600080fd5b61404986613a8c565b945061405760208701613a8c565b9350604086013567ffffffffffffffff8082111561407457600080fd5b61408089838a01613fc2565b9450606088013591508082111561409657600080fd5b6140a289838a01613fc2565b935060808801359150808211156140b857600080fd5b506140c588828901613bd0565b9150509295509295909350565b60008060008060008060008060008060a08b8d0312156140f157600080fd5b8a3567ffffffffffffffff8082111561410957600080fd5b6141158e838f01613dce565b909c509a5060208d013591508082111561412e57600080fd5b61413a8e838f01613dce565b909a50985060408d013591508082111561415357600080fd5b61415f8e838f01613dce565b909850965060608d013591508082111561417857600080fd5b6141848e838f01613dce565b909650945060808d013591508082111561419d57600080fd5b506141aa8d828e01613dce565b915080935050809150509295989b9194979a5092959850565b6000806000806000606086880312156141db57600080fd5b6141e486613a8c565b9450602086013567ffffffffffffffff80821115613e4a57600080fd5b6000806000806000806060878903121561421a57600080fd5b863567ffffffffffffffff8082111561423257600080fd5b61423e8a838b01613dce565b9098509650602089013591508082111561425757600080fd5b6142638a838b01613dce565b9096509450604089013591508082111561427c57600080fd5b5061428989828a01613dce565b979a9699509497509295939492505050565b600080600080600080606087890312156142b457600080fd5b863567ffffffffffffffff808211156142cc57600080fd5b61423e8a838b01613ecc565b600080604083850312156142eb57600080fd5b823567ffffffffffffffff8082111561430357600080fd5b61430f86838701613c68565b9350602085013591508082111561432557600080fd5b5061433285828601613fc2565b9150509250929050565b600081518084526020808501945080840160005b8381101561436c57815187529582019590820190600101614350565b509495945050505050565b602081526000612d9c602083018461433c565b60008060006040848603121561439f57600080fd5b833567ffffffffffffffff8111156143b657600080fd5b6143c286828701613dce565b90945092505060208401356143d681613ce0565b809150509250925092565b6000806000806000606086880312156143f957600080fd5b85359450602086013567ffffffffffffffff8082111561441857600080fd5b61442489838a01613ecc565b9096509450604088013591508082111561443d57600080fd5b50613e7c88828901613ecc565b60008060006040848603121561445f57600080fd5b83359250602084013567ffffffffffffffff81111561447d57600080fd5b61448986828701613ecc565b9497909650939450505050565b600080604083850312156144a957600080fd5b823591506144b960208401613a8c565b90509250929050565b6000806000606084860312156144d757600080fd5b833592506144e760208501613a8c565b9150604084013590509250925092565b6000806040838503121561450a57600080fd5b61451383613a8c565b9150602083013561452381613ce0565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561456f5783516001600160a01b03168352928401929184019160010161454a565b50909695505050505050565b60208152815115156020820152600060208301516040808401526145a26060840182613b00565b949350505050565b6000806000606084860312156145bf57600080fd5b83359250602084013567ffffffffffffffff8111156145dd57600080fd5b6145e986828701613c68565b92505060408401356143d681613ce0565b6000806040838503121561460d57600080fd5b61461683613a8c565b91506144b960208401613a8c565b600080600080600060a0868803121561463c57600080fd5b61464586613a8c565b945061465360208701613a8c565b93506040860135925060608601359150608086013567ffffffffffffffff81111561467d57600080fd5b6140c588828901613bd0565b600181811c9082168061469d57607f821691505b6020821081036146bd57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611c4c57600081815260208120601f850160051c810160208610156146ea5750805b601f850160051c820191505b81811015610c1b578281556001016146f6565b815167ffffffffffffffff81111561472357614723613b8d565b614737816147318454614689565b846146c3565b602080601f83116001811461476c57600084156147545750858301515b600019600386901b1c1916600185901b178555610c1b565b600085815260208120601f198616915b8281101561479b5788860151825594840194600190910190840161477c565b50858210156147b95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b6000826147fc57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610797576107976147c9565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261484557600080fd5b83018035915067ffffffffffffffff82111561486057600080fd5b602001915036819003821315610ce757600080fd5b6000808335601e1984360301811261488c57600080fd5b83018035915067ffffffffffffffff8211156148a757600080fd5b6020019150600581901b3603821315610ce757600080fd5b600060001982036148d2576148d26147c9565b5060010190565b6000602082840312156148eb57600080fd5b8151612d9c81613ce0565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6040815260006149356040830186886148f6565b82810360208401526149488185876148f6565b979650505050505050565b67ffffffffffffffff83111561496b5761496b613b8d565b61497f836149798354614689565b836146c3565b6000601f8411600181146149b3576000851561499b5750838201355b600019600387901b1c1916600186901b178355610ed6565b600083815260209020601f19861690835b828110156149e457868501358255602094850194600190920191016149c4565b5086821015614a015760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6020815260006145a26020830184866148f6565b80820180821115610797576107976147c9565b604081526000614a4d604083018561433c565b8281036020840152614a5f818561433c565b95945050505050565b60006001600160a01b03808816835280871660208401525060a06040830152614a9460a083018661433c565b8281036060840152614aa6818661433c565b90508281036080840152614aba8185613b00565b98975050505050505050565b600060208284031215614ad857600080fd5b8151612d9c81613acd565b600060033d1115614afc5760046000803e5060005160e01c5b90565b600060443d1015614b0d5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715614b5b57505050505090565b8285019150815181811115614b735750505050505090565b843d8701016020828501011115614b8d5750505050505090565b614b9c60208286010187613ba3565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261494860a0830184613b00565b81810381811115610797576107976147c9565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220420a7735f1a8869de14115d60b768c47691af7cca2e9121367472cb597bc11f764736f6c634300081100330000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102e85760003560e01c806351dc02f211610191578063a22cb465116100e3578063d8c3a27411610097578063f242432a11610071578063f242432a146106c1578063f2fde38b146106d4578063ffa1ad74146106e757600080fd5b8063d8c3a2741461065f578063d8d045b414610672578063e985e9c51461068557600080fd5b8063a3246ad3116100c8578063a3246ad31461060c578063c1e037281461062c578063d4bf502a1461064c57600080fd5b8063a22cb465146105e5578063a25a3393146105f857600080fd5b806375b238fc1161014557806391d148541161011f57806391d148541461058657806395d89b41146105ca5780639713c807146105d257600080fd5b806375b238fc146105275780638bb9c5bf1461054e5780638da5cb5b1461056157600080fd5b806357f7789e1161017657806357f7789e146104f95780635b23e3ce1461050c578063715018a61461051f57600080fd5b806351dc02f2146104d357806356000f77146104e657600080fd5b80632d28c08b1161024a5780633db0f8ab116101fe578063485d3c07116101d8578063485d3c07146104925780634a597065146104a55780634e1273f4146104b357600080fd5b80633db0f8ab146104595780633f2bc9661461046c57806346317db71461047f57600080fd5b8063319210231161022f578063319210231461042b578063334980a51461043e57806333aa4fb31461045157600080fd5b80632d28c08b146104055780632eb2c2d61461041857600080fd5b80631fbd2402116102a1578063249fde3b11610286578063249fde3b146103ad57806324f029c3146103c05780632a55205a146103d357600080fd5b80631fbd2402146103735780631ff7f0bc1461038657600080fd5b806306fdde03116102d257806306fdde03146103365780630e89341c1461034b5780631258e8871461035e57600080fd5b8062fdd58e146102ed57806301ffc9a714610313575b600080fd5b6103006102fb366004613aa3565b6106ef565b6040519081526020015b60405180910390f35b610326610321366004613ae3565b61079d565b604051901515815260200161030a565b61033e6107c6565b60405161030a9190613b46565b61033e610359366004613b59565b610855565b61037161036c366004613b72565b61092a565b005b610371610381366004613cf9565b6109cb565b6103007ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af581565b6103716103bb366004613e13565b610b7d565b6103716103ce366004613e8d565b610c23565b6103e66103e1366004613eaa565b610c76565b604080516001600160a01b03909316835260208301919091520161030a565b610371610413366004613f0e565b610cee565b610371610426366004614028565b610e3b565b6103716104393660046140d2565b610edd565b61032661044c366004613b72565b61111a565b6103716111ca565b6103716104673660046141c3565b611214565b61032661047a366004613b72565b611331565b61037161048d366004614201565b611360565b6103716104a036600461429b565b611503565b610133546103269060ff1681565b6104c66104c13660046142d8565b611635565b60405161030a9190614377565b6103716104e136600461438a565b611773565b6103716104f43660046143e1565b611869565b61037161050736600461444a565b611974565b61037161051a3660046143e1565b611ab5565b610371611bb1565b6103007fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b61037161055c366004613b59565b611bc5565b60cc546001600160a01b03165b6040516001600160a01b03909116815260200161030a565b610326610594366004614496565b60fe54600090815260ff6020818152604080842086855282528084206001600160a01b0386168552909152909120541692915050565b61033e611c2b565b6103716105e03660046144c2565b611c39565b6103716105f33660046144f7565b611c51565b6101665461056e906001600160a01b031681565b61061f61061a366004613b59565b611c9c565b60405161030a919061452e565b61063f61063a366004613b59565b611cc5565b60405161030a919061457b565b61037161065a3660046145aa565b611d9b565b61037161066d366004613e13565b611dae565b610371610680366004613aa3565b611e30565b6103266106933660046145fa565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b6103716106cf366004614624565b611e42565b6103716106e2366004613b72565b611edd565b610300600181565b60006001600160a01b0383166107725760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006107a882611f6d565b806107b757506107b782611fef565b8061079757506107978261203d565b61019a80546107d490614689565b80601f016020809104026020016040519081016040528092919081815260200182805461080090614689565b801561084d5780601f106108225761010080835404028352916020019161084d565b820191906000526020600020905b81548152906001019060200180831161083057829003601f168201915b505050505081565b600081815261019c602052604090205460609060ff1661088857604051631d6fa32560e31b815260040160405180910390fd5b600082815261019c6020526040902060010180546108a590614689565b80601f01602080910402602001604051908101604052809291908181526020018280546108d190614689565b801561091e5780601f106108f35761010080835404028352916020019161091e565b820191906000526020600020905b81548152906001019060200180831161090157829003601f168201915b50505050509050919050565b61093333611331565b610969576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61016680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff198316811790935560405191169190829033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f90600090a45050565b600054610100900460ff16158080156109eb5750600054600160ff909116105b80610a055750303b158015610a05575060005460ff166001145b610a775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610769565b6000805460ff191660011790558015610a9a576000805461ff0019166101001790555b610ab26040518060200160405280600081525061208b565b610abc87876120ff565b610ac585612174565b610adb83610133805460ff191682151517905550565b610ae4826121f8565b610b107fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177585600161226c565b61019a610b1d8a82614709565b5061019b610b2b8982614709565b508015610b72576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610bed575033610be160cc546001600160a01b031690565b6001600160a01b031614155b15610c0e576040516376c1743160e01b815260048101829052602401610769565b610c1b86868686866123f9565b505050505050565b610c2c33611331565b610c62576040517f4701b18c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610133805460ff1916911515919091179055565b609754609854600084815260996020526040812054909283926001600160a01b039182169290911615610cc8575050600084815260996020526040902080546001909101546001600160a01b03909116905b8181610cd6612710886147df565b610ce09190614801565b9350935050505b9250929050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610d5e575033610d5260cc546001600160a01b031690565b6001600160a01b031614155b15610d7f576040516376c1743160e01b815260048101829052602401610769565b6000610e228a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525061251392505050565b9050610e2f81858561268b565b50505050505050505050565b6001600160a01b038516331480610e575750610e578533610693565b610ec95760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610769565b610ed68585858585612747565b5050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610f4d575033610f4160cc546001600160a01b031690565b6001600160a01b031614155b15610f6e576040516376c1743160e01b815260048101829052602401610769565b60008a9003610f90576040516317314b6160e01b815260040160405180910390fd5b60005b8a81101561110c5760006110ae8d8d84818110610fb257610fb2614818565b9050602002810190610fc4919061482e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e915086905081811061100d5761100d614818565b905060200281019061101f9190614875565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508e92508d915087905081811061106557611065614818565b90506020028101906110779190614875565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061251392505050565b90506110f9818888858181106110c6576110c6614818565b90506020020160208101906110db9190613b72565b8787868181106110ed576110ed614818565b9050602002013561268b565b5080611104816148bf565b915050610f93565b505050505050505050505050565b610166546000906001600160a01b03163b810361113957506000919050565b610166546040517f334980a50000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529091169063334980a590602401602060405180830381865afa9250505080156111b9575060408051601f3d908101601f191682019092526111b6918101906148d9565b60015b61079757506000919050565b919050565b6111d26129e0565b60fe80549060006111e2836148bf565b909155505060405133907fdf1eaea754aea6dc7d083377ed7366dd7405e3fb0f16ddfb9448770520e4427990600090a2565b600083900361124f576040517f3fb001d600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0386161480159061128c57506001600160a01b038516600090815260666020908152604080832033845290915290205460ff16155b156112c3576040517fc9c1cf1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ed68585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612a3a92505050565b600061134560cc546001600160a01b031690565b6001600160a01b0316826001600160a01b0316149050919050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156113d05750336113c460cc546001600160a01b031690565b6001600160a01b031614155b156113f1576040516376c1743160e01b815260048101829052602401610769565b6000869003611413576040516317314b6160e01b815260040160405180910390fd5b60005b868110156114f9576114e688888381811061143357611433614818565b9050602002810190611445919061482e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a925089915085905081811061148e5761148e614818565b90506020028101906114a09190614875565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525089925088915086905081811061106557611065614818565b50806114f1816148bf565b915050611416565b5050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775808652908352818520338652909252909220541615801561157357503361156760cc546001600160a01b031690565b6001600160a01b031614155b15611594576040516376c1743160e01b815260048101829052602401610769565b6114f987878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525061251392505050565b606081518351146116ae5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610769565b6000835167ffffffffffffffff8111156116ca576116ca613b8d565b6040519080825280602002602001820160405280156116f3578160200160208202803683370190505b50905060005b845181101561176b5761173e85828151811061171757611717614818565b602002602001015185838151811061173157611731614818565b60200260200101516106ef565b82828151811061175057611750614818565b6020908102919091010152611764816148bf565b90506116f9565b509392505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156117e35750336117d760cc546001600160a01b031690565b6001600160a01b031614155b15611804576040516376c1743160e01b815260048101829052602401610769565b6118637ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525087925061226c915050565b50505050565b6101335460ff166118a6576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118af85612cc8565b6118e5576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118ef3386612ce0565b611925576040517f57deb26a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f5c0564b4237730adb947143019acb5addfdbf1be3ad1edf72e24a8f9d02fd2c1868686866040516119659493929190614921565b60405180910390a35050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156119e45750336119d860cc546001600160a01b031690565b6001600160a01b031614155b15611a05576040516376c1743160e01b815260048101829052602401610769565b600084815261019c602052604090205460ff16611a3557604051631d6fa32560e31b815260040160405180910390fd5b6000829003611a57576040516317314b6160e01b815260040160405180910390fd5b600084815261019c60205260409020600101611a74838583614953565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051611aa7929190614a13565b60405180910390a250505050565b6101335460ff16611af2576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611afb85612cc8565b611b31576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b3b3386612d10565b611b71576040517f59dc379f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f40ebea9c3c7603a5d233a0bec01e483338737b6bed01bed2ac09ccbaa3d4b7ac868686866040516119659493929190614921565b611bb96129e0565b611bc36000612d25565b565b604080516001808252818301909252600091602080830190803683370190505090503381600081518110611bfb57611bfb614818565b60200260200101906001600160a01b031690816001600160a01b031681525050611c278282600061226c565b5050565b61019b80546107d490614689565b611c416129e0565b611c4c83838361268b565b505050565b81611c5b8161111a565b15611c92576040517fe0574fb800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c4c8383612d84565b60fe54600090815261010060209081526040808320848452909152902060609061079790612d8f565b604080518082019091526000815260606020820152600082815261019c60209081526040918290208251808401909352805460ff16151583526001810180549192840191611d1290614689565b80601f0160208091040260200160405190810160405280929190818152602001828054611d3e90614689565b8015611d8b5780601f10611d6057610100808354040283529160200191611d8b565b820191906000526020600020905b815481529060010190602001808311611d6e57829003601f168201915b5050505050815250509050919050565b611da36129e0565b611c4c83838361226c565b60fe54600090815260ff602081815260408084207ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af58086529083528185203386529092529092205416610c0e576040517fee074e7400000000000000000000000000000000000000000000000000000000815260048101829052602401610769565b611e386129e0565b611c278282612da3565b6001600160a01b038516331480611e5e5750611e5e8533610693565b611ed05760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610769565b610ed68585858585612e52565b611ee56129e0565b6001600160a01b038116611f615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610769565b611f6a81612d25565b50565b60006001600160e01b031982167fd9b67a26000000000000000000000000000000000000000000000000000000001480611fd057506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061079757506301ffc9a760e01b6001600160e01b0319831614610797565b60006001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061079757506301ffc9a760e01b6001600160e01b0319831614610797565b60006001600160e01b031982167f0d23ecb900000000000000000000000000000000000000000000000000000000148061079757506301ffc9a760e01b6001600160e01b0319831614610797565b600054610100900460ff166120f65760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f6a81613021565b600054610100900460ff1661216a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611c278282613095565b600054610100900460ff166121df5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b6121e7613100565b6121f081612d25565b611f6a613173565b600054610100900460ff166122635760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f6a816131de565b60005b82518110156118635760fe54600090815260ff60209081526040808320878452909152812084518492908690859081106122ab576122ab614818565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555081156123395761233383828151811061230557612305614818565b60209081029190910181015160fe5460009081526101008352604080822089835290935291909120906132a5565b5061237e565b61237c83828151811061234e5761234e614818565b60209081029190910181015160fe5460009081526101008352604080822089835290935291909120906132ba565b505b81151583828151811061239357612393614818565b60200260200101516001600160a01b0316336001600160a01b03167fc9f6f69b3c19bd2b7eb8273129bbca5e3db0e3be63ca9903e140122a5bbb556e876040516123df91815260200190565b60405180910390a4806123f1816148bf565b91505061226f565b600085815261019c602052604090205460ff1661242957604051631d6fa32560e31b815260040160405180910390fd5b6000839003612464576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82811461249d576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015610c1b576125018585838181106124bd576124bd614818565b90506020020160208101906124d29190613b72565b878585858181106124e5576124e5614818565b90506020020135604051806020016040528060008152506132cf565b8061250b816148bf565b9150506124a0565b60008351600003612537576040516317314b6160e01b815260040160405180910390fd5b8251600003612572576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81518351146125ad576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61019980549060006125be836148bf565b90915550506040805180820182526001808252602080830188815261019954600090815261019c9092529390208251815460ff191690151517815592519192919082019061260c9082614709565b5090505060005b835181101561267e5761266c84828151811061263157612631614818565b60200260200101516101995485848151811061264f5761264f614818565b6020026020010151604051806020016040528060008152506132cf565b80612676816148bf565b915050612613565b5050610199549392505050565b6001600160a01b0382166126cb576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710811115612707576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600092835260996020526040909220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117815560010155565b81518351146127be5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610769565b6001600160a01b03841661283a5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610769565b3360005b845181101561297a57600085828151811061285b5761285b614818565b60200260200101519050600085838151811061287957612879614818565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156129205760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610769565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061295f908490614a27565b9250508190555050505080612973906148bf565b905061283e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516129ca929190614a3a565b60405180910390a4610c1b818787878787613401565b60cc546001600160a01b03163314611bc35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610769565b6001600160a01b038316612ab65760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610769565b8051825114612b2d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610769565b604080516020810190915260009081905233905b8351811015612c5b576000848281518110612b5e57612b5e614818565b602002602001015190506000848381518110612b7c57612b7c614818565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015612c225760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152608401610769565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612c53816148bf565b915050612b41565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612cac929190614a3a565b60405180910390a4604080516020810190915260009052611863565b600081815261019c602052604081205460ff16610797565b6000612cf460cc546001600160a01b031690565b6001600160a01b0316836001600160a01b031614905092915050565b600080612d1d84846106ef565b119392505050565b60cc80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611c273383836135ed565b60606000612d9c836136e1565b9392505050565b6001600160a01b038216612de3576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710811115612e1f576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6097805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609855565b6001600160a01b038416612ece5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610769565b336000612eda8561373c565b90506000612ee78561373c565b905060008681526065602090815260408083206001600160a01b038c16845290915290205485811015612f825760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610769565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612fc1908490614a27565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b72848a8a8a8a8a613787565b600054610100900460ff1661308c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611f6a816138ca565b600054610100900460ff16611e385760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b600054610100900460ff1661316b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611bc36138d6565b600054610100900460ff16611bc35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b600054610100900460ff166132495760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b610166805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405160009033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f908390a450565b6000612d9c836001600160a01b03841661394a565b6000612d9c836001600160a01b038416613999565b6001600160a01b03841661334b5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610769565b3360006133578561373c565b905060006133648561373c565b905060008681526065602090815260408083206001600160a01b038b16845290915281208054879290613398908490614a27565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46133f883600089898989613787565b50505050505050565b6001600160a01b0384163b15610c1b576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c819061345e9089908990889088908890600401614a68565b6020604051808303816000875af1925050508015613499575060408051601f3d908101601f1916820190925261349691810190614ac6565b60015b61354e576134a5614ae3565b806308c379a0036134de57506134b9614aff565b806134c457506134e0565b8060405162461bcd60e51b81526004016107699190613b46565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610769565b6001600160e01b031981167fbc197c8100000000000000000000000000000000000000000000000000000000146133f85760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610769565b816001600160a01b0316836001600160a01b0316036136745760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610769565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561091e57602002820191906000526020600020905b81548152602001906001019080831161371d5750505050509050919050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061377657613776614818565b602090810291909101015292915050565b6001600160a01b0384163b15610c1b576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906137e49089908990889088908890600401614ba7565b6020604051808303816000875af192505050801561381f575060408051601f3d908101601f1916820190925261381c91810190614ac6565b60015b61382b576134a5614ae3565b6001600160e01b031981167ff23a6e6100000000000000000000000000000000000000000000000000000000146133f85760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610769565b6067611c278282614709565b600054610100900460ff166139415760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610769565b611bc333612d25565b600081815260018301602052604081205461399157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610797565b506000610797565b60008181526001830160205260408120548015613a825760006139bd600183614bdf565b85549091506000906139d190600190614bdf565b9050818114613a365760008660000182815481106139f1576139f1614818565b9060005260206000200154905080876000018481548110613a1457613a14614818565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a4757613a47614bf2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610797565b6000915050610797565b80356001600160a01b03811681146111c557600080fd5b60008060408385031215613ab657600080fd5b613abf83613a8c565b946020939093013593505050565b6001600160e01b031981168114611f6a57600080fd5b600060208284031215613af557600080fd5b8135612d9c81613acd565b6000815180845260005b81811015613b2657602081850181015186830182015201613b0a565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000612d9c6020830184613b00565b600060208284031215613b6b57600080fd5b5035919050565b600060208284031215613b8457600080fd5b612d9c82613a8c565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613bc957613bc9613b8d565b6040525050565b600082601f830112613be157600080fd5b813567ffffffffffffffff811115613bfb57613bfb613b8d565b604051613c126020601f19601f8501160182613ba3565b818152846020838601011115613c2757600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff821115613c5e57613c5e613b8d565b5060051b60200190565b600082601f830112613c7957600080fd5b81356020613c8682613c44565b604051613c938282613ba3565b83815260059390931b8501820192828101915086841115613cb357600080fd5b8286015b84811015613cd557613cc881613a8c565b8352918301918301613cb7565b509695505050505050565b8015158114611f6a57600080fd5b80356111c581613ce0565b600080600080600080600080610100898b031215613d1657600080fd5b883567ffffffffffffffff80821115613d2e57600080fd5b613d3a8c838d01613bd0565b995060208b0135915080821115613d5057600080fd5b613d5c8c838d01613bd0565b9850613d6a60408c01613a8c565b975060608b01359650613d7f60808c01613a8c565b955060a08b0135915080821115613d9557600080fd5b50613da28b828c01613c68565b935050613db160c08a01613cee565b9150613dbf60e08a01613a8c565b90509295985092959890939650565b60008083601f840112613de057600080fd5b50813567ffffffffffffffff811115613df857600080fd5b6020830191508360208260051b8501011115610ce757600080fd5b600080600080600060608688031215613e2b57600080fd5b85359450602086013567ffffffffffffffff80821115613e4a57600080fd5b613e5689838a01613dce565b90965094506040880135915080821115613e6f57600080fd5b50613e7c88828901613dce565b969995985093965092949392505050565b600060208284031215613e9f57600080fd5b8135612d9c81613ce0565b60008060408385031215613ebd57600080fd5b50508035926020909101359150565b60008083601f840112613ede57600080fd5b50813567ffffffffffffffff811115613ef657600080fd5b602083019150836020828501011115610ce757600080fd5b60008060008060008060008060a0898b031215613f2a57600080fd5b883567ffffffffffffffff80821115613f4257600080fd5b613f4e8c838d01613ecc565b909a50985060208b0135915080821115613f6757600080fd5b613f738c838d01613dce565b909850965060408b0135915080821115613f8c57600080fd5b50613f998b828c01613dce565b9095509350613fac905060608a01613a8c565b9150608089013590509295985092959890939650565b600082601f830112613fd357600080fd5b81356020613fe082613c44565b604051613fed8282613ba3565b83815260059390931b850182019282810191508684111561400d57600080fd5b8286015b84811015613cd55780358352918301918301614011565b600080600080600060a0868803121561404057600080fd5b61404986613a8c565b945061405760208701613a8c565b9350604086013567ffffffffffffffff8082111561407457600080fd5b61408089838a01613fc2565b9450606088013591508082111561409657600080fd5b6140a289838a01613fc2565b935060808801359150808211156140b857600080fd5b506140c588828901613bd0565b9150509295509295909350565b60008060008060008060008060008060a08b8d0312156140f157600080fd5b8a3567ffffffffffffffff8082111561410957600080fd5b6141158e838f01613dce565b909c509a5060208d013591508082111561412e57600080fd5b61413a8e838f01613dce565b909a50985060408d013591508082111561415357600080fd5b61415f8e838f01613dce565b909850965060608d013591508082111561417857600080fd5b6141848e838f01613dce565b909650945060808d013591508082111561419d57600080fd5b506141aa8d828e01613dce565b915080935050809150509295989b9194979a5092959850565b6000806000806000606086880312156141db57600080fd5b6141e486613a8c565b9450602086013567ffffffffffffffff80821115613e4a57600080fd5b6000806000806000806060878903121561421a57600080fd5b863567ffffffffffffffff8082111561423257600080fd5b61423e8a838b01613dce565b9098509650602089013591508082111561425757600080fd5b6142638a838b01613dce565b9096509450604089013591508082111561427c57600080fd5b5061428989828a01613dce565b979a9699509497509295939492505050565b600080600080600080606087890312156142b457600080fd5b863567ffffffffffffffff808211156142cc57600080fd5b61423e8a838b01613ecc565b600080604083850312156142eb57600080fd5b823567ffffffffffffffff8082111561430357600080fd5b61430f86838701613c68565b9350602085013591508082111561432557600080fd5b5061433285828601613fc2565b9150509250929050565b600081518084526020808501945080840160005b8381101561436c57815187529582019590820190600101614350565b509495945050505050565b602081526000612d9c602083018461433c565b60008060006040848603121561439f57600080fd5b833567ffffffffffffffff8111156143b657600080fd5b6143c286828701613dce565b90945092505060208401356143d681613ce0565b809150509250925092565b6000806000806000606086880312156143f957600080fd5b85359450602086013567ffffffffffffffff8082111561441857600080fd5b61442489838a01613ecc565b9096509450604088013591508082111561443d57600080fd5b50613e7c88828901613ecc565b60008060006040848603121561445f57600080fd5b83359250602084013567ffffffffffffffff81111561447d57600080fd5b61448986828701613ecc565b9497909650939450505050565b600080604083850312156144a957600080fd5b823591506144b960208401613a8c565b90509250929050565b6000806000606084860312156144d757600080fd5b833592506144e760208501613a8c565b9150604084013590509250925092565b6000806040838503121561450a57600080fd5b61451383613a8c565b9150602083013561452381613ce0565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561456f5783516001600160a01b03168352928401929184019160010161454a565b50909695505050505050565b60208152815115156020820152600060208301516040808401526145a26060840182613b00565b949350505050565b6000806000606084860312156145bf57600080fd5b83359250602084013567ffffffffffffffff8111156145dd57600080fd5b6145e986828701613c68565b92505060408401356143d681613ce0565b6000806040838503121561460d57600080fd5b61461683613a8c565b91506144b960208401613a8c565b600080600080600060a0868803121561463c57600080fd5b61464586613a8c565b945061465360208701613a8c565b93506040860135925060608601359150608086013567ffffffffffffffff81111561467d57600080fd5b6140c588828901613bd0565b600181811c9082168061469d57607f821691505b6020821081036146bd57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611c4c57600081815260208120601f850160051c810160208610156146ea5750805b601f850160051c820191505b81811015610c1b578281556001016146f6565b815167ffffffffffffffff81111561472357614723613b8d565b614737816147318454614689565b846146c3565b602080601f83116001811461476c57600084156147545750858301515b600019600386901b1c1916600185901b178555610c1b565b600085815260208120601f198616915b8281101561479b5788860151825594840194600190910190840161477c565b50858210156147b95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b6000826147fc57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610797576107976147c9565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261484557600080fd5b83018035915067ffffffffffffffff82111561486057600080fd5b602001915036819003821315610ce757600080fd5b6000808335601e1984360301811261488c57600080fd5b83018035915067ffffffffffffffff8211156148a757600080fd5b6020019150600581901b3603821315610ce757600080fd5b600060001982036148d2576148d26147c9565b5060010190565b6000602082840312156148eb57600080fd5b8151612d9c81613ce0565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6040815260006149356040830186886148f6565b82810360208401526149488185876148f6565b979650505050505050565b67ffffffffffffffff83111561496b5761496b613b8d565b61497f836149798354614689565b836146c3565b6000601f8411600181146149b3576000851561499b5750838201355b600019600387901b1c1916600186901b178355610ed6565b600083815260209020601f19861690835b828110156149e457868501358255602094850194600190920191016149c4565b5086821015614a015760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6020815260006145a26020830184866148f6565b80820180821115610797576107976147c9565b604081526000614a4d604083018561433c565b8281036020840152614a5f818561433c565b95945050505050565b60006001600160a01b03808816835280871660208401525060a06040830152614a9460a083018661433c565b8281036060840152614aa6818661433c565b90508281036080840152614aba8185613b00565b98975050505050505050565b600060208284031215614ad857600080fd5b8151612d9c81613acd565b600060033d1115614afc5760046000803e5060005160e01c5b90565b600060443d1015614b0d5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715614b5b57505050505090565b8285019150815181811115614b735750505050505090565b843d8701016020828501011115614b8d5750505050505090565b614b9c60208286010187613ba3565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261494860a0830184613b00565b81810381811115610797576107976147c9565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220420a7735f1a8869de14115d60b768c47691af7cca2e9121367472cb597bc11f764736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : disable (bool): True
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.