ETH Price: $1,983.37 (-1.45%)
 

Overview

ETH Balance

134.296936081523866271 ETH

Eth Value

$266,360.43 (@ $1,983.37/ETH)

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer245660092026-03-01 23:53:111 hr ago1772409191IN
Fee Recipient: 0xbefa...1fc
0.00787587 ETH0.00000090.04058096
Transfer245650882026-03-01 20:48:594 hrs ago1772398139IN
Fee Recipient: 0xbefa...1fc
0.01021651 ETH0.00000290.12935881
Transfer245649872026-03-01 20:28:474 hrs ago1772396927IN
Fee Recipient: 0xbefa...1fc
0.02009009 ETH0.000001680.0753019
Transfer245639382026-03-01 16:58:478 hrs ago1772384327IN
Fee Recipient: 0xbefa...1fc
0.00719163 ETH0.000001940.08692261
Transfer245637922026-03-01 16:29:238 hrs ago1772382563IN
Fee Recipient: 0xbefa...1fc
0.00731018 ETH0.000001540.06887373
Transfer245626502026-03-01 12:39:4712 hrs ago1772368787IN
Fee Recipient: 0xbefa...1fc
0.00771378 ETH0.000001340.05992039
Transfer245623412026-03-01 11:37:4713 hrs ago1772365067IN
Fee Recipient: 0xbefa...1fc
0.00483871 ETH0.000000790.03542677
Transfer245616192026-03-01 9:12:3516 hrs ago1772356355IN
Fee Recipient: 0xbefa...1fc
0.00601836 ETH0.000000720.03232751
Transfer245615332026-03-01 8:55:2316 hrs ago1772355323IN
Fee Recipient: 0xbefa...1fc
0.02649571 ETH0.000000710.03179119
Transfer245613852026-03-01 8:25:3516 hrs ago1772353535IN
Fee Recipient: 0xbefa...1fc
0.00513997 ETH0.00000060.027148
Transfer245610322026-03-01 7:14:5917 hrs ago1772349299IN
Fee Recipient: 0xbefa...1fc
0.01017394 ETH0.000000760.03420094
Transfer245605012026-03-01 5:28:2319 hrs ago1772342903IN
Fee Recipient: 0xbefa...1fc
0.01264032 ETH0.000000730.03300343
Transfer245596672026-03-01 2:40:5922 hrs ago1772332859IN
Fee Recipient: 0xbefa...1fc
0.00632925 ETH0.000001570.07038956
Transfer245592152026-03-01 1:09:5924 hrs ago1772327399IN
Fee Recipient: 0xbefa...1fc
0.04895661 ETH0.000001060.04749847
Transfer245580212026-02-28 21:09:4728 hrs ago1772312987IN
Fee Recipient: 0xbefa...1fc
0.00687732 ETH0.000002270.10138264
Transfer245571522026-02-28 18:14:5930 hrs ago1772302499IN
Fee Recipient: 0xbefa...1fc
0.00696766 ETH0.000001140.05110307
Transfer245569362026-02-28 17:31:3531 hrs ago1772299895IN
Fee Recipient: 0xbefa...1fc
0.01582775 ETH0.000001140.05112258
Transfer245561942026-02-28 15:01:4734 hrs ago1772290907IN
Fee Recipient: 0xbefa...1fc
0.01316072 ETH0.000002680.11991366
Transfer245560672026-02-28 14:36:1134 hrs ago1772289371IN
Fee Recipient: 0xbefa...1fc
0.06207736 ETH0.000002640.11790437
Transfer245559892026-02-28 14:20:3534 hrs ago1772288435IN
Fee Recipient: 0xbefa...1fc
0.04407811 ETH0.000003920.17513229
Transfer245558542026-02-28 13:52:5935 hrs ago1772286779IN
Fee Recipient: 0xbefa...1fc
0.12440682 ETH0.000001570.07024911
Transfer245558322026-02-28 13:48:3535 hrs ago1772286515IN
Fee Recipient: 0xbefa...1fc
0.54139605 ETH0.00000110.04945589
Transfer245553532026-02-28 12:12:2337 hrs ago1772280743IN
Fee Recipient: 0xbefa...1fc
0.00664927 ETH0.000001010.04522957
Transfer245547912026-02-28 10:19:2338 hrs ago1772273963IN
Fee Recipient: 0xbefa...1fc
0.01407756 ETH0.000001390.06231746
Transfer245542572026-02-28 8:32:2340 hrs ago1772267543IN
Fee Recipient: 0xbefa...1fc
0.02716167 ETH0.000001380.06179859
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer245654102026-03-01 21:53:233 hrs ago1772402003
Fee Recipient: 0xbefa...1fc
0.01370848 ETH
Transfer245645172026-03-01 18:54:356 hrs ago1772391275
Fee Recipient: 0xbefa...1fc
0.03314112 ETH
Transfer245640722026-03-01 17:25:357 hrs ago1772385935
Fee Recipient: 0xbefa...1fc
0.01884477 ETH
Transfer245630872026-03-01 14:07:3511 hrs ago1772374055
Fee Recipient: 0xbefa...1fc
0.13143842 ETH
Transfer245619992026-03-01 10:29:2314 hrs ago1772360963
Fee Recipient: 0xbefa...1fc
0.01314087 ETH
Transfer245616162026-03-01 9:11:5916 hrs ago1772356319
Fee Recipient: 0xbefa...1fc
0.03428861 ETH
Transfer245583082026-02-28 22:07:3527 hrs ago1772316455
Fee Recipient: 0xbefa...1fc
0.0165652 ETH
Transfer245552552026-02-28 11:52:4737 hrs ago1772279567
Fee Recipient: 0xbefa...1fc
0.01599573 ETH
Transfer245521732026-02-28 1:32:4747 hrs ago1772242367
Fee Recipient: 0xbefa...1fc
0.01770686 ETH
Transfer245517572026-02-28 0:09:112 days ago1772237351
Fee Recipient: 0xbefa...1fc
0.01313202 ETH
Transfer245515692026-02-27 23:31:352 days ago1772235095
Fee Recipient: 0xbefa...1fc
0.01067065 ETH
Transfer245506382026-02-27 20:24:352 days ago1772223875
Fee Recipient: 0xbefa...1fc
0.02056842 ETH
Transfer245495742026-02-27 16:51:112 days ago1772211071
Fee Recipient: 0xbefa...1fc
0.02111125 ETH
Transfer245453482026-02-27 2:42:232 days ago1772160143
Fee Recipient: 0xbefa...1fc
0.01999744 ETH
Transfer245426522026-02-26 17:41:593 days ago1772127719
Fee Recipient: 0xbefa...1fc
0.02397906 ETH
Transfer245424612026-02-26 17:03:233 days ago1772125403
Fee Recipient: 0xbefa...1fc
0.05251633 ETH
Transfer245416942026-02-26 14:28:593 days ago1772116139
Fee Recipient: 0xbefa...1fc
0.02020378 ETH
Transfer245394032026-02-26 6:49:353 days ago1772088575
Fee Recipient: 0xbefa...1fc
0.01599632 ETH
Transfer245381092026-02-26 2:29:593 days ago1772072999
Fee Recipient: 0xbefa...1fc
0.0234272 ETH
Transfer245379002026-02-26 1:47:473 days ago1772070467
Fee Recipient: 0xbefa...1fc
0.01656574 ETH
Transfer245377032026-02-26 1:07:594 days ago1772068079
Fee Recipient: 0xbefa...1fc
0.01572796 ETH
Transfer245371892026-02-25 23:24:474 days ago1772061887
Fee Recipient: 0xbefa...1fc
0.0274207 ETH
Transfer245362932026-02-25 20:24:354 days ago1772051075
Fee Recipient: 0xbefa...1fc
0.02170084 ETH
Transfer245361672026-02-25 19:59:114 days ago1772049551
Fee Recipient: 0xbefa...1fc
0.01941588 ETH
Transfer245349292026-02-25 15:49:354 days ago1772034575
Fee Recipient: 0xbefa...1fc
0.05477965 ETH
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Produced Blocks

 Latest 25 blocks (From a total of 463 blocks with 2.71 Ether produced)

