OP Sepolia Testnet

Contract

0x1b8a151e64bC07dE0AcF967a0cB17Ee16c3c8E2D
Source Code Source Code

Overview

ETH Balance

0 ETH

More Info

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Amount
Deploy Proxy256050672025-03-26 18:11:14295 days ago1743012674IN
0x1b8a151e...16c3c8E2D
0 ETH0.0000013841630.00150027
Deploy Proxy256050582025-03-26 18:10:56295 days ago1743012656IN
0x1b8a151e...16c3c8E2D
0 ETH0.0000003971390.00150028
Deploy Proxy256050472025-03-26 18:10:34295 days ago1743012634IN
0x1b8a151e...16c3c8E2D
0 ETH0.0000014034830.00150028
Deploy Proxy256050312025-03-26 18:10:02295 days ago1743012602IN
0x1b8a151e...16c3c8E2D
0 ETH0.0000011279190.00150028

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Amount
383890572026-01-16 16:24:141 hr ago1768580654
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383890492026-01-16 16:23:581 hr ago1768580638
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383890442026-01-16 16:23:481 hr ago1768580628
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383890342026-01-16 16:23:281 hr ago1768580608
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383889052026-01-16 16:19:101 hr ago1768580350
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383888972026-01-16 16:18:541 hr ago1768580334
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383888892026-01-16 16:18:381 hr ago1768580318
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383888792026-01-16 16:18:181 hr ago1768580298
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383853572026-01-16 14:20:543 hrs ago1768573254
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383853502026-01-16 14:20:403 hrs ago1768573240
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383853422026-01-16 14:20:243 hrs ago1768573224
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383853372026-01-16 14:20:143 hrs ago1768573214
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383852692026-01-16 14:17:583 hrs ago1768573078
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383852612026-01-16 14:17:423 hrs ago1768573062
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383852542026-01-16 14:17:283 hrs ago1768573048
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383852482026-01-16 14:17:163 hrs ago1768573036
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383819292026-01-16 12:26:385 hrs ago1768566398
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383819212026-01-16 12:26:225 hrs ago1768566382
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383819132026-01-16 12:26:065 hrs ago1768566366
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383819082026-01-16 12:25:565 hrs ago1768566356
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383818282026-01-16 12:23:165 hrs ago1768566196
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383818212026-01-16 12:23:025 hrs ago1768566182
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383818132026-01-16 12:22:465 hrs ago1768566166
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383818052026-01-16 12:22:305 hrs ago1768566150
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
383781362026-01-16 10:20:127 hrs ago1768558812
0x1b8a151e...16c3c8E2D
 Contract Creation0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ContractCloneFactory

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion, GNU GPLv3 license

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;

import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {ExecutionUtils} from "../../../utils/ExecutionUtils.sol";
import {BaseProxyDeployer} from "./BaseProxyDeployer.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
 * deploying minimal proxy contracts, also known as "clones".
 * A minimal proxy needs to do:
 * 1. calldatacopy into memory
 * 2. delegatecall into an implementation contract
 * 3. returndatacopy into memory
 * 4, return data to the caller or revert
 * The exact runtime code of the standard clone contract is this:
 * 363d3d373d3d3d363d73bebebebebebebebebebebebebebebebebebebebe5af43d82803e903d91602b57fd5bf3
 * wherein the bytes at indices 10 - 29 (inclusive) are replaced with the 20 byte address of the master functionality/implementation contract.
 * The creation code, which includes the runtime code, is this:
 * 3d602d80600a3d3981f3363d3d373d3d3d363d73bebebebebebebebebebebebebebebebebebebebe5af43d82803e903d91602b57fd5bf3
 * 3d602d80600a3d3981f3 copies the runtime into memory.
 * A reference implementation of this can be found at the optionality/clone-factory github repo.
 */
contract ContractCloneFactory is BaseProxyDeployer {

    /**
     * @dev Salted deterministic deployment of minimal proxy contracts that mimics the behavior of implementation.
     *      Using the same implementation, salt, msgSender() multiple time will not deploy a new clone.
     * @param _implementation contract to be cloned
     * @param _initializingData calldata of the deployed contract's initializer function
     * @param _salt extra salt that's used to deterministically deploy the clone
     */
    function _deployProxy(address _implementation, bytes memory _initializingData, bytes32 _salt)
    internal override returns (address deployedContract) {
        deployedContract = Clones.cloneDeterministic(_implementation, _salt);
        if (_initializingData.length > 0) {
            ExecutionUtils.callAndRevert(deployedContract, 0, _initializingData);
        }
    }

    /**
     * @dev Pre-compute the counterfactual address prior to deployment of minimal proxy contracts that mimics the behavior of implementation.
     * @param _implementation contract to be cloned
     * @param _initializingData calldata of the deployed contract's initializer function
     * @param _salt extra salt that's used to deterministically deploy the clone
     */
    function _getProxyAddress(address _implementation, bytes memory _initializingData, bytes32 _salt)
    internal override view returns (address calculatedContract) {
        (_initializingData);
        calculatedContract = Clones.predictDeterministicAddress(_implementation, _salt, address(this));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822Proxiable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 3 of 17 : IERC1967.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 *
 * _Available since v4.8.3._
 */
interface IERC1967 {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

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
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol)

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) {
        /// @solidity memory-safe-assembly
        assembly {
            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
            // of the `implementation` address with the bytecode before the address.
            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
            instance := create(0, 0x09, 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) {
        /// @solidity memory-safe-assembly
        assembly {
            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
            // of the `implementation` address with the bytecode before the address.
            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
            instance := create2(0, 0x09, 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) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(add(ptr, 0x38), deployer)
            mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
            mstore(add(ptr, 0x14), implementation)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
            mstore(add(ptr, 0x58), salt)
            mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
            predicted := keccak256(add(ptr, 0x43), 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
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)

pragma solidity ^0.8.0;

import "../Proxy.sol";
import "./ERC1967Upgrade.sol";

/**
 * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
 * implementation address that can be changed. This address is stored in storage in the location specified by
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
 * implementation behind the proxy.
 */
contract ERC1967Proxy is Proxy, ERC1967Upgrade {
    /**
     * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.
     *
     * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded
     * function call, and allows initializing the storage of the proxy like a Solidity constructor.
     */
    constructor(address _logic, bytes memory _data) payable {
        _upgradeToAndCall(_logic, _data, false);
    }

    /**
     * @dev Returns the current implementation address.
     */
    function _implementation() internal view virtual override returns (address impl) {
        return ERC1967Upgrade._getImplementation();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeacon.sol";
import "../../interfaces/IERC1967.sol";
import "../../interfaces/draft-IERC1822.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._
 */
abstract contract ERC1967Upgrade is IERC1967 {
    // 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 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 _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @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 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 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
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)

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 internal 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 overridden 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 internal 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 overridden should call `super._beforeFallback()`.
     */
    function _beforeFallback() internal virtual {}
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// 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;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Create2.sol)

pragma solidity ^0.8.0;

/**
 * @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 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) {
        require(address(this).balance >= amount, "Create2: insufficient balance");
        require(bytecode.length != 0, "Create2: bytecode length is zero");
        /// @solidity memory-safe-assembly
        assembly {
            addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
        }
        require(addr != address(0), "Create2: Failed on deploy");
    }

    /**
     * @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)
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

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:
 * ```solidity
 * 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`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;

import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
import {Context} from "@openzeppelin/contracts/utils/Context.sol";

/**
* @dev Bytecode contract deployer that takes creation bytecode and salt as input, then deploys (or calculates the address of) the contract via create2 opcode.
*      To alleviate the front-running, please mix the owner information (if any) into the salt. Meanwhile, this contract also mixes the provided salt with _msgSender().
*/
contract ContractBytecodeDeployer is Context {

    event ContractDeployed(address indexed addr, bytes32 salt);

    /**
     * @dev Salted deterministic deployment using create2.
     * @param _creationCode initCode, runtimeCode and constructor parameters of the contract to be deployed,
     *        abi.encodePacked(type(Contract).creationCode,abi.encode(ConstructorArgs..))
     *        e.g. abi.encodePacked(type(ContractWithParameters).creationCode, abi.encode(addr)) (ContractWithParameters)
     * @param _salt extra salt that's used to create the new contract at a deterministic address, e.g. 0x0
     */
    function deploy(bytes calldata _creationCode, bytes32 _salt) public returns (address deployedContract) {
        (address addr, bytes32 mixedSalt) = getAddress(_creationCode, _salt);
        if (addr.code.length > 0) {
            return addr;
        }
        deployedContract = Create2.deploy(0, mixedSalt, _creationCode);
        emit ContractDeployed(deployedContract, mixedSalt);
    }

    /**
     * @dev Pre-compute the counterfactual address prior to deployment.
     * @param _creationCode initCode, runtimeCode and constructor parameters of the contract to be deployed,
     *        abi.encodePacked(type(Contract).creationCode,abi.encode(ConstructorArgs..))
     *        e.g. abi.encodePacked(type(ContractWithParameters).creationCode, abi.encode(addr)) (ContractWithParameters)
     * @param _salt extra salt that's used to create the new contract at a deterministic address, e.g. 0x0
     */
    function getAddress(bytes calldata _creationCode, bytes32 _salt) public view returns (address calculatedContract, bytes32 mixedSalt) {
        mixedSalt = getMixedSalt(_salt);
        // |                   | ↓ 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) |            ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |
        // call computeAddress(salt, bytecodeHash, address(this))
        calculatedContract = Create2.computeAddress(mixedSalt, keccak256(_creationCode), address(this));
    }

    /**
     * @dev Helper method to get mixed salt that alleviates the front-running.
     * @param _salt extra salt that's used to create the new contract at a deterministic address, e.g. 0x0
     */
    function getMixedSalt(bytes32 _salt) public view returns (bytes32) {
        return keccak256(abi.encodePacked(_salt, _msgSender()));
    }
}

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;

import {Context} from "@openzeppelin/contracts/utils/Context.sol";
import {IProxyDeployer} from "../interfaces/IProxyDeployer.sol";

abstract contract BaseProxyDeployer is IProxyDeployer, Context {

    /**
     * @dev Salted deterministic deployment of proxy contracts.
     *      Using the same implementation, salt, msgSender() multiple time will not deploy a new clone.
     * @param _implementation contract to be cloned
     * @param _initializingData calldata of the deployed contract's initializer function
     * @param _salt extra salt that's used to deterministically deploy the clone
     */
    function deployProxy(address _implementation, bytes memory _initializingData, bytes32 _salt)
    public override returns (address deployedContract) {
        if (_implementation.code.length == 0) {
            revert InvalidImplementation(_implementation);
        }
        (address addr, bytes32 mixedSalt) = getProxyAddress(_implementation, _initializingData, _salt);
        if (addr.code.length > 0) {
            return addr;
        }
        deployedContract = _deployProxy(_implementation, _initializingData, mixedSalt);
        emit ProxyDeployed(_implementation, deployedContract, mixedSalt);
    }

    /**
     * @dev Pre-compute the counterfactual address prior to deployment of proxy contracts.
     * @param _implementation contract to be cloned
     * @param _initializingData calldata of the deployed contract's initializer function
     * @param _salt extra salt that's used to deterministically deploy the clone
     */
    function getProxyAddress(address _implementation, bytes memory _initializingData, bytes32 _salt)
    public override view returns (address calculatedContract, bytes32 mixedSalt) {
        mixedSalt = getMixedSalt(_initializingData, _salt);
        calculatedContract = _getProxyAddress(_implementation, _initializingData, mixedSalt);
    }

    /**
     * @dev Helper method to get mixed salt that alleviates the front-running.
     * @param _initializingData calldata of the deployed contract's initializer function
     * @param _salt extra salt that's used to create the new contract at a deterministic address, e.g. 0x0
     */
    function getMixedSalt(bytes memory _initializingData, bytes32 _salt) public view returns (bytes32) {
        return keccak256(abi.encodePacked(keccak256(_initializingData), _salt, _msgSender()));
    }

    function _deployProxy(address _implementation, bytes memory _initializingData, bytes32 _salt)
    internal virtual returns (address deployedContract);

    function _getProxyAddress(address _implementation, bytes memory _initializingData, bytes32 _salt)
    internal virtual view returns (address calculatedContract);
}

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;

import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
import {BaseProxyDeployer} from "./BaseProxyDeployer.sol";
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

/**
* @dev Vanilla ERC1967 contract factory that creates ERC1967Proxy from implementation and initializing data, e.g. UUPS contracts.
* ERC1967Proxy contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
* implementation address that can be changed. This address is stored in storage in the location specified by
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
* implementation behind the proxy.
* Although Transparent proxy, UUPS, Beacon and others usually incorporate EIP-1967 storage pattern, this factory
* does not support TransparentUpgradeableProxy and BeaconProxy for the time being because they need to initialize
* additional storage slots such as admin or beacon.
*/
contract ERC1967ProxyFactory is BaseProxyDeployer {

    /**
     * @dev Salted deterministic deployment of ERC1967 proxy contracts.
     * @param _implementation logic contract
     * @param _initializingData calldata of the deployed contract's initializer function
     * @param _salt extra salt that's used to deterministically deploy the proxy
     */
    function _deployProxy(address _implementation, bytes memory _initializingData, bytes32 _salt)
    internal override returns (address deployedContract) {
        // The new keyword and constructor would do the following:
        // 1. _implementation is checked in the constructor
        // 2. Perform implementation upgrade by storing a new address in the EIP1967 implementation slot
        // 3. Perform a delegate call if _initializingData.length > 0
        deployedContract = address((payable(new ERC1967Proxy{salt : _salt}(
                _implementation,
                _initializingData))));
    }

    /**
     * @dev Pre-compute the counterfactual address prior to deployment of ERC1967 proxy contracts.
     * @param _implementation logic contract
     * @param _initializingData calldata of the deployed contract's initializer function
     * @param _salt extra salt that's used to deterministically deploy the proxy
     */
    function _getProxyAddress(address _implementation, bytes memory _initializingData, bytes32 _salt)
    internal override view returns (address calculatedContract) {
        calculatedContract = Create2.computeAddress(_salt,
            keccak256(abi.encodePacked(
                type(ERC1967Proxy).creationCode,
                abi.encode(_implementation, _initializingData))),
            address(this));
    }
}

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;

interface IProxyDeployer {

    event ProxyDeployed(address indexed implementation, address proxy, bytes32 salt);

    error InvalidImplementation(address implementation);

    /**
     * @dev Salted deterministic deployment of proxy contracts.
     *      Using the same implementation, salt, msgSender() multiple time will not deploy a new clone.
     * @param _implementation contract to be cloned
     * @param _initializingData calldata of the deployed contract's initializer function
     * @param _salt extra salt that's used to deterministically deploy the clone
     */
    function deployProxy(address _implementation, bytes memory _initializingData, bytes32 _salt)
    external returns (address deployedContract);

    /**
     * @dev Pre-compute the counterfactual address prior to deployment of proxy contracts.
     * @param _implementation contract to be cloned
     * @param _initializingData calldata of the deployed contract's initializer function
     * @param _salt extra salt that's used to deterministically deploy the clone
     */
    function getProxyAddress(address _implementation, bytes memory _initializingData, bytes32 _salt)
    external view returns (address calculatedContract, bytes32 mixedSalt);
}

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;

// solhint-disable no-inline-assembly

/**
 * Utility functions helpful when making different kinds of contract calls in Solidity.
 * For inline assembly, please refer to https://docs.soliditylang.org/en/latest/assembly.html
 * For opcodes, please refer to https://ethereum.org/en/developers/docs/evm/opcodes/ and https://www.evm.codes/
 */
library ExecutionUtils {

    function call(address to,
        uint256 value,
        bytes memory data
    ) internal returns (bool success, bytes memory returnData) {
        assembly {
            success := call(gas(), to, value, add(data, 0x20), mload(data), 0, 0)
            let len := returndatasize()
            let ptr := mload(0x40)
            mstore(0x40, add(ptr, add(len, 0x20)))
            mstore(ptr, len)
            returndatacopy(add(ptr, 0x20), 0, len)
            returnData := ptr
        }
    }

    function revertWithData(bytes memory returnData) internal pure {
        assembly {
            revert(add(returnData, 32), mload(returnData))
        }
    }

    function callAndRevert(address to,
        uint256 value,
        bytes memory data) internal {
        (bool success, bytes memory returnData) = call(to, value, data);
        if (!success) {
            revertWithData(returnData);
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "remappings": [
    "@account-abstraction/=lib/account-abstraction/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/",
    "account-abstraction/=lib/account-abstraction/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/"
  ]
}

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"InvalidImplementation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"address","name":"proxy","type":"address"},{"indexed":false,"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"ProxyDeployed","type":"event"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"bytes","name":"_initializingData","type":"bytes"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"deployProxy","outputs":[{"internalType":"address","name":"deployedContract","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_initializingData","type":"bytes"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"getMixedSalt","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"bytes","name":"_initializingData","type":"bytes"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"getProxyAddress","outputs":[{"internalType":"address","name":"calculatedContract","type":"address"},{"internalType":"bytes32","name":"mixedSalt","type":"bytes32"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506105e1806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806360a1f85e14610046578063c28f4b6e14610083578063dd03f4ad146100c2575b600080fd5b6100596100543660046104f4565b6100e3565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100966100913660046104f4565b6101f7565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835260208301919091520161007a565b6100d56100d0366004610566565b610268565b60405190815260200161007a565b60008373ffffffffffffffffffffffffffffffffffffffff163b600003610153576040517f0c76093700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024015b60405180910390fd5b6000806101618686866101f7565b909250905073ffffffffffffffffffffffffffffffffffffffff82163b1561018b575090506101f0565b6101968686836102cd565b6040805173ffffffffffffffffffffffffffffffffffffffff808416825260208201859052929550918816917fd283ed05905c0eb69fe3ef042c6ad706d8d9c75b138624098de540fa2c011a05910160405180910390a250505b9392505050565b6000806102048484610268565b6040513060388201526f5af43d82803e903d91602b57fd5bf3ff60248201526014810196909652733d602d80600a3d3981f3363d3d373d3d3d363d738652605886018190526037600c87012060788701526055604390960195909520959350505050565b8151602080840191909120604080518084019290925281810184905233606090811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001690830152805160548184030181526074909201905280519101205b92915050565b60006102d984836102ef565b8351909150156101f0576101f0816000856103b3565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f5905073ffffffffffffffffffffffffffffffffffffffff81166102c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f455243313136373a2063726561746532206661696c6564000000000000000000604482015260640161014a565b6000806103c18585856103da565b91509150816103d3576103d381610412565b5050505050565b6000606060008084516020860187895af191503d604051602082018101604052818152816000602083013e8092505050935093915050565b805160208201fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261045a57600080fd5b813567ffffffffffffffff808211156104755761047561041a565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156104bb576104bb61041a565b816040528381528660208588010111156104d457600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561050957600080fd5b833573ffffffffffffffffffffffffffffffffffffffff8116811461052d57600080fd5b9250602084013567ffffffffffffffff81111561054957600080fd5b61055586828701610449565b925050604084013590509250925092565b6000806040838503121561057957600080fd5b823567ffffffffffffffff81111561059057600080fd5b61059c85828601610449565b9560209490940135945050505056fea2646970667358221220d0b70f790b384037e18484f59398afb8eca23645164c50a845c693dca2e4acb464736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c806360a1f85e14610046578063c28f4b6e14610083578063dd03f4ad146100c2575b600080fd5b6100596100543660046104f4565b6100e3565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100966100913660046104f4565b6101f7565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835260208301919091520161007a565b6100d56100d0366004610566565b610268565b60405190815260200161007a565b60008373ffffffffffffffffffffffffffffffffffffffff163b600003610153576040517f0c76093700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024015b60405180910390fd5b6000806101618686866101f7565b909250905073ffffffffffffffffffffffffffffffffffffffff82163b1561018b575090506101f0565b6101968686836102cd565b6040805173ffffffffffffffffffffffffffffffffffffffff808416825260208201859052929550918816917fd283ed05905c0eb69fe3ef042c6ad706d8d9c75b138624098de540fa2c011a05910160405180910390a250505b9392505050565b6000806102048484610268565b6040513060388201526f5af43d82803e903d91602b57fd5bf3ff60248201526014810196909652733d602d80600a3d3981f3363d3d373d3d3d363d738652605886018190526037600c87012060788701526055604390960195909520959350505050565b8151602080840191909120604080518084019290925281810184905233606090811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001690830152805160548184030181526074909201905280519101205b92915050565b60006102d984836102ef565b8351909150156101f0576101f0816000856103b3565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f5905073ffffffffffffffffffffffffffffffffffffffff81166102c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f455243313136373a2063726561746532206661696c6564000000000000000000604482015260640161014a565b6000806103c18585856103da565b91509150816103d3576103d381610412565b5050505050565b6000606060008084516020860187895af191503d604051602082018101604052818152816000602083013e8092505050935093915050565b805160208201fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261045a57600080fd5b813567ffffffffffffffff808211156104755761047561041a565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156104bb576104bb61041a565b816040528381528660208588010111156104d457600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561050957600080fd5b833573ffffffffffffffffffffffffffffffffffffffff8116811461052d57600080fd5b9250602084013567ffffffffffffffff81111561054957600080fd5b61055586828701610449565b925050604084013590509250925092565b6000806040838503121561057957600080fd5b823567ffffffffffffffff81111561059057600080fd5b61059c85828601610449565b9560209490940135945050505056fea2646970667358221220d0b70f790b384037e18484f59398afb8eca23645164c50a845c693dca2e4acb464736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0x1b8a151e64bC07dE0AcF967a0cB17Ee16c3c8E2D
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.