Overview
S Balance
0 S
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
ERC1155SinglePerToken
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 9999999 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol"; import {IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {Registry} from "../Registry.sol"; import {IFactoryNFT} from "../IFactoryNFT.sol"; import {ILaunchpadNFT} from "../../interfaces/ILaunchpadNFT.sol"; import {SamWitchERC1155SinglePerToken} from "./SamWitchERC1155SinglePerToken.sol"; contract ERC1155SinglePerToken is OwnableUpgradeable, ILaunchpadNFT, IFactoryNFT, ERC2981, SamWitchERC1155SinglePerToken { using Strings for uint256; error StorageSlotIncorrect(); error NotLaunchpad(); error ERC1155NonexistentToken(uint256 tokenId); // From base class uint40 _totalSupplyAll uint16 private _royaltyPercentage; address private _royaltyRecipient; address internal _launchpad; Registry internal _registry; string private _baseTokenURI; string public name; string public symbol; modifier onlyLaunchpad() virtual { require(address(_launchpad) == _msgSender(), NotLaunchpad()); _; } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( address registry, address launchpad, string calldata baseTokenURI, string calldata nftName, string calldata nftSymbol, uint16 royaltyPercentage, address royaltyRecipient, address contractOwner ) external initializer { __Ownable_init(contractOwner); __SamWitchERC1155SinglePerToken_init(""); bool storageSlotCorrect; assembly ("memory-safe") { storageSlotCorrect := eq(_royaltyPercentage.slot, _totalSupplyAll.slot) } require(storageSlotCorrect, StorageSlotIncorrect()); _launchpad = launchpad; _registry = Registry(registry); _baseTokenURI = baseTokenURI; name = nftName; symbol = nftSymbol; _royaltyPercentage = royaltyPercentage; _royaltyRecipient = royaltyRecipient; } function setDetails(string calldata baseTokenURI) external override onlyLaunchpad { _baseTokenURI = baseTokenURI; } function mint(address to, uint256[] memory ids, uint256[] memory values) external onlyLaunchpad { _mintBatch(to, ids, values, ""); } /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. */ function burn(address account, uint256 id, uint256 value) external { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), ERC1155MissingApprovalForAll(_msgSender(), account) ); _burn(account, id, value); } function burnBatch(address account, uint256[] memory ids, uint256[] memory values) external { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), ERC1155MissingApprovalForAll(_msgSender(), account) ); _burnBatch(account, ids, values); } function _requireOwned(uint256 tokenId) private view { require(ownerOf(tokenId) != address(0), ERC1155NonexistentToken(tokenId)); } /** * @dev See {SamWitchERC1155SinglePerToken-uri}. */ function uri(uint256 tokenId) public view override returns (string memory) { _requireOwned(tokenId); return string.concat(_baseTokenURI, tokenId.toString(), ".json"); } /** * @dev See {ERC2981-royaltyInfo}. */ function royaltyInfo( uint256 /*tokenId*/, uint256 salePrice ) public view override returns (address recipient, uint256 royaltyAmount) { recipient = _royaltyRecipient; royaltyAmount = (salePrice * _royaltyPercentage) / 10000; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC2981, SamWitchERC1155SinglePerToken) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } function setBaseURI(string calldata baseTokenURI) external onlyOwner { _baseTokenURI = baseTokenURI; } function setRoyalty(uint16 royaltyPercentage, address royaltyRecipient) external onlyOwner { _royaltyPercentage = royaltyPercentage; _royaltyRecipient = royaltyRecipient; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../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. * * The initial owner is set to the address provided by the deployer. 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 { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable struct OwnableStorage { address _owner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300; function _getOwnableStorage() private pure returns (OwnableStorage storage $) { assembly { $.slot := OwnableStorageLocation } } /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ function __Ownable_init(address initialOwner) internal onlyInitializing { __Ownable_init_unchained(initialOwner); } function __Ownable_init_unchained(address initialOwner) internal onlyInitializing { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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) { OwnableStorage storage $ = _getOwnableStorage(); return $._owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { OwnableStorage storage $ = _getOwnableStorage(); address oldOwner = $._owner; $._owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @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] * ```solidity * 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 Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 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 in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._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 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._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() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @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 { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.20; import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol"; import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"; import {Initializable} from "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. */ abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable __self = address(this); /** * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)` * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called, * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string. * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function * during an upgrade. */ string public constant UPGRADE_INTERFACE_VERSION = "5.0.0"; /** * @dev The call is from an unauthorized context. */ error UUPSUnauthorizedCallContext(); /** * @dev The storage `slot` is unsupported as a UUID. */ error UUPSUnsupportedProxiableUUID(bytes32 slot); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { _checkProxy(); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { _checkNotDelegated(); _; } function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual notDelegated returns (bytes32) { return ERC1967Utils.IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data); } /** * @dev Reverts if the execution is not performed via delegatecall or the execution * context is not of a proxy with an ERC1967-compliant implementation pointing to self. * See {_onlyProxy}. */ function _checkProxy() internal view virtual { if ( address(this) == __self || // Must be called through delegatecall ERC1967Utils.getImplementation() != __self // Must be called through an active proxy ) { revert UUPSUnauthorizedCallContext(); } } /** * @dev Reverts if the execution is performed via delegatecall. * See {notDelegated}. */ function _checkNotDelegated() internal view virtual { if (address(this) != __self) { // Must not be called through delegatecall revert UUPSUnauthorizedCallContext(); } } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call. * * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value * is expected to be the implementation slot in ERC1967. * * Emits an {IERC1967-Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) { revert UUPSUnsupportedProxiableUUID(slot); } ERC1967Utils.upgradeToAndCall(newImplementation, data); } catch { // The implementation is not UUPS revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../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); * } * ``` */ abstract contract ERC165Upgradeable is Initializable, IERC165 { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.20; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.20; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {UpgradeableBeacon} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol) pragma solidity ^0.8.20; import {IBeacon} from "../beacon/IBeacon.sol"; import {Address} from "../../utils/Address.sol"; import {StorageSlot} from "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. */ library ERC1967Utils { // We re-declare ERC-1967 events here because they can't be used directly from IERC1967. // This will be fixed in Solidity 0.8.21. At that point we should remove these events. /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev The `implementation` of the proxy is invalid. */ error ERC1967InvalidImplementation(address implementation); /** * @dev The `admin` of the proxy is invalid. */ error ERC1967InvalidAdmin(address admin); /** * @dev The `beacon` of the proxy is invalid. */ error ERC1967InvalidBeacon(address beacon); /** * @dev An upgrade function sees `msg.value > 0` that may be lost. */ error ERC1967NonPayable(); /** * @dev Returns the current implementation address. */ function getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { if (newImplementation.code.length == 0) { revert ERC1967InvalidImplementation(newImplementation); } StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Performs implementation upgrade with additional setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); if (data.length > 0) { Address.functionDelegateCall(newImplementation, data); } else { _checkNonPayable(); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ function getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { if (newAdmin == address(0)) { revert ERC1967InvalidAdmin(address(0)); } StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {IERC1967-AdminChanged} event. */ function changeAdmin(address newAdmin) internal { emit AdminChanged(getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { if (newBeacon.code.length == 0) { revert ERC1967InvalidBeacon(newBeacon); } StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon; address beaconImplementation = IBeacon(newBeacon).implementation(); if (beaconImplementation.code.length == 0) { revert ERC1967InvalidImplementation(beaconImplementation); } } /** * @dev Change the beacon and trigger a setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-BeaconUpgraded} event. * * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for * efficiency. */ function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } else { _checkNonPayable(); } } /** * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract * if an upgrade doesn't perform an initialization call. */ function _checkNonPayable() private { if (msg.value > 0) { revert ERC1967NonPayable(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/common/ERC2981.sol) pragma solidity ^0.8.20; import {IERC2981} from "../../interfaces/IERC2981.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 tokenId => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator); /** * @dev The default royalty receiver is invalid. */ error ERC2981InvalidDefaultRoyaltyReceiver(address receiver); /** * @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator); /** * @dev The royalty receiver for `tokenId` is invalid. */ error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver); /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidDefaultRoyaltyReceiver(address(0)); } _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0)); } _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.20; import {IERC1155} from "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. */ interface IERC1155MetadataURI is IERC1155 { /** * @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 v5.0.1) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` amount of tokens of 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 value 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 a `value` amount of tokens of type `id` from `from` to `to`. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155Received} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * 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 `value` 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 value, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments. * * Requirements: * * - `ids` and `values` 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 values, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Interface that must be implemented by smart contracts in order to receive * ERC-1155 token transfers. */ interface IERC1155Receiver is IERC165 { /** * @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 v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) 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 FailedInnerCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Arrays.sol) pragma solidity ^0.8.20; import {StorageSlot} from "./StorageSlot.sol"; import {Math} from "./math/Math.sol"; /** * @dev Collection of functions related to array types. */ library Arrays { using StorageSlot for bytes32; /** * @dev Searches a sorted `array` and returns the first index that contains * a value greater or equal to `element`. If no such index exists (i.e. all * values in the array are strictly less than `element`), the array length is * returned. Time complexity O(log n). * * `array` is expected to be sorted in ascending order, and to contain no * repeated elements. */ function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) { uint256 low = 0; uint256 high = array.length; if (high == 0) { return 0; } while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds towards zero (it does integer division with truncation). if (unsafeAccess(array, mid).value > element) { high = mid; } else { low = mid + 1; } } // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound. if (low > 0 && unsafeAccess(array, low - 1).value == element) { return low - 1; } else { return low; } } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getAddressSlot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getBytes32Slot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getUint256Slot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) { assembly { res := mload(add(add(arr, 0x20), mul(pos, 0x20))) } } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) { assembly { res := mload(add(add(arr, 0x20), mul(pos, 0x20))) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.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); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.20; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(newImplementation.code.length > 0); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import {IERC1155MetadataURI} from "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import {ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {ERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import {Arrays} from "@openzeppelin/contracts/utils/Arrays.sol"; import {IERC1155Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/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 OpenZeppelin v5.0.0 */ abstract contract SamWitchERC1155SinglePerToken is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155, IERC1155MetadataURI, IERC1155Errors { using Arrays for uint256[]; using Arrays for address[]; error ERC1155MintingMoreThanOneSameNFT(); // Mapping from token ID to account balances mapping(uint256 tokenId => address owner) private _owner; // This is just the default, can be overriden // 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; uint40 internal _totalSupplyAll; /** * @dev See {_setURI}. */ function __SamWitchERC1155SinglePerToken_init(string memory uri_) internal onlyInitializing { __SamWitchERC1155SinglePerToken_init_unchained(uri_); } function __SamWitchERC1155SinglePerToken_init_unchained(string memory uri_) internal onlyInitializing { _setURI(uri_); } function totalSupply(uint256 tokenId) public view returns (uint256) { return _exists(tokenId) ? 1 : 0; } function totalSupply() external view returns (uint256) { return _totalSupplyAll; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).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 /* id */) public view virtual returns (string memory) { return _uri; } /** * Override this function to return the owner of the token if you have a better packed implementation */ function ownerOf(uint256 id) public view virtual returns (address) { return _owner[id]; } /** * @dev See {IERC1155-balanceOf}. */ function balanceOf(address account, uint256 id) public view virtual returns (uint256) { return ownerOf(id) == account ? 1 : 0; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual returns (uint256[] memory) { if (accounts.length != ids.length) { revert ERC1155InvalidArrayLength(ids.length, accounts.length); } uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i)); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual { address sender = _msgSender(); if (from != sender && !isApprovedForAll(from, sender)) { revert ERC1155MissingApprovalForAll(sender, from); } _safeTransferFrom(from, to, id, value, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) public virtual { address sender = _msgSender(); if (from != sender && !isApprovedForAll(from, sender)) { revert ERC1155MissingApprovalForAll(sender, from); } _safeBatchTransferFrom(from, to, ids, values, data); } /** * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from` * (or `to`) is the zero address. * * Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise. * * Requirements: * * - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received} * or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value. * - `ids` and `values` must have the same length. * * NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead. */ function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual { if (ids.length != values.length) { revert ERC1155InvalidArrayLength(ids.length, values.length); } address operator = _msgSender(); bool isBurnt = to == address(0); bool isMinted = from == address(0); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids.unsafeMemoryAccess(i); uint256 value = values.unsafeMemoryAccess(i); if (!isMinted) { uint256 fromBalance = ownerOf(id) == from ? 1 : 0; if (fromBalance < value) { revert ERC1155InsufficientBalance(from, fromBalance, value, id); } } else { if (value > 1 || totalSupply(id) != 0) { revert ERC1155MintingMoreThanOneSameNFT(); } } if (isBurnt) { _updateOwner(id, from, address(0)); } else if (from != to) { _updateOwner(id, from, to); } } if (ids.length == 1) { uint256 id = ids.unsafeMemoryAccess(0); uint256 value = values.unsafeMemoryAccess(0); emit TransferSingle(operator, from, to, id, value); if (isBurnt) { unchecked { --_totalSupplyAll; } } else if (isMinted) { unchecked { ++_totalSupplyAll; } } } else { if (isBurnt) { unchecked { _totalSupplyAll = uint40(_totalSupplyAll - ids.length); } } else if (isMinted) { unchecked { _totalSupplyAll = uint40(_totalSupplyAll + ids.length); } } emit TransferBatch(operator, from, to, ids, values); } } /** * @dev Version of {_update} that performs the token acceptance check by calling * {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it * contains code (eg. is a smart contract at the moment of execution). * * IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any * update to the contract state after this function would break the check-effect-interaction pattern. Consider * overriding {_update} instead. */ function _updateWithAcceptanceCheck( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal virtual { _update(from, to, ids, values); if (to != address(0)) { address operator = _msgSender(); if (ids.length == 1) { uint256 id = ids.unsafeMemoryAccess(0); uint256 value = values.unsafeMemoryAccess(0); _doSafeTransferAcceptanceCheck(operator, from, to, id, value, data); } else { _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data); } } } /** * @dev Transfers a `value` 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 `value` 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 value, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(from, to, ids, values, 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. * - `ids` and `values` must have the same length. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } _updateWithAcceptanceCheck(from, to, ids, values, 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 values 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 a `value` amount of tokens of 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 value, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(address(0), to, ids, values, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `values` must have the same length. * - `to` cannot be the zero address. * - 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 values, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } _updateWithAcceptanceCheck(address(0), to, ids, values, data); } /** * @dev Destroys a `value` amount of tokens of type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `value` amount of tokens of type `id`. */ function _burn(address from, uint256 id, uint256 value) internal { if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(from, address(0), ids, values, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `value` amount of tokens of type `id`. * - `ids` and `values` must have the same length. */ function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal { if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } _updateWithAcceptanceCheck(from, address(0), ids, values, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the zero address. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC1155InvalidOperator(address(0)); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address * if it contains code at the moment of execution. */ function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 value, bytes memory data ) private { if (to.code.length > 0) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { // Tokens rejected revert ERC1155InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { // non-ERC1155Receiver implementer revert ERC1155InvalidReceiver(to); } else { assembly ("memory-safe") { revert(add(32, reason), mload(reason)) } } } } } /** * @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address * if it contains code at the moment of execution. */ function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) private { if (to.code.length > 0) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { // Tokens rejected revert ERC1155InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { // non-ERC1155Receiver implementer revert ERC1155InvalidReceiver(to); } else { assembly ("memory-safe") { revert(add(32, reason), mload(reason)) } } } } } /** * @dev Creates an array in memory with only one value for each of the elements provided. */ function _asSingletonArrays( uint256 element1, uint256 element2 ) private pure returns (uint256[] memory array1, uint256[] memory array2) { assembly ("memory-safe") { // Load the free memory pointer array1 := mload(0x40) // Set array length to 1 mstore(array1, 1) // Store the single element at the next word after the length (where content starts) mstore(add(array1, 0x20), element1) // Repeat for next array locating it right after the first array array2 := add(array1, 0x40) mstore(array2, 1) mstore(add(array2, 0x20), element2) // Update the free memory pointer by pointing after the second array mstore(0x40, add(array2, 0x40)) } } // Override this function if _updateOwner is overriden function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owner[tokenId] != address(0); } function _updateOwner(uint256 id, address /*from */, address to) internal virtual { _owner[id] = to; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; interface IFactoryNFT { function initialize( address registry, address launchpad, string calldata baseTokenURI, string calldata nftName, string calldata nftSymbol, uint16 royaltyPercentage, address royaltyRecipient, address owner ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; // This is a contract that is shared with all the NFT beacon proxies to upgrade them with some shared state contract Registry is UUPSUpgradeable, OwnableUpgradeable { /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize() external initializer { __UUPSUpgradeable_init(); __Ownable_init(_msgSender()); } // solhint-disable-next-line no-empty-blocks function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; // This is an interface any NFT contract must implement to be used by the Launchpad interface ILaunchpadNFT { function mint(address to, uint256[] calldata tokenIds, uint256[] calldata amounts) external; function setDetails(string calldata baseTokenURI) external; }
{ "evmVersion": "cancun", "optimizer": { "enabled": true, "runs": 9999999, "details": { "yul": true } }, "viaIR": true, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[],"name":"ERC1155MintingMoreThanOneSameNFT","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155NonexistentToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"NotLaunchpad","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"StorageSlotIncorrect","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"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":"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":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"registry","type":"address"},{"internalType":"address","name":"launchpad","type":"address"},{"internalType":"string","name":"baseTokenURI","type":"string"},{"internalType":"string","name":"nftName","type":"string"},{"internalType":"string","name":"nftSymbol","type":"string"},{"internalType":"uint16","name":"royaltyPercentage","type":"uint16"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"address","name":"contractOwner","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":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"recipient","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":"values","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":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseTokenURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseTokenURI","type":"string"}],"name":"setDetails","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"royaltyPercentage","type":"uint16"},{"internalType":"address","name":"royaltyRecipient","type":"address"}],"name":"setRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","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
6080806040523460aa575f5160206134565f395f51905f525460ff8160401c16609b576002600160401b03196001600160401b038216016049575b6040516133a790816100af8239f35b6001600160401b0319166001600160401b039081175f5160206134565f395f51905f525581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f80603a565b63f92ee8a960e01b5f5260045ffd5b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c8062fdd58e1461019357806301ffc9a71461018e5780630608bdf81461018957806306fdde03146101845780630e89341c1461017f57806312d273711461017a57806318160ddd146101755780632a55205a146101705780632eb2c2d61461016b5780633e8a8009146101665780634e1273f41461016157806355f804b31461015c5780636352211e146101575780636b20c45414610152578063715018a61461014d5780638da5cb5b1461014857806395d89b41146101435780639727756a1461013e578063a22cb46514610139578063bd85b03914610134578063e985e9c51461012f578063f242432a1461012a578063f2fde38b146101255763f5298aca14610120575f80fd5b611973565b61192c565b6117de565b611748565b61170c565b6115e1565b61124e565b61118b565b61111b565b611041565b610f74565b610e8c565b610e72565b610d93565b610d15565b610c1d565b610a7d565b610a3b565b610970565b610703565b6105ed565b6103f5565b6102c0565b610249565b6004359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b5f80fd5b6024359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b60c4359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b60e4359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602061028e610285610198565b60243590611a62565b604051908152f35b7fffffffff000000000000000000000000000000000000000000000000000000008116036101bb57565b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb577fffffffff0000000000000000000000000000000000000000000000000000000060043561031c81610296565b167f2a55205a000000000000000000000000000000000000000000000000000000008114908115610356575b506040519015158152602090f35b7fd9b67a26000000000000000000000000000000000000000000000000000000008114915081156103ba575b8115610390575b505f610348565b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150145f610389565b7f0e89341c0000000000000000000000000000000000000000000000000000000081149150610382565b60a4359061ffff821682036101bb57565b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb5760043561ffff811681036101bb576104d0906104836104416101bf565b9161044a61291b565b7fffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffff66ffff00000000006005549260281b16911617600555565b7fffffffffff0000000000000000000000000000000000000000ffffffffffffff7affffffffffffffffffffffffffffffffffffffff000000000000006005549260381b16911617600555565b005b90600182811c92168015610519575b60208310146104ec57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f16916104e1565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761059157604052565b610523565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b9060206105ea928181520190610596565b90565b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576040515f60095461062b816104d2565b80845290600181169081156106c15750600114610663575b61065f8361065381850382610550565b604051918291826105d9565b0390f35b60095f9081527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af939250905b8082106106a757509091508101602001610653610643565b91926001816020925483858801015201910190929161068f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660208086019190915291151560051b840190910191506106539050610643565b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57600435805f52600260205273ffffffffffffffffffffffffffffffffffffffff60405f205416156109175780815f927a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008110156108ec575b50806d04ee2d6d415b85acef8100000000600a9210156108d0575b662386f26fc100008110156108bb575b6305f5e1008110156108a9575b612710811015610899575b606481101561088a575b101561087f575b6108417fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602161080b60018601612987565b948501015b01917f3031323334353637383961626364656600000000000000000000000000000000600a82061a8353600a900490565b90811561087357610841907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90610810565b61065f61065384611a98565b6001909101906107d9565b600290606490049301926107d2565b60049061271090049301926107c8565b6008906305f5e10090049301926107bd565b601090662386f26fc1000090049301926107b0565b6020906d04ee2d6d415b85acef810000000090049301926107a0565b604093507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000090049050600a610785565b7f9307fe39000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b9181601f840112156101bb5782359167ffffffffffffffff83116101bb57602083818601950101116101bb57565b346101bb576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576109a8610198565b6109b06101bf565b9060443567ffffffffffffffff81116101bb576109d1903690600401610942565b929060643567ffffffffffffffff81116101bb576109f3903690600401610942565b946084359567ffffffffffffffff87116101bb57610a186104d0973690600401610942565b939092610a236103e4565b95610a2c6101e2565b97610a35610205565b99611bc3565b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602064ffffffffff60055416604051908152f35b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57600554602881901c61ffff16602435818102918115918304141715610afb576040805160389390931c73ffffffffffffffffffffffffffffffffffffffff168352612710909104602083015290f35b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b67ffffffffffffffff81116105915760051b60200190565b9080601f830112156101bb578135610b5781610b28565b92610b656040519485610550565b81845260208085019260051b8201019283116101bb57602001905b828210610b8d5750505090565b8135815260209182019101610b80565b67ffffffffffffffff811161059157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f820112156101bb57803590610bee82610b9d565b92610bfc6040519485610550565b828452602083830101116101bb57815f926020809301838601378301015290565b346101bb5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57610c54610198565b610c5c6101bf565b9060443567ffffffffffffffff81116101bb57610c7d903690600401610b40565b60643567ffffffffffffffff81116101bb57610c9d903690600401610b40565b906084359367ffffffffffffffff85116101bb57610cc26104d0953690600401610bd7565b93612520565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126101bb576004359067ffffffffffffffff82116101bb57610d1191600401610942565b9091565b346101bb576104d0610d2636610cc8565b90610d4a73ffffffffffffffffffffffffffffffffffffffff6006541633146125b1565b6125e0565b90602080835192838152019201905f5b818110610d6c5750505090565b8251845260209384019390920191600101610d5f565b9060206105ea928181520190610d4f565b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb5760043567ffffffffffffffff81116101bb57366023820112156101bb57806004013590610dee82610b28565b91610dfc6040519384610550565b8083526024602084019160051b830101913683116101bb57602401905b828210610e5a578360243567ffffffffffffffff81116101bb5761065f91610e48610e4e923690600401610b40565b90612712565b60405191829182610d82565b60208091610e6784610228565b815201910190610e19565b346101bb576104d0610e8336610cc8565b90610d4a61291b565b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576004355f526002602052602073ffffffffffffffffffffffffffffffffffffffff60405f205416604051908152f35b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126101bb5760043573ffffffffffffffffffffffffffffffffffffffff811681036101bb579160243567ffffffffffffffff81116101bb5782610f5491600401610b40565b916044359067ffffffffffffffff82116101bb576105ea91600401610b40565b346101bb57610f8236610eea565b73ffffffffffffffffffffffffffffffffffffffff83929316338114838115610ffd575b610fb19133906127af565b15610fd1576104d09260405192610fc9602085610550565b5f8452612a2d565b7f01a83514000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b5050805f526003602052610fb18360ff6110383360405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b54169150610fa6565b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb5761107761291b565b5f73ffffffffffffffffffffffffffffffffffffffff7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300547fffffffffffffffffffffffff000000000000000000000000000000000000000081167f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602073ffffffffffffffffffffffffffffffffffffffff7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005416604051908152f35b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576040515f600a546111c9816104d2565b80845290600181169081156106c157506001146111f05761065f8361065381850382610550565b600a5f9081527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8939250905b80821061123457509091508101602001610653610643565b91926001816020925483858801015201910190929161121c565b346101bb5761125c36610eea565b61127f73ffffffffffffffffffffffffffffffffffffffff6006541633146125b1565b60405192602061128f8186610550565b5f855273ffffffffffffffffffffffffffffffffffffffff821693841595866115b55781518551908181036115875750505f5b82518110156113bf578060051b9060018580848701015193890101511180156113ae575b61138657600191868a15611332575061132c905f52600260205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b016112c2565b611381915f52600260205273ffffffffffffffffffffffffffffffffffffffff60405f2091167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b61132c565b7fc69891be000000000000000000000000000000000000000000000000000000005f5260045ffd5b506113b882612800565b15156112e6565b5083858489898651600181145f146114ef57505f838801517fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6261141a8688015160405191829133958360209093929193604081019481520152565b0390a480156114c75761149761146561143960055464ffffffffff1690565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0164ffffffffff1690565b64ffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000006005541617600555565b1561149e57005b84516001036114b957806104d0950151910151915f3361327b565b5090926104d0935f336130a0565b6114ea6114656114dd60055464ffffffffff1690565b60010164ffffffffff1690565b611497565b82156115595761146561151e9164ffffffffff61151260055464ffffffffff1690565b160364ffffffffff1690565b5f6040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180611551898d83612fdc565b0390a4611497565b6114656115829164ffffffffff61157660055464ffffffffff1690565b160164ffffffffff1690565b61151e565b7f5b059991000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b7f57f447ce000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57611618610198565b6024358015158082036101bb5773ffffffffffffffffffffffffffffffffffffffff83169283156116e05761167690335f52600360205260405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b9060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691161790557f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31604051806116db339482919091602081019215159052565b0390a3005b7fced3e100000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602061028e600435612800565b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602060ff6117d2611786610198565b73ffffffffffffffffffffffffffffffffffffffff6117a36101bf565b91165f526003845260405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b54166040519015158152f35b346101bb5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57611815610198565b61181d6101bf565b604435906064359260843567ffffffffffffffff81116101bb57611845903690600401610bd7565b9273ffffffffffffffffffffffffffffffffffffffff821633811415806118ee575b6118bf5773ffffffffffffffffffffffffffffffffffffffff8416156115b55715610fd1576104d0946118b760405192600184526020840152604083019160018352606084015260808301604052565b929091612c9f565b7fe237d922000000000000000000000000000000000000000000000000000000005f523360045260245260445ffd5b50805f52600360205260ff6119243360405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b541615611867565b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576104d0611966610198565b61196e61291b565b61282e565b346101bb5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576119aa610198565b6044359060243573ffffffffffffffffffffffffffffffffffffffff8216338114838115611a1e575b6119de9133906127af565b15610fd1576104d092611a0e60405192600184526020840152604083019160018352606084015260808301604052565b9060405192610fc9602085610550565b5050805f5260036020526119de8360ff611a593360405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b541691506119d3565b905f52600260205273ffffffffffffffffffffffffffffffffffffffff8060405f2054169116145f14611a9457600190565b5f90565b9060405191825f600854611aab816104d2565b9060018116908115611b855750600114611b28575b5090602060059284611b26955192839101825e7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5810185520183610550565b565b60085f9081529091507ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee35b828210611b695750508101602090810190611ac0565b602091929350806001915483858a010152019101859291611b53565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016602080860191909152821515909202840182019250611ac09050565b98969492909160ff9a9896949267ffffffffffffffff611c1b611c0d7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549e8f60401c1615151590565b9d67ffffffffffffffff1690565b1680159081611e0e575b6001149081611e04575b159081611dfb575b50611dd357611cb89a8c611caf60017fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000007ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005416177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055565b611d58576122a4565b611cbe57565b611d297fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055565b604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1565b611dce680100000000000000007fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005416177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055565b6122a4565b7ff92ee8a9000000000000000000000000000000000000000000000000000000005f5260045ffd5b9050155f611c37565b303b159150611c2f565b8d9150611c25565b601f8111611e22575050565b60045f5260205f20906020601f840160051c83019310611e5c575b601f0160051c01905b818110611e51575050565b5f8155600101611e46565b9091508190611e3d565b601f8111611e72575050565b60085f5260205f20906020601f840160051c83019310611eac575b601f0160051c01905b818110611ea1575050565b5f8155600101611e96565b9091508190611e8d565b601f8211611ec357505050565b5f5260205f20906020601f840160051c83019310611efb575b601f0160051c01905b818110611ef0575050565b5f8155600101611ee5565b9091508190611edc565b919067ffffffffffffffff811161059157611f2c81611f256008546104d2565b6008611eb6565b5f601f8211600114611f88578190611f7893945f92611f7d575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600855565b013590505f80611f46565b60085f527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216937ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3915f5b86811061202a5750836001959610611ff2575b505050811b01600855565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690555f8080611fe7565b90926020600181928686013581550194019101611fd4565b919067ffffffffffffffff811161059157612069816120626009546104d2565b6009611eb6565b5f601f82116001146120b95781906120b493945f92611f7d5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600955565b60095f527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216937f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af915f5b86811061215b5750836001959610612123575b505050811b01600955565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690555f8080612118565b90926020600181928686013581550194019101612105565b919067ffffffffffffffff81116105915761219a81612193600a546104d2565b600a611eb6565b5f601f82116001146121ea5781906121e593945f92611f7d5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600a55565b600a5f527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216937fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8915f5b86811061228c5750836001959610612254575b505050811b01600a55565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690555f8080612249565b90926020600181928686013581550194019101612236565b919293949a996122be906122b66129d6565b61196e6129d6565b60405160206122cd8183610550565b5f82526122d86129d6565b6122e06129d6565b81519167ffffffffffffffff831161059157612306836123016004546104d2565b611e16565b602091601f841160011461242a57509461241073ffffffffffffffffffffffffffffffffffffffff611b269e9f966123ce6104839e9d9b976123898861044a9f9d98996124159a61241a9e5f9261241f5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b6004555b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff00000000000000000000000000000000000000006006541617600655565b1673ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff00000000000000000000000000000000000000006007541617600755565b611f05565b612042565b612173565b015190505f80611f46565b60045f5291907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084167f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b935f905b828210612508575050611b269e9f966123ce6104839e9d9b9760018861044a9f9d9861241a9d98612410986124159c73ffffffffffffffffffffffffffffffffffffffff99106124d1575b505050811b0160045561238d565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c191690555f80806124c3565b80600186978294978701518155019601940190612478565b9392919073ffffffffffffffffffffffffffffffffffffffff85163381141580612573575b6118bf5773ffffffffffffffffffffffffffffffffffffffff8216156115b55715610fd157611b2694612c9f565b50805f52600360205260ff6125a93360405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b541615612545565b156125b857565b7fed6fcad9000000000000000000000000000000000000000000000000000000005f5260045ffd5b919067ffffffffffffffff811161059157612605816126006008546104d2565b611e66565b5f601f8211600114612650578190611f7893945f92611f7d5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60085f527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216937ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3915f5b8681106126b95750836001959610611ff257505050811b01600855565b9092602060018192868601358155019401910161269c565b80518210156126e55760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b919091805183518082036115875750508051907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061276861275284610b28565b936127606040519586610550565b808552610b28565b013660208401375f5b81518110156127a8578061279760019260051b6020808287010151918901015190611a62565b6127a182866126d1565b5201612771565b5090925050565b156127b8575050565b9073ffffffffffffffffffffffffffffffffffffffff80927fe237d922000000000000000000000000000000000000000000000000000000005f52166004521660245260445ffd5b5f9081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615611a9457600190565b73ffffffffffffffffffffffffffffffffffffffff1680156128ef5773ffffffffffffffffffffffffffffffffffffffff7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930054827fffffffffffffffffffffffff00000000000000000000000000000000000000008216177f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b7f1e4fbdf7000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b73ffffffffffffffffffffffffffffffffffffffff7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005416330361295b57565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b9061299182610b9d565b61299e6040519182610550565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06129cc8294610b9d565b0190602036910137565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460401c1615612a0557565b7fd7e6bcf8000000000000000000000000000000000000000000000000000000005f5260045ffd5b90925092909282518451908181036115875750919273ffffffffffffffffffffffffffffffffffffffff82168015159350905f5b8151811015612be2578060051b60208082850101519189010151865f14612b865784612ace612ab5612a9b855f52600260205260405f2090565b5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b03612b7e5760ff60015b1690808210612b2357505090612b1d6001925f52600260205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b01612a61565b6040517f03dee4c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff881660048201526024810192909252604482015260648101829052608490fd5b60ff5f612ad8565b600190929192118015612bd1575b61138657612b1d6001925f52600260205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b50612bdb82612800565b1515612b94565b509092505f939491508051600181148514612c49575060209081015191810151604080519384529183015233917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f629190a4611b2661146561143960055464ffffffffff1690565b7f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb9192612c8c611465612c9a9364ffffffffff61151260055464ffffffffff1690565b604051918291339583612fdc565b0390a4565b9091805184519081810361158757505073ffffffffffffffffffffffffffffffffffffffff83969596169182159073ffffffffffffffffffffffffffffffffffffffff8116928315975f9989159a5b8351811015612e79578060051b6020808287010151918c0101518d5f14612e4e5788612d28612ab5612a9b855f52600260205260405f2090565b03612e465760ff60015b1690808210612deb575050906001915b8715612d8557612d7f905f52600260205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b01612cee565b8a8a8a03612d95575b5050612d7f565b612de4915f52600260205273ffffffffffffffffffffffffffffffffffffffff60405f2091167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b5f8a612d8e565b6040517f03dee4c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff891660048201526024810192909252604482015260648101829052608490fd5b60ff5f612d32565b600190929192118015612e68575b61138657600191612d42565b50612e7282612800565b1515612e5c565b50979591989296949099508851600181145f14612f4c575060208981015187820151604080519283529282015233917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291a48115612f2c5750612ee861146561143960055464ffffffffff1690565b15612ef5575b5050505050565b8451600103612f1b57602080612f11960151920151923361327b565b5f80808080612eee565b612f27949192336130a0565b612f11565b15612ee857612f476114656114dd60055464ffffffffff1690565b612ee8565b909192845f14612fae5750611465612f749164ffffffffff61151260055464ffffffffff1690565b6040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180612fa6898d83612fdc565b0390a4612ee8565b612fb9575b50612f74565b611465612fd69164ffffffffff61157660055464ffffffffff1690565b5f612fb3565b9091612ff36105ea93604084526040840190610d4f565b916020818403910152610d4f565b908160209103126101bb57516105ea81610296565b93906105ea959373ffffffffffffffffffffffffffffffffffffffff61306394816130559416885216602087015260a0604087015260a0860190610d4f565b908482036060860152610d4f565b916080818403910152610596565b3d1561309b573d9061308282610b9d565b916130906040519384610550565b82523d5f602084013e565b606090565b9091949293853b6130b4575b505050505050565b6020936130ef9160405196879586957fbc197c8100000000000000000000000000000000000000000000000000000000875260048701613016565b03815f73ffffffffffffffffffffffffffffffffffffffff87165af15f9181613209575b506131735750613121613071565b805191908261316c577f57f447ce000000000000000000000000000000000000000000000000000000005f5273ffffffffffffffffffffffffffffffffffffffff821660045260245ffd5b9050602001fd5b7fffffffff000000000000000000000000000000000000000000000000000000007fbc197c81000000000000000000000000000000000000000000000000000000009116036131c857505f80808080806130ac565b7f57f447ce000000000000000000000000000000000000000000000000000000005f5273ffffffffffffffffffffffffffffffffffffffff1660045260245ffd5b61322c91925060203d602011613233575b6132248183610550565b810190613001565b905f613113565b503d61321a565b919273ffffffffffffffffffffffffffffffffffffffff60a094816105ea989794168552166020840152604083015260608201528160808201520190610596565b9091949293853b61328e57505050505050565b6020936132c99160405196879586957ff23a6e610000000000000000000000000000000000000000000000000000000087526004870161323a565b03815f73ffffffffffffffffffffffffffffffffffffffff87165af15f9181613350575b506132fb5750613121613071565b7fffffffff000000000000000000000000000000000000000000000000000000007ff23a6e61000000000000000000000000000000000000000000000000000000009116036131c857505f80808080806130ac565b61336a91925060203d602011613233576132248183610550565b905f6132ed56fea264697066735822122063a438fbb7093d3cc791b5d38eb4560db9926aa9e417c27c46c56074b6cd2b4364736f6c634300081c0033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f3560e01c8062fdd58e1461019357806301ffc9a71461018e5780630608bdf81461018957806306fdde03146101845780630e89341c1461017f57806312d273711461017a57806318160ddd146101755780632a55205a146101705780632eb2c2d61461016b5780633e8a8009146101665780634e1273f41461016157806355f804b31461015c5780636352211e146101575780636b20c45414610152578063715018a61461014d5780638da5cb5b1461014857806395d89b41146101435780639727756a1461013e578063a22cb46514610139578063bd85b03914610134578063e985e9c51461012f578063f242432a1461012a578063f2fde38b146101255763f5298aca14610120575f80fd5b611973565b61192c565b6117de565b611748565b61170c565b6115e1565b61124e565b61118b565b61111b565b611041565b610f74565b610e8c565b610e72565b610d93565b610d15565b610c1d565b610a7d565b610a3b565b610970565b610703565b6105ed565b6103f5565b6102c0565b610249565b6004359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b5f80fd5b6024359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b60c4359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b60e4359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b359073ffffffffffffffffffffffffffffffffffffffff821682036101bb57565b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602061028e610285610198565b60243590611a62565b604051908152f35b7fffffffff000000000000000000000000000000000000000000000000000000008116036101bb57565b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb577fffffffff0000000000000000000000000000000000000000000000000000000060043561031c81610296565b167f2a55205a000000000000000000000000000000000000000000000000000000008114908115610356575b506040519015158152602090f35b7fd9b67a26000000000000000000000000000000000000000000000000000000008114915081156103ba575b8115610390575b505f610348565b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150145f610389565b7f0e89341c0000000000000000000000000000000000000000000000000000000081149150610382565b60a4359061ffff821682036101bb57565b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb5760043561ffff811681036101bb576104d0906104836104416101bf565b9161044a61291b565b7fffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffff66ffff00000000006005549260281b16911617600555565b7fffffffffff0000000000000000000000000000000000000000ffffffffffffff7affffffffffffffffffffffffffffffffffffffff000000000000006005549260381b16911617600555565b005b90600182811c92168015610519575b60208310146104ec57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f16916104e1565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761059157604052565b610523565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b9060206105ea928181520190610596565b90565b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576040515f60095461062b816104d2565b80845290600181169081156106c15750600114610663575b61065f8361065381850382610550565b604051918291826105d9565b0390f35b60095f9081527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af939250905b8082106106a757509091508101602001610653610643565b91926001816020925483858801015201910190929161068f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660208086019190915291151560051b840190910191506106539050610643565b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57600435805f52600260205273ffffffffffffffffffffffffffffffffffffffff60405f205416156109175780815f927a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008110156108ec575b50806d04ee2d6d415b85acef8100000000600a9210156108d0575b662386f26fc100008110156108bb575b6305f5e1008110156108a9575b612710811015610899575b606481101561088a575b101561087f575b6108417fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602161080b60018601612987565b948501015b01917f3031323334353637383961626364656600000000000000000000000000000000600a82061a8353600a900490565b90811561087357610841907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90610810565b61065f61065384611a98565b6001909101906107d9565b600290606490049301926107d2565b60049061271090049301926107c8565b6008906305f5e10090049301926107bd565b601090662386f26fc1000090049301926107b0565b6020906d04ee2d6d415b85acef810000000090049301926107a0565b604093507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000090049050600a610785565b7f9307fe39000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b9181601f840112156101bb5782359167ffffffffffffffff83116101bb57602083818601950101116101bb57565b346101bb576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576109a8610198565b6109b06101bf565b9060443567ffffffffffffffff81116101bb576109d1903690600401610942565b929060643567ffffffffffffffff81116101bb576109f3903690600401610942565b946084359567ffffffffffffffff87116101bb57610a186104d0973690600401610942565b939092610a236103e4565b95610a2c6101e2565b97610a35610205565b99611bc3565b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602064ffffffffff60055416604051908152f35b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57600554602881901c61ffff16602435818102918115918304141715610afb576040805160389390931c73ffffffffffffffffffffffffffffffffffffffff168352612710909104602083015290f35b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b67ffffffffffffffff81116105915760051b60200190565b9080601f830112156101bb578135610b5781610b28565b92610b656040519485610550565b81845260208085019260051b8201019283116101bb57602001905b828210610b8d5750505090565b8135815260209182019101610b80565b67ffffffffffffffff811161059157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f820112156101bb57803590610bee82610b9d565b92610bfc6040519485610550565b828452602083830101116101bb57815f926020809301838601378301015290565b346101bb5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57610c54610198565b610c5c6101bf565b9060443567ffffffffffffffff81116101bb57610c7d903690600401610b40565b60643567ffffffffffffffff81116101bb57610c9d903690600401610b40565b906084359367ffffffffffffffff85116101bb57610cc26104d0953690600401610bd7565b93612520565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126101bb576004359067ffffffffffffffff82116101bb57610d1191600401610942565b9091565b346101bb576104d0610d2636610cc8565b90610d4a73ffffffffffffffffffffffffffffffffffffffff6006541633146125b1565b6125e0565b90602080835192838152019201905f5b818110610d6c5750505090565b8251845260209384019390920191600101610d5f565b9060206105ea928181520190610d4f565b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb5760043567ffffffffffffffff81116101bb57366023820112156101bb57806004013590610dee82610b28565b91610dfc6040519384610550565b8083526024602084019160051b830101913683116101bb57602401905b828210610e5a578360243567ffffffffffffffff81116101bb5761065f91610e48610e4e923690600401610b40565b90612712565b60405191829182610d82565b60208091610e6784610228565b815201910190610e19565b346101bb576104d0610e8336610cc8565b90610d4a61291b565b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576004355f526002602052602073ffffffffffffffffffffffffffffffffffffffff60405f205416604051908152f35b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126101bb5760043573ffffffffffffffffffffffffffffffffffffffff811681036101bb579160243567ffffffffffffffff81116101bb5782610f5491600401610b40565b916044359067ffffffffffffffff82116101bb576105ea91600401610b40565b346101bb57610f8236610eea565b73ffffffffffffffffffffffffffffffffffffffff83929316338114838115610ffd575b610fb19133906127af565b15610fd1576104d09260405192610fc9602085610550565b5f8452612a2d565b7f01a83514000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b5050805f526003602052610fb18360ff6110383360405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b54169150610fa6565b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb5761107761291b565b5f73ffffffffffffffffffffffffffffffffffffffff7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300547fffffffffffffffffffffffff000000000000000000000000000000000000000081167f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602073ffffffffffffffffffffffffffffffffffffffff7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005416604051908152f35b346101bb575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576040515f600a546111c9816104d2565b80845290600181169081156106c157506001146111f05761065f8361065381850382610550565b600a5f9081527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8939250905b80821061123457509091508101602001610653610643565b91926001816020925483858801015201910190929161121c565b346101bb5761125c36610eea565b61127f73ffffffffffffffffffffffffffffffffffffffff6006541633146125b1565b60405192602061128f8186610550565b5f855273ffffffffffffffffffffffffffffffffffffffff821693841595866115b55781518551908181036115875750505f5b82518110156113bf578060051b9060018580848701015193890101511180156113ae575b61138657600191868a15611332575061132c905f52600260205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b016112c2565b611381915f52600260205273ffffffffffffffffffffffffffffffffffffffff60405f2091167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b61132c565b7fc69891be000000000000000000000000000000000000000000000000000000005f5260045ffd5b506113b882612800565b15156112e6565b5083858489898651600181145f146114ef57505f838801517fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6261141a8688015160405191829133958360209093929193604081019481520152565b0390a480156114c75761149761146561143960055464ffffffffff1690565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0164ffffffffff1690565b64ffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000006005541617600555565b1561149e57005b84516001036114b957806104d0950151910151915f3361327b565b5090926104d0935f336130a0565b6114ea6114656114dd60055464ffffffffff1690565b60010164ffffffffff1690565b611497565b82156115595761146561151e9164ffffffffff61151260055464ffffffffff1690565b160364ffffffffff1690565b5f6040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180611551898d83612fdc565b0390a4611497565b6114656115829164ffffffffff61157660055464ffffffffff1690565b160164ffffffffff1690565b61151e565b7f5b059991000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b7f57f447ce000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57611618610198565b6024358015158082036101bb5773ffffffffffffffffffffffffffffffffffffffff83169283156116e05761167690335f52600360205260405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b9060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691161790557f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31604051806116db339482919091602081019215159052565b0390a3005b7fced3e100000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602061028e600435612800565b346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602060ff6117d2611786610198565b73ffffffffffffffffffffffffffffffffffffffff6117a36101bf565b91165f526003845260405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b54166040519015158152f35b346101bb5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57611815610198565b61181d6101bf565b604435906064359260843567ffffffffffffffff81116101bb57611845903690600401610bd7565b9273ffffffffffffffffffffffffffffffffffffffff821633811415806118ee575b6118bf5773ffffffffffffffffffffffffffffffffffffffff8416156115b55715610fd1576104d0946118b760405192600184526020840152604083019160018352606084015260808301604052565b929091612c9f565b7fe237d922000000000000000000000000000000000000000000000000000000005f523360045260245260445ffd5b50805f52600360205260ff6119243360405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b541615611867565b346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576104d0611966610198565b61196e61291b565b61282e565b346101bb5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576119aa610198565b6044359060243573ffffffffffffffffffffffffffffffffffffffff8216338114838115611a1e575b6119de9133906127af565b15610fd1576104d092611a0e60405192600184526020840152604083019160018352606084015260808301604052565b9060405192610fc9602085610550565b5050805f5260036020526119de8360ff611a593360405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b541691506119d3565b905f52600260205273ffffffffffffffffffffffffffffffffffffffff8060405f2054169116145f14611a9457600190565b5f90565b9060405191825f600854611aab816104d2565b9060018116908115611b855750600114611b28575b5090602060059284611b26955192839101825e7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5810185520183610550565b565b60085f9081529091507ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee35b828210611b695750508101602090810190611ac0565b602091929350806001915483858a010152019101859291611b53565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016602080860191909152821515909202840182019250611ac09050565b98969492909160ff9a9896949267ffffffffffffffff611c1b611c0d7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549e8f60401c1615151590565b9d67ffffffffffffffff1690565b1680159081611e0e575b6001149081611e04575b159081611dfb575b50611dd357611cb89a8c611caf60017fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000007ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005416177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055565b611d58576122a4565b611cbe57565b611d297fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055565b604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1565b611dce680100000000000000007fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005416177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055565b6122a4565b7ff92ee8a9000000000000000000000000000000000000000000000000000000005f5260045ffd5b9050155f611c37565b303b159150611c2f565b8d9150611c25565b601f8111611e22575050565b60045f5260205f20906020601f840160051c83019310611e5c575b601f0160051c01905b818110611e51575050565b5f8155600101611e46565b9091508190611e3d565b601f8111611e72575050565b60085f5260205f20906020601f840160051c83019310611eac575b601f0160051c01905b818110611ea1575050565b5f8155600101611e96565b9091508190611e8d565b601f8211611ec357505050565b5f5260205f20906020601f840160051c83019310611efb575b601f0160051c01905b818110611ef0575050565b5f8155600101611ee5565b9091508190611edc565b919067ffffffffffffffff811161059157611f2c81611f256008546104d2565b6008611eb6565b5f601f8211600114611f88578190611f7893945f92611f7d575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600855565b013590505f80611f46565b60085f527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216937ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3915f5b86811061202a5750836001959610611ff2575b505050811b01600855565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690555f8080611fe7565b90926020600181928686013581550194019101611fd4565b919067ffffffffffffffff811161059157612069816120626009546104d2565b6009611eb6565b5f601f82116001146120b95781906120b493945f92611f7d5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600955565b60095f527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216937f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af915f5b86811061215b5750836001959610612123575b505050811b01600955565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690555f8080612118565b90926020600181928686013581550194019101612105565b919067ffffffffffffffff81116105915761219a81612193600a546104d2565b600a611eb6565b5f601f82116001146121ea5781906121e593945f92611f7d5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b600a55565b600a5f527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216937fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8915f5b86811061228c5750836001959610612254575b505050811b01600a55565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690555f8080612249565b90926020600181928686013581550194019101612236565b919293949a996122be906122b66129d6565b61196e6129d6565b60405160206122cd8183610550565b5f82526122d86129d6565b6122e06129d6565b81519167ffffffffffffffff831161059157612306836123016004546104d2565b611e16565b602091601f841160011461242a57509461241073ffffffffffffffffffffffffffffffffffffffff611b269e9f966123ce6104839e9d9b976123898861044a9f9d98996124159a61241a9e5f9261241f5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b6004555b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff00000000000000000000000000000000000000006006541617600655565b1673ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff00000000000000000000000000000000000000006007541617600755565b611f05565b612042565b612173565b015190505f80611f46565b60045f5291907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084167f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b935f905b828210612508575050611b269e9f966123ce6104839e9d9b9760018861044a9f9d9861241a9d98612410986124159c73ffffffffffffffffffffffffffffffffffffffff99106124d1575b505050811b0160045561238d565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c191690555f80806124c3565b80600186978294978701518155019601940190612478565b9392919073ffffffffffffffffffffffffffffffffffffffff85163381141580612573575b6118bf5773ffffffffffffffffffffffffffffffffffffffff8216156115b55715610fd157611b2694612c9f565b50805f52600360205260ff6125a93360405f209073ffffffffffffffffffffffffffffffffffffffff165f5260205260405f2090565b541615612545565b156125b857565b7fed6fcad9000000000000000000000000000000000000000000000000000000005f5260045ffd5b919067ffffffffffffffff811161059157612605816126006008546104d2565b611e66565b5f601f8211600114612650578190611f7893945f92611f7d5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60085f527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216937ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3915f5b8681106126b95750836001959610611ff257505050811b01600855565b9092602060018192868601358155019401910161269c565b80518210156126e55760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b919091805183518082036115875750508051907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061276861275284610b28565b936127606040519586610550565b808552610b28565b013660208401375f5b81518110156127a8578061279760019260051b6020808287010151918901015190611a62565b6127a182866126d1565b5201612771565b5090925050565b156127b8575050565b9073ffffffffffffffffffffffffffffffffffffffff80927fe237d922000000000000000000000000000000000000000000000000000000005f52166004521660245260445ffd5b5f9081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615611a9457600190565b73ffffffffffffffffffffffffffffffffffffffff1680156128ef5773ffffffffffffffffffffffffffffffffffffffff7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930054827fffffffffffffffffffffffff00000000000000000000000000000000000000008216177f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b7f1e4fbdf7000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b73ffffffffffffffffffffffffffffffffffffffff7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005416330361295b57565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b9061299182610b9d565b61299e6040519182610550565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06129cc8294610b9d565b0190602036910137565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460401c1615612a0557565b7fd7e6bcf8000000000000000000000000000000000000000000000000000000005f5260045ffd5b90925092909282518451908181036115875750919273ffffffffffffffffffffffffffffffffffffffff82168015159350905f5b8151811015612be2578060051b60208082850101519189010151865f14612b865784612ace612ab5612a9b855f52600260205260405f2090565b5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b03612b7e5760ff60015b1690808210612b2357505090612b1d6001925f52600260205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b01612a61565b6040517f03dee4c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff881660048201526024810192909252604482015260648101829052608490fd5b60ff5f612ad8565b600190929192118015612bd1575b61138657612b1d6001925f52600260205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b50612bdb82612800565b1515612b94565b509092505f939491508051600181148514612c49575060209081015191810151604080519384529183015233917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f629190a4611b2661146561143960055464ffffffffff1690565b7f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb9192612c8c611465612c9a9364ffffffffff61151260055464ffffffffff1690565b604051918291339583612fdc565b0390a4565b9091805184519081810361158757505073ffffffffffffffffffffffffffffffffffffffff83969596169182159073ffffffffffffffffffffffffffffffffffffffff8116928315975f9989159a5b8351811015612e79578060051b6020808287010151918c0101518d5f14612e4e5788612d28612ab5612a9b855f52600260205260405f2090565b03612e465760ff60015b1690808210612deb575050906001915b8715612d8557612d7f905f52600260205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b01612cee565b8a8a8a03612d95575b5050612d7f565b612de4915f52600260205273ffffffffffffffffffffffffffffffffffffffff60405f2091167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b5f8a612d8e565b6040517f03dee4c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff891660048201526024810192909252604482015260648101829052608490fd5b60ff5f612d32565b600190929192118015612e68575b61138657600191612d42565b50612e7282612800565b1515612e5c565b50979591989296949099508851600181145f14612f4c575060208981015187820151604080519283529282015233917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291a48115612f2c5750612ee861146561143960055464ffffffffff1690565b15612ef5575b5050505050565b8451600103612f1b57602080612f11960151920151923361327b565b5f80808080612eee565b612f27949192336130a0565b612f11565b15612ee857612f476114656114dd60055464ffffffffff1690565b612ee8565b909192845f14612fae5750611465612f749164ffffffffff61151260055464ffffffffff1690565b6040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180612fa6898d83612fdc565b0390a4612ee8565b612fb9575b50612f74565b611465612fd69164ffffffffff61157660055464ffffffffff1690565b5f612fb3565b9091612ff36105ea93604084526040840190610d4f565b916020818403910152610d4f565b908160209103126101bb57516105ea81610296565b93906105ea959373ffffffffffffffffffffffffffffffffffffffff61306394816130559416885216602087015260a0604087015260a0860190610d4f565b908482036060860152610d4f565b916080818403910152610596565b3d1561309b573d9061308282610b9d565b916130906040519384610550565b82523d5f602084013e565b606090565b9091949293853b6130b4575b505050505050565b6020936130ef9160405196879586957fbc197c8100000000000000000000000000000000000000000000000000000000875260048701613016565b03815f73ffffffffffffffffffffffffffffffffffffffff87165af15f9181613209575b506131735750613121613071565b805191908261316c577f57f447ce000000000000000000000000000000000000000000000000000000005f5273ffffffffffffffffffffffffffffffffffffffff821660045260245ffd5b9050602001fd5b7fffffffff000000000000000000000000000000000000000000000000000000007fbc197c81000000000000000000000000000000000000000000000000000000009116036131c857505f80808080806130ac565b7f57f447ce000000000000000000000000000000000000000000000000000000005f5273ffffffffffffffffffffffffffffffffffffffff1660045260245ffd5b61322c91925060203d602011613233575b6132248183610550565b810190613001565b905f613113565b503d61321a565b919273ffffffffffffffffffffffffffffffffffffffff60a094816105ea989794168552166020840152604083015260608201528160808201520190610596565b9091949293853b61328e57505050505050565b6020936132c99160405196879586957ff23a6e610000000000000000000000000000000000000000000000000000000087526004870161323a565b03815f73ffffffffffffffffffffffffffffffffffffffff87165af15f9181613350575b506132fb5750613121613071565b7fffffffff000000000000000000000000000000000000000000000000000000007ff23a6e61000000000000000000000000000000000000000000000000000000009116036131c857505f80808080806130ac565b61336a91925060203d602011613233576132248183610550565b905f6132ed56fea264697066735822122063a438fbb7093d3cc791b5d38eb4560db9926aa9e417c27c46c56074b6cd2b4364736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.