Contract 0xD534bB9fba20152AbCb20fCB2D96B00392971B5c 6

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x02c3ef57674c5cf198132a49399a12b602d44c5d6ea69c7aef62f2b858c22290Create Op For256118922023-01-30 14:34:2810 hrs 8 mins ago0xd68c3f92f4a611e17ba67533b7ad3b2e7268e8c2 IN  0xd534bb9fba20152abcb20fcb2d96b00392971b5c0 AVAX0.002949544 26
0xe384cdbd32e00b556f6f0587a3dabc938546ef760a95685ff1f59217d8e15e16Create Op For256118632023-01-30 14:33:3110 hrs 9 mins ago0xd68c3f92f4a611e17ba67533b7ad3b2e7268e8c2 IN  0xd534bb9fba20152abcb20fcb2d96b00392971b5c0 AVAX0.002949544 26
0x7bf8cef284ec1489b70d8ba8324d1562075f77ab54cbb000a752a58fa4b9a3f4Create Op For256117662023-01-30 14:30:1110 hrs 13 mins ago0xd68c3f92f4a611e17ba67533b7ad3b2e7268e8c2 IN  0xd534bb9fba20152abcb20fcb2d96b00392971b5c0 AVAX0.002949544 26
0x06730549e49663d4c11891a64c16776b02d53be0bc6d98581ebba60cf0998789Create Op For256117442023-01-30 14:29:2610 hrs 13 mins ago0xd68c3f92f4a611e17ba67533b7ad3b2e7268e8c2 IN  0xd534bb9fba20152abcb20fcb2d96b00392971b5c0 AVAX0.002949232 26
0x0cb6a6904c9d3c5a0a4fa9d0f90509b1f6d5244dcf4a4367efe0c573cab29b08Create Op For256115962023-01-30 14:24:2510 hrs 18 mins ago0xd68c3f92f4a611e17ba67533b7ad3b2e7268e8c2 IN  0xd534bb9fba20152abcb20fcb2d96b00392971b5c0 AVAX0.002949544 26
0x69d14b3bb611a21f93221e45d70a3f19ea9da7fda8a873fc2b01b287a23f9bbdCreate Op253972932023-01-25 13:30:515 days 11 hrs ago0xd68c3f92f4a611e17ba67533b7ad3b2e7268e8c2 IN  0xd534bb9fba20152abcb20fcb2d96b00392971b5c0 AVAX0.002932046 26
0x285439056fb0ac019e01a9fa8efef3fce97ce9fc71ad5ee3d96a09dcbb80ac6b0x60a06040253592602023-01-24 15:55:286 days 8 hrs ago0x00ecd25a5f729eecacadb4b606ced38760e07c47 IN  Create: OpFactory0 AVAX0.00883307525
[ Download CSV Export 
Latest 6 internal transactions
Parent Txn Hash Block From To Value
0x02c3ef57674c5cf198132a49399a12b602d44c5d6ea69c7aef62f2b858c22290256118922023-01-30 14:34:2810 hrs 8 mins ago 0xd534bb9fba20152abcb20fcb2d96b00392971b5c  Contract Creation0 AVAX
0xe384cdbd32e00b556f6f0587a3dabc938546ef760a95685ff1f59217d8e15e16256118632023-01-30 14:33:3110 hrs 9 mins ago 0xd534bb9fba20152abcb20fcb2d96b00392971b5c  Contract Creation0 AVAX
0x7bf8cef284ec1489b70d8ba8324d1562075f77ab54cbb000a752a58fa4b9a3f4256117662023-01-30 14:30:1110 hrs 13 mins ago 0xd534bb9fba20152abcb20fcb2d96b00392971b5c  Contract Creation0 AVAX
0x06730549e49663d4c11891a64c16776b02d53be0bc6d98581ebba60cf0998789256117442023-01-30 14:29:2610 hrs 13 mins ago 0xd534bb9fba20152abcb20fcb2d96b00392971b5c  Contract Creation0 AVAX
0x0cb6a6904c9d3c5a0a4fa9d0f90509b1f6d5244dcf4a4367efe0c573cab29b08256115962023-01-30 14:24:2510 hrs 18 mins ago 0xd534bb9fba20152abcb20fcb2d96b00392971b5c  Contract Creation0 AVAX
0x69d14b3bb611a21f93221e45d70a3f19ea9da7fda8a873fc2b01b287a23f9bbd253972932023-01-25 13:30:515 days 11 hrs ago 0xd534bb9fba20152abcb20fcb2d96b00392971b5c  Contract Creation0 AVAX
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
OpFactory

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 3 : Clones.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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));
    }
}

