Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x6f410881...0240a8593 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
CREATE3Factory
Compiler Version
v0.8.28+commit.7893614a
Contract Source Code (Solidity)
/**
*Submitted for verification at swellchainscan.io on 2025-04-07
*/
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.6.0 >=0.8.0 ^0.8.13;
// lib/solmate/src/utils/Bytes32AddressLib.sol
/// @notice Library for converting between addresses and bytes32 values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Bytes32AddressLib.sol)
library Bytes32AddressLib {
function fromLast20Bytes(bytes32 bytesValue) internal pure returns (address) {
return address(uint160(uint256(bytesValue)));
}
function fillLast12Bytes(address addressValue) internal pure returns (bytes32) {
return bytes32(bytes20(addressValue));
}
}
// src/ICREATE3Factory.sol
/// @title Factory for deploying contracts to deterministic addresses via CREATE3
/// @author zefram.eth
/// @notice Enables deploying contracts using CREATE3. Each deployer (msg.sender) has
/// its own namespace for deployed addresses.
interface ICREATE3Factory {
/// @notice Deploys a contract using CREATE3
/// @dev The provided salt is hashed together with msg.sender to generate the final salt
/// @param salt The deployer-specific salt for determining the deployed contract's address
/// @param creationCode The creation code of the contract to deploy
/// @return deployed The address of the deployed contract
function deploy(bytes32 salt, bytes memory creationCode)
external
payable
returns (address deployed);
/// @notice Predicts the address of a deployed contract
/// @dev The provided salt is hashed together with the deployer address to generate the final salt
/// @param deployer The deployer account that will call deploy()
/// @param salt The deployer-specific salt for determining the deployed contract's address
/// @return deployed The address of the contract that will be deployed
function getDeployed(address deployer, bytes32 salt)
external
view
returns (address deployed);
}
// lib/solmate/src/utils/CREATE3.sol
/// @notice Deploy to deterministic addresses without an initcode factor.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/CREATE3.sol)
/// @author Modified from 0xSequence (https://github.com/0xSequence/create3/blob/master/contracts/Create3.sol)
library CREATE3 {
using Bytes32AddressLib for bytes32;
//--------------------------------------------------------------------------------//
// Opcode | Opcode + Arguments | Description | Stack View //
//--------------------------------------------------------------------------------//
// 0x36 | 0x36 | CALLDATASIZE | size //
// 0x3d | 0x3d | RETURNDATASIZE | 0 size //
// 0x3d | 0x3d | RETURNDATASIZE | 0 0 size //
// 0x37 | 0x37 | CALLDATACOPY | //
// 0x36 | 0x36 | CALLDATASIZE | size //
// 0x3d | 0x3d | RETURNDATASIZE | 0 size //
// 0x34 | 0x34 | CALLVALUE | value 0 size //
// 0xf0 | 0xf0 | CREATE | newContract //
//--------------------------------------------------------------------------------//
// Opcode | Opcode + Arguments | Description | Stack View //
//--------------------------------------------------------------------------------//
// 0x67 | 0x67XXXXXXXXXXXXXXXX | PUSH8 bytecode | bytecode //
// 0x3d | 0x3d | RETURNDATASIZE | 0 bytecode //
// 0x52 | 0x52 | MSTORE | //
// 0x60 | 0x6008 | PUSH1 08 | 8 //
// 0x60 | 0x6018 | PUSH1 18 | 24 8 //
// 0xf3 | 0xf3 | RETURN | //
//--------------------------------------------------------------------------------//
bytes internal constant PROXY_BYTECODE = hex"67_36_3d_3d_37_36_3d_34_f0_3d_52_60_08_60_18_f3";
bytes32 internal constant PROXY_BYTECODE_HASH = keccak256(PROXY_BYTECODE);
function deploy(
bytes32 salt,
bytes memory creationCode,
uint256 value
) internal returns (address deployed) {
bytes memory proxyChildBytecode = PROXY_BYTECODE;
address proxy;
assembly {
// Deploy a new contract with our pre-made bytecode via CREATE2.
// We start 32 bytes into the code to avoid copying the byte length.
proxy := create2(0, add(proxyChildBytecode, 32), mload(proxyChildBytecode), salt)
}
require(proxy != address(0), "DEPLOYMENT_FAILED");
deployed = getDeployed(salt);
(bool success, ) = proxy.call{value: value}(creationCode);
require(success && deployed.code.length != 0, "INITIALIZATION_FAILED");
}
function getDeployed(bytes32 salt) internal view returns (address) {
address proxy = keccak256(
abi.encodePacked(
// Prefix:
bytes1(0xFF),
// Creator:
address(this),
// Salt:
salt,
// Bytecode hash:
PROXY_BYTECODE_HASH
)
).fromLast20Bytes();
return
keccak256(
abi.encodePacked(
// 0xd6 = 0xc0 (short RLP prefix) + 0x16 (length of: 0x94 ++ proxy ++ 0x01)
// 0x94 = 0x80 + 0x14 (0x14 = the length of an address, 20 bytes, in hex)
hex"d6_94",
proxy,
hex"01" // Nonce of the proxy contract (1)
)
).fromLast20Bytes();
}
}
// src/CREATE3Factory.sol
/// @title Factory for deploying contracts to deterministic addresses via CREATE3
/// @author zefram.eth
/// @notice Enables deploying contracts using CREATE3. Each deployer (msg.sender) has
/// its own namespace for deployed addresses.
contract CREATE3Factory is ICREATE3Factory {
///
function deploy(bytes32 salt, bytes memory creationCode)
external
payable
override
returns (address deployed)
{
// hash salt with the deployer address to give each deployer its own namespace
salt = keccak256(abi.encodePacked(msg.sender, salt));
return CREATE3.deploy(salt, creationCode, msg.value);
}
///
function getDeployed(address deployer, bytes32 salt)
external
view
override
returns (address deployed)
{
// hash salt with the deployer address to give each deployer its own namespace
salt = keccak256(abi.encodePacked(deployer, salt));
return CREATE3.getDeployed(salt);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"creationCode","type":"bytes"}],"name":"deploy","outputs":[{"internalType":"address","name":"deployed","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"deployer","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"getDeployed","outputs":[{"internalType":"address","name":"deployed","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x6080604052348015600e575f5ffd5b506104868061001c5f395ff3fe608060405260043610610028575f3560e01c806350f1c4641461002c578063cdcb760a14610067575b5f5ffd5b348015610037575f5ffd5b5061004b61004636600461031a565b61007a565b6040516001600160a01b03909116815260200160405180910390f35b61004b610075366004610363565b6100b6565b5f828260405160200161008e92919061041d565b6040516020818303038152906040528051906020012091506100af826100ed565b9392505050565b5f33836040516020016100ca92919061041d565b6040516020818303038152906040528051906020012092506100af8383346101c6565b604080518082018252601081526f67363d3d37363d34f03d5260086018f360801b60209182015290516001600160f81b0319918101919091526001600160601b03193060601b166021820152603581018290527f21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f60558201525f90819061018b906075015b6040516020818303038152906040528051906020012090565b6040516135a560f21b60208201526001600160601b0319606083901b166022820152600160f81b60368201529091506100af90603701610172565b5f5f6040518060400160405280601081526020016f67363d3d37363d34f03d5260086018f360801b81525090505f858251602084015ff590506001600160a01b03811661024e5760405162461bcd60e51b81526020600482015260116024820152701111541313d65351539517d19052531151607a1b60448201526064015b60405180910390fd5b610257866100ed565b92505f816001600160a01b03168587604051610273919061043a565b5f6040518083038185875af1925050503d805f81146102ad576040519150601f19603f3d011682016040523d82523d5f602084013e6102b2565b606091505b505090508080156102cc57506001600160a01b0384163b15155b6103105760405162461bcd60e51b815260206004820152601560248201527412539255125053125690551253d397d19052531151605a1b6044820152606401610245565b5050509392505050565b5f5f6040838503121561032b575f5ffd5b82356001600160a01b0381168114610341575f5ffd5b946020939093013593505050565b634e487b7160e01b5f52604160045260245ffd5b5f5f60408385031215610374575f5ffd5b8235915060208301356001600160401b03811115610390575f5ffd5b8301601f810185136103a0575f5ffd5b80356001600160401b038111156103b9576103b961034f565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e7576103e761034f565b6040528181528282016020018710156103fe575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b60609290921b6001600160601b0319168252601482015260340190565b5f82518060208501845e5f92019182525091905056fea2646970667358221220a04a14bbd6904be4b70dbda041687f4baef3dac6674bb305dccbe94336f2c46464736f6c634300081c0033
Deployed Bytecode
0x608060405260043610610028575f3560e01c806350f1c4641461002c578063cdcb760a14610067575b5f5ffd5b348015610037575f5ffd5b5061004b61004636600461031a565b61007a565b6040516001600160a01b03909116815260200160405180910390f35b61004b610075366004610363565b6100b6565b5f828260405160200161008e92919061041d565b6040516020818303038152906040528051906020012091506100af826100ed565b9392505050565b5f33836040516020016100ca92919061041d565b6040516020818303038152906040528051906020012092506100af8383346101c6565b604080518082018252601081526f67363d3d37363d34f03d5260086018f360801b60209182015290516001600160f81b0319918101919091526001600160601b03193060601b166021820152603581018290527f21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f60558201525f90819061018b906075015b6040516020818303038152906040528051906020012090565b6040516135a560f21b60208201526001600160601b0319606083901b166022820152600160f81b60368201529091506100af90603701610172565b5f5f6040518060400160405280601081526020016f67363d3d37363d34f03d5260086018f360801b81525090505f858251602084015ff590506001600160a01b03811661024e5760405162461bcd60e51b81526020600482015260116024820152701111541313d65351539517d19052531151607a1b60448201526064015b60405180910390fd5b610257866100ed565b92505f816001600160a01b03168587604051610273919061043a565b5f6040518083038185875af1925050503d805f81146102ad576040519150601f19603f3d011682016040523d82523d5f602084013e6102b2565b606091505b505090508080156102cc57506001600160a01b0384163b15155b6103105760405162461bcd60e51b815260206004820152601560248201527412539255125053125690551253d397d19052531151605a1b6044820152606401610245565b5050509392505050565b5f5f6040838503121561032b575f5ffd5b82356001600160a01b0381168114610341575f5ffd5b946020939093013593505050565b634e487b7160e01b5f52604160045260245ffd5b5f5f60408385031215610374575f5ffd5b8235915060208301356001600160401b03811115610390575f5ffd5b8301601f810185136103a0575f5ffd5b80356001600160401b038111156103b9576103b961034f565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e7576103e761034f565b6040528181528282016020018710156103fe575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b60609290921b6001600160601b0319168252601482015260340190565b5f82518060208501845e5f92019182525091905056fea2646970667358221220a04a14bbd6904be4b70dbda041687f4baef3dac6674bb305dccbe94336f2c46464736f6c634300081c0033
Deployed Bytecode Sourcemap
6385:798:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;6836:344;;;;;;;;;;-1:-1:-1;6836:344:0;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;589:32:1;;;571:51;;559:2;544:18;6836:344:0;;;;;;;6445:373;;;;;;:::i;:::-;;:::i;6836:344::-;6957:16;7113:8;7123:4;7096:32;;;;;;;;;:::i;:::-;;;;;;;;;;;;;7086:43;;;;;;7079:50;;7147:25;7167:4;7147:19;:25::i;:::-;7140:32;6836:344;-1:-1:-1;;;6836:344:0:o;6445:373::-;6573:16;6729:10;6741:4;6712:34;;;;;;;;;:::i;:::-;;;;;;;;;;;;;6702:45;;;;;;6695:52;;6765:45;6780:4;6786:12;6800:9;6765:14;:45::i;5233:875::-;4430:14;;;;;;;;;;;-1:-1:-1;;;4430:14:0;;;;;5351:273;;-1:-1:-1;;;;;;5351:273:0;;;2330:39:1;;;;-1:-1:-1;;;;;;5482:4:0;2431:2:1;2402:15;2398:45;2385:11;;;2378:66;2460:12;;;2453:28;;;4420:25:0;2497:12:1;;;2490:28;-1:-1:-1;;;;5327:326:0;;2534:12:1;;5351:273:0;;;;;;;;;;;;;5327:308;;;;;;466:10;347:140;5327:326;5714:353;;-1:-1:-1;;;5714:353:0;;;2888:28:1;-1:-1:-1;;;;;;2978:2:1;2949:15;;;2945:45;2932:11;;;2925:66;-1:-1:-1;;;3007:12:1;;;3000:33;5311:342:0;;-1:-1:-1;5686:414:0;;3049:12:1;;5714:353:0;2557:510:1;4454:771:0;4578:16;4607:31;4641:14;;;;;;;;;;;;;-1:-1:-1;;;4641:14:0;;;4607:48;;4668:13;4952:4;4931:18;4925:25;4920:2;4900:18;4896:27;4893:1;4885:72;4876:81;-1:-1:-1;;;;;;4986:19:0;;4978:49;;;;-1:-1:-1;;;4978:49:0;;3274:2:1;4978:49:0;;;3256:21:1;3313:2;3293:18;;;3286:30;-1:-1:-1;;;3332:18:1;;;3325:47;3389:18;;4978:49:0;;;;;;;;;5051:17;5063:4;5051:11;:17::i;:::-;5040:28;;5080:12;5098:5;-1:-1:-1;;;;;5098:10:0;5116:5;5123:12;5098:38;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5079:57;;;5155:7;:36;;;;-1:-1:-1;;;;;;5166:20:0;;;:25;;5155:36;5147:70;;;;-1:-1:-1;;;5147:70:0;;3926:2:1;5147:70:0;;;3908:21:1;3965:2;3945:18;;;3938:30;-1:-1:-1;;;3984:18:1;;;3977:51;4045:18;;5147:70:0;3724:345:1;5147:70:0;4596:629;;;4454:771;;;;;:::o;14:406:1:-;82:6;90;143:2;131:9;122:7;118:23;114:32;111:52;;;159:1;156;149:12;111:52;185:23;;-1:-1:-1;;;;;237:31:1;;227:42;;217:70;;283:1;280;273:12;217:70;306:5;384:2;369:18;;;;356:32;;-1:-1:-1;;;14:406:1:o;633:127::-;694:10;689:3;685:20;682:1;675:31;725:4;722:1;715:15;749:4;746:1;739:15;765:1058;842:6;850;903:2;891:9;882:7;878:23;874:32;871:52;;;919:1;916;909:12;871:52;964:23;;;-1:-1:-1;1062:2:1;1047:18;;1034:32;-1:-1:-1;;;;;1078:30:1;;1075:50;;;1121:1;1118;1111:12;1075:50;1144:22;;1197:4;1189:13;;1185:27;-1:-1:-1;1175:55:1;;1226:1;1223;1216:12;1175:55;1266:2;1253:16;-1:-1:-1;;;;;1284:6:1;1281:30;1278:56;;;1314:18;;:::i;:::-;1363:2;1357:9;1455:2;1417:17;;-1:-1:-1;;1413:31:1;;;1446:2;1409:40;1405:54;1393:67;;-1:-1:-1;;;;;1475:34:1;;1511:22;;;1472:62;1469:88;;;1537:18;;:::i;:::-;1573:2;1566:22;1597;;;1638:15;;;1655:2;1634:24;1631:37;-1:-1:-1;1628:57:1;;;1681:1;1678;1671:12;1628:57;1737:6;1732:2;1728;1724:11;1719:2;1711:6;1707:15;1694:50;1790:1;1785:2;1776:6;1768;1764:19;1760:28;1753:39;1811:6;1801:16;;;;;765:1058;;;;;:::o;1828:286::-;2030:2;2001:15;;;;-1:-1:-1;;;;;;1997:45:1;1985:58;;2068:2;2059:12;;2052:28;2105:2;2096:12;;1828:286::o;3418:301::-;3547:3;3585:6;3579:13;3631:6;3624:4;3616:6;3612:17;3607:3;3601:37;3693:1;3657:16;;3682:13;;;-1:-1:-1;3657:16:1;3418:301;-1:-1:-1;3418:301:1:o
Swarm Source
ipfs://a04a14bbd6904be4b70dbda041687f4baef3dac6674bb305dccbe94336f2c464
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.