ETH Price: $3,668.97 (+0.77%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Execute200677822024-06-11 9:46:47208 days ago1718099207IN
0x722Da9f2...5968613A4
0 ETH0.004812388.98368668
Execute200677802024-06-11 9:46:23208 days ago1718099183IN
0x722Da9f2...5968613A4
0 ETH0.000698068.95095089
Execute200677722024-06-11 9:44:47208 days ago1718099087IN
0x722Da9f2...5968613A4
0 ETH0.004819998.52637898
Execute200677702024-06-11 9:44:23208 days ago1718099063IN
0x722Da9f2...5968613A4
0 ETH0.000630858.07799928
Execute200624052024-06-10 15:44:11209 days ago1718034251IN
0x722Da9f2...5968613A4
0 ETH0.0099400518.56074575
Execute200624032024-06-10 15:43:47209 days ago1718034227IN
0x722Da9f2...5968613A4
0 ETH0.0017730418.64634767
Execute200623482024-06-10 15:32:47209 days ago1718033567IN
0x722Da9f2...5968613A4
0 ETH0.0060196215.97246603
Execute200623442024-06-10 15:31:59209 days ago1718033519IN
0x722Da9f2...5968613A4
0 ETH0.0016664617.50564207
Initialize200553442024-06-09 16:04:59210 days ago1717949099IN
0x722Da9f2...5968613A4
0 ETH0.001779949.97452536
Execute199258852024-05-22 14:02:11228 days ago1716386531IN
0x722Da9f2...5968613A4
0 ETH0.0024294114.20028294
Execute199251922024-05-22 11:42:23228 days ago1716378143IN
0x722Da9f2...5968613A4
0 ETH0.003437658.12963461
Execute199251792024-05-22 11:39:47228 days ago1716377987IN
0x722Da9f2...5968613A4
0 ETH0.003892489.27615873
Execute199251722024-05-22 11:38:23228 days ago1716377903IN
0x722Da9f2...5968613A4
0 ETH0.0042650510.08584825
Execute199251462024-05-22 11:33:11228 days ago1716377591IN
0x722Da9f2...5968613A4
0 ETH0.004174129.87081452
Execute199251392024-05-22 11:31:47228 days ago1716377507IN
0x722Da9f2...5968613A4
0 ETH0.004104129.7051423
Execute199251172024-05-22 11:27:11228 days ago1716377231IN
0x722Da9f2...5968613A4
0 ETH0.004024289.51837945
Execute199251082024-05-22 11:25:23228 days ago1716377123IN
0x722Da9f2...5968613A4
0 ETH0.003647478.62713863
Execute199250962024-05-22 11:22:59228 days ago1716376979IN
0x722Da9f2...5968613A4
0 ETH0.003414388.08620864
Execute199250862024-05-22 11:20:59228 days ago1716376859IN
0x722Da9f2...5968613A4
0 ETH0.003565078.43243161
Execute199250742024-05-22 11:18:35228 days ago1716376715IN
0x722Da9f2...5968613A4
0 ETH0.003752258.87517405
Execute199250622024-05-22 11:16:11228 days ago1716376571IN
0x722Da9f2...5968613A4
0 ETH0.003422368.0948985
Execute199250412024-05-22 11:11:59228 days ago1716376319IN
0x722Da9f2...5968613A4
0 ETH0.003050347.21334734
Execute199250312024-05-22 11:09:59228 days ago1716376199IN
0x722Da9f2...5968613A4
0 ETH0.00361568.57622724
Execute199250122024-05-22 11:05:59228 days ago1716375959IN
0x722Da9f2...5968613A4
0 ETH0.003279777.75561332
Execute199249722024-05-22 10:57:59228 days ago1716375479IN
0x722Da9f2...5968613A4
0 ETH0.003160657.47303691
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
199258852024-05-22 14:02:11228 days ago1716386531
0x722Da9f2...5968613A4
159.91167375 ETH
199251922024-05-22 11:42:23228 days ago1716378143
0x722Da9f2...5968613A4
3 ETH
199251792024-05-22 11:39:47228 days ago1716377987
0x722Da9f2...5968613A4
4 ETH
199251722024-05-22 11:38:23228 days ago1716377903
0x722Da9f2...5968613A4
3 ETH
199251462024-05-22 11:33:11228 days ago1716377591
0x722Da9f2...5968613A4
3 ETH
199251392024-05-22 11:31:47228 days ago1716377507
0x722Da9f2...5968613A4
3 ETH
199251172024-05-22 11:27:11228 days ago1716377231
0x722Da9f2...5968613A4
3 ETH
199251082024-05-22 11:25:23228 days ago1716377123
0x722Da9f2...5968613A4
3 ETH
199250962024-05-22 11:22:59228 days ago1716376979
0x722Da9f2...5968613A4
3 ETH
199250862024-05-22 11:20:59228 days ago1716376859
0x722Da9f2...5968613A4
3 ETH
199250742024-05-22 11:18:35228 days ago1716376715
0x722Da9f2...5968613A4
3 ETH
199250622024-05-22 11:16:11228 days ago1716376571
0x722Da9f2...5968613A4
3 ETH
199250412024-05-22 11:11:59228 days ago1716376319
0x722Da9f2...5968613A4
3 ETH
199250312024-05-22 11:09:59228 days ago1716376199
0x722Da9f2...5968613A4
3 ETH
199250122024-05-22 11:05:59228 days ago1716375959
0x722Da9f2...5968613A4
3 ETH
199249722024-05-22 10:57:59228 days ago1716375479
0x722Da9f2...5968613A4
3 ETH
199248582024-05-22 10:34:35228 days ago1716374075
0x722Da9f2...5968613A4
13 ETH
199199572024-05-21 18:05:59229 days ago1716314759
0x722Da9f2...5968613A4
218.28126742 ETH
191933502024-02-09 21:48:59331 days ago1707515339
0x722Da9f2...5968613A4
43.5 ETH
191929162024-02-09 20:21:47331 days ago1707510107
0x722Da9f2...5968613A4
22.06893987 ETH
191928872024-02-09 20:15:59331 days ago1707509759
0x722Da9f2...5968613A4
22.06146645 ETH
191607582024-02-05 8:02:23335 days ago1707120143
0x722Da9f2...5968613A4
0.00123312 ETH
191607192024-02-05 7:54:35335 days ago1707119675
0x722Da9f2...5968613A4
0.02346221 ETH
191607052024-02-05 7:51:47335 days ago1707119507
0x722Da9f2...5968613A4
0.02469533 ETH
191393952024-02-02 8:01:47338 days ago1706860907  Contract Creation0 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x16B74810...D81e44227
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
ImmutableBeaconProxy

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
paris EvmVersion
File 1 of 8 : ImmutableBeaconProxy.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.22;

import {Proxy} from "@openzeppelin/contracts/proxy/Proxy.sol";
import {IBeacon} from "contracts/interfaces/base/proxy/IBeacon.sol";
import {SafeCall} from "contracts/libraries/SafeCall.sol";

contract ImmutableBeaconProxy is Proxy {
    using {SafeCall.safeDelegateCall} for address;

    address private immutable beacon;

    error BeaconCallFailed();
    error BeaconReturnedUnexpectedNumberOfBytes(uint256);
    error BeaconReturnedAddressZero();

    constructor(bytes memory initDataWithSelector) {
        beacon = msg.sender;

        if (initDataWithSelector.length > 0) {
            _implementation().safeDelegateCall(initDataWithSelector);
        } else {
            // Make sure msg.sender implements IBeacon interface
            _implementation();
        }
    }

    function _implementation() internal view override returns (address impl) {
        (bool success, bytes memory result) = beacon.staticcall(
            abi.encodeCall(IBeacon.implementation, ())
        );

        if (!success) revert BeaconCallFailed();
        if (result.length != 32) revert BeaconReturnedUnexpectedNumberOfBytes(result.length);

        impl = abi.decode(result, (address));
        if (impl == address(0)) revert BeaconReturnedAddressZero();
    }
}

File 2 of 8 : Proxy.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/Proxy.sol)

pragma solidity ^0.8.20;

/**
 * @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 {
        _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();
    }
}

File 3 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 4 of 8 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) 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 FailedInnerCall();
        }
    }
}

File 5 of 8 : Command.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {CommandLibrary} from "contracts/libraries/CommandLibrary.sol";

/**
 * @title Command
 * @notice Contains arguments for a low-level call.
 * @dev This struct allows deferring the call's execution, suspending it by passing it to another function or contract.
 * @dev `target` The address to be called.
 * @dev `value` Value to send in the call.
 * @dev `payload` Encoded call with function selector and arguments.
 */
struct Command {
    address target;
    uint256 value;
    bytes payload;
}

using CommandLibrary for Command global;

File 6 of 8 : IBeacon.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

interface IBeacon {
    error ImplementationAddressIsZero();

    /**
     * This upgrade will affect all Beacon Proxies that use this Beacon
     * @param newImplementation New implementation to delegate calls from Beacon Proxies
     */
    function upgradeTo(address newImplementation) external;

    /**
     * Returns address of the current used by Beacon Proxies
     */
    function implementation() external view returns (address);
}

File 7 of 8 : CommandLibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Command} from "contracts/interfaces/accountAbstraction/interpreter/Command.sol";
import {SafeCall} from "contracts/libraries/SafeCall.sol";

