Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 53 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Safe Create2 | 20682702 | 82 days ago | IN | 0 ETH | 0.01143172 | ||||
Safe Create2 | 20682699 | 82 days ago | IN | 0 ETH | 0.00570813 | ||||
Safe Create2 | 20682698 | 82 days ago | IN | 0 ETH | 0.00549458 | ||||
Safe Create2 | 20682695 | 82 days ago | IN | 0 ETH | 0.00611224 | ||||
Safe Create2 | 20682694 | 82 days ago | IN | 0 ETH | 0.00600966 | ||||
Safe Create2 | 20682677 | 82 days ago | IN | 0 ETH | 0.00263929 | ||||
Safe Create2 | 20666817 | 85 days ago | IN | 0 ETH | 0.00480749 | ||||
Safe Create2 | 20631157 | 90 days ago | IN | 0 ETH | 0.00294897 | ||||
Safe Create2 | 20627324 | 90 days ago | IN | 0 ETH | 0.0015829 | ||||
Safe Create2 | 20627274 | 90 days ago | IN | 0 ETH | 0.00139047 | ||||
Safe Create2 | 20627244 | 90 days ago | IN | 0 ETH | 0.0010064 | ||||
Safe Create2 | 20627188 | 90 days ago | IN | 0 ETH | 0.00121478 | ||||
Safe Create2 | 20627156 | 90 days ago | IN | 0 ETH | 0.00118829 | ||||
Safe Create2 | 20627027 | 90 days ago | IN | 0 ETH | 0.00121572 | ||||
Safe Create2 | 20627023 | 90 days ago | IN | 0 ETH | 0.00066269 | ||||
Safe Create2 | 20627008 | 90 days ago | IN | 0 ETH | 0.0005456 | ||||
Safe Create2 | 20618038 | 91 days ago | IN | 0 ETH | 0.00474202 | ||||
Safe Create2 | 20612690 | 92 days ago | IN | 0 ETH | 0.00532313 | ||||
Safe Create2 | 20612689 | 92 days ago | IN | 0 ETH | 0.00468078 | ||||
Safe Create2 | 20611079 | 92 days ago | IN | 0 ETH | 0.00443882 | ||||
Safe Create2 | 20611067 | 92 days ago | IN | 0 ETH | 0.00209178 | ||||
Safe Create2 | 20611066 | 92 days ago | IN | 0 ETH | 0.00183678 | ||||
Safe Create2 | 20611062 | 92 days ago | IN | 0 ETH | 0.00190121 | ||||
Safe Create2 | 20611061 | 92 days ago | IN | 0 ETH | 0.00208772 | ||||
Safe Create2 | 20611060 | 92 days ago | IN | 0 ETH | 0.00074418 |
Latest 25 internal transactions (View All)
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Create2Factory
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // optimization enabled, 1000 runs, evm: petersburg /** * @title Immutable Create2 Contract Factory * @author 0age * @notice This contract provides a safeCreate2 function that takes a salt value * and a block of initialization code as arguments and passes them into inline * assembly. The contract prevents redeploys by maintaining a mapping of all * contracts that have already been deployed. There is also a view function that * computes the address of the contract that will be created when submitting a * given salt or nonce along with a given block of initialization code. * @dev This contract has not yet been fully tested or audited - proceed with * caution and please share any exploits or optimizations you discover. */ contract Create2Factory { event ContractDeployed(address indexed deploymentAddress); // mapping to track which addresses have already been deployed. mapping(address => bool) public _deployed; /** * @dev Create a contract using CREATE2 by submitting a given salt or nonce * along with the initialization code for the contract. Note that the first 20 * bytes of the salt must match those of the calling address, which prevents * contract creation events from being submitted by unintended parties. * @param salt bytes32 The nonce that will be passed into the CREATE2 call. * @param initializationCode bytes The initialization code that will be passed * into the CREATE2 call. * @return deploymentAddress address of the contract that will be created, or the null address * if a contract already exists at that address. */ function safeCreate2( bytes32 salt, bytes calldata initializationCode ) external payable returns (address deploymentAddress) { // move the initialization code from calldata to memory. bytes memory initCode = initializationCode; // determine the target address for contract deployment. address targetDeploymentAddress = address( uint160( // downcast to match the address type. uint256( // convert to uint to truncate upper digits. keccak256( // compute the CREATE2 hash using 4 inputs. abi.encodePacked( // pack all inputs to the hash together. hex"ff", // start with 0xff to distinguish from RLP. address(this), // this contract will be the caller. salt, // pass in the supplied salt value. keccak256( // pass in the hash of initialization code. abi.encodePacked( initCode ) ) ) ) ) ) ); // ensure that a contract hasn't been previously deployed to target address. require( !_deployed[targetDeploymentAddress], "Invalid contract creation - contract has already been deployed." ); // using inline assembly: load data and length of data, then call CREATE2. assembly { // solhint-disable-line let encoded_data := add(0x20, initCode) // load initialization code. let encoded_size := mload(initCode) // load the init code's length. deploymentAddress := create2( // call CREATE2 with 4 arguments. callvalue(), // forward any attached value. encoded_data, // pass in initialization code. encoded_size, // pass in init code's length. salt // pass in the salt value. ) } // check address against target to ensure that deployment was successful. require( deploymentAddress == targetDeploymentAddress, "Failed to deploy contract using provided salt and initialization code." ); // record the deployment of the contract to prevent redeploys. _deployed[deploymentAddress] = true; emit ContractDeployed(deploymentAddress); } /** * @dev Compute the address of the contract that will be created when * submitting a given salt or nonce to the contract along with the contract's * initialization code. The CREATE2 address is computed in accordance with * EIP-1014, and adheres to the formula therein of * `keccak256( 0xff ++ address ++ salt ++ keccak256(init_code)))[12:]` when * performing the computation. The computed address is then checked for any * existing contract code - if so, the null address will be returned instead. * @param salt bytes32 The nonce passed into the CREATE2 address calculation. * @param initCode bytes The contract initialization code to be used. * that will be passed into the CREATE2 address calculation. * @return deploymentAddress address The contract that will be created, or the null address * if a contract has already been deployed to that address. */ function findCreate2Address( bytes32 salt, bytes calldata initCode ) external view returns (address deploymentAddress) { // determine the address where the contract will be deployed. deploymentAddress = address( uint160( // downcast to match the address type. uint256( // convert to uint to truncate upper digits. keccak256( // compute the CREATE2 hash using 4 inputs. abi.encodePacked( // pack all inputs to the hash together. hex"ff", // start with 0xff to distinguish from RLP. address(this), // this contract will be the caller. salt, // pass in the supplied salt value. keccak256( // pass in the hash of initialization code. abi.encodePacked( initCode ) ) ) ) ) ) ); // return null address to signify failure if contract has been deployed. if (_deployed[deploymentAddress]) { return address(0); } } /** * @dev Compute the address of the contract that will be created when * submitting a given salt or nonce to the contract along with the keccak256 * hash of the contract's initialization code. The CREATE2 address is computed * in accordance with EIP-1014, and adheres to the formula therein of * `keccak256( 0xff ++ address ++ salt ++ keccak256(init_code)))[12:]` when * performing the computation. The computed address is then checked for any * existing contract code - if so, the null address will be returned instead. * @param salt bytes32 The nonce passed into the CREATE2 address calculation. * @param initCodeHash bytes32 The keccak256 hash of the initialization code * that will be passed into the CREATE2 address calculation. * @return deploymentAddress address the contract that will be created, or the null address * if a contract has already been deployed to that address. */ function findCreate2AddressViaHash( bytes32 salt, bytes32 initCodeHash ) external view returns (address deploymentAddress) { // determine the address where the contract will be deployed. deploymentAddress = address( uint160( // downcast to match the address type. uint256( // convert to uint to truncate upper digits. keccak256( // compute the CREATE2 hash using 4 inputs. abi.encodePacked( // pack all inputs to the hash together. hex"ff", // start with 0xff to distinguish from RLP. address(this), // this contract will be the caller. salt, // pass in the supplied salt value. initCodeHash // pass in the hash of initialization code. ) ) ) ) ); // return null address to signify failure if contract has been deployed. if (_deployed[deploymentAddress]) { return address(0); } } /** * @dev Determine if a contract has already been deployed by the factory to a * given address. * @param deploymentAddress address The contract address to check. * @return True if the contract has been deployed, false otherwise. */ function hasBeenDeployed( address deploymentAddress ) external view returns (bool) { // determine if a contract has been deployed to the provided address. return _deployed[deploymentAddress]; } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "viaIR": true, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deploymentAddress","type":"address"}],"name":"ContractDeployed","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_deployed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"initCode","type":"bytes"}],"name":"findCreate2Address","outputs":[{"internalType":"address","name":"deploymentAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes32","name":"initCodeHash","type":"bytes32"}],"name":"findCreate2AddressViaHash","outputs":[{"internalType":"address","name":"deploymentAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"deploymentAddress","type":"address"}],"name":"hasBeenDeployed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"initializationCode","type":"bytes"}],"name":"safeCreate2","outputs":[{"internalType":"address","name":"deploymentAddress","type":"address"}],"stateMutability":"payable","type":"function"}]
Contract Creation Code
6080806040523461001657610651908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c90816308508b8f1461006a575080633b67d8091461006557806364e030871461006057806385cf97ab1461005b5763a49a7c901461005657600080fd5b6102fd565b6102d3565b610145565b6100c4565b3461009a57604060ff916001600160a01b036100853661009d565b16815280602052205416151560805260206080f35b80fd5b60209060031901126100bf576004356001600160a01b03811681036100bf5790565b600080fd5b346100bf576001600160a01b036100da3661009d565b166000526000602052602060ff604060002054166040519015158152f35b60406003198201126100bf576004359160243567ffffffffffffffff928382116100bf57806023830112156100bf5781600401359384116100bf57602484830101116100bf576024019190565b61015b610151366100f8565b9291923691610374565b9061020b6101ff604051602081018161017482886103bb565b0391610188601f199384810183528261034d565b5190206040517fff00000000000000000000000000000000000000000000000000000000000000602082019081526bffffffffffffffffffffffff193060601b1660218301526035820187905260558201929092526075928301815290916101f0908261034d565b5190206001600160a01b031690565b6001600160a01b031690565b9161024261023d610239610232866001600160a01b03166000526000602052604060002090565b5460ff1690565b1590565b6103e6565b80519060200134f5906102626001600160a01b0380841692168214610457565b61028f610282836001600160a01b03166000526000602052604060002090565b805460ff19166001179055565b6102cf6040519283927f8ffcdc15a283d706d38281f500270d8b5a656918f555de0913d7455e3e6bc1bf600080a26001600160a01b031682526020820190565b0390f35b346100bf5760206102ec6102e6366100f8565b916104ee565b6001600160a01b0360405191168152f35b346100bf5760403660031901126100bf5760206102ec6024356004356105b2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761036f57604052565b61031e565b92919267ffffffffffffffff821161036f576040519161039e601f8201601f19166020018461034d565b8294818452818301116100bf578281602093846000960137010152565b9081519160005b8381106103d3575050016000815290565b80602080928401015181850152016103c2565b156103ed57565b608460405162461bcd60e51b815260206004820152603f60248201527f496e76616c696420636f6e7472616374206372656174696f6e202d20636f6e7460448201527f726163742068617320616c7265616479206265656e206465706c6f7965642e006064820152fd5b1561045e57565b60a460405162461bcd60e51b815260206004820152604660248201527f4661696c656420746f206465706c6f7920636f6e7472616374207573696e672060448201527f70726f76696465642073616c7420616e6420696e697469616c697a6174696f6e60648201527f20636f64652e00000000000000000000000000000000000000000000000000006084820152fd5b9061058f610581916001600160a01b03946105236020604051838194838301968737810160008382015203808452018261034d565b5190206040519283916020830195308791605593917fff0000000000000000000000000000000000000000000000000000000000000084526bffffffffffffffffffffffff199060601b166001840152601583015260358201520190565b03601f19810183528261034d565b519020169081600052600060205260ff604060002054166105ac57565b60009150565b6040517fff00000000000000000000000000000000000000000000000000000000000000602082019081523060601b6bffffffffffffffffffffffff19166021830152603582019290925260558101929092526001600160a01b039161058f816075810161058156fea26469706673582212201f954d97d83b0ad9453d6c9f6519b6c0049714a73759cca32c8b58b2fa454ac664736f6c63430008180033
Deployed Bytecode
0x6080604052600436101561001257600080fd5b6000803560e01c90816308508b8f1461006a575080633b67d8091461006557806364e030871461006057806385cf97ab1461005b5763a49a7c901461005657600080fd5b6102fd565b6102d3565b610145565b6100c4565b3461009a57604060ff916001600160a01b036100853661009d565b16815280602052205416151560805260206080f35b80fd5b60209060031901126100bf576004356001600160a01b03811681036100bf5790565b600080fd5b346100bf576001600160a01b036100da3661009d565b166000526000602052602060ff604060002054166040519015158152f35b60406003198201126100bf576004359160243567ffffffffffffffff928382116100bf57806023830112156100bf5781600401359384116100bf57602484830101116100bf576024019190565b61015b610151366100f8565b9291923691610374565b9061020b6101ff604051602081018161017482886103bb565b0391610188601f199384810183528261034d565b5190206040517fff00000000000000000000000000000000000000000000000000000000000000602082019081526bffffffffffffffffffffffff193060601b1660218301526035820187905260558201929092526075928301815290916101f0908261034d565b5190206001600160a01b031690565b6001600160a01b031690565b9161024261023d610239610232866001600160a01b03166000526000602052604060002090565b5460ff1690565b1590565b6103e6565b80519060200134f5906102626001600160a01b0380841692168214610457565b61028f610282836001600160a01b03166000526000602052604060002090565b805460ff19166001179055565b6102cf6040519283927f8ffcdc15a283d706d38281f500270d8b5a656918f555de0913d7455e3e6bc1bf600080a26001600160a01b031682526020820190565b0390f35b346100bf5760206102ec6102e6366100f8565b916104ee565b6001600160a01b0360405191168152f35b346100bf5760403660031901126100bf5760206102ec6024356004356105b2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761036f57604052565b61031e565b92919267ffffffffffffffff821161036f576040519161039e601f8201601f19166020018461034d565b8294818452818301116100bf578281602093846000960137010152565b9081519160005b8381106103d3575050016000815290565b80602080928401015181850152016103c2565b156103ed57565b608460405162461bcd60e51b815260206004820152603f60248201527f496e76616c696420636f6e7472616374206372656174696f6e202d20636f6e7460448201527f726163742068617320616c7265616479206265656e206465706c6f7965642e006064820152fd5b1561045e57565b60a460405162461bcd60e51b815260206004820152604660248201527f4661696c656420746f206465706c6f7920636f6e7472616374207573696e672060448201527f70726f76696465642073616c7420616e6420696e697469616c697a6174696f6e60648201527f20636f64652e00000000000000000000000000000000000000000000000000006084820152fd5b9061058f610581916001600160a01b03946105236020604051838194838301968737810160008382015203808452018261034d565b5190206040519283916020830195308791605593917fff0000000000000000000000000000000000000000000000000000000000000084526bffffffffffffffffffffffff199060601b166001840152601583015260358201520190565b03601f19810183528261034d565b519020169081600052600060205260ff604060002054166105ac57565b60009150565b6040517fff00000000000000000000000000000000000000000000000000000000000000602082019081523060601b6bffffffffffffffffffffffff19166021830152603582019290925260558101929092526001600160a01b039161058f816075810161058156fea26469706673582212201f954d97d83b0ad9453d6c9f6519b6c0049714a73759cca32c8b58b2fa454ac664736f6c63430008180033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.