File 2 of 3 : IDefiOp.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

interface IDefiOp {
    function init(address owner_) external;

    function withdrawERC20(address token) external;

    function withdrawNative() external;
}

File 3 of 3 : OpFactory.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/proxy/Clones.sol";

import {IDefiOp} from "./interfaces/IDefiOp.sol";

contract OpFactory {
    address public immutable opImplementation;
    event OpCreated(address owner, address opContract);

    constructor(address opImplementation_) {
        opImplementation = opImplementation_;
    }

    function getOpFor(address wallet) external view returns (address op) {
        op = Clones.predictDeterministicAddress(
            opImplementation,
            keccak256(abi.encodePacked(wallet)),
            address(this)
        );
    }

    function createOp() external {
        createOpFor(msg.sender);
    }

    function createOpFor(address owner) public {
        address op = Clones.cloneDeterministic(
            opImplementation,
            keccak256(abi.encodePacked(owner))
        );
        IDefiOp(op).init(owner);

        emit OpCreated(owner, op);
    }
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"opImplementation_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"opContract","type":"address"}],"name":"OpCreated","type":"event"},{"inputs":[],"name":"createOp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"createOpFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"getOpFor","outputs":[{"internalType":"address","name":"op","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"opImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b50604051610683380380610683833981810160405281019061003291906100cf565b8073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1681525050506100fc565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061009c82610071565b9050919050565b6100ac81610091565b81146100b757600080fd5b50565b6000815190506100c9816100a3565b92915050565b6000602082840312156100e5576100e461006c565b5b60006100f3848285016100ba565b91505092915050565b6080516105606101236000396000818160c70152818160fb01526101f701526105606000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063468512d914610051578063829a29e31461006f578063b81ef1db14610079578063c55f630814610095575b600080fd5b6100596100c5565b60405161006691906103a8565b60405180910390f35b6100776100e9565b005b610093600480360381019061008e91906103f4565b6100f4565b005b6100af60048036038101906100aa91906103f4565b6101f0565b6040516100bc91906103a8565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b6100f2336100f4565b565b60006101467f00000000000000000000000000000000000000000000000000000000000000008360405160200161012b9190610469565b6040516020818303038152906040528051906020012061024a565b90508073ffffffffffffffffffffffffffffffffffffffff166319ab453c836040518263ffffffff1660e01b815260040161018191906103a8565b600060405180830381600087803b15801561019b57600080fd5b505af11580156101af573d6000803e3d6000fd5b505050507fcd48388cd7912bf899cd4e5db7ec55b9b5a32dd2951163f9d6e16d07fd49edda82826040516101e4929190610484565b60405180910390a15050565b60006102437f0000000000000000000000000000000000000000000000000000000000000000836040516020016102279190610469565b6040516020818303038152906040528051906020012030610306565b9050919050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102f79061050a565b60405180910390fd5b92915050565b60006040518260388201526f5af43d82803e903d91602b57fd5bf3ff6024820152846014820152733d602d80600a3d3981f3363d3d373d3d3d363d7381528360588201526037600c8201206078820152605560438201209150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061039282610367565b9050919050565b6103a281610387565b82525050565b60006020820190506103bd6000830184610399565b92915050565b600080fd5b6103d181610387565b81146103dc57600080fd5b50565b6000813590506103ee816103c8565b92915050565b60006020828403121561040a576104096103c3565b5b6000610418848285016103df565b91505092915050565b60008160601b9050919050565b600061043982610421565b9050919050565b600061044b8261042e565b9050919050565b61046361045e82610387565b610440565b82525050565b60006104758284610452565b60148201915081905092915050565b60006040820190506104996000830185610399565b6104a66020830184610399565b9392505050565b600082825260208201905092915050565b7f455243313136373a2063726561746532206661696c6564000000000000000000600082015250565b60006104f46017836104ad565b91506104ff826104be565b602082019050919050565b60006020820190508181036000830152610523816104e7565b905091905056fea2646970667358221220ab4d8fffd609767fd46ac50d603eb244d4ec64b432e5015d2345b221c41a40d464736f6c6343000811003300000000000000000000000077ed391a04c33c894d9d2b7d7de8612448e5f69f

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000077ed391a04c33c894d9d2b7d7de8612448e5f69f

-----Decoded View---------------
Arg [0] : opImplementation_ (address): 0x77ed391a04c33c894d9d2b7d7de8612448e5f69f

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000077ed391a04c33c894d9d2b7d7de8612448e5f69f


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.