/**
 * @notice Utility to convert often-used methods into a Command object
 */
library CommandPresets {
    function approve(
        address _token,
        address _to,
        uint256 _amount
    ) internal pure returns (Command memory cmd_) {
        cmd_.target = _token;
        cmd_.payload = abi.encodeCall(IERC20.approve, (_to, _amount));
    }

    function transfer(
        address _token,
        address _to,
        uint256 _amount
    ) internal pure returns (Command memory cmd_) {
        cmd_.target = _token;
        cmd_.payload = abi.encodeCall(IERC20.transfer, (_to, _amount));
    }
}

library CommandExecutor {
    using SafeCall for Command[];

    function execute(Command[] calldata _cmds) external {
        _cmds.safeCallAll();
    }
}

library CommandLibrary {
    using CommandLibrary for Command[];

    function last(Command[] memory _self) internal pure returns (Command memory) {
        return _self[_self.length - 1];
    }

    function asArray(Command memory _self) internal pure returns (Command[] memory result_) {
        result_ = new Command[](1);
        result_[0] = _self;
    }

    function concat(
        Command memory _self,
        Command memory _cmd
    ) internal pure returns (Command[] memory result_) {
        result_ = new Command[](2);
        result_[0] = _self;
        result_[1] = _cmd;
    }

    function concat(
        Command memory _self,
        Command[] memory _cmds
    ) internal pure returns (Command[] memory result_) {
        result_ = new Command[](_cmds.length + 1);
        result_[0] = _self;
        for (uint256 i = 1; i < result_.length; i++) {
            result_[i] = _cmds[i - 1];
        }
    }

    function append(
        Command[] memory _self,
        Command[] memory _cmds
    ) internal pure returns (Command[] memory result_) {
        result_ = new Command[](_self.length + _cmds.length);
        uint256 i;
        for (; i < _self.length; i++) {
            result_[i] = _self[i];
        }
        for (; i < result_.length; i++) {
            result_[i] = _cmds[i - _self.length];
        }
    }

    function push(
        Command[] memory _self,
        Command memory _cmd
    ) internal pure returns (Command[] memory result_) {
        result_ = new Command[](_self.length + 1);
        for (uint256 i; i < _self.length; i++) {
            result_[i] = _self[i];
        }
        result_[_self.length] = _cmd;
    }

    function unshift(
        Command[] memory _self,
        Command memory _cmd
    ) internal pure returns (Command[] memory result_) {
        result_ = new Command[](1 + _self.length);
        result_[0] = _cmd;
        for (uint256 i = 1; i < result_.length; i++) {
            result_[i] = _self[i - 1];
        }
    }

    function unshift(
        Command[] memory _self,
        Command[] memory _cmds
    ) internal pure returns (Command[] memory result_) {
        result_ = new Command[](_cmds.length + _self.length);
        uint256 i;
        for (; i < _cmds.length; i++) {
            result_[i] = _cmds[i];
        }
        for (; i < result_.length; i++) {
            result_[i] = _self[i - _cmds.length];
        }
    }

    function populateWithApprove(
        Command memory _self,
        address _token,
        uint256 _amount
    ) internal pure returns (Command[] memory result_) {
        if (_amount != 0) {
            result_ = CommandPresets.approve(_token, _self.target, _amount).concat(_self);
        } else {
            result_ = _self.asArray();
        }
    }

    function populateWithRevokeAndApprove(
        Command memory _self,
        address _token,
        uint256 _amount
    ) internal pure returns (Command[] memory result_) {
        return
            CommandPresets.approve(_token, _self.target, 0).concat(
                _self.populateWithApprove(_token, _amount)
            );
    }

    function populateWithApprove(
        Command[] memory _self,
        address _token,
        uint256 _amount
    ) internal pure returns (Command[] memory result_) {
        if (_amount != 0) {
            result_ = _self.unshift(
                CommandPresets.approve(_token, _self[_self.length - 1].target, _amount)
            );
        } else {
            result_ = _self;
        }
    }

    function populateWithApprove(
        Command memory _self,
        address[2] memory _tokens,
        uint256[2] memory _amounts
    ) internal pure returns (Command[] memory result_) {
        if (_amounts[0] != 0 && _amounts[1] != 0) {
            result_ = CommandPresets
                .approve(_tokens[0], _self.target, _amounts[0])
                .concat(CommandPresets.approve(_tokens[1], _self.target, _amounts[1]))
                .push(_self);
        } else {
            if (_amounts[0] != 0) {
                result_ = populateWithApprove(_self, _tokens[0], _amounts[0]);
            } else {
                result_ = populateWithApprove(_self, _tokens[1], _amounts[1]);
            }
        }
    }

    function populateWithApprove(
        Command memory _self,
        address[3] memory _tokens,
        uint256[3] memory _amounts
    ) internal pure returns (Command[] memory result_) {
        if (_amounts[0] != 0 && _amounts[1] != 0 && _amounts[2] != 0) {
            result_ = CommandPresets
                .approve(_tokens[0], _self.target, _amounts[0])
                .concat(CommandPresets.approve(_tokens[1], _self.target, _amounts[1]))
                .push(CommandPresets.approve(_tokens[2], _self.target, _amounts[2]))
                .push(_self);
        } else {
            if (_amounts[0] == 0) {
                result_ = populateWithApprove(
                    _self,
                    [_tokens[1], _tokens[2]],
                    [_amounts[1], _amounts[2]]
                );
            } else if (_amounts[1] == 0) {
                result_ = populateWithApprove(
                    _self,
                    [_tokens[0], _tokens[2]],
                    [_amounts[0], _amounts[2]]
                );
            } else {
                result_ = populateWithApprove(
                    _self,
                    [_tokens[0], _tokens[1]],
                    [_amounts[0], _amounts[1]]
                );
            }
        }
    }

    function populateWithApprove(
        Command memory _self,
        address[4] memory _tokens,
        uint256[4] memory _amounts
    ) internal pure returns (Command[] memory result_) {
        if (_amounts[0] != 0 && _amounts[1] != 0 && _amounts[2] != 0 && _amounts[3] != 0) {
            result_ = CommandPresets
                .approve(_tokens[0], _self.target, _amounts[0])
                .concat(CommandPresets.approve(_tokens[1], _self.target, _amounts[1]))
                .push(CommandPresets.approve(_tokens[2], _self.target, _amounts[2]))
                .push(CommandPresets.approve(_tokens[3], _self.target, _amounts[3]))
                .push(_self);
        } else {
            if (_amounts[0] == 0) {
                result_ = populateWithApprove(
                    _self,
                    [_tokens[1], _tokens[2], _tokens[3]],
                    [_amounts[1], _amounts[2], _amounts[3]]
                );
            } else if (_amounts[1] == 0) {
                result_ = populateWithApprove(
                    _self,
                    [_tokens[0], _tokens[2], _tokens[3]],
                    [_amounts[0], _amounts[2], _amounts[3]]
                );
            } else if (_amounts[2] == 0) {
                result_ = populateWithApprove(
                    _self,
                    [_tokens[0], _tokens[1], _tokens[3]],
                    [_amounts[0], _amounts[1], _amounts[3]]
                );
            } else {
                result_ = populateWithApprove(
                    _self,
                    [_tokens[0], _tokens[1], _tokens[2]],
                    [_amounts[0], _amounts[1], _amounts[2]]
                );
            }
        }
    }
}

File 8 of 8 : SafeCall.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {Command} from "contracts/interfaces/accountAbstraction/interpreter/Command.sol";

/**
 * @notice Safe methods performing a low-level calls that revert
 * if the call was not successful
 */
library SafeCall {
    using Address for address;

    function safeCallAll(Command[] memory _cmds) internal {
        for (uint256 i; i < _cmds.length; i++) {
            safeCall(_cmds[i]);
        }
    }

    function safeCall(Command memory _cmd) internal returns (bytes memory result_) {
        result_ = safeCall(_cmd.target, _cmd.value, _cmd.payload);
    }

    function safeCall(address _target, bytes memory _data) internal returns (bytes memory result_) {
        result_ = safeCall(_target, 0, _data);
    }

    function safeCall(
        address _target,
        uint256 _value,
        bytes memory _data
    ) internal returns (bytes memory result_) {
        result_ = _target.functionCallWithValue(_data, _value);
    }

    function safeDelegateCall(
        address _target,
        bytes memory _data
    ) internal returns (bytes memory result_) {
        result_ = _target.functionDelegateCall(_data);
    }
}

Settings
{
  "viaIR": true,
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bytes","name":"initDataWithSelector","type":"bytes"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"BeaconCallFailed","type":"error"},{"inputs":[],"name":"BeaconReturnedAddressZero","type":"error"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"BeaconReturnedUnexpectedNumberOfBytes","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"stateMutability":"payable","type":"fallback"}]

Deployed Bytecode

0x7f5c60da1b0000000000000000000000000000000000000000000000000000000060a052600460805260c060405260008060805160a07f0000000000000000000000005f085177680037ce1486d4b516d2c8e6a19689665afa610060610170565b9015610117578051602081036100e45761009f61008683602080825183010191016101de565b73ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff811661020f5760046040517ffb678c30000000000000000000000000000000000000000000000000000000008152fd5b6040517f7ce64c780000000000000000000000000000000000000000000000000000000081526004810191909152602490fd5b60046040517f73a769bf000000000000000000000000000000000000000000000000000000008152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b3d156101d95767ffffffffffffffff903d8281116101d45760405192601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168401908111848210176101d45760405282523d6000602084013e565b610141565b606090565b9081602091031261020a575173ffffffffffffffffffffffffffffffffffffffff8116810361020a5790565b600080fd5b6000808092368280378136915af43d82803e1561022a573d90f35b3d90fdfea2646970667358221220027eff3143e7a819b553e2f0d74de6e2458783a2beb226a1fd4210096a83007364736f6c63430008160033

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
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.