Block Transaction Difficulty Gas Used Reward
245624632026-03-01 12:02:2313 hrs ago17723665433670.00 TH52,997,631 (88.33%)
0.001761266681722162 ETH
245580862026-02-28 21:22:5927 hrs ago17723137794690.00 TH36,373,325 (60.62%)
0.002168916128223129 ETH
245566492026-02-28 16:33:4732 hrs ago17722964271810.00 TH12,489,511 (20.82%)
0.003499550432189717 ETH
245464632026-02-27 6:26:232 days ago17721735833900.00 TH18,442,741 (30.74%)
0.001905290212252323 ETH
245406712026-02-26 11:03:593 days ago17721038391000.00 TH10,041,979 (16.74%)
0.004955480404457528 ETH
245395882026-02-26 7:26:473 days ago17720908071210.00 TH6,588,572 (10.98%)
0.001618050049708577 ETH
245282062026-02-24 17:18:355 days ago17719535151130.00 TH11,620,987 (19.37%)
0.004173132514150243 ETH
245262682026-02-24 10:49:235 days ago1771930163720.00 TH4,344,770 (7.24%)
0.001519333820895953 ETH
245246572026-02-24 5:26:115 days ago17719107712140.00 TH54,669,933 (91.12%)
0.00198108094957576 ETH
245223882026-02-23 21:51:116 days ago1771883471810.00 TH5,605,914 (9.34%)
0.001384115190284856 ETH
245175232026-02-23 5:33:596 days ago1771824839520.00 TH4,232,040 (7.05%)
0.001311225865455606 ETH
245174742026-02-23 5:24:116 days ago1771824251510.00 TH3,794,485 (6.32%)
0.001740026882470413 ETH
245138242026-02-22 17:11:597 days ago1771780319480.00 TH3,849,181 (6.42%)
0.001173293204943064 ETH
245098662026-02-22 3:58:117 days ago1771732691780.00 TH29,634,887 (49.39%)
0.001697646713754621 ETH
245085712026-02-21 23:37:478 days ago1771717067320.00 TH3,308,445 (5.51%)
0.001732871264415151 ETH
245078322026-02-21 21:08:598 days ago17717081391030.00 TH7,809,682 (13.02%)
0.001708807606988538 ETH
245065242026-02-21 16:45:598 days ago1771692359620.00 TH5,281,176 (8.80%)
0.001874454504164681 ETH
245058822026-02-21 14:37:118 days ago1771684631810.00 TH6,771,227 (11.29%)
0.00243970792425856 ETH
245013482026-02-20 23:27:239 days ago1771630043500.00 TH3,931,263 (6.55%)
0.001908665469537292 ETH
244999152026-02-20 18:40:119 days ago1771612811900.00 TH6,609,851 (11.02%)
0.005517696445152152 ETH
244944332026-02-20 0:19:4710 days ago1771546787530.00 TH3,483,112 (5.81%)
0.002257120281500507 ETH
244930272026-02-19 19:37:1110 days ago17715298311210.00 TH5,371,817 (8.95%)
0.001553004116250614 ETH
244921162026-02-19 16:33:4710 days ago17715188272150.00 TH13,367,874 (22.28%)
0.003936875295113941 ETH
244918222026-02-19 15:34:5910 days ago1771515299770.00 TH7,005,798 (11.68%)
0.003330653795800798 ETH
244861332026-02-18 20:32:2311 days ago1771446743620.00 TH3,629,717 (6.05%)
0.00244057075394208 ETH
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Minimal Proxy Contract for 0xd94c0ce4f8eefa4ebf44bf6665688edeef213b33

