Forkchoice Ethereum Mainnet

Address Contract Verified

Address 0x78DB1f2Dbd1e6Fb746F8B57CB3407368D0246037
Balance 0 ETH
Nonce 149
Code Size 1463 bytes
Indexed Transactions 0 (149 on-chain, 1.3% indexed)
External Etherscan · Sourcify

Contract Bytecode

1463 bytes
0x6080604052600436101561001257600080fd5b6000803560e01c9081632e4d44cb1461006a57508063715018a6146100655780637fde56da146100605780638da5cb5b1461005b5763f2fde38b1461005657600080fd5b61019f565b610176565b610146565b6100e6565b346100e35760403660031901126100e35760243567ffffffffffffffff918282116100e357366023830112156100e35781600401359283116100e35736602484840101116100e3576100df6100c58460248501600435610230565b6040516001600160a01b0390911681529081906020820190565b0390f35b80fd5b34610141576000806003193601126100e3576101006103aa565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b600080fd5b34610141576020366003190112610141576020610164600435610449565b6040516001600160a01b039091168152f35b34610141576000366003190112610141576000546040516001600160a01b039091168152602090f35b34610141576020366003190112610141576004356001600160a01b038116808203610141576101cc6103aa565b156101dc576101da90610402565b005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b916102396103aa565b6102428161038e565b90610250604051928361036c565b808252602082019236828201116101415781600092602092863783010152610276610514565b9261028081610449565b93843b610323576020815191016000f56001600160a01b038116156103115760009283809351925af16102b1610551565b50158015610308575b6102f6576040516001600160a01b03821681527fdbc06f215b86124d4866a1c48173e58111bc1a46538b8ac1b0cee8ec5fb2888890602090a190565b6040516353de54b960e01b8152600490fd5b50803b156102ba565b60405163bbd2fe8760e01b8152600490fd5b60405163cd43efa160e01b8152600490fd5b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761036757604052565b610335565b90601f8019910116810190811067ffffffffffffffff82111761036757604052565b67ffffffffffffffff811161036757601f01601f191660200190565b6000546001600160a01b031633036103be57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3565b60405190602082019060ff60f81b82523060601b602184015260358301527f21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f605583015260558252608082019180831067ffffffffffffffff84111761036757826105059261051194604052825190209160a08101926135a560f21b84526bffffffffffffffffffffffff199060601b1660a282015260b6600160f81b910152601781526104f68161034b565b5190206001600160a01b031690565b6001600160a01b031690565b90565b604051906040820182811067ffffffffffffffff82111761036757604052601082526f67363d3d37363d34f03d5260086018f360801b6020830152565b3d1561057c573d906105628261038e565b91610570604051938461036c565b82523d6000602084013e565b60609056fea2646970667358221220f3d0afcd2e982779ddc4f99ed387675ad888269bf3c5f22da4f8a15d8ddfe37764736f6c63430008180033

Verified Source Code Full Match

Compiler: v0.8.24+commit.e11b9ed9 EVM: paris Optimization: Yes (200 runs)
Create3Factory.sol 46 lines
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;

import "./libraries/LibCreate3.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
 * @title Create3Factory
 * @notice Deploys contracts deterministically using CREATE3, ensuring deterministic addresses and secure deployment.
 */
contract Create3Factory is Ownable {
    /**
     * @notice Emitted after deploying a contract using CREATE3.
     */
    event Create3Contract(address contractAddress);

    /**
     * @notice Constructor that sets the initial owner.
     * @param _owner The address to be assigned as the contract’s owner.
     */
    constructor(address _owner) {
        _transferOwnership(_owner);
    }

    /**
     * @notice Builds (deploys) a new contract using CREATE3 with a given salt and contract bytecode.
     * @dev Only the contract owner can invoke this. Uses the LibCreate3 library for the deterministic address.
     * @param _create3Salt The salt used to derive the deterministic address.
     * @param _contractBytecode The bytecode of the contract to deploy.
     * @return result The address of the deployed contract.
     */
    function build(bytes32 _create3Salt, bytes calldata _contractBytecode) external onlyOwner returns (address result) {
        result = LibCreate3.create3(_create3Salt, _contractBytecode);
        emit Create3Contract(result);
    }

    /**
     * @notice Computes the CREATE3-based deterministic address for a given salt, without deploying.
     * @param _create3Salt The salt used for CREATE3 derivation.
     * @return The predicted address of the contract once deployed.
     */
    function computeAddress(bytes32 _create3Salt) public view returns (address) {
        return LibCreate3.addressOf(_create3Salt);
    }
}
LibCreate3.sol 121 lines
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;

