Source Code
Overview
ETH Balance
More Info
ContractCreator
Multichain Info
N/A
Latest 24 from a total of 24 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Deploy | 4062162 | 436 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4062065 | 436 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4061584 | 436 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4060163 | 436 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4021352 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4021124 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4020890 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4020670 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4020622 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4017711 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4016832 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4016729 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4015981 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4015773 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4015644 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4015619 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4015602 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4015585 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4015546 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4011419 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4011374 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4002111 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4001719 | 437 days ago | IN | 0 ETH | 0.00002561 | ||||
| Deploy | 4001608 | 437 days ago | IN | 0 ETH | 0.00002561 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | Amount | ||
|---|---|---|---|---|---|---|
| 11052971 | 263 days ago | Contract Creation | 0 ETH | |||
| 11052971 | 263 days ago | 0 ETH | ||||
| 11052885 | 263 days ago | Contract Creation | 0 ETH | |||
| 11052885 | 263 days ago | 0 ETH | ||||
| 9913622 | 290 days ago | Contract Creation | 0 ETH | |||
| 9913622 | 290 days ago | 0 ETH | ||||
| 9906975 | 290 days ago | Contract Creation | 0 ETH | |||
| 9906975 | 290 days ago | 0 ETH | ||||
| 9906924 | 290 days ago | Contract Creation | 0 ETH | |||
| 9906924 | 290 days ago | 0 ETH | ||||
| 9828196 | 292 days ago | Contract Creation | 0 ETH | |||
| 9828196 | 292 days ago | 0 ETH | ||||
| 9664604 | 296 days ago | Contract Creation | 0 ETH | |||
| 9664604 | 296 days ago | 0 ETH | ||||
| 9521377 | 299 days ago | Contract Creation | 0 ETH | |||
| 9521377 | 299 days ago | 0 ETH | ||||
| 9356211 | 303 days ago | Contract Creation | 0 ETH | |||
| 9356211 | 303 days ago | 0 ETH | ||||
| 9355162 | 303 days ago | Contract Creation | 0 ETH | |||
| 9355162 | 303 days ago | 0 ETH | ||||
| 9355137 | 303 days ago | Contract Creation | 0 ETH | |||
| 9355137 | 303 days ago | 0 ETH | ||||
| 9354612 | 303 days ago | Contract Creation | 0 ETH | |||
| 9354612 | 303 days ago | 0 ETH | ||||
| 9354188 | 303 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
SimpleFactory
Compiler Version
v0.8.23+commit.f704f362
Contract Source Code (Solidity Multiple files format)
// SPDX-License-Identifier: MIT AND Apache-2.0
pragma solidity 0.8.23;
import {Create2} from "./Create2.sol";
contract SimpleFactory {
////////////////////////////// Events //////////////////////////////
event Deployed(address indexed addr);
////////////////////////////// Custom Errors //////////////////////////////
/**
* @dev The contract deployed is empty
*/
error SimpleFactoryEmptyContract(address deployed);
////////////////////////////// External Methods //////////////////////////////
/**
* @notice Deploys a contract using create2
* @param _bytecode the bytecode of the contract to deploy
* @param _salt the salt to use for create2
*/
function deploy(bytes memory _bytecode, bytes32 _salt) external returns (address addr_) {
addr_ = Create2.deploy(0, _salt, _bytecode);
if (addr_.code.length == 0) revert SimpleFactoryEmptyContract(addr_);
emit Deployed(addr_);
}
/**
* @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 _bytecodeHash, bytes32 _salt) external view returns (address addr_) {
return Create2.computeAddress(_salt, _bytecodeHash);
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Create2.sol)
pragma solidity ^0.8.20;
/**
* @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 Not enough balance for performing a CREATE2 deploy.
*/
error Create2InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev There's no code to deploy.
*/
error Create2EmptyBytecode();
/**
* @dev The deployment failed.
*/
error Create2FailedDeployment();
/**
* @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) {
if (address(this).balance < amount) {
revert Create2InsufficientBalance(address(this).balance, amount);
}
if (bytecode.length == 0) {
revert Create2EmptyBytecode();
}
/// @solidity memory-safe-assembly
assembly {
addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
}
if (addr == address(0)) {
revert Create2FailedDeployment();
}
}
/**
* @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)
}
}
}
Contract ABI
API[{"inputs":[],"name":"Create2EmptyBytecode","type":"error"},{"inputs":[],"name":"Create2FailedDeployment","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"Create2InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"deployed","type":"address"}],"name":"SimpleFactoryEmptyContract","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"Deployed","type":"event"},{"inputs":[{"internalType":"bytes32","name":"_bytecodeHash","type":"bytes32"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"computeAddress","outputs":[{"internalType":"address","name":"addr_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_bytecode","type":"bytes"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"deploy","outputs":[{"internalType":"address","name":"addr_","type":"address"}],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b506102ef806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063481286e61461003b5780634af63f021461006a575b600080fd5b61004e6100493660046101cc565b61007d565b6040516001600160a01b03909116815260200160405180910390f35b61004e610078366004610204565b610090565b60006100898284610115565b9392505050565b600061009e60008385610122565b9050806001600160a01b03163b6000036100db576040516301e3495560e61b81526001600160a01b03821660048201526024015b60405180910390fd5b6040516001600160a01b038216907ff40fcec21964ffb566044d083b4073f29f7f7929110ea19e1b3ebe375d89055e90600090a292915050565b60006100898383306101a2565b60008347101561014e5760405163392efb2b60e21b8152476004820152602481018590526044016100d2565b815160000361017057604051631328927760e21b815260040160405180910390fd5b8282516020840186f590506001600160a01b03811661008957604051633a0ba96160e11b815260040160405180910390fd5b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b600080604083850312156101df57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561021757600080fd5b823567ffffffffffffffff8082111561022f57600080fd5b818501915085601f83011261024357600080fd5b813581811115610255576102556101ee565b604051601f8201601f19908116603f0116810190838211818310171561027d5761027d6101ee565b8160405282815288602084870101111561029657600080fd5b82602086016020830137600060209382018401529896909101359650505050505056fea2646970667358221220a4f98720e260ac7efccc9b974672f0f0444b653cb7fb85a3bcb7c283e5f7e1c564736f6c63430008170033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063481286e61461003b5780634af63f021461006a575b600080fd5b61004e6100493660046101cc565b61007d565b6040516001600160a01b03909116815260200160405180910390f35b61004e610078366004610204565b610090565b60006100898284610115565b9392505050565b600061009e60008385610122565b9050806001600160a01b03163b6000036100db576040516301e3495560e61b81526001600160a01b03821660048201526024015b60405180910390fd5b6040516001600160a01b038216907ff40fcec21964ffb566044d083b4073f29f7f7929110ea19e1b3ebe375d89055e90600090a292915050565b60006100898383306101a2565b60008347101561014e5760405163392efb2b60e21b8152476004820152602481018590526044016100d2565b815160000361017057604051631328927760e21b815260040160405180910390fd5b8282516020840186f590506001600160a01b03811661008957604051633a0ba96160e11b815260040160405180910390fd5b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b600080604083850312156101df57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561021757600080fd5b823567ffffffffffffffff8082111561022f57600080fd5b818501915085601f83011261024357600080fd5b813581811115610255576102556101ee565b604051601f8201601f19908116603f0116810190838211818310171561027d5761027d6101ee565b8160405282815288602084870101111561029657600080fd5b82602086016020830137600060209382018401529896909101359650505050505056fea2646970667358221220a4f98720e260ac7efccc9b974672f0f0444b653cb7fb85a3bcb7c283e5f7e1c564736f6c63430008170033
Deployed Bytecode Sourcemap
112:1232:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1174:168;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;431:32:2;;;413:51;;401:2;386:18;1174:168:1;;;;;;;714:256;;;;;;:::i;:::-;;:::i;1174:168::-;1259:13;1291:44;1314:5;1321:13;1291:22;:44::i;:::-;1284:51;1174:168;-1:-1:-1;;;1174:168:1:o;714:256::-;787:13;820:35;835:1;838:5;845:9;820:14;:35::i;:::-;812:43;;869:5;-1:-1:-1;;;;;869:17:1;;890:1;869:22;865:68;;900:33;;-1:-1:-1;;;900:33:1;;-1:-1:-1;;;;;431:32:2;;900:33:1;;;413:51:2;386:18;;900:33:1;;;;;;;;865:68;948:15;;-1:-1:-1;;;;;948:15:1;;;;;;;;714:256;;;;:::o;2190:165:0:-;2273:7;2299:49;2314:4;2320:12;2342:4;2299:14;:49::i;1413:573::-;1500:12;1552:6;1528:21;:30;1524:125;;;1581:57;;-1:-1:-1;;;1581:57:0;;1608:21;1581:57;;;1785:25:2;1826:18;;;1819:34;;;1758:18;;1581:57:0;1611:248:2;1524:125:0;1662:8;:15;1681:1;1662:20;1658:80;;1705:22;;-1:-1:-1;;;1705:22:0;;;;;;;;;;;1658:80;1875:4;1864:8;1858:15;1851:4;1841:8;1837:19;1829:6;1821:59;1813:67;-1:-1:-1;;;;;;1903:18:0;;1899:81;;1944:25;;-1:-1:-1;;;1944:25:0;;;;;;;;;;;2598:1800;2723:12;2834:4;2828:11;4053:12;4046:4;4041:3;4037:14;4030:36;4102:4;4095;4090:3;4086:14;4079:28;4132:8;4127:3;4120:21;4225:4;4220:3;4216:14;4203:27;;4336:4;4329:5;4321:20;4379:2;4362:20;;;2598:1800;-1:-1:-1;;;;2598:1800:0:o;14:248:2:-;82:6;90;143:2;131:9;122:7;118:23;114:32;111:52;;;159:1;156;149:12;111:52;-1:-1:-1;;182:23:2;;;252:2;237:18;;;224:32;;-1:-1:-1;14:248:2:o;475:127::-;536:10;531:3;527:20;524:1;517:31;567:4;564:1;557:15;591:4;588:1;581:15;607:999;684:6;692;745:2;733:9;724:7;720:23;716:32;713:52;;;761:1;758;751:12;713:52;801:9;788:23;830:18;871:2;863:6;860:14;857:34;;;887:1;884;877:12;857:34;925:6;914:9;910:22;900:32;;970:7;963:4;959:2;955:13;951:27;941:55;;992:1;989;982:12;941:55;1028:2;1015:16;1050:2;1046;1043:10;1040:36;;;1056:18;;:::i;:::-;1131:2;1125:9;1099:2;1185:13;;-1:-1:-1;;1181:22:2;;;1205:2;1177:31;1173:40;1161:53;;;1229:18;;;1249:22;;;1226:46;1223:72;;;1275:18;;:::i;:::-;1315:10;1311:2;1304:22;1350:2;1342:6;1335:18;1392:7;1385:4;1380:2;1376;1372:11;1368:22;1365:35;1362:55;;;1413:1;1410;1403:12;1362:55;1473:2;1466:4;1462:2;1458:13;1451:4;1443:6;1439:17;1426:50;1520:1;1513:4;1496:15;;;1492:26;;1485:37;1496:15;1579:20;;;;1566:34;;-1:-1:-1;;;;;;607:999:2:o
Swarm Source
ipfs://a4f98720e260ac7efccc9b974672f0f0444b653cb7fb85a3bcb7c283e5f7e1c5
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.