Contract Name:
SplitWallet

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.4;

import {ISplitMain} from './interfaces/ISplitMain.sol';
import {ERC20} from '@rari-capital/solmate/src/tokens/ERC20.sol';
import {SafeTransferLib} from '@rari-capital/solmate/src/utils/SafeTransferLib.sol';

/**
 * ERRORS
 */

/// @notice Unauthorized sender
error Unauthorized();

/**
 * @title SplitWallet
 * @author 0xSplits <[email protected]>
 * @notice The implementation logic for `SplitProxy`.
 * @dev `SplitProxy` handles `receive()` itself to avoid the gas cost with `DELEGATECALL`.
 */
contract SplitWallet {
  using SafeTransferLib for address;
  using SafeTransferLib for ERC20;

  /**
   * EVENTS
   */

  /** @notice emitted after each successful ETH transfer to proxy
   *  @param split Address of the split that received ETH
   *  @param amount Amount of ETH received
   */
  event ReceiveETH(address indexed split, uint256 amount);

  /**
   * STORAGE
   */

  /**
   * STORAGE - CONSTANTS & IMMUTABLES
   */

  /// @notice address of SplitMain for split distributions & EOA/SC withdrawals
  ISplitMain public immutable splitMain;

  /**
   * MODIFIERS
   */

  /// @notice Reverts if the sender isn't SplitMain
  modifier onlySplitMain() {
    if (msg.sender != address(splitMain)) revert Unauthorized();
    _;
  }

  /**
   * CONSTRUCTOR
   */

  constructor() {
    splitMain = ISplitMain(msg.sender);
  }

  /**
   * FUNCTIONS - PUBLIC & EXTERNAL
   */

  /** @notice Sends amount `amount` of ETH in proxy to SplitMain
   *  @dev payable reduces gas cost; no vulnerability to accidentally lock
   *  ETH introduced since fn call is restricted to SplitMain
   *  @param amount Amount to send
   */
  function sendETHToMain(uint256 amount) external payable onlySplitMain() {
    address(splitMain).safeTransferETH(amount);
  }

  /** @notice Sends amount `amount` of ERC20 `token` in proxy to SplitMain
   *  @dev payable reduces gas cost; no vulnerability to accidentally lock
   *  ETH introduced since fn call is restricted to SplitMain
   *  @param token Token to send
   *  @param amount Amount to send
   */
  function sendERC20ToMain(ERC20 token, uint256 amount)
    external
    payable
    onlySplitMain()
  {
    token.safeTransfer(address(splitMain), amount);
  }
}

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.4;

import {ERC20} from '@rari-capital/solmate/src/tokens/ERC20.sol';

/**
 * @title ISplitMain
 * @author 0xSplits <[email protected]>
 */
interface ISplitMain {
  /**
   * FUNCTIONS
   */

  function walletImplementation() external returns (address);

  function createSplit(
    address[] calldata accounts,
    uint32[] calldata percentAllocations,
    uint32 distributorFee,
    address controller
  ) external returns (address);

  function predictImmutableSplitAddress(
    address[] calldata accounts,
    uint32[] calldata percentAllocations,
    uint32 distributorFee
  ) external view returns (address);

  function updateSplit(
    address split,
    address[] calldata accounts,
    uint32[] calldata percentAllocations,
    uint32 distributorFee
  ) external;

  function transferControl(address split, address newController) external;

  function cancelControlTransfer(address split) external;

  function acceptControl(address split) external;

  function makeSplitImmutable(address split) external;

  function distributeETH(
    address split,
    address[] calldata accounts,
    uint32[] calldata percentAllocations,
    uint32 distributorFee,
    address distributorAddress
  ) external;

  function updateAndDistributeETH(
    address split,
    address[] calldata accounts,
    uint32[] calldata percentAllocations,
    uint32 distributorFee,
    address distributorAddress
  ) external;

  function distributeERC20(
    address split,
    ERC20 token,
    address[] calldata accounts,
    uint32[] calldata percentAllocations,
    uint32 distributorFee,
    address distributorAddress
  ) external;

  function updateAndDistributeERC20(
    address split,
    ERC20 token,
    address[] calldata accounts,
    uint32[] calldata percentAllocations,
    uint32 distributorFee,
    address distributorAddress
  ) external;

  function withdraw(
    address account,
    uint256 withdrawETH,
    ERC20[] calldata tokens
  ) external;

  /**
   * EVENTS
   */

  /** @notice emitted after each successful split creation
   *  @param split Address of the created split
   */
  event CreateSplit(address indexed split);

  /** @notice emitted after each successful split update
   *  @param split Address of the updated split
   */
  event UpdateSplit(address indexed split);

  /** @notice emitted after each initiated split control transfer
   *  @param split Address of the split control transfer was initiated for
   *  @param newPotentialController Address of the split's new potential controller
   */
  event InitiateControlTransfer(
    address indexed split,
    address indexed newPotentialController
  );

  /** @notice emitted after each canceled split control transfer
   *  @param split Address of the split control transfer was canceled for
   */
  event CancelControlTransfer(address indexed split);

  /** @notice emitted after each successful split control transfer
   *  @param split Address of the split control was transferred for
   *  @param previousController Address of the split's previous controller
   *  @param newController Address of the split's new controller
   */
  event ControlTransfer(
    address indexed split,
    address indexed previousController,
    address indexed newController
  );

  /** @notice emitted after each successful ETH balance split
   *  @param split Address of the split that distributed its balance
   *  @param amount Amount of ETH distributed
   *  @param distributorAddress Address to credit distributor fee to
   */
  event DistributeETH(
    address indexed split,
    uint256 amount,
    address indexed distributorAddress
  );

  /** @notice emitted after each successful ERC20 balance split
   *  @param split Address of the split that distributed its balance
   *  @param token Address of ERC20 distributed
   *  @param amount Amount of ERC20 distributed
   *  @param distributorAddress Address to credit distributor fee to
   */
  event DistributeERC20(
    address indexed split,
    ERC20 indexed token,
    uint256 amount,
    address indexed distributorAddress
  );

  /** @notice emitted after each successful withdrawal
   *  @param account Address that funds were withdrawn to
   *  @param ethAmount Amount of ETH withdrawn
   *  @param tokens Addresses of ERC20s withdrawn
   *  @param tokenAmounts Amounts of corresponding ERC20s withdrawn
   */
  event Withdrawal(
    address indexed account,
    uint256 ethAmount,
    ERC20[] tokens,
    uint256[] tokenAmounts
  );
}

// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*///////////////////////////////////////////////////////////////
                                  EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*///////////////////////////////////////////////////////////////
                             METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*///////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*///////////////////////////////////////////////////////////////
                             EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    bytes32 public constant PERMIT_TYPEHASH =
        keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*///////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*///////////////////////////////////////////////////////////////
                              ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*///////////////////////////////////////////////////////////////
                              EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            bytes32 digest = keccak256(
                abi.encodePacked(
                    "\x19\x01",
                    DOMAIN_SEPARATOR(),
                    keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
                )
            );

            address recoveredAddress = ecrecover(digest, v, r, s);

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*///////////////////////////////////////////////////////////////
                       INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Gnosis (https://github.com/gnosis/gp-v2-contracts/blob/main/src/contracts/libraries/GPv2SafeERC20.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
library SafeTransferLib {
    /*///////////////////////////////////////////////////////////////
                            ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool callStatus;

        assembly {
            // Transfer the ETH and store if it succeeded or not.
            callStatus := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(callStatus, "ETH_TRANSFER_FAILED");
    }

    /*///////////////////////////////////////////////////////////////
                           ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool callStatus;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata to memory piece by piece:
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) // Begin with the function selector.
            mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "from" argument.
            mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Finally append the "amount" argument. No mask as it's a full 32 byte value.

            // Call the token and store if it succeeded or not.
            // We use 100 because the calldata length is 4 + 32 * 3.
            callStatus := call(gas(), token, 0, freeMemoryPointer, 100, 0, 0)
        }

        require(didLastOptionalReturnCallSucceed(callStatus), "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool callStatus;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata to memory piece by piece:
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) // Begin with the function selector.
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Finally append the "amount" argument. No mask as it's a full 32 byte value.

            // Call the token and store if it succeeded or not.
            // We use 68 because the calldata length is 4 + 32 * 2.
            callStatus := call(gas(), token, 0, freeMemoryPointer, 68, 0, 0)
        }

        require(didLastOptionalReturnCallSucceed(callStatus), "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool callStatus;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata to memory piece by piece:
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) // Begin with the function selector.
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Finally append the "amount" argument. No mask as it's a full 32 byte value.

            // Call the token and store if it succeeded or not.
            // We use 68 because the calldata length is 4 + 32 * 2.
            callStatus := call(gas(), token, 0, freeMemoryPointer, 68, 0, 0)
        }

        require(didLastOptionalReturnCallSucceed(callStatus), "APPROVE_FAILED");
    }

    /*///////////////////////////////////////////////////////////////
                         INTERNAL HELPER LOGIC
    //////////////////////////////////////////////////////////////*/

    function didLastOptionalReturnCallSucceed(bool callStatus) private pure returns (bool success) {
        assembly {
            // Get how many bytes the call returned.
            let returnDataSize := returndatasize()

            // If the call reverted:
            if iszero(callStatus) {
                // Copy the revert message into memory.
                returndatacopy(0, 0, returnDataSize)

                // Revert with the same message.
                revert(0, returnDataSize)
            }

            switch returnDataSize
            case 32 {
                // Copy the return data into memory.
                returndatacopy(0, 0, returnDataSize)

                // Set success to whether it returned true.
                success := iszero(iszero(mload(0)))
            }
            case 0 {
                // There was no return data.
                success := 1
            }
            default {
                // It returned some malformed input.
                success := 0
            }
        }
    }
}

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

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"split","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ReceiveETH","type":"event"},{"inputs":[{"internalType":"contract ERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sendERC20ToMain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sendETHToMain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"splitMain","outputs":[{"internalType":"contract ISplitMain","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.