/**
  @title A library for deploying contracts EIP-3171 style.
  @author Agustin Aguilar <[email protected]>
*/
library LibCreate3 {
    error ErrorCreatingProxy();
    error ErrorCreatingContract();
    error TargetAlreadyExists();

    /**
    @notice The bytecode for a contract that proxies the creation of another contract
    @dev If this code is deployed using CREATE2 it can be used to decouple `creationCode` from the child contract address

  0x67363d3d37363d34f03d5260086018f3:
      0x00  0x67  0x67XXXXXXXXXXXXXXXX  PUSH8 bytecode  0x363d3d37363d34f0
      0x01  0x3d  0x3d                  RETURNDATASIZE  0 0x363d3d37363d34f0
      0x02  0x52  0x52                  MSTORE
      0x03  0x60  0x6008                PUSH1 08        8
      0x04  0x60  0x6018                PUSH1 18        24 8
      0x05  0xf3  0xf3                  RETURN

  0x363d3d37363d34f0:
      0x00  0x36  0x36                  CALLDATASIZE    cds
      0x01  0x3d  0x3d                  RETURNDATASIZE  0 cds
      0x02  0x3d  0x3d                  RETURNDATASIZE  0 0 cds
      0x03  0x37  0x37                  CALLDATACOPY
      0x04  0x36  0x36                  CALLDATASIZE    cds
      0x05  0x3d  0x3d                  RETURNDATASIZE  0 cds
      0x06  0x34  0x34                  CALLVALUE       val 0 cds
      0x07  0xf0  0xf0                  CREATE          addr
  */

    bytes internal constant PROXY_CHILD_BYTECODE = hex"67_36_3d_3d_37_36_3d_34_f0_3d_52_60_08_60_18_f3";

    //                        KECCAK256_PROXY_CHILD_BYTECODE = keccak256(PROXY_CHILD_BYTECODE);
    bytes32 internal constant KECCAK256_PROXY_CHILD_BYTECODE = 0x21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f;

    /**
    @notice Returns the size of the code on a given address
    @param _addr Address that may or may not contain code
    @return size of the code on the given `_addr`
  */
    function codeSize(address _addr) internal view returns (uint256 size) {
        assembly { size := extcodesize(_addr) }
    }

    /**
    @notice Creates a new contract with given `_creationCode` and `_salt`
    @param _salt Salt of the contract creation, resulting address will be derivated from this value only
    @param _creationCode Creation code (constructor) of the contract to be deployed, this value doesn't affect the resulting address
    @return addr of the deployed contract, reverts on error
  */
    function create3(bytes32 _salt, bytes memory _creationCode) internal returns (address addr) {
        return create3(_salt, _creationCode, 0);
    }

    /**
    @notice Creates a new contract with given `_creationCode` and `_salt`
    @param _salt Salt of the contract creation, resulting address will be derivated from this value only
    @param _creationCode Creation code (constructor) of the contract to be deployed, this value doesn't affect the resulting address
    @param _value In WEI of ETH to be forwarded to child contract
    @return addr of the deployed contract, reverts on error
  */
    function create3(bytes32 _salt, bytes memory _creationCode, uint256 _value) internal returns (address addr) {
        // Creation code
        bytes memory creationCode = PROXY_CHILD_BYTECODE;

        // Get target final address
        addr = addressOf(_salt);
        if (codeSize(addr) != 0) revert TargetAlreadyExists();

        // Create CREATE2 proxy
        address proxy; assembly { proxy := create2(0, add(creationCode, 32), mload(creationCode), _salt)}
        if (proxy == address(0)) revert ErrorCreatingProxy();

        // Call proxy with final init code
        (bool success,) = proxy.call{ value: _value }(_creationCode);
        if (!success || codeSize(addr) == 0) revert ErrorCreatingContract();
    }

    /**
    @notice Computes the resulting address of a contract deployed using address(this) and the given `_salt`
    @param _salt Salt of the contract creation, resulting address will be derivated from this value only
    @return addr of the deployed contract, reverts on error

    @dev The address creation formula is: keccak256(rlp([keccak256(0xff ++ address(this) ++ _salt ++ keccak256(childBytecode))[12:], 0x01]))
  */
    function addressOf(bytes32 _salt) internal view returns (address) {
        address proxy = address(
            uint160(
                uint256(
                    keccak256(
                        abi.encodePacked(
                            hex'ff',
                            address(this),
                            _salt,
                            KECCAK256_PROXY_CHILD_BYTECODE
                        )
                    )
                )
            )
        );

        return address(
            uint160(
                uint256(
                    keccak256(
                        abi.encodePacked(
                            hex"d6_94",
                            proxy,
                            hex"01"
                        )
                    )
                )
            )
        );
    }
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions 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 {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

Read Contract

computeAddress 0x7fde56da → address
owner 0x8da5cb5b → address

Write Contract 3 functions

These functions modify contract state and require a wallet transaction to execute.

build 0x2e4d44cb
bytes32 _create3Salt
bytes _contractBytecode
returns: address
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

This address has 149 on-chain transactions, but only 1.3% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →