Source Code
Overview
POL Balance
More Info
ContractCreator
Multichain Info
N/A
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:
Factory
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 100000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache 2.0 pragma solidity 0.8.4; import "@openzeppelin/contracts/proxy/Clones.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol"; /* Copyright Tether.to 2024 Author Will Norden Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 */ contract Factory is OwnableUpgradeable { event LogDeployClone( uint256 indexed id, address indexed clone, address indexed owner ); event LogSetTemplate(uint256 indexed id, address indexed template); mapping(uint256 => address) public templateBeacons; mapping(uint256 => address) public templateClones; function initialize() public virtual initializer { __Ownable_init(); } function setTemplate(uint256 _id, address _template) public onlyOwner { templateBeacons[_id] = _template; require( IBeacon(_template).implementation() != address(0), "Factory: Invalid template" ); emit LogSetTemplate(_id, _template); } function deployTemplateWithBytes( uint256 _id, bytes calldata data ) public returns (address clone) { address template = IBeacon(templateBeacons[_id]).implementation(); require(template != address(0), "Factory: Template not set"); clone = Clones.cloneDeterministic(template, keccak256(data)); (bool success, ) = clone.call(data); require(success, "Factory: Failed to initialize clone"); emit LogDeployClone(_id, address(clone), msg.sender); } function deployBeaconTemplateWithBytes( uint256 _id, bytes calldata data ) public returns (BeaconProxy clone) { address template = templateBeacons[_id]; require(template != address(0), "Factory: Template not set"); clone = new BeaconProxy(template, data); emit LogDeployClone(_id, address(clone), msg.sender); } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal initializer { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal initializer { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(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"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IBeacon.sol"; import "../Proxy.sol"; import "../ERC1967/ERC1967Upgrade.sol"; /** * @dev This contract implements a proxy that gets the implementation address for each call from a {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 Initializes the proxy with `beacon`. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity * constructor. * * Requirements: * * - `beacon` must be a contract with the interface {IBeacon}. */ constructor(address beacon, bytes memory data) payable { assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1)); _upgradeBeaconToAndCall(beacon, data, false); } /** * @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 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 pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create(0, ptr, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create2(0, ptr, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000) mstore(add(ptr, 0x38), shl(0x60, deployer)) mstore(add(ptr, 0x4c), salt) mstore(add(ptr, 0x6c), keccak256(ptr, 0x37)) predicted := keccak256(add(ptr, 0x37), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "../beacon/IBeacon.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._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967Upgrade { // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return 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 _upgradeToAndCallSecure( address newImplementation, bytes memory data, bool forceCall ) internal { address oldImplementation = _getImplementation(); // Initial upgrade and setup call _setImplementation(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } // Perform rollback test if not already in progress StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT); if (!rollbackTesting.value) { // Trigger rollback using upgradeTo from the new implementation rollbackTesting.value = true; Address.functionDelegateCall( newImplementation, abi.encodeWithSignature("upgradeTo(address)", oldImplementation) ); rollbackTesting.value = false; // Check rollback was effective require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades"); // Finally reset to the new implementation and log the upgrade _upgradeTo(newImplementation); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return 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 Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @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 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 internall 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 overriden 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 internall 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 overriden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev 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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
{ "optimizer": { "enabled": true, "runs": 100000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"clone","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"LogDeployClone","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"template","type":"address"}],"name":"LogSetTemplate","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":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"deployBeaconTemplateWithBytes","outputs":[{"internalType":"contract BeaconProxy","name":"clone","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"deployTemplateWithBytes","outputs":[{"internalType":"address","name":"clone","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_template","type":"address"}],"name":"setTemplate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"templateBeacons","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"templateClones","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50611b73806100206000396000f3fe60806040523480156200001157600080fd5b5060043610620000b05760003560e01c80638da5cb5b116200007f578063a60523a91162000062578063a60523a9146200019c578063cf8882d614620001b3578063f2fde38b14620001ca57600080fd5b80638da5cb5b146200014457806392f3c022146200016357600080fd5b80630b0065cd14620000b5578063287665d314620000ce578063715018a614620001305780638129fc1c146200013a575b600080fd5b620000cc620000c636600462000f81565b620001e1565b005b62000107620000df36600462000f68565b60666020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b620000cc62000407565b620000cc62000498565b60335473ffffffffffffffffffffffffffffffffffffffff1662000107565b620001076200017436600462000f68565b60656020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b62000107620001ad36600462000fb3565b620005bd565b62000107620001c436600462000fb3565b620006d8565b620000cc620001db36600462000f23565b62000982565b60335473ffffffffffffffffffffffffffffffffffffffff16331462000268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600082815260656020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915581517f5c60da1b00000000000000000000000000000000000000000000000000000000815291519092635c60da1b9260048082019391829003018186803b1580156200030557600080fd5b505afa1580156200031a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000340919062000f49565b73ffffffffffffffffffffffffffffffffffffffff161415620003c0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f466163746f72793a20496e76616c69642074656d706c6174650000000000000060448201526064016200025f565b60405173ffffffffffffffffffffffffffffffffffffffff82169083907f7fecca286a9a327a3eb1c1e8468b2e6e91bd9128434e636852e754e339ec66ea90600090a35050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146200048a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200025f565b62000496600062000ab0565b565b600054610100900460ff1680620004b2575060005460ff16155b62000540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200025f565b600054610100900460ff161580156200058057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6200058a62000b27565b8015620005ba57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b50565b60008381526065602052604081205473ffffffffffffffffffffffffffffffffffffffff16806200064b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f466163746f72793a2054656d706c617465206e6f74207365740000000000000060448201526064016200025f565b8084846040516200065c9062000f15565b6200066a939291906200103f565b604051809103906000f08015801562000687573d6000803e3d6000fd5b50604051909250339073ffffffffffffffffffffffffffffffffffffffff84169087907f9029a99f5d71a81c2d697339924b6c6b2e50bbb296f038016ff0d88be34ab1ca90600090a4509392505050565b60008381526065602090815260408083205481517f5c60da1b0000000000000000000000000000000000000000000000000000000081529151849373ffffffffffffffffffffffffffffffffffffffff90921692635c60da1b926004808301939192829003018186803b1580156200074f57600080fd5b505afa15801562000764573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200078a919062000f49565b905073ffffffffffffffffffffffffffffffffffffffff81166200080b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f466163746f72793a2054656d706c617465206e6f74207365740000000000000060448201526064016200025f565b62000830818585604051620008229291906200102f565b604051809103902062000c23565b915060008273ffffffffffffffffffffffffffffffffffffffff1685856040516200085d9291906200102f565b6000604051808303816000865af19150503d80600081146200089c576040519150601f19603f3d011682016040523d82523d6000602084013e620008a1565b606091505b505090508062000934576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f466163746f72793a204661696c656420746f20696e697469616c697a6520636c60448201527f6f6e65000000000000000000000000000000000000000000000000000000000060648201526084016200025f565b604051339073ffffffffffffffffffffffffffffffffffffffff85169088907f9029a99f5d71a81c2d697339924b6c6b2e50bbb296f038016ff0d88be34ab1ca90600090a450509392505050565b60335473ffffffffffffffffffffffffffffffffffffffff16331462000a05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200025f565b73ffffffffffffffffffffffffffffffffffffffff811662000aaa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016200025f565b620005ba815b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff168062000b41575060005460ff16155b62000bcf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200025f565b600054610100900460ff1615801562000c0f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b62000c1962000d09565b6200058a62000e22565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528360601b60148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f591505073ffffffffffffffffffffffffffffffffffffffff811662000d03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f455243313136373a2063726561746532206661696c656400000000000000000060448201526064016200025f565b92915050565b600054610100900460ff168062000d23575060005460ff16155b62000db1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200025f565b600054610100900460ff161580156200058a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790558015620005ba57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b600054610100900460ff168062000e3c575060005460ff16155b62000eca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200025f565b600054610100900460ff1615801562000f0a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6200058a3362000ab0565b610a7180620010cd83390190565b60006020828403121562000f35578081fd5b813562000f4281620010a9565b9392505050565b60006020828403121562000f5b578081fd5b815162000f4281620010a9565b60006020828403121562000f7a578081fd5b5035919050565b6000806040838503121562000f94578081fd5b82359150602083013562000fa881620010a9565b809150509250929050565b60008060006040848603121562000fc8578081fd5b83359250602084013567ffffffffffffffff8082111562000fe7578283fd5b818601915086601f83011262000ffb578283fd5b8135818111156200100a578384fd5b8760208285010111156200101c578384fd5b6020830194508093505050509250925092565b8183823760009101908152919050565b73ffffffffffffffffffffffffffffffffffffffff8416815260406020820152816040820152818360608301376000818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b73ffffffffffffffffffffffffffffffffffffffff81168114620005ba57600080fdfe608060405260405162000a7138038062000a718339810160408190526200002691620004b8565b6200005360017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51620005d5565b60008051602062000a2a833981519152146200007f57634e487b7160e01b600052600160045260246000fd5b6200008d8282600062000095565b50506200063e565b620000a0836200017a565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a2600082511180620000e25750805b15620001755762000173836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200012657600080fd5b505afa1580156200013b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016191906200049b565b836200032b60201b620000291760201c565b505b505050565b62000190816200035a60201b620000551760201c565b620001f05760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6200027a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200022e57600080fd5b505afa15801562000243573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200026991906200049b565b6200035a60201b620000551760201c565b620002e15760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401620001e7565b806200030a60008051602062000a2a83398151915260001b6200036060201b6200005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606062000353838360405180606001604052806027815260200162000a4a6027913962000363565b9392505050565b3b151590565b90565b6060833b620003c45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001e7565b600080856001600160a01b031685604051620003e1919062000582565b600060405180830381855af49150503d80600081146200041e576040519150601f19603f3d011682016040523d82523d6000602084013e62000423565b606091505b5090925090506200043682828662000440565b9695505050505050565b606083156200045157508162000353565b825115620004625782518084602001fd5b8160405162461bcd60e51b8152600401620001e79190620005a0565b80516001600160a01b03811681146200049657600080fd5b919050565b600060208284031215620004ad578081fd5b62000353826200047e565b60008060408385031215620004cb578081fd5b620004d6836200047e565b60208401519092506001600160401b0380821115620004f3578283fd5b818501915085601f83011262000507578283fd5b8151818111156200051c576200051c62000628565b604051601f8201601f19908116603f0116810190838211818310171562000547576200054762000628565b8160405282815288602084870101111562000560578586fd5b62000573836020830160208801620005f9565b80955050505050509250929050565b6000825162000596818460208701620005f9565b9190910192915050565b6020815260008251806020840152620005c1816040850160208701620005f9565b601f01601f19169190910160400192915050565b600082821015620005f457634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101562000616578181015183820152602001620005fc565b83811115620001735750506000910152565b634e487b7160e01b600052604160045260246000fd5b6103dc806200064e6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610120565b565b606061004e838360405180606001604052806027815260200161038060279139610144565b9392505050565b3b151590565b90565b600061009e7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100e357600080fd5b505afa1580156100f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011b91906102ae565b905090565b3660008037600080366000845af43d6000803e80801561013f573d6000f35b3d6000fd5b6060833b6101d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff168560405161020191906102e2565b600060405180830381855af49150503d806000811461023c576040519150601f19603f3d011682016040523d82523d6000602084013e610241565b606091505b509150915061025182828661025b565b9695505050505050565b6060831561026a57508161004e565b82511561027a5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101d091906102fe565b6000602082840312156102bf578081fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461004e578182fd5b600082516102f481846020870161034f565b9190910192915050565b602081526000825180602084015261031d81604085016020870161034f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60005b8381101561036a578181015183820152602001610352565b83811115610379576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212202e2c9d54161c101f77fa42671fde1d8ebcebf0f7f535a2cf1048e9bc667b944964736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220233dd755ad7ded7c6b170822605c8f2bceff1ea2b7cf0b1fa247fa068879c6f064736f6c63430008040033
Deployed Bytecode
0x60806040523480156200001157600080fd5b5060043610620000b05760003560e01c80638da5cb5b116200007f578063a60523a91162000062578063a60523a9146200019c578063cf8882d614620001b3578063f2fde38b14620001ca57600080fd5b80638da5cb5b146200014457806392f3c022146200016357600080fd5b80630b0065cd14620000b5578063287665d314620000ce578063715018a614620001305780638129fc1c146200013a575b600080fd5b620000cc620000c636600462000f81565b620001e1565b005b62000107620000df36600462000f68565b60666020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b620000cc62000407565b620000cc62000498565b60335473ffffffffffffffffffffffffffffffffffffffff1662000107565b620001076200017436600462000f68565b60656020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b62000107620001ad36600462000fb3565b620005bd565b62000107620001c436600462000fb3565b620006d8565b620000cc620001db36600462000f23565b62000982565b60335473ffffffffffffffffffffffffffffffffffffffff16331462000268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600082815260656020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915581517f5c60da1b00000000000000000000000000000000000000000000000000000000815291519092635c60da1b9260048082019391829003018186803b1580156200030557600080fd5b505afa1580156200031a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000340919062000f49565b73ffffffffffffffffffffffffffffffffffffffff161415620003c0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f466163746f72793a20496e76616c69642074656d706c6174650000000000000060448201526064016200025f565b60405173ffffffffffffffffffffffffffffffffffffffff82169083907f7fecca286a9a327a3eb1c1e8468b2e6e91bd9128434e636852e754e339ec66ea90600090a35050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146200048a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200025f565b62000496600062000ab0565b565b600054610100900460ff1680620004b2575060005460ff16155b62000540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200025f565b600054610100900460ff161580156200058057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6200058a62000b27565b8015620005ba57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b50565b60008381526065602052604081205473ffffffffffffffffffffffffffffffffffffffff16806200064b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f466163746f72793a2054656d706c617465206e6f74207365740000000000000060448201526064016200025f565b8084846040516200065c9062000f15565b6200066a939291906200103f565b604051809103906000f08015801562000687573d6000803e3d6000fd5b50604051909250339073ffffffffffffffffffffffffffffffffffffffff84169087907f9029a99f5d71a81c2d697339924b6c6b2e50bbb296f038016ff0d88be34ab1ca90600090a4509392505050565b60008381526065602090815260408083205481517f5c60da1b0000000000000000000000000000000000000000000000000000000081529151849373ffffffffffffffffffffffffffffffffffffffff90921692635c60da1b926004808301939192829003018186803b1580156200074f57600080fd5b505afa15801562000764573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200078a919062000f49565b905073ffffffffffffffffffffffffffffffffffffffff81166200080b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f466163746f72793a2054656d706c617465206e6f74207365740000000000000060448201526064016200025f565b62000830818585604051620008229291906200102f565b604051809103902062000c23565b915060008273ffffffffffffffffffffffffffffffffffffffff1685856040516200085d9291906200102f565b6000604051808303816000865af19150503d80600081146200089c576040519150601f19603f3d011682016040523d82523d6000602084013e620008a1565b606091505b505090508062000934576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f466163746f72793a204661696c656420746f20696e697469616c697a6520636c60448201527f6f6e65000000000000000000000000000000000000000000000000000000000060648201526084016200025f565b604051339073ffffffffffffffffffffffffffffffffffffffff85169088907f9029a99f5d71a81c2d697339924b6c6b2e50bbb296f038016ff0d88be34ab1ca90600090a450509392505050565b60335473ffffffffffffffffffffffffffffffffffffffff16331462000a05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200025f565b73ffffffffffffffffffffffffffffffffffffffff811662000aaa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016200025f565b620005ba815b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff168062000b41575060005460ff16155b62000bcf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200025f565b600054610100900460ff1615801562000c0f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b62000c1962000d09565b6200058a62000e22565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528360601b60148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f591505073ffffffffffffffffffffffffffffffffffffffff811662000d03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f455243313136373a2063726561746532206661696c656400000000000000000060448201526064016200025f565b92915050565b600054610100900460ff168062000d23575060005460ff16155b62000db1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200025f565b600054610100900460ff161580156200058a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790558015620005ba57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b600054610100900460ff168062000e3c575060005460ff16155b62000eca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200025f565b600054610100900460ff1615801562000f0a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6200058a3362000ab0565b610a7180620010cd83390190565b60006020828403121562000f35578081fd5b813562000f4281620010a9565b9392505050565b60006020828403121562000f5b578081fd5b815162000f4281620010a9565b60006020828403121562000f7a578081fd5b5035919050565b6000806040838503121562000f94578081fd5b82359150602083013562000fa881620010a9565b809150509250929050565b60008060006040848603121562000fc8578081fd5b83359250602084013567ffffffffffffffff8082111562000fe7578283fd5b818601915086601f83011262000ffb578283fd5b8135818111156200100a578384fd5b8760208285010111156200101c578384fd5b6020830194508093505050509250925092565b8183823760009101908152919050565b73ffffffffffffffffffffffffffffffffffffffff8416815260406020820152816040820152818360608301376000818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b73ffffffffffffffffffffffffffffffffffffffff81168114620005ba57600080fdfe608060405260405162000a7138038062000a718339810160408190526200002691620004b8565b6200005360017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51620005d5565b60008051602062000a2a833981519152146200007f57634e487b7160e01b600052600160045260246000fd5b6200008d8282600062000095565b50506200063e565b620000a0836200017a565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a2600082511180620000e25750805b15620001755762000173836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200012657600080fd5b505afa1580156200013b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016191906200049b565b836200032b60201b620000291760201c565b505b505050565b62000190816200035a60201b620000551760201c565b620001f05760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6200027a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200022e57600080fd5b505afa15801562000243573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200026991906200049b565b6200035a60201b620000551760201c565b620002e15760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401620001e7565b806200030a60008051602062000a2a83398151915260001b6200036060201b6200005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606062000353838360405180606001604052806027815260200162000a4a6027913962000363565b9392505050565b3b151590565b90565b6060833b620003c45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001e7565b600080856001600160a01b031685604051620003e1919062000582565b600060405180830381855af49150503d80600081146200041e576040519150601f19603f3d011682016040523d82523d6000602084013e62000423565b606091505b5090925090506200043682828662000440565b9695505050505050565b606083156200045157508162000353565b825115620004625782518084602001fd5b8160405162461bcd60e51b8152600401620001e79190620005a0565b80516001600160a01b03811681146200049657600080fd5b919050565b600060208284031215620004ad578081fd5b62000353826200047e565b60008060408385031215620004cb578081fd5b620004d6836200047e565b60208401519092506001600160401b0380821115620004f3578283fd5b818501915085601f83011262000507578283fd5b8151818111156200051c576200051c62000628565b604051601f8201601f19908116603f0116810190838211818310171562000547576200054762000628565b8160405282815288602084870101111562000560578586fd5b62000573836020830160208801620005f9565b80955050505050509250929050565b6000825162000596818460208701620005f9565b9190910192915050565b6020815260008251806020840152620005c1816040850160208701620005f9565b601f01601f19169190910160400192915050565b600082821015620005f457634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101562000616578181015183820152602001620005fc565b83811115620001735750506000910152565b634e487b7160e01b600052604160045260246000fd5b6103dc806200064e6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610120565b565b606061004e838360405180606001604052806027815260200161038060279139610144565b9392505050565b3b151590565b90565b600061009e7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100e357600080fd5b505afa1580156100f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011b91906102ae565b905090565b3660008037600080366000845af43d6000803e80801561013f573d6000f35b3d6000fd5b6060833b6101d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff168560405161020191906102e2565b600060405180830381855af49150503d806000811461023c576040519150601f19603f3d011682016040523d82523d6000602084013e610241565b606091505b509150915061025182828661025b565b9695505050505050565b6060831561026a57508161004e565b82511561027a5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101d091906102fe565b6000602082840312156102bf578081fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461004e578182fd5b600082516102f481846020870161034f565b9190910192915050565b602081526000825180602084015261031d81604085016020870161034f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60005b8381101561036a578181015183820152602001610352565b83811115610379576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212202e2c9d54161c101f77fa42671fde1d8ebcebf0f7f535a2cf1048e9bc667b944964736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220233dd755ad7ded7c6b170822605c8f2bceff1ea2b7cf0b1fa247fa068879c6f064736f6c63430008040033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.