Overview
xDAI Balance
xDAI Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 3 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
35951874 | 223 days ago | Contract Creation | 0 xDAI | |||
35951874 | 223 days ago | Contract Creation | 0 xDAI | |||
35951874 | 223 days ago | Contract Creation | 0 xDAI |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ERC1155SoulboundFactory
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 20000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; import {ERC1155Soulbound} from "@0xsequence/contracts-library/tokens/ERC1155/presets/soulbound/ERC1155Soulbound.sol"; import { IERC1155SoulboundFactory, IERC1155SoulboundFactoryFunctions } from "@0xsequence/contracts-library/tokens/ERC1155/presets/soulbound/IERC1155SoulboundFactory.sol"; import {SequenceProxyFactory} from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol"; /** * Deployer of ERC-1155 Soulbound proxies. */ contract ERC1155SoulboundFactory is IERC1155SoulboundFactory, SequenceProxyFactory { /** * Creates an ERC-1155 Soulbound Factory. * @param factoryOwner The owner of the ERC-1155 Soulbound Factory */ constructor(address factoryOwner) { ERC1155Soulbound impl = new ERC1155Soulbound(); SequenceProxyFactory._initialize(address(impl), factoryOwner); } /// @inheritdoc IERC1155SoulboundFactoryFunctions function deploy( address proxyOwner, address tokenOwner, string memory name, string memory baseURI, string memory contractURI, address royaltyReceiver, uint96 royaltyFeeNumerator ) external returns (address proxyAddr) { bytes32 salt = keccak256(abi.encode(tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator)); proxyAddr = _createProxy(salt, proxyOwner, ""); ERC1155Soulbound(proxyAddr).initialize( tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator ); emit ERC1155SoulboundDeployed(proxyAddr); return proxyAddr; } /// @inheritdoc IERC1155SoulboundFactoryFunctions function determineAddress( address proxyOwner, address tokenOwner, string memory name, string memory baseURI, string memory contractURI, address royaltyReceiver, uint96 royaltyFeeNumerator ) external view returns (address proxyAddr) { bytes32 salt = keccak256(abi.encode(tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator)); return _computeProxyAddress(salt, proxyOwner, ""); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; import {ERC1155Items} from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/ERC1155Items.sol"; import { IERC1155Soulbound, IERC1155SoulboundFunctions } from "@0xsequence/contracts-library/tokens/ERC1155/presets/soulbound/IERC1155Soulbound.sol"; /** * An implementation of ERC-1155 that prevents transfers. */ contract ERC1155Soulbound is ERC1155Items, IERC1155Soulbound { bytes32 public constant TRANSFER_ADMIN_ROLE = keccak256("TRANSFER_ADMIN_ROLE"); bool internal _transferLocked; constructor() ERC1155Items() {} /// @inheritdoc ERC1155Items function initialize( address owner, string memory tokenName, string memory tokenBaseURI, string memory tokenContractURI, address royaltyReceiver, uint96 royaltyFeeNumerator ) public virtual override { _transferLocked = true; _grantRole(TRANSFER_ADMIN_ROLE, owner); super.initialize(owner, tokenName, tokenBaseURI, tokenContractURI, royaltyReceiver, royaltyFeeNumerator); } /// @inheritdoc IERC1155SoulboundFunctions function setTransferLocked(bool locked) external override onlyRole(TRANSFER_ADMIN_ROLE) { _transferLocked = locked; } /// @inheritdoc IERC1155SoulboundFunctions function getTransferLocked() external view override returns (bool) { return _transferLocked; } // Transfer hooks function _safeTransferFrom(address from, address to, uint256 id, uint256 amount) internal virtual override { // Mint transactions allowed if (_transferLocked && from != address(0)) { revert TransfersLocked(); } super._safeTransferFrom(from, to, id, amount); } function _safeBatchTransferFrom(address from, address to, uint256[] memory ids, uint256[] memory amounts) internal virtual override { // Mint transactions allowed if (_transferLocked && from != address(0)) { revert TransfersLocked(); } super._safeBatchTransferFrom(from, to, ids, amounts); } function _burn(address from, uint256 id, uint256 amount) internal virtual override { if (_transferLocked) { revert TransfersLocked(); } super._burn(from, id, amount); } function _batchBurn(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual override { if (_transferLocked) { revert TransfersLocked(); } super._batchBurn(from, ids, amounts); } // Views function supportsInterface(bytes4 interfaceId) public view override returns (bool) { return type(IERC1155SoulboundFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; interface IERC1155SoulboundFactoryFunctions { /** * Creates an ERC-1155 Soulbound proxy. * @param proxyOwner The owner of the ERC-1155 Soulbound proxy * @param tokenOwner The owner of the ERC-1155 Soulbound implementation * @param name The name of the ERC-1155 Soulbound proxy * @param baseURI The base URI of the ERC-1155 Soulbound proxy * @param contractURI The contract URI of the ERC-1155 Soulbound proxy * @param royaltyReceiver Address of who should be sent the royalty payment * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500) * @return proxyAddr The address of the ERC-1155 Soulbound Proxy */ function deploy( address proxyOwner, address tokenOwner, string memory name, string memory baseURI, string memory contractURI, address royaltyReceiver, uint96 royaltyFeeNumerator ) external returns (address proxyAddr); /** * Computes the address of a proxy instance. * @param proxyOwner The owner of the ERC-1155 Soulbound proxy * @param tokenOwner The owner of the ERC-1155 Soulbound implementation * @param name The name of the ERC-1155 Soulbound proxy * @param baseURI The base URI of the ERC-1155 Soulbound proxy * @param contractURI The contract URI of the ERC-1155 Soulbound proxy * @param royaltyReceiver Address of who should be sent the royalty payment * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500) * @return proxyAddr The address of the ERC-1155 Soulbound Proxy */ function determineAddress( address proxyOwner, address tokenOwner, string memory name, string memory baseURI, string memory contractURI, address royaltyReceiver, uint96 royaltyFeeNumerator ) external returns (address proxyAddr); } interface IERC1155SoulboundFactorySignals { /** * Event emitted when a new ERC-1155 Soulbound proxy contract is deployed. * @param proxyAddr The address of the deployed proxy. */ event ERC1155SoulboundDeployed(address proxyAddr); } interface IERC1155SoulboundFactory is IERC1155SoulboundFactoryFunctions, IERC1155SoulboundFactorySignals {}
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; import { TransparentUpgradeableBeaconProxy, ITransparentUpgradeableBeaconProxy } from "./TransparentUpgradeableBeaconProxy.sol"; import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {UpgradeableBeacon} from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; /** * An proxy factory that deploys upgradeable beacon proxies. * @dev The factory owner is able to upgrade the beacon implementation. * @dev Proxy deployers are able to override the beacon reference with their own. */ abstract contract SequenceProxyFactory is Ownable { UpgradeableBeacon public beacon; /** * Initialize a Sequence Proxy Factory. * @param implementation The initial beacon implementation. * @param factoryOwner The owner of the factory. */ function _initialize(address implementation, address factoryOwner) internal { beacon = new UpgradeableBeacon(implementation); Ownable._transferOwnership(factoryOwner); } /** * Deploys and initializes a new proxy instance. * @param _salt The deployment salt. * @param _proxyOwner The owner of the proxy. * @param _data The initialization data. * @return proxyAddress The address of the deployed proxy. */ function _createProxy(bytes32 _salt, address _proxyOwner, bytes memory _data) internal returns (address proxyAddress) { bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data)); bytes memory bytecode = type(TransparentUpgradeableBeaconProxy).creationCode; proxyAddress = Create2.deploy(0, saltedHash, bytecode); ITransparentUpgradeableBeaconProxy(payable(proxyAddress)).initialize(_proxyOwner, address(beacon), _data); } /** * Computes the address of a proxy instance. * @param _salt The deployment salt. * @param _proxyOwner The owner of the proxy. * @return proxy The expected address of the deployed proxy. */ function _computeProxyAddress(bytes32 _salt, address _proxyOwner, bytes memory _data) internal view returns (address) { bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data)); bytes32 bytecodeHash = keccak256(type(TransparentUpgradeableBeaconProxy).creationCode); return Create2.computeAddress(saltedHash, bytecodeHash); } /** * Upgrades the beacon implementation. * @param implementation The new beacon implementation. */ function upgradeBeacon(address implementation) public onlyOwner { beacon.upgradeTo(implementation); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; import { IERC1155Items, IERC1155ItemsFunctions } from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/IERC1155Items.sol"; import {ERC1155BaseToken} from "@0xsequence/contracts-library/tokens/ERC1155/ERC1155BaseToken.sol"; import {ERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/ERC2981Controlled.sol"; /** * An implementation of ERC-1155 capable of minting when role provided. */ contract ERC1155Items is ERC1155BaseToken, IERC1155Items { bytes32 internal constant MINTER_ROLE = keccak256("MINTER_ROLE"); address private immutable initializer; bool private initialized; constructor() { initializer = msg.sender; } /** * Initialize the contract. * @param owner Owner address * @param tokenName Token name * @param tokenBaseURI Base URI for token metadata * @param tokenContractURI Contract URI for token metadata * @param royaltyReceiver Address of who should be sent the royalty payment * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500) * @dev This should be called immediately after deployment. */ function initialize( address owner, string memory tokenName, string memory tokenBaseURI, string memory tokenContractURI, address royaltyReceiver, uint96 royaltyFeeNumerator ) public virtual { if (msg.sender != initializer || initialized) { revert InvalidInitialization(); } ERC1155BaseToken._initialize(owner, tokenName, tokenBaseURI, tokenContractURI); _setDefaultRoyalty(royaltyReceiver, royaltyFeeNumerator); _grantRole(MINTER_ROLE, owner); initialized = true; } // // Minting // /** * Mint tokens. * @param to Address to mint tokens to. * @param tokenId Token ID to mint. * @param amount Amount of tokens to mint. * @param data Data to pass if receiver is contract. */ function mint(address to, uint256 tokenId, uint256 amount, bytes memory data) external onlyRole(MINTER_ROLE) { _mint(to, tokenId, amount, data); } /** * Mint tokens. * @param to Address to mint tokens to. * @param tokenIds Token IDs to mint. * @param amounts Amounts of tokens to mint. * @param data Data to pass if receiver is contract. */ function batchMint(address to, uint256[] memory tokenIds, uint256[] memory amounts, bytes memory data) external onlyRole(MINTER_ROLE) { _batchMint(to, tokenIds, amounts, data); } // // Views // /** * Check interface support. * @param interfaceId Interface id * @return True if supported */ function supportsInterface(bytes4 interfaceId) public view virtual override (ERC1155BaseToken) returns (bool) { return type(IERC1155ItemsFunctions).interfaceId == interfaceId || ERC1155BaseToken.supportsInterface(interfaceId) || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; interface IERC1155SoulboundFunctions { /** * Sets the transfer lock. * @param locked Whether or not transfers are locked. */ function setTransferLocked(bool locked) external; /** * Gets the transfer lock. * @return Whether or not transfers are locked. */ function getTransferLocked() external view returns (bool); } interface IERC1155SoulboundSignals { /** * Transfers locked. */ error TransfersLocked(); } interface IERC1155Soulbound is IERC1155SoulboundFunctions, IERC1155SoulboundSignals {}
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; import {BeaconProxy, Proxy} from "./openzeppelin/BeaconProxy.sol"; import {TransparentUpgradeableProxy, ERC1967Proxy} from "./openzeppelin/TransparentUpgradeableProxy.sol"; interface ITransparentUpgradeableBeaconProxy { function initialize(address admin, address beacon, bytes memory data) external; } error InvalidInitialization(); /** * @dev As the underlying proxy implementation (TransparentUpgradeableProxy) allows the admin to call the implementation, * care must be taken to avoid proxy selector collisions. Implementation selectors must not conflict with the proxy selectors. * See https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing]. * The proxy selectors are: * - 0xcf7a1d77: initialize * - 0x3659cfe6: upgradeTo (from TransparentUpgradeableProxy) * - 0x4f1ef286: upgradeToAndCall (from TransparentUpgradeableProxy) * - 0x8f283970: changeAdmin (from TransparentUpgradeableProxy) * - 0xf851a440: admin (from TransparentUpgradeableProxy) * - 0x5c60da1b: implementation (from TransparentUpgradeableProxy) */ contract TransparentUpgradeableBeaconProxy is TransparentUpgradeableProxy, BeaconProxy { /** * Decode the initialization data from the msg.data and call the initialize function. */ function _dispatchInitialize() private returns (bytes memory) { _requireZeroValue(); (address admin, address beacon, bytes memory data) = abi.decode(msg.data[4:], (address, address, bytes)); initialize(admin, beacon, data); return ""; } function initialize(address admin, address beacon, bytes memory data) internal { if (_admin() != address(0)) { // Redundant call. This function can only be called when the admin is not set. revert InvalidInitialization(); } _changeAdmin(admin); _upgradeBeaconToAndCall(beacon, data, false); } /** * @dev If the admin is not set, the fallback function is used to initialize the proxy. * @dev If the admin is set, the fallback function is used to delegatecall the implementation. */ function _fallback() internal override (TransparentUpgradeableProxy, Proxy) { if (_getAdmin() == address(0)) { bytes memory ret; bytes4 selector = msg.sig; if (selector == ITransparentUpgradeableBeaconProxy.initialize.selector) { ret = _dispatchInitialize(); // solhint-disable-next-line no-inline-assembly assembly { return(add(ret, 0x20), mload(ret)) } } // When the admin is not set, the fallback function is used to initialize the proxy. revert InvalidInitialization(); } TransparentUpgradeableProxy._fallback(); } /** * Returns the current implementation address. * @dev This is the implementation address set by the admin, or the beacon implementation. */ function _implementation() internal view override (ERC1967Proxy, BeaconProxy) returns (address) { address implementation = ERC1967Proxy._implementation(); if (implementation != address(0)) { return implementation; } return BeaconProxy._implementation(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Create2.sol) pragma solidity ^0.8.0; /** * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer. * `CREATE2` can be used to compute in advance the address where a smart * contract will be deployed, which allows for interesting new mechanisms known * as 'counterfactual interactions'. * * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more * information. */ library Create2 { /** * @dev Deploys a contract using `CREATE2`. The address where the contract * will be deployed can be known in advance via {computeAddress}. * * The bytecode for a contract can be obtained from Solidity with * `type(contractName).creationCode`. * * Requirements: * * - `bytecode` must not be empty. * - `salt` must have not been used for `bytecode` already. * - the factory must have a balance of at least `amount`. * - if `amount` is non-zero, `bytecode` must have a `payable` constructor. */ function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) { require(address(this).balance >= amount, "Create2: insufficient balance"); require(bytecode.length != 0, "Create2: bytecode length is zero"); /// @solidity memory-safe-assembly assembly { addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt) } require(addr != address(0), "Create2: Failed on deploy"); } /** * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the * `bytecodeHash` or `salt` will result in a new destination address. */ function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) { return computeAddress(salt, bytecodeHash, address(this)); } /** * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}. */ function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) // Get free memory pointer // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... | // |-------------------|---------------------------------------------------------------------------| // | bytecodeHash | CCCCCCCCCCCCC...CC | // | salt | BBBBBBBBBBBBB...BB | // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA | // | 0xFF | FF | // |-------------------|---------------------------------------------------------------------------| // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC | // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ | mstore(add(ptr, 0x40), bytecodeHash) mstore(add(ptr, 0x20), salt) mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff mstore8(start, 0xff) addr := keccak256(start, 85) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. 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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol) pragma solidity ^0.8.0; import "./IBeacon.sol"; import "../../access/Ownable.sol"; import "../../utils/Address.sol"; /** * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their * implementation contract, which is where they will delegate all function calls. * * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon. */ contract UpgradeableBeacon is IBeacon, Ownable { address private _implementation; /** * @dev Emitted when the implementation returned by the beacon is changed. */ event Upgraded(address indexed implementation); /** * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the * beacon. */ constructor(address implementation_) { _setImplementation(implementation_); } /** * @dev Returns the current implementation address. */ function implementation() public view virtual override returns (address) { return _implementation; } /** * @dev Upgrades the beacon to a new implementation. * * Emits an {Upgraded} event. * * Requirements: * * - msg.sender must be the owner of the contract. * - `newImplementation` must be a contract. */ function upgradeTo(address newImplementation) public virtual onlyOwner { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation contract address for this beacon * * Requirements: * * - `newImplementation` must be a contract. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "UpgradeableBeacon: implementation is not a contract"); _implementation = newImplementation; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; interface IERC1155ItemsFunctions { /** * Mint tokens. * @param to Address to mint tokens to. * @param tokenId Token ID to mint. * @param amount Amount of tokens to mint. * @param data Data to pass if receiver is contract. */ function mint(address to, uint256 tokenId, uint256 amount, bytes memory data) external; /** * Mint tokens. * @param to Address to mint tokens to. * @param tokenIds Token IDs to mint. * @param amounts Amounts of tokens to mint. * @param data Data to pass if receiver is contract. */ function batchMint(address to, uint256[] memory tokenIds, uint256[] memory amounts, bytes memory data) external; } interface IERC1155ItemsSignals { /** * Invalid initialization error. */ error InvalidInitialization(); } interface IERC1155Items is IERC1155ItemsFunctions, IERC1155ItemsSignals {}
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; import { ERC1155Supply, ERC1155 } from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/ERC1155Supply.sol"; import {ERC1155Metadata} from "@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155Metadata.sol"; import {ERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/ERC2981Controlled.sol"; error InvalidInitialization(); /** * A standard base implementation of ERC-1155 for use in Sequence library contracts. */ abstract contract ERC1155BaseToken is ERC1155Supply, ERC1155Metadata, ERC2981Controlled { bytes32 internal constant METADATA_ADMIN_ROLE = keccak256("METADATA_ADMIN_ROLE"); string private _contractURI; /** * Deploy contract. */ constructor() ERC1155Metadata("", "") {} /** * Initialize the contract. * @param owner Owner address. * @param tokenName Token name. * @param tokenBaseURI Base URI for token metadata. * @param tokenContractURI Contract URI for token metadata. * @dev This should be called immediately after deployment. */ function _initialize( address owner, string memory tokenName, string memory tokenBaseURI, string memory tokenContractURI ) internal { name = tokenName; baseURI = tokenBaseURI; _contractURI = tokenContractURI; _grantRole(DEFAULT_ADMIN_ROLE, owner); _grantRole(ROYALTY_ADMIN_ROLE, owner); _grantRole(METADATA_ADMIN_ROLE, owner); } // // Metadata // /** * Update the base URI of token's URI. * @param tokenBaseURI New base URI of token's URI */ function setBaseMetadataURI(string memory tokenBaseURI) external onlyRole(METADATA_ADMIN_ROLE) { _setBaseMetadataURI(tokenBaseURI); } /** * Update the name of the contract. * @param tokenName New contract name */ function setContractName(string memory tokenName) external onlyRole(METADATA_ADMIN_ROLE) { _setContractName(tokenName); } /** * Update the contract URI of token's URI. * @param tokenContractURI New contract URI of token's URI * @notice Refer to https://docs.opensea.io/docs/contract-level-metadata */ function setContractURI(string memory tokenContractURI) external onlyRole(METADATA_ADMIN_ROLE) { _contractURI = tokenContractURI; } // // Burn // /** * Allows the owner of the token to burn their tokens. * @param tokenId Id of token to burn * @param amount Amount of tokens to burn */ function burn(uint256 tokenId, uint256 amount) public virtual { _burn(msg.sender, tokenId, amount); } /** * Burn tokens of given token id for each (tokenIds[i], amounts[i]) pair. * @param tokenIds Array of token ids to burn * @param amounts Array of the amount to be burned */ function batchBurn(uint256[] memory tokenIds, uint256[] memory amounts) public virtual { _batchBurn(msg.sender, tokenIds, amounts); } // // Views // /** * Get the contract URI of token's URI. * @return Contract URI of token's URI * @notice Refer to https://docs.opensea.io/docs/contract-level-metadata */ function contractURI() public view returns (string memory) { return _contractURI; } /** * Check interface support. * @param interfaceId Interface id * @return True if supported */ function supportsInterface(bytes4 interfaceId) public view virtual override (ERC1155Supply, ERC1155Metadata, ERC2981Controlled) returns (bool) { return ERC1155Supply.supportsInterface(interfaceId) || ERC1155Metadata.supportsInterface(interfaceId) || ERC2981Controlled.supportsInterface(interfaceId) || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; import {IERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/IERC2981Controlled.sol"; import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol"; import {AccessControlEnumerable} from "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; /** * An implementation of ERC-2981 that allows updates by roles. */ abstract contract ERC2981Controlled is ERC2981, AccessControlEnumerable, IERC2981Controlled { bytes32 internal constant ROYALTY_ADMIN_ROLE = keccak256("ROYALTY_ADMIN_ROLE"); // // Royalty // /** * Sets the royalty information that all ids in this contract will default to. * @param receiver Address of who should be sent the royalty payment * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500) */ function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyRole(ROYALTY_ADMIN_ROLE) { _setDefaultRoyalty(receiver, feeNumerator); } /** * Sets the royalty information that a given token id in this contract will use. * @param tokenId The token id to set the royalty information for * @param receiver Address of who should be sent the royalty payment * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500) * @notice This overrides the default royalty information for this token id */ function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external onlyRole(ROYALTY_ADMIN_ROLE) { _setTokenRoyalty(tokenId, receiver, feeNumerator); } // // Views // /** * Check interface support. * @param interfaceId Interface id * @return True if supported */ function supportsInterface(bytes4 interfaceId) public view virtual override (ERC2981, AccessControlEnumerable) returns (bool) { return ERC2981.supportsInterface(interfaceId) || AccessControlEnumerable.supportsInterface(interfaceId) || type(IERC2981Controlled).interfaceId == interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol) // Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated. pragma solidity ^0.8.19; import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; import "@openzeppelin/contracts/proxy/Proxy.sol"; import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol"; /** * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. * * _Available since v3.4._ */ contract BeaconProxy is Proxy, ERC1967Upgrade { /** * @dev Returns the current beacon address. */ function _beacon() internal view virtual returns (address) { return _getBeacon(); } /** * @dev Returns the current implementation address of the associated beacon. */ function _implementation() internal view virtual override returns (address) { return IBeacon(_getBeacon()).implementation(); } /** * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. * * Requirements: * * - `beacon` must be a contract. * - The implementation returned by `beacon` must be a contract. */ function _setBeacon(address beacon, bytes memory data) internal virtual { _upgradeBeaconToAndCall(beacon, data, false); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol) /// @notice This implementation is a copy of OpenZeppelin's with the following changes: /// - Pragma updated /// - Imports updated /// - Constructor removed /// - Allows admin to call implementation pragma solidity ^0.8.19; import "./ERC1967Proxy.sol"; /** * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy} * does not implement this interface directly, and some of its functions are implemented by an internal dispatch * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not * include them in the ABI so this interface must be used to interact with it. */ interface ITransparentUpgradeableProxy is IERC1967 { function admin() external view returns (address); function implementation() external view returns (address); function changeAdmin(address) external; function upgradeTo(address) external; function upgradeToAndCall(address, bytes memory) external payable; } /** * @dev This contract implements a proxy that is upgradeable by an admin. * * Unlike the original OpenZeppelin implementation, this contract does not prevent the admin from calling the implementation. * This potentially exposes the admin to a proxy selector attack. See * https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing]. * When using this contract, you must ensure that the implementation function selectors do not clash with the proxy selectors. * The proxy selectors are: * - 0x3659cfe6: upgradeTo * - 0x4f1ef286: upgradeToAndCall * - 0x8f283970: changeAdmin * - 0xf851a440: admin * - 0x5c60da1b: implementation * * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the * implementation. * * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised. */ contract TransparentUpgradeableProxy is ERC1967Proxy { /** * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin. * * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the * implementation provides a function with the same selector. */ modifier ifAdmin() { if (msg.sender == _getAdmin()) { _; } else { _fallback(); } } /** * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior */ function _fallback() internal virtual override { if (msg.sender == _getAdmin()) { bytes memory ret; bytes4 selector = msg.sig; if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) { ret = _dispatchUpgradeTo(); } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) { ret = _dispatchUpgradeToAndCall(); } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) { ret = _dispatchChangeAdmin(); } else if (selector == ITransparentUpgradeableProxy.admin.selector) { ret = _dispatchAdmin(); } else if (selector == ITransparentUpgradeableProxy.implementation.selector) { ret = _dispatchImplementation(); } else { // Call implementation return super._fallback(); } assembly { return(add(ret, 0x20), mload(ret)) } } else { super._fallback(); } } /** * @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 _dispatchAdmin() private returns (bytes memory) { _requireZeroValue(); address admin = _getAdmin(); return abi.encode(admin); } /** * @dev Returns the current implementation. * * 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. * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` */ function _dispatchImplementation() private returns (bytes memory) { _requireZeroValue(); address implementation = _implementation(); return abi.encode(implementation); } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _dispatchChangeAdmin() private returns (bytes memory) { _requireZeroValue(); address newAdmin = abi.decode(msg.data[4:], (address)); _changeAdmin(newAdmin); return ""; } /** * @dev Upgrade the implementation of the proxy. */ function _dispatchUpgradeTo() private returns (bytes memory) { _requireZeroValue(); address newImplementation = abi.decode(msg.data[4:], (address)); _upgradeToAndCall(newImplementation, bytes(""), false); return ""; } /** * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the * proxied contract. */ function _dispatchUpgradeToAndCall() private returns (bytes memory) { (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes)); _upgradeToAndCall(newImplementation, data, true); return ""; } /** * @dev Returns the current admin. * * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead. */ function _admin() internal view virtual returns (address) { return _getAdmin(); } /** * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to * emulate some proxy functions being non-payable while still allowing value to pass through. */ function _requireZeroValue() internal { require(msg.value == 0); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @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. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; import {ERC1155} from "@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155.sol"; import { IERC1155Supply, IERC1155SupplyFunctions } from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/IERC1155Supply.sol"; /** * An ERC-1155 extension that tracks token supply. */ abstract contract ERC1155Supply is ERC1155, IERC1155Supply { // Current supply uint256 public totalSupply; mapping(uint256 => uint256) public tokenSupply; /** * Mint _amount of tokens of a given id * @param _to The address to mint tokens to * @param _id Token id to mint * @param _amount The amount to be minted * @param _data Data to pass if receiver is contract */ function _mint(address _to, uint256 _id, uint256 _amount, bytes memory _data) internal virtual { totalSupply += _amount; tokenSupply[_id] += _amount; balances[_to][_id] += _amount; emit TransferSingle(msg.sender, address(0x0), _to, _id, _amount); _callonERC1155Received(address(0x0), _to, _id, _amount, gasleft(), _data); } /** * Mint tokens for each ids in _ids * @param _to The address to mint tokens to * @param _ids Array of ids to mint * @param _amounts Array of amount of tokens to mint per id * @param _data Data to pass if receiver is contract */ function _batchMint(address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) internal virtual { uint256 nMint = _ids.length; if (nMint != _amounts.length) { revert InvalidArrayLength(); } // Executing all minting uint256 totalAmount = 0; for (uint256 i = 0; i < nMint; i++) { // Update storage balance balances[_to][_ids[i]] += _amounts[i]; tokenSupply[_ids[i]] += _amounts[i]; totalAmount += _amounts[i]; } totalSupply += totalAmount; emit TransferBatch(msg.sender, address(0x0), _to, _ids, _amounts); // Calling onReceive method if recipient is contract _callonERC1155BatchReceived(address(0x0), _to, _ids, _amounts, gasleft(), _data); } /** * Burn _amount of tokens of a given token id * @param _from The address to burn tokens from * @param _id Token id to burn * @param _amount The amount to be burned */ function _burn(address _from, uint256 _id, uint256 _amount) internal virtual { // Supply totalSupply -= _amount; tokenSupply[_id] -= _amount; // Balances balances[_from][_id] -= _amount; // Emit event emit TransferSingle(msg.sender, _from, address(0x0), _id, _amount); } /** * Burn tokens of given token id for each (_ids[i], _amounts[i]) pair * @param _from The address to burn tokens from * @param _ids Array of token ids to burn * @param _amounts Array of the amount to be burned */ function _batchBurn(address _from, uint256[] memory _ids, uint256[] memory _amounts) internal virtual { uint256 nBurn = _ids.length; if (nBurn != _amounts.length) { revert InvalidArrayLength(); } uint256 totalAmount = 0; for (uint256 i = 0; i < nBurn; i++) { // Update balances balances[_from][_ids[i]] -= _amounts[i]; tokenSupply[_ids[i]] -= _amounts[i]; totalAmount += _amounts[i]; } totalSupply -= totalAmount; // Emit batch mint event emit TransferBatch(msg.sender, _from, address(0x0), _ids, _amounts); } // // Views // /** * Check interface support. * @param interfaceId Interface id * @return True if supported */ function supportsInterface(bytes4 interfaceId) public view virtual override (ERC1155) returns (bool) { return type(IERC1155SupplyFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import '../../interfaces/IERC1155Metadata.sol'; import '../../utils/ERC165.sol'; /** * @notice Contract that handles metadata related methods. * @dev Methods assume a deterministic generation of URI based on token IDs. * Methods also assume that URI uses hex representation of token IDs. */ contract ERC1155Metadata is IERC1155Metadata, ERC165 { // URI's default URI prefix string public baseURI; string public name; // set the initial name and base URI constructor(string memory _name, string memory _baseURI) { name = _name; baseURI = _baseURI; } /***********************************| | Metadata Public Functions | |__________________________________*/ /** * @notice A distinct Uniform Resource Identifier (URI) for a given token. * @dev URIs are defined in RFC 3986. * URIs are assumed to be deterministically generated based on token ID * @return URI string */ function uri(uint256 _id) public view virtual override returns (string memory) { return string(abi.encodePacked(baseURI, _uint2str(_id), ".json")); } /***********************************| | Metadata Internal Functions | |__________________________________*/ /** * @notice Will emit default URI log event for corresponding token _id * @param _tokenIDs Array of IDs of tokens to log default URI */ function _logURIs(uint256[] memory _tokenIDs) internal virtual { string memory baseURL = baseURI; string memory tokenURI; for (uint256 i = 0; i < _tokenIDs.length; i++) { tokenURI = string(abi.encodePacked(baseURL, _uint2str(_tokenIDs[i]), ".json")); emit URI(tokenURI, _tokenIDs[i]); } } /** * @notice Will update the base URL of token's URI * @param _newBaseMetadataURI New base URL of token's URI */ function _setBaseMetadataURI(string memory _newBaseMetadataURI) internal { baseURI = _newBaseMetadataURI; } /** * @notice Will update the name of the contract * @param _newName New contract name */ function _setContractName(string memory _newName) internal { name = _newName; } /** * @notice Query if a contract implements an interface * @param _interfaceID The interface identifier, as specified in ERC-165 * @return `true` if the contract implements `_interfaceID` and */ function supportsInterface(bytes4 _interfaceID) public view virtual override returns (bool) { if (_interfaceID == type(IERC1155Metadata).interfaceId) { return true; } return super.supportsInterface(_interfaceID); } /***********************************| | Utility Internal Functions | |__________________________________*/ function _uint2str(uint _i) internal pure returns (string memory _uintAsString) { if (_i == 0) { return '0'; } uint j = _i; uint len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint k = len; while (_i != 0) { k = k - 1; uint8 temp = (48 + uint8(_i - (_i / 10) * 10)); bytes1 b1 = bytes1(temp); bstr[k] = b1; _i /= 10; } return string(bstr); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; interface IERC2981ControlledFunctions { /** * Sets the royalty information that all ids in this contract will default to. * @param receiver Address of who should be sent the royalty payment * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500) */ function setDefaultRoyalty(address receiver, uint96 feeNumerator) external; /** * Sets the royalty information that a given token id in this contract will use. * @param tokenId The token id to set the royalty information for * @param receiver Address of who should be sent the royalty payment * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500) * @notice This overrides the default royalty information for this token id */ function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external; } interface IERC2981Controlled is IERC2981ControlledFunctions {}
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../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. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @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 override 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 { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _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 { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _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 v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol) pragma solidity ^0.8.0; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overridden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeacon.sol"; import "../../interfaces/IERC1967.sol"; import "../../interfaces/draft-IERC1822.sol"; import "../../utils/Address.sol"; import "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ */ abstract contract ERC1967Upgrade is IERC1967 { // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev 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 { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. */ 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 { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev 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 { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol) // Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated. pragma solidity ^0.8.19; import "@openzeppelin/contracts/proxy/Proxy.sol"; import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol"; /** * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an * implementation address that can be changed. This address is stored in storage in the location specified by * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the * implementation behind the proxy. */ contract ERC1967Proxy is Proxy, ERC1967Upgrade { /** * @dev Returns the current implementation address. */ function _implementation() internal view virtual override returns (address impl) { return ERC1967Upgrade._getImplementation(); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "../../interfaces/IERC1155TokenReceiver.sol"; import "../../interfaces/IERC1155.sol"; import "../../utils/Address.sol"; import "../../utils/ERC165.sol"; /** * @dev Implementation of Multi-Token Standard contract */ contract ERC1155 is IERC1155, ERC165 { using Address for address; /***********************************| | Variables and Events | |__________________________________*/ // onReceive function signatures bytes4 constant internal ERC1155_RECEIVED_VALUE = 0xf23a6e61; bytes4 constant internal ERC1155_BATCH_RECEIVED_VALUE = 0xbc197c81; // Objects balances mapping (address => mapping(uint256 => uint256)) internal balances; // Operator Functions mapping (address => mapping(address => bool)) internal operators; /***********************************| | Public Transfer Functions | |__________________________________*/ /** * @notice Transfers amount amount of an _id from the _from address to the _to address specified * @param _from Source address * @param _to Target address * @param _id ID of the token type * @param _amount Transfered amount * @param _data Additional data with no specified format, sent in call to `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data) public virtual override { require((msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeTransferFrom: INVALID_OPERATOR"); require(_to != address(0),"ERC1155#safeTransferFrom: INVALID_RECIPIENT"); _safeTransferFrom(_from, _to, _id, _amount); _callonERC1155Received(_from, _to, _id, _amount, gasleft(), _data); } /** * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) * @param _from Source addresses * @param _to Target addresses * @param _ids IDs of each token type * @param _amounts Transfer amounts per token type * @param _data Additional data with no specified format, sent in call to `_to` */ function safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) public virtual override { // Requirements require((msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeBatchTransferFrom: INVALID_OPERATOR"); require(_to != address(0), "ERC1155#safeBatchTransferFrom: INVALID_RECIPIENT"); _safeBatchTransferFrom(_from, _to, _ids, _amounts); _callonERC1155BatchReceived(_from, _to, _ids, _amounts, gasleft(), _data); } /***********************************| | Internal Transfer Functions | |__________________________________*/ /** * @notice Transfers amount amount of an _id from the _from address to the _to address specified * @param _from Source address * @param _to Target address * @param _id ID of the token type * @param _amount Transfered amount */ function _safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount) internal virtual { // Update balances balances[_from][_id] -= _amount; balances[_to][_id] += _amount; // Emit event emit TransferSingle(msg.sender, _from, _to, _id, _amount); } /** * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155Received(...) */ function _callonERC1155Received(address _from, address _to, uint256 _id, uint256 _amount, uint256 _gasLimit, bytes memory _data) internal virtual { // Check if recipient is contract if (_to.isContract()) { bytes4 retval = IERC1155TokenReceiver(_to).onERC1155Received{gas: _gasLimit}(msg.sender, _from, _id, _amount, _data); require(retval == ERC1155_RECEIVED_VALUE, "ERC1155#_callonERC1155Received: INVALID_ON_RECEIVE_MESSAGE"); } } /** * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) * @param _from Source addresses * @param _to Target addresses * @param _ids IDs of each token type * @param _amounts Transfer amounts per token type */ function _safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts) internal virtual { require(_ids.length == _amounts.length, "ERC1155#_safeBatchTransferFrom: INVALID_ARRAYS_LENGTH"); // Number of transfer to execute uint256 nTransfer = _ids.length; // Executing all transfers for (uint256 i = 0; i < nTransfer; i++) { // Update storage balance of previous bin balances[_from][_ids[i]] -= _amounts[i]; balances[_to][_ids[i]] += _amounts[i]; } // Emit event emit TransferBatch(msg.sender, _from, _to, _ids, _amounts); } /** * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155BatchReceived(...) */ function _callonERC1155BatchReceived(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, uint256 _gasLimit, bytes memory _data) internal virtual { // Pass data if recipient is contract if (_to.isContract()) { bytes4 retval = IERC1155TokenReceiver(_to).onERC1155BatchReceived{gas: _gasLimit}(msg.sender, _from, _ids, _amounts, _data); require(retval == ERC1155_BATCH_RECEIVED_VALUE, "ERC1155#_callonERC1155BatchReceived: INVALID_ON_RECEIVE_MESSAGE"); } } /***********************************| | Operator Functions | |__________________________________*/ /** * @notice Enable or disable approval for a third party ("operator") to manage all of caller's tokens * @param _operator Address to add to the set of authorized operators * @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external virtual override { // Update operator status operators[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } /** * @notice Queries the approval status of an operator for a given owner * @param _owner The owner of the Tokens * @param _operator Address of authorized operator * @return isOperator True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) public view virtual override returns (bool isOperator) { return operators[_owner][_operator]; } /***********************************| | Balance Functions | |__________________________________*/ /** * @notice Get the balance of an account's Tokens * @param _owner The address of the token holder * @param _id ID of the Token * @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) public view virtual override returns (uint256) { return balances[_owner][_id]; } /** * @notice Get the balance of multiple account/token pairs * @param _owners The addresses of the token holders * @param _ids ID of the Tokens * @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] memory _owners, uint256[] memory _ids) public view virtual override returns (uint256[] memory) { require(_owners.length == _ids.length, "ERC1155#balanceOfBatch: INVALID_ARRAY_LENGTH"); // Variables uint256[] memory batchBalances = new uint256[](_owners.length); // Iterate over each owner and token ID for (uint256 i = 0; i < _owners.length; i++) { batchBalances[i] = balances[_owners[i]][_ids[i]]; } return batchBalances; } /***********************************| | ERC165 Functions | |__________________________________*/ /** * @notice Query if a contract implements an interface * @param _interfaceID The interface identifier, as specified in ERC-165 * @return `true` if the contract implements `_interfaceID` and */ function supportsInterface(bytes4 _interfaceID) public view virtual override(ERC165, IERC165) returns (bool) { if (_interfaceID == type(IERC1155).interfaceId) { return true; } return super.supportsInterface(_interfaceID); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; interface IERC1155SupplyFunctions { /** * Returns the total supply of ERC1155 tokens. */ function totalSupply() external returns (uint256); /** * Returns the total supply of a given ERC1155 token. * @param tokenId The ERC1155 token id. */ function tokenSupply(uint256 tokenId) external returns (uint256); } interface IERC1155SupplySignals { /** * Invalid array input length. */ error InvalidArrayLength(); } interface IERC1155Supply is IERC1155SupplySignals {}
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IERC1155Metadata { event URI(string _uri, uint256 indexed _id); /****************************************| | Functions | |_______________________________________*/ /** * @notice A distinct Uniform Resource Identifier (URI) for a given token. * @dev URIs are defined in RFC 3986. * URIs are assumed to be deterministically generated based on token ID * Token IDs are assumed to be represented in their hex format in URIs * @return URI string */ function uri(uint256 _id) external view returns (string memory); }
pragma solidity ^0.8.0; import "../interfaces/IERC165.sol"; abstract contract ERC165 is IERC165 { /** * @notice Query if a contract implements an interface * @param _interfaceID The interface identifier, as specified in ERC-165 * @return `true` if the contract implements `_interfaceID` */ function supportsInterface(bytes4 _interfaceID) public view virtual override returns (bool) { return _interfaceID == this.supportsInterface.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../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. * * _Available since v4.5._ */ 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 v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./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); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) pragma solidity ^0.8.0; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. * * _Available since v4.8.3._ */ interface IERC1967 { /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @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 v4.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```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(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ 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: Apache-2.0 pragma solidity ^0.8.0; /** * @dev ERC-1155 interface for accepting safe transfers. */ interface IERC1155TokenReceiver { /** * @notice Handle the receipt of a single ERC1155 token type * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated * This function MAY throw to revert and reject the transfer * Return of other amount than the magic value MUST result in the transaction being reverted * Note: The token contract address is always the message sender * @param _operator The address which called the `safeTransferFrom` function * @param _from The address which previously owned the token * @param _id The id of the token being transferred * @param _amount The amount of tokens being transferred * @param _data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` */ function onERC1155Received(address _operator, address _from, uint256 _id, uint256 _amount, bytes calldata _data) external returns(bytes4); /** * @notice Handle the receipt of multiple ERC1155 token types * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated * This function MAY throw to revert and reject the transfer * Return of other amount than the magic value WILL result in the transaction being reverted * Note: The token contract address is always the message sender * @param _operator The address which called the `safeBatchTransferFrom` function * @param _from The address which previously owned the token * @param _ids An array containing ids of each token being transferred * @param _amounts An array containing amounts of each token being transferred * @param _data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` */ function onERC1155BatchReceived(address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data) external returns(bytes4); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import './IERC165.sol'; interface IERC1155 is IERC165 { /****************************************| | Events | |_______________________________________*/ /** * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning * Operator MUST be msg.sender * When minting/creating tokens, the `_from` field MUST be set to `0x0` * When burning/destroying tokens, the `_to` field MUST be set to `0x0` * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID * To broadcast the existence of a token ID with no initial balance, the contract SHOULD emit the TransferSingle event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0 */ event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount); /** * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning * Operator MUST be msg.sender * When minting/creating tokens, the `_from` field MUST be set to `0x0` * When burning/destroying tokens, the `_to` field MUST be set to `0x0` * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID * To broadcast the existence of multiple token IDs with no initial balance, this SHOULD emit the TransferBatch event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0 */ event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts); /** * @dev MUST emit when an approval is updated */ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /****************************************| | Functions | |_______________________________________*/ /** * @notice Transfers amount of an _id from the _from address to the _to address specified * @dev MUST emit TransferSingle event on success * Caller must be approved to manage the _from account's tokens (see isApprovedForAll) * MUST throw if `_to` is the zero address * MUST throw if balance of sender for token `_id` is lower than the `_amount` sent * MUST throw on any other error * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155Received` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * @param _from Source address * @param _to Target address * @param _id ID of the token type * @param _amount Transfered amount * @param _data Additional data with no specified format, sent in call to `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes calldata _data) external; /** * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) * @dev MUST emit TransferBatch event on success * Caller must be approved to manage the _from account's tokens (see isApprovedForAll) * MUST throw if `_to` is the zero address * MUST throw if length of `_ids` is not the same as length of `_amounts` * MUST throw if any of the balance of sender for token `_ids` is lower than the respective `_amounts` sent * MUST throw on any other error * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * Transfers and events MUST occur in the array order they were submitted (_ids[0] before _ids[1], etc) * @param _from Source addresses * @param _to Target addresses * @param _ids IDs of each token type * @param _amounts Transfer amounts per token type * @param _data Additional data with no specified format, sent in call to `_to` */ function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data) external; /** * @notice Get the balance of an account's Tokens * @param _owner The address of the token holder * @param _id ID of the Token * @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) external view returns (uint256); /** * @notice Get the balance of multiple account/token pairs * @param _owners The addresses of the token holders * @param _ids ID of the Tokens * @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); /** * @notice Enable or disable approval for a third party ("operator") to manage all of caller's tokens * @dev MUST emit the ApprovalForAll event on success * @param _operator Address to add to the set of authorized operators * @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external; /** * @notice Queries the approval status of an operator for a given owner * @param _owner The owner of the Tokens * @param _operator Address of authorized operator * @return isOperator True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) external view returns (bool isOperator); }
pragma solidity ^0.8.0; /** * Utility library of inline functions on addresses */ library Address { // Default hash for EOA accounts returned by extcodehash bytes32 constant internal ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract. * @param _address address of the account to check * @return Whether the target address is a contract */ function isContract(address _address) internal view returns (bool) { bytes32 codehash; // Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address or if it has a non-zero code hash or account hash assembly { codehash := extcodehash(_address) } return (codehash != 0x0 && codehash != ACCOUNT_HASH); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** * @title ERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ interface IERC165 { /** * @notice Query if a contract implements an interface * @dev Interface identification is specified in ERC-165. This function * uses less than 30,000 gas * @param _interfaceId The interface identifier, as specified in ERC-165 */ function supportsInterface(bytes4 _interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface 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 v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @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), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(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) { 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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); 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 keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @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 up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (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; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) 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. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 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. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); 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 (rounding == Rounding.Up && 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 down. * * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @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); } } }
{ "evmVersion": "paris", "libraries": {}, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "optimizer": { "enabled": true, "runs": 20000 }, "remappings": [ "@0xsequence/contracts-library/=src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "murky/=lib/murky/src/", "@0xsequence/erc20-meta-token/=lib/0xsequence/erc20-meta-token/src/", "@0xsequence/erc-1155/=lib/0xsequence/erc-1155/src/", "erc721a/=lib/chiru-labs/erc721a/", "erc721a-upgradeable/=lib/chiru-labs/erc721a-upgradeable/", "@openzeppelin/=lib/openzeppelin/", "@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "solady/=lib/solady/src/", "0xsequence/=lib/0xsequence/", "chiru-labs/=lib/chiru-labs/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/murky/lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin/" ], "viaIR": true, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"factoryOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"proxyAddr","type":"address"}],"name":"ERC1155SoulboundDeployed","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"},{"inputs":[],"name":"beacon","outputs":[{"internalType":"contract UpgradeableBeacon","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"proxyOwner","type":"address"},{"internalType":"address","name":"tokenOwner","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"string","name":"contractURI","type":"string"},{"internalType":"address","name":"royaltyReceiver","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator","type":"uint96"}],"name":"deploy","outputs":[{"internalType":"address","name":"proxyAddr","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"proxyOwner","type":"address"},{"internalType":"address","name":"tokenOwner","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"string","name":"contractURI","type":"string"},{"internalType":"address","name":"royaltyReceiver","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator","type":"uint96"}],"name":"determineAddress","outputs":[{"internalType":"address","name":"proxyAddr","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"upgradeBeacon","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608034610125576001600160401b0390601f62006aa638819003918201601f191683019291908484118385101761010f57816020928492604096875283398101031261012557516001600160a01b038082168203610125576100603361012a565b8251936145d894858101958187108388111761010f57620024ce823980600096039086f0908115610105578451916105ee808401928311848410176100f1579184849260209462001ee0853916815203019085f080156100e4576100d69394501660018060a01b0319600154161760015561012a565b51611d6e9081620001728239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce4583146106cb57806338234f4d146103e657806359659e90146103935780636dbefeff1461029f578063715018a6146101ff5780638da5cb5b146101aa5763f2fde38b1461006e57600080fd5b346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6576100a561078e565b906100ae61099f565b73ffffffffffffffffffffffffffffffffffffffff809216928315610123575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b5050346101fb57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fb5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b833461029c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261029c5761023661099f565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5050346101fb576103536055600b6102d56102b9366108cb565b908b9c969a95949c9792975197889460209e8f87019788610a84565b03936103077fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe095868101835282610815565b51902092875192610317846107f9565b835273ffffffffffffffffffffffffffffffffffffffff966103478860015416948a519586938d85019889610af7565b03908101835282610815565b5190206111eb855161036788830182610815565b81815287810191610b4e83395190209085519186830152868201523081520160ff815320915191168152f35b5050346101fb57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fb5760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b5090346101a6576103f6366108cb565b91879996989399959495519960208b8b8b8a849f8b8a8a8a8a8a86019661041d9588610a84565b03937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09485810182526104509082610815565b51902092815194610460866107f9565b8d865273ffffffffffffffffffffffffffffffffffffffff9486866001541694519485938401966104919388610af7565b0390810182526104a19082610815565b5190208b516111eb908f6104b783820183610815565b828252810191610b4e833980511561066e57518392918df5169b8c15610612578160015416928d3b1561060e578b92838f92938f8c956105379151988997889687957fcf7a1d7700000000000000000000000000000000000000000000000000000000875216908501526024840152606060448401526064830190610a41565b03925af18015610604579089916105f0575b5050893b156105ec5791879594939161058d938a5198899788977ff89548180000000000000000000000000000000000000000000000000000000089528801610a84565b038183885af180156105e2576105ce575b50507f212d93efc097ef6776ff65646bb06d271de24ebe85fc741b169a373801463716838251848152a151908152f35b6105d882916107b6565b61029c578061059e565b83513d84823e3d90fd5b8780fd5b6105f9906107b6565b6105ec578738610549565b8a513d8b823e3d90fd5b8b80fd5b6064888f8e51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b50506064888f808f51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b5090346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6578261070561078e565b61070d61099f565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561078a5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af19081156107815750610775575080f35b61077e906107b6565b80f35b513d84823e3d90fd5b8380fd5b6004359073ffffffffffffffffffffffffffffffffffffffff821682036107b157565b600080fd5b67ffffffffffffffff81116107ca57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176107ca57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107ca57604052565b81601f820112156107b15780359067ffffffffffffffff82116107ca57604051926108a960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185610815565b828452602083830101116107b157816000926020809301838601378301015290565b9060e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126107b15773ffffffffffffffffffffffffffffffffffffffff9060043582811681036107b1579260243583811681036107b1579267ffffffffffffffff926044358481116107b1578361094791600401610856565b936064358181116107b1578461095f91600401610856565b936084359182116107b15761097691600401610856565b9160a43590811681036107b1579060c4356bffffffffffffffffffffffff811681036107b15790565b73ffffffffffffffffffffffffffffffffffffffff6000541633036109c057565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60005b838110610a315750506000910152565b8181015183820152602001610a21565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610a7d81518092818752878088019101610a1e565b0116010190565b9496959160a094610adc6bffffffffffffffffffffffff95610ace610aea9473ffffffffffffffffffffffffffffffffffffffff8097168b5260c060208c015260c08b0190610a41565b9089820360408b0152610a41565b908782036060890152610a41565b9616608085015216910152565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610b488251809360208685019101610a1e565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea264697066735822122045004168ba82273e43eeb6c01989363db864f4e92bc6bcc90fadfdb4a6c90d8564736f6c63430008130033a2646970667358221220f1e2cf3518e8976de38cf0a484b878c969f9cf85a59d0ecce5e21f8a27d385e064736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea26469706673582212201342d7da4ff651b86bceb8a63d98cff68dd07c475146281deaa480413570ea7564736f6c6343000813003360a060405234620002ec5762000014620002f1565b6200001e620002f1565b815190916001600160401b0390818311620001ed576005938454916001948584811c9416918215620002e1575b60209283861014620002cb578190601f9586811162000277575b5083908683116001146200020f5760009262000203575b5050600019600383901b1c191690861b1786555b8151938411620001ed576004958654908682811c92168015620001e2575b83831014620001cd5784821162000184575b5050809284116001146200011957509282939183926000946200010d575b50501b916000199060031b1c19161790555b336080526040516142c290816200031682396080518161034f0152f35b015192503880620000de565b919083601f1981168760005284600020946000905b888383106200016957505050106200014f575b505050811b019055620000f0565b015160001960f88460031b161c1916905538808062000141565b8587015188559096019594850194879350908101906200012e565b87600052826000209085808801821c830193858910620001c3575b01901c019086905b828110620001b65750620000c0565b60008155018690620001a7565b935082936200019f565b602288634e487b7160e01b6000525260246000fd5b91607f1691620000ae565b634e487b7160e01b600052604160045260246000fd5b0151905038806200007c565b90889350601f198316918a600052856000209260005b8782821062000260575050841162000246575b505050811b01865562000090565b015160001960f88460031b161c1916905538808062000238565b8385015186558c9790950194938401930162000225565b9091508860005283600020868085018b1c820192868610620002c1575b918a9186959493018c1c01915b828110620002b157505062000065565b600081558594508a9101620002a1565b9250819262000294565b634e487b7160e01b600052602260045260246000fd5b93607f16936200004b565b600080fd5b60405190602082016001600160401b03811183821017620001ed576040526000825256fe608080604052600436101561001357600080fd5b60003560e01c908162fdd58e14612f775750806301ffc9a714612ea457806304634d8d14612e6257806306fdde0314612dbc5780630b5ee00614612c435780630e89341c14612afb57806318160ddd14612add57806320ec271b14612997578063248a9ca3146129685780632693ebf21461293c5780632a55205a146128885780632eb2c2d6146123a65780632f2ff15d146122d057806335e60bd41461200f57806336568abe14611f495780634e1273f414611d5a5780635944c75314611c3c57806368a37ae814611c015780636c0360eb14611b5b578063731133e914611a095780637e518ec81461188f578063842f9b68146118695780639010d07c1461181657806391d14854146117bb578063938e3d7b14611641578063a217fddf14611625578063a22cb46514611592578063b390c0ab146114f4578063b48ab8b6146111e2578063ca15c873146111b6578063d547741f14611175578063e8a3d4851461108f578063e985e9c51461102b578063f242432a14610c595763f89548181461019f57600080fd5b34610c545760c0600319360112610c54576101b8612fc7565b60243567ffffffffffffffff8111610c54576101d890369060040161311f565b9060443567ffffffffffffffff8111610c54576101f990369060040161311f565b9060643567ffffffffffffffff8111610c545761021a90369060040161311f565b73ffffffffffffffffffffffffffffffffffffffff6084351660843503610c54576bffffffffffffffffffffffff60a4351660a43503610c5457600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010017905573ffffffffffffffffffffffffffffffffffffffff821660009081527f240abdbcdb02f5e390e80fc01f6670d9ae0d46970a0d7b933281c81f8456df9e602052604090205460ff1615610bb7575b7f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c600052600960205261033773ffffffffffffffffffffffffffffffffffffffff83167fbb47ba84ade104d32fdfa33bee5e0faef1ae541476ae15df126ba217f45027c1613c54565b5073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163314801590610bab575b610b8157835167ffffffffffffffff81116108f65761039960055461300d565b601f8111610ae2575b50602094601f8211600114610a5e57948192939495600092610a53575b50506000198260011b9260031b1c1916176005555b825167ffffffffffffffff81116108f6576103f060045461300d565b601f81116109b4575b506020601f82116001146109305781929394600092610925575b50506000198260011b9260031b1c1916176004555b80519067ffffffffffffffff82116108f657610445600a5461300d565b601f8111610891575b50602090601f83116001146107f257918061066e949273ffffffffffffffffffffffffffffffffffffffff946000926107e7575b50506000198260011b9260031b1c191617600a555b80821660009081527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c7602052604090205460ff1615610780575b6000805260096020526105068183167fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b613c54565b5080821660009081527fa9ced9fdc45cded6d4b7a90e36d1ee82b957a500cc22704c465e9bdf275406fd60205260409020547f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0119060ff161561072a575b600052600960205261057b8282166040600020613c54565b5080821660009081527f95f185554aba264de8ed412af70e5aba6acb0e648f258c912ad29ed85d11ca1860205260409020547fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a59060ff16156106d4575b60005260096020526105f08282166040600020613c54565b506105ff60a435608435613ee5565b80821660009081527f51a495916474fe1a0c0fcfb65a8a97682b84a054118858cdd1f5dfd7fc0919eb60205260409020547f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69060ff161561067e575b6000526009602052166040600020613c54565b50600b805460ff19166001179055005b80600052600860205260406000208383166000526020526040600020600160ff1982541617905533838316827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a461065b565b80600052600860205260406000208383166000526020526040600020600160ff1982541617905533838316827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a46105d8565b80600052600860205260406000208383166000526020526040600020600160ff1982541617905533838316827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4610563565b80821660008181527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c760205260408120805460ff191660011790553391907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a46104d1565b015190503880610482565b90601f19831691600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a89260005b818110610879575092600192859273ffffffffffffffffffffffffffffffffffffffff9661066e989610610860575b505050811b01600a55610497565b015160001960f88460031b161c19169055388080610852565b92936020600181928786015181550195019301610823565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8601f840160051c810191602085106108ec575b601f0160051c01905b8181106108e0575061044e565b600081556001016108d3565b90915081906108ca565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b015190503880610413565b601f1982169060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b9160005b81811061099c57509583600195969710610983575b505050811b01600455610428565b015160001960f88460031b161c19169055388080610975565b9192602060018192868b015181550194019201610960565b6004600052601f820160051c7f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0160208310610a2c575b601f820160051c7f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018110610a2057506103f9565b600081556001016109eb565b507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b6109eb565b0151905038806103bf565b601f1982169560056000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db09160005b888110610aca57508360019596979810610ab1575b505050811b016005556103d4565b015160001960f88460031b161c19169055388080610aa3565b91926020600181928685015181550194019201610a8e565b6005600052601f820160051c7f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00160208310610b5a575b601f820160051c7f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018110610b4e57506103a2565b60008155600101610b19565b507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0610b19565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b5060ff600b5416610379565b73ffffffffffffffffffffffffffffffffffffffff821660008181527f240abdbcdb02f5e390e80fc01f6670d9ae0d46970a0d7b933281c81f8456df9e60205260408120805460ff191660011790553391907f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a46102ce565b600080fd5b34610c545760a0600319360112610c5457610c72612fc7565b610c7a612fea565b906044356064359260843567ffffffffffffffff8111610c5457610ca290369060040161311f565b73ffffffffffffffffffffffffffffffffffffffff809416938433148015611007575b15610f83578216918215610eff5760ff600b5460081c1680610ef6575b610ecc57846000526020956000875260406000208560005287526040600020610d0c828254613281565b9055836000526000875260406000208560005287526040600020610d31828254613ac7565b90558386604051878152838a8201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4610d705a926133ac565b610d7657005b60008794610dd396604051978896879586937ff23a6e61000000000000000000000000000000000000000000000000000000009c8d865233600487015260248601526044850152606484015260a0608484015260a48301906130de565b0393f18015610ec0577fffffffff0000000000000000000000000000000000000000000000000000000091600091610e93575b501603610e0f57005b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152603a60248201527f45524331313535235f63616c6c6f6e4552433131353552656365697665643a2060448201527f494e56414c49445f4f4e5f524543454956455f4d4553534147450000000000006064820152fd5b610eb39150843d8611610eb9575b610eab8183613098565b810190613226565b84610e06565b503d610ea1565b6040513d6000823e3d90fd5b60046040517fdb89e3f4000000000000000000000000000000000000000000000000000000008152fd5b50841515610ce2565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4552433131353523736166655472616e7366657246726f6d3a20494e56414c4960448201527f445f524543495049454e540000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433131353523736166655472616e7366657246726f6d3a20494e56414c4960448201527f445f4f50455241544f52000000000000000000000000000000000000000000006064820152fd5b5084600052600160205260406000203360005260205260ff60406000205416610cc5565b34610c54576040600319360112610c5457611044612fc7565b61104c612fea565b9073ffffffffffffffffffffffffffffffffffffffff809116600052600160205260406000209116600052602052602060ff604060002054166040519015158152f35b34610c54576000600319360112610c54576040516000600a546110b18161300d565b8084529060019081811690811561114e57506001146110f3575b6110ef846110db81860382613098565b6040519182916020835260208301906130de565b0390f35b600a600090815292507fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a85b8284106111365750505081016020016110db826110cb565b8054602085870181019190915290930192810161111e565b60ff191660208087019190915292151560051b850190920192506110db91508390506110cb565b34610c54576040600319360112610c54576111b4600435611194612fea565b908060005260086020526111af600160406000200154613912565b613a30565b005b34610c54576020600319360112610c545760043560005260096020526020604060002054604051908152f35b34610c5457600319608081360112610c54576111fc612fc7565b9067ffffffffffffffff602435818111610c545761121e90369060040161317e565b92604435828111610c545761123790369060040161317e565b91606435908111610c545761125090369060040161311f565b906112596137ba565b8451835181036114ca5760008073ffffffffffffffffffffffffffffffffffffffff8416925b80831061143757506112949150600254613ac7565b6002558060006040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb3391806112cc8a8d83613e32565b0390a46112d95a926133ac565b6112df57005b600061134a916020956113596040519889978896879461133a7fbc197c81000000000000000000000000000000000000000000000000000000009e8f885233600489015289602489015260a0604489015260a48801906131f2565b90848783030160648801526131f2565b918483030160848501526130de565b0393f18015610ec0577fffffffff0000000000000000000000000000000000000000000000000000000091600091611419575b50160361139557005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f45524331313535235f63616c6c6f6e455243313135354261746368526563656960448201527f7665643a20494e56414c49445f4f4e5f524543454956455f4d455353414745006064820152fd5b611431915060203d8111610eb957610eab8183613098565b8361138c565b906114bd6114c3918a60038a6114958861148e81611455818661326d565b51948d600052602095600087526040600020611471848b61326d565b5160005287526114876040600020918254613ac7565b905561326d565b519461326d565b51600052526114aa6040600020918254613ac7565b90556114b6858a61326d565b5190613ac7565b9261325e565b919061127f565b60046040517f9d89020a000000000000000000000000000000000000000000000000000000008152fd5b34610c5457611502366131dc565b9060ff600b5460081c16610ecc578161151f600093600254613281565b600255818352600360205260408320611539828254613281565b905533835282602052604083208284526020526040832061155b828254613281565b9055604051918252602082015233907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4005b34610c54576040600319360112610c54576115ab612fc7565b602435801515809103610c545733600052600160205273ffffffffffffffffffffffffffffffffffffffff604060002092169182600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b34610c54576000600319360112610c5457602060405160008152f35b34610c5457602080600319360112610c545767ffffffffffffffff600435818111610c545761167490369060040161311f565b9161167d613662565b82519182116108f657611691600a5461300d565b601f8111611757575b5080601f83116001146116d6575081926000926116cb575b50506000198260011b9260031b1c191617600a55600080f35b0151905082806116b2565b90601f19831693600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8926000905b86821061173f5750508360019510611726575b505050811b01600a55005b015160001960f88460031b161c1916905582808061171b565b80600185968294968601518155019501930190611708565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8601f840160051c8101918385106117b1575b601f0160051c01905b8181106117a5575061169a565b60008155600101611798565b909150819061178f565b34610c54576040600319360112610c54576117d4612fea565b600435600052600860205273ffffffffffffffffffffffffffffffffffffffff60406000209116600052602052602060ff604060002054166040519015158152f35b34610c54576040600319360112610c54576004356000526009602052602073ffffffffffffffffffffffffffffffffffffffff6118596024356040600020613c3c565b9190546040519260031b1c168152f35b34610c54576000600319360112610c5457602060ff600b5460081c166040519015158152f35b34610c5457602080600319360112610c545767ffffffffffffffff600435818111610c54576118c290369060040161311f565b916118cb613662565b82519182116108f6576118df60045461300d565b601f81116119a5575b5080601f831160011461192457508192600092611919575b50506000198260011b9260031b1c191617600455600080f35b015190508280611900565b90601f1983169360046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b86821061198d5750508360019510611974575b505050811b01600455005b015160001960f88460031b161c19169055828080611969565b80600185968294968601518155019501930190611956565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f840160051c8101918385106119ff575b601f0160051c01905b8181106119f357506118e8565b600081556001016119e6565b90915081906119dd565b34610c54576080600319360112610c5457611a22612fc7565b60243560443560643567ffffffffffffffff8111610c5457611a4890369060040161311f565b92611a516137ba565b611a5d82600254613ac7565b60025582600052602093600385526040600020611a7b848254613ac7565b905573ffffffffffffffffffffffffffffffffffffffff821691826000526000865260406000208560005286526040600020611ab8858254613ac7565b905582600060405187815286898201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4611af85a916133ac565b611afe57005b610dd393600087946040518097819682957ff23a6e61000000000000000000000000000000000000000000000000000000009b8c85523360048601528660248601526044850152606484015260a0608484015260a48301906130de565b34610c54576000600319360112610c54576040516000600454611b7d8161300d565b8084529060019081811690811561114e5750600114611ba6576110ef846110db81860382613098565b6004600090815292507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410611be95750505081016020016110db826110cb565b80546020858701810191909152909301928101611bd1565b34610c54576000600319360112610c545760206040517f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c8152f35b34610c54576060600319360112610c5457611c55612fea565b6044356bffffffffffffffffffffffff8116809103610c5457611c766133e2565b611c84612710821115613e5a565b73ffffffffffffffffffffffffffffffffffffffff809216918215611cfc577fffffffffffffffffffffffff00000000000000000000000000000000000000009060405193611cd285613060565b84526020840192835260043560005260076020526040600020935116915160a01b16179055600080f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b34610c54576040600319360112610c545760043567ffffffffffffffff808211610c545736602383011215610c5457816004013590611d9882613166565b92611da66040519485613098565b82845260209260248486019160051b83010191368311610c5457602401905b828210611f1d57505050602435908111610c5457611de790369060040161317e565b8251815103611e9957825190601f19611e18611e0284613166565b93611e106040519586613098565b808552613166565b01368484013760005b8451811015611e86578073ffffffffffffffffffffffffffffffffffffffff611e4d611e81938861326d565b5116600052600085526040600020611e65828561326d565b516000528552604060002054611e7b828661326d565b5261325e565b611e21565b604051848152806110ef818701866131f2565b608482604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602c60248201527f455243313135352362616c616e63654f6642617463683a20494e56414c49445f60448201527f41525241595f4c454e47544800000000000000000000000000000000000000006064820152fd5b813573ffffffffffffffffffffffffffffffffffffffff81168103610c54578152908401908401611dc5565b34610c54576040600319360112610c5457611f62612fea565b3373ffffffffffffffffffffffffffffffffffffffff821603611f8b576111b490600435613a30565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b34610c5457602080600319360112610c545760043590811515809203610c54577f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c908160005260088152604060002033600052815260ff60406000205416156120a657600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16600885901b61ff0016179055005b6120af33613ad4565b916040516120bc8161307c565b604281528281019160603684378151156122a1576030835381516001908110156122a157607860218401536041905b8082116122215750506121c45761217693612185926048926040519687937f416363657373436f6e74726f6c3a206163636f756e742000000000000000000088860152612141815180928a6037890191016130bb565b8401917f206973206d697373696e6720726f6c65200000000000000000000000000000006037840152518093868401906130bb565b01036028810185520183613098565b6121c06040519283927f08c379a0000000000000000000000000000000000000000000000000000000008452600484015260248301906130de565b0390fd5b606483604051907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f811660108110156122a1577f3031323334353637383961626364656600000000000000000000000000000000901a61225d848661328e565b5360041c9180156122725760001901906120eb565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b34610c54576040600319360112610c54576111b460043560096122f1612fea565b91806000526020906008825261230e600160406000200154613912565b806000526008825273ffffffffffffffffffffffffffffffffffffffff604060002094169384600052825260ff6040600020541615612356575b600052526040600020613c54565b806000526008825260406000208460005282526040600020600160ff198254161790553384827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4612348565b34610c545760a0600319360112610c54576123bf612fc7565b6123c7612fea565b9060449067ffffffffffffffff908235828111610c54576123ec90369060040161317e565b6064948535848111610c545761240690369060040161317e565b93608435908111610c545761241f90369060040161311f565b73ffffffffffffffffffffffffffffffffffffffff9081851633148015612862575b156127df578183161561275c5760ff600b5460081c1680612751575b610ecc5783518651036126ce57835160005b81811061264457505060405182841690838716907f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb3391806124b28c8b83613e32565b0390a45a946124c0846133ac565b6124c657005b8291604051978896879586947fbc197c810000000000000000000000000000000000000000000000000000000086523360048701521660248501528a840160a0905260a48401612515916131f2565b838103600319018c850152612529916131f2565b82810360031901608484015261253e916130de565b039216600090602095f1908115610ec0577fbc197c8100000000000000000000000000000000000000000000000000000000917fffffffff0000000000000000000000000000000000000000000000000000000091600091612626575b5016036125a457005b7f7665643a20494e56414c49445f4f4e5f524543454956455f4d455353414745006084927f45524331313535235f63616c6c6f6e4552433131353542617463685265636569604051937f08c379a000000000000000000000000000000000000000000000000000000000855260206004860152603f6024860152840152820152fd5b61263e915060203d8111610eb957610eab8183613098565b8561259b565b806126526126c9928a61326d565b5185891660005260209060008252604060002061266f848b61326d565b5160005282526126856040600020918254613281565b9055612691828b61326d565b5190868816600052600081526040600020906126ad848b61326d565b51600052526126c26040600020918254613ac7565b905561325e565b61246f565b6084877f494e56414c49445f4152524159535f4c454e47544800000000000000000000008a7f45524331313535235f7361666542617463685472616e7366657246726f6d3a20604051937f08c379a00000000000000000000000000000000000000000000000000000000085526020600486015260356024860152840152820152fd5b50818516151561245d565b6084877f4e56414c49445f524543495049454e54000000000000000000000000000000008a7f45524331313535237361666542617463685472616e7366657246726f6d3a2049604051937f08c379a00000000000000000000000000000000000000000000000000000000085526020600486015260306024860152840152820152fd5b6084877f4e56414c49445f4f50455241544f5200000000000000000000000000000000008a7f45524331313535237361666542617463685472616e7366657246726f6d3a2049604051937f08c379a000000000000000000000000000000000000000000000000000000000855260206004860152602f6024860152840152820152fd5b50818516600052600160205260406000203360005260205260ff60406000205416612441565b34610c5457612896366131dc565b906000526007602052604060002090604051916128b283613060565b5473ffffffffffffffffffffffffffffffffffffffff928382169182825260a01c6020820152901561291a575b6bffffffffffffffffffffffff6020820151169182810292818404149015171561227257604092612710915116918351928352046020820152f35b5060405161292781613060565b600654838116825260a01c60208201526128df565b34610c54576020600319360112610c545760043560005260036020526020604060002054604051908152f35b34610c54576020600319360112610c545760043560005260086020526020600160406000200154604051908152f35b34610c54576040600319360112610c545767ffffffffffffffff600435818111610c54576129c990369060040161317e565b90602435908111610c54576129e290369060040161317e565b60ff600b5460081c16610ecc57815191815183036114ca576000926000905b808210612a52575050612a18600093600254613281565b6002557f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb60405180612a4d3395339583613e32565b0390a4005b9093612ad1612ad791612a65878761326d565b5133600052602090600082526040600020612a808a8961326d565b516000528252612a966040600020918254613281565b90556003612aa4898961326d565b5191612ab08a8961326d565b5160005252612ac56040600020918254613281565b90556114b6878761326d565b9461325e565b90612a01565b34610c54576000600319360112610c54576020600254604051908152f35b34610c5457602080600319360112610c5457612b1860043561329f565b906040519182826000600454612b2d8161300d565b90600190818116908115612c265750600114612bc3575b50509081612b5e8560059594612baf9751948592016130bb565b017f2e6a736f6e0000000000000000000000000000000000000000000000000000008152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5810185520183613098565b6110ef6040519282849384528301906130de565b60046000908152949593949192507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b838310612c0e57509294939250508201810183612b5e612b44565b8054838a018701528896508795909201918101612bf3565b60ff19168686015250508015150283018201905083612b5e612b44565b34610c5457602080600319360112610c545767ffffffffffffffff90600435828111610c5457612c7790369060040161311f565b91612c80613662565b82519081116108f657600591612c96835461300d565b601f8111612d5b575b5080601f8311600114612cdb5750819293600092612cd0575b50506000198260011b9260031b1c1916179055600080f35b015190508380612cb8565b90601f19831694846000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0926000905b878210612d43575050836001959610612d2a575b505050811b019055005b015160001960f88460031b161c19169055838080612d20565b80600185968294968601518155019501930190612d0c565b836000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0601f8401851c810191838510612db2575b601f01851c01905b818110612da65750612c9f565b60008155600101612d99565b9091508190612d91565b34610c54576000600319360112610c54576040516000600554612dde8161300d565b8084529060019081811690811561114e5750600114612e07576110ef846110db81860382613098565b6005600090815292507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b828410612e4a5750505081016020016110db826110cb565b80546020858701810191909152909301928101612e32565b34610c54576040600319360112610c5457612e7b612fc7565b6024356bffffffffffffffffffffffff81168103610c54576111b491612e9f6133e2565b613ee5565b34610c54576020600319360112610c54576004357fffffffff000000000000000000000000000000000000000000000000000000008116808203610c5457602091817fb1c990bc0000000000000000000000000000000000000000000000000000000014918215612f1c575b50506040519015158152f35b7fc79b8b5f000000000000000000000000000000000000000000000000000000001491508115612f66575b8115612f56575b508280612f10565b612f609150613fbd565b82612f4e565b9050612f7181613fbd565b90612f47565b34610c54576040600319360112610c545760209073ffffffffffffffffffffffffffffffffffffffff612fa8612fc7565b1660005260008252604060002060243560005282526040600020548152f35b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610c5457565b6024359073ffffffffffffffffffffffffffffffffffffffff82168203610c5457565b90600182811c92168015613056575b602083101461302757565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f169161301c565b6040810190811067ffffffffffffffff8211176108f657604052565b6080810190811067ffffffffffffffff8211176108f657604052565b90601f601f19910116810190811067ffffffffffffffff8211176108f657604052565b60005b8381106130ce5750506000910152565b81810151838201526020016130be565b90601f19601f6020936130fc815180928187528780880191016130bb565b0116010190565b67ffffffffffffffff81116108f657601f01601f191660200190565b81601f82011215610c545780359061313682613103565b926131446040519485613098565b82845260208383010111610c5457816000926020809301838601378301015290565b67ffffffffffffffff81116108f65760051b60200190565b81601f82011215610c545780359161319583613166565b926131a36040519485613098565b808452602092838086019260051b820101928311610c54578301905b8282106131cd575050505090565b813581529083019083016131bf565b6003196040910112610c54576004359060243590565b90815180825260208080930193019160005b828110613212575050505090565b835185529381019392810192600101613204565b90816020910312610c5457517fffffffff0000000000000000000000000000000000000000000000000000000081168103610c545790565b60001981146122725760010190565b80518210156122a15760209160051b010190565b9190820391821161227257565b9081518110156122a1570160200190565b80156133725780816000925b61335e5750806132ba83613103565b926132c86040519485613098565b808452601f196132d782613103565b01366020860137915b6132e957505090565b60001982019182116122725781600a808304928184029184830414841517156122725761331960ff928392613281565b16603001908111612272577fff000000000000000000000000000000000000000000000000000000000000006133579160f81b1660001a918561328e565b53806132e0565b9161336a600a9161325e565b9204806132ab565b5060405161337f81613060565b600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b3f80151590816133ba575090565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709150141590565b3360009081527fa9ced9fdc45cded6d4b7a90e36d1ee82b957a500cc22704c465e9bdf275406fd602090815260408083205490927f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0119160ff16156134465750505050565b61344f33613ad4565b9184519061345c8261307c565b6042825284820192606036853782511561363557603084538251906001918210156136355790607860218501536041915b8183116135885750505061352c5760486121c09386936134f6936134e798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612141815180928c6037890191016130bb565b01036028810187520185613098565b519283927f08c379a0000000000000000000000000000000000000000000000000000000008452600484015260248301906130de565b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015613608577f3031323334353637383961626364656600000000000000000000000000000000901a6135c5858761328e565b5360041c9280156135db5760001901919061348d565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b3360009081527f95f185554aba264de8ed412af70e5aba6acb0e648f258c912ad29ed85d11ca18602090815260408083205490927fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a59160ff16156136c65750505050565b6136cf33613ad4565b918451906136dc8261307c565b6042825284820192606036853782511561363557603084538251906001918210156136355790607860218501536041915b8183116137675750505061352c5760486121c09386936134f6936134e798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612141815180928c6037890191016130bb565b909192600f81166010811015613608577f3031323334353637383961626364656600000000000000000000000000000000901a6137a4858761328e565b5360041c9280156135db5760001901919061370d565b3360009081527f51a495916474fe1a0c0fcfb65a8a97682b84a054118858cdd1f5dfd7fc0919eb602090815260408083205490927f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69160ff161561381e5750505050565b61382733613ad4565b918451906138348261307c565b6042825284820192606036853782511561363557603084538251906001918210156136355790607860218501536041915b8183116138bf5750505061352c5760486121c09386936134f6936134e798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612141815180928c6037890191016130bb565b909192600f81166010811015613608577f3031323334353637383961626364656600000000000000000000000000000000901a6138fc858761328e565b5360041c9280156135db57600019019190613865565b60009080825260209060088252604092838120338252835260ff84822054161561393c5750505050565b61394533613ad4565b918451906139528261307c565b6042825284820192606036853782511561363557603084538251906001918210156136355790607860218501536041915b8183116139dd5750505061352c5760486121c09386936134f6936134e798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612141815180928c6037890191016130bb565b909192600f81166010811015613608577f3031323334353637383961626364656600000000000000000000000000000000901a613a1a858761328e565b5360041c9280156135db57600019019190613983565b906040613a7c92600090808252600860205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff8383205416613a7f575b8152600960205220613cf7565b50565b808252600860205282822084835260205282822060ff1981541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4613a6f565b9190820180921161227257565b604051906060820182811067ffffffffffffffff8211176108f657604052602a82526020820160403682378251156122a1576030905381516001908110156122a157607860218401536029905b808211613b8f575050613b315790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015613c0e577f3031323334353637383961626364656600000000000000000000000000000000901a613bcb848661328e565b5360041c918015613be0576000190190613b21565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b80548210156122a15760005260206000200190600090565b91906001830160009082825280602052604082205415600014613cf15784549468010000000000000000861015613cc45783613cb4613c9d886001604098999a01855584613c3c565b81939154906000199060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b90600182019060009281845282602052604084205490811515600014613e2b5760001991828101818111613dfe57825490848201918211613dd157808203613d9c575b50505080548015613d6f57820191613d528383613c3c565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b613dbc613dac613c9d9386613c3c565b90549060031b1c92839286613c3c565b90558652846020526040862055388080613d3a565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b9091613e49613e57936040845260408401906131f2565b9160208184039101526131f2565b90565b15613e6157565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff831691613f18612710841115613e5a565b16918215613f5f577fffffffffffffffffffffffff0000000000000000000000000000000000000000916020604051613f5081613060565b858152015260a01b1617600655565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152fd5b613fc681614063565b908115613ffa575b8115613fe9575b8115613fdf575090565b613e579150614126565b9050613ff481614126565b90613fd5565b90506140058161400b565b90613fce565b7f0e89341c000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000082161461405d57613e5790614063565b50600190565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f3e85e62f00000000000000000000000000000000000000000000000000000000149081156140b3575090565b613e5791507fffffffff00000000000000000000000000000000000000000000000000000000167fd9b67a2600000000000000000000000000000000000000000000000000000000811461405d577f01ffc9a7000000000000000000000000000000000000000000000000000000001490565b61412f81614215565b90811561417d575b8115614152575b8115614148575090565b613e57915061418e565b7fffffffff00000000000000000000000000000000000000000000000000000000811615915061413e565b90506141888161418e565b90614137565b7fffffffff000000000000000000000000000000000000000000000000000000008116907f5a05180f0000000000000000000000000000000000000000000000000000000082149182156141e157505090565b7f7965db0b00000000000000000000000000000000000000000000000000000000149150811561420f575090565b613e5791505b7fffffffff00000000000000000000000000000000000000000000000000000000167f2a55205a000000000000000000000000000000000000000000000000000000008114908115614265575090565b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150149056fea2646970667358221220b36777fe9fe780fadc66eecc030c6f58436d0e96ee9680effff07e866026402664736f6c63430008130033000000000000000000000000007a47e6bf40c1e0ed5c01ae42fdc75879140bc4
Deployed Bytecode
0x6040608081526004908136101561001557600080fd5b600091823560e01c80631bce4583146106cb57806338234f4d146103e657806359659e90146103935780636dbefeff1461029f578063715018a6146101ff5780638da5cb5b146101aa5763f2fde38b1461006e57600080fd5b346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6576100a561078e565b906100ae61099f565b73ffffffffffffffffffffffffffffffffffffffff809216928315610123575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b5050346101fb57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fb5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b833461029c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261029c5761023661099f565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5050346101fb576103536055600b6102d56102b9366108cb565b908b9c969a95949c9792975197889460209e8f87019788610a84565b03936103077fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe095868101835282610815565b51902092875192610317846107f9565b835273ffffffffffffffffffffffffffffffffffffffff966103478860015416948a519586938d85019889610af7565b03908101835282610815565b5190206111eb855161036788830182610815565b81815287810191610b4e83395190209085519186830152868201523081520160ff815320915191168152f35b5050346101fb57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fb5760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b5090346101a6576103f6366108cb565b91879996989399959495519960208b8b8b8a849f8b8a8a8a8a8a86019661041d9588610a84565b03937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09485810182526104509082610815565b51902092815194610460866107f9565b8d865273ffffffffffffffffffffffffffffffffffffffff9486866001541694519485938401966104919388610af7565b0390810182526104a19082610815565b5190208b516111eb908f6104b783820183610815565b828252810191610b4e833980511561066e57518392918df5169b8c15610612578160015416928d3b1561060e578b92838f92938f8c956105379151988997889687957fcf7a1d7700000000000000000000000000000000000000000000000000000000875216908501526024840152606060448401526064830190610a41565b03925af18015610604579089916105f0575b5050893b156105ec5791879594939161058d938a5198899788977ff89548180000000000000000000000000000000000000000000000000000000089528801610a84565b038183885af180156105e2576105ce575b50507f212d93efc097ef6776ff65646bb06d271de24ebe85fc741b169a373801463716838251848152a151908152f35b6105d882916107b6565b61029c578061059e565b83513d84823e3d90fd5b8780fd5b6105f9906107b6565b6105ec578738610549565b8a513d8b823e3d90fd5b8b80fd5b6064888f8e51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b50506064888f808f51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b5090346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6578261070561078e565b61070d61099f565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561078a5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af19081156107815750610775575080f35b61077e906107b6565b80f35b513d84823e3d90fd5b8380fd5b6004359073ffffffffffffffffffffffffffffffffffffffff821682036107b157565b600080fd5b67ffffffffffffffff81116107ca57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176107ca57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107ca57604052565b81601f820112156107b15780359067ffffffffffffffff82116107ca57604051926108a960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185610815565b828452602083830101116107b157816000926020809301838601378301015290565b9060e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126107b15773ffffffffffffffffffffffffffffffffffffffff9060043582811681036107b1579260243583811681036107b1579267ffffffffffffffff926044358481116107b1578361094791600401610856565b936064358181116107b1578461095f91600401610856565b936084359182116107b15761097691600401610856565b9160a43590811681036107b1579060c4356bffffffffffffffffffffffff811681036107b15790565b73ffffffffffffffffffffffffffffffffffffffff6000541633036109c057565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60005b838110610a315750506000910152565b8181015183820152602001610a21565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610a7d81518092818752878088019101610a1e565b0116010190565b9496959160a094610adc6bffffffffffffffffffffffff95610ace610aea9473ffffffffffffffffffffffffffffffffffffffff8097168b5260c060208c015260c08b0190610a41565b9089820360408b0152610a41565b908782036060890152610a41565b9616608085015216910152565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610b488251809360208685019101610a1e565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea264697066735822122045004168ba82273e43eeb6c01989363db864f4e92bc6bcc90fadfdb4a6c90d8564736f6c63430008130033a2646970667358221220f1e2cf3518e8976de38cf0a484b878c969f9cf85a59d0ecce5e21f8a27d385e064736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000007a47e6bf40c1e0ed5c01ae42fdc75879140bc4
-----Decoded View---------------
Arg [0] : factoryOwner (address): 0x007a47e6BF40C1e0ed5c01aE42fDC75879140bc4
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000007a47e6bf40c1e0ed5c01ae42fdc75879140bc4
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.