Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x39DC6a99209B5e6B81dC8540C86Ff10981ebDA29
Balance 0 ETH
Nonce 1
Code Size 4164 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

4164 bytes
0x6080604052600436106100345760003560e01c8063a524679e1461006f578063ca0bfcce1461009a578063ec6925a7146100b6575b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161006690610ddf565b60405180910390fd5b34801561007b57600080fd5b506100846100e1565b6040516100919190610d19565b60405180910390f35b6100b460048036036100af91908101906107d1565b6100f5565b005b3480156100c257600080fd5b506100cb6104bb565b6040516100d89190610edf565b60405180910390f35b6f219ab540356cbb839cbe05303d7705fa81565b858590508888905014801561010f57508383905088889050145b801561012057508181905088889050145b61015f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015690610e1f565b60405180910390fd5b600088889050116101a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019c90610ebf565b60405180910390fd5b6101c4888890506801bc16d674ec8000006104c890919063ffffffff16565b341015610206576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101fd90610e9f565b60405180910390fd5b600080905060008090505b89899050811015610404576f219ab540356cbb839cbe05303d7705fa73ffffffffffffffffffffffffffffffffffffffff1663228951186801bc16d674ec8000008c8c8581811061025e57fe5b905060200281018035600160200383360303811261027b57600080fd5b8083019250508135905060208201915067ffffffffffffffff8111156102a057600080fd5b6001810236038213156102b257600080fd5b8c8c878181106102be57fe5b90506020028101803560016020038336030381126102db57600080fd5b8083019250508135905060208201915067ffffffffffffffff81111561030057600080fd5b60018102360382131561031257600080fd5b8c8c8981811061031e57fe5b905060200281018035600160200383360303811261033b57600080fd5b8083019250508135905060208201915067ffffffffffffffff81111561036057600080fd5b60018102360382131561037257600080fd5b8c8c8b81811061037e57fe5b905060200201356040518963ffffffff1660e01b81526004016103a79796959493929190610d5d565b6000604051808303818588803b1580156103c057600080fd5b505af11580156103d4573d6000803e3d6000fd5b50505050506103f56801bc16d674ec8000008361053890919063ffffffff16565b91508080600101915050610211565b50610424898990506801bc16d674ec8000006104c890919063ffffffff16565b811461042c57fe5b6000610441823461058d90919063ffffffff16565b905060008111156104af577f5bf796d990a3e234f75e4f1e307ccc21ddd796f87f41563e8320696505ee268a338260405161047d929190610d34565b60405180910390a16104ae813373ffffffffffffffffffffffffffffffffffffffff166105d790919063ffffffff16565b5b50505050505050505050565b6801bc16d674ec80000081565b6000808314156104db5760009050610532565b60008284029050828482816104ec57fe5b041461052d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052490610e7f565b60405180910390fd5b809150505b92915050565b600080828401905083811015610583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057a90610dff565b60405180910390fd5b8091505092915050565b60006105cf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506106e2565b905092915050565b803073ffffffffffffffffffffffffffffffffffffffff16311015610631576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062890610e5f565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405161065790610d04565b60006040518083038185875af1925050503d8060008114610694576040519150601f19603f3d011682016040523d82523d6000602084013e610699565b606091505b50509050806106dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d490610e3f565b60405180910390fd5b505050565b600083831115829061072a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107219190610dbd565b60405180910390fd5b5060008385039050809150509392505050565b60008083601f84011261074f57600080fd5b8235905067ffffffffffffffff81111561076857600080fd5b60208301915083602082028301111561078057600080fd5b9250929050565b60008083601f84011261079957600080fd5b8235905067ffffffffffffffff8111156107b257600080fd5b6020830191508360208202830111156107ca57600080fd5b9250929050565b6000806000806000806000806080898b0312156107ed57600080fd5b600089013567ffffffffffffffff81111561080757600080fd5b6108138b828c01610787565b9850985050602089013567ffffffffffffffff81111561083257600080fd5b61083e8b828c01610787565b9650965050604089013567ffffffffffffffff81111561085d57600080fd5b6108698b828c01610787565b9450945050606089013567ffffffffffffffff81111561088857600080fd5b6108948b828c0161073d565b92509250509295985092959890939650565b6108af81610f78565b82525050565b6108be81610f32565b82525050565b6108cd81610f44565b82525050565b60006108df8385610f05565b93506108ec838584610fae565b6108f583610ff0565b840190509392505050565b600061090b82610efa565b6109158185610f21565b9350610925818560208601610fbd565b61092e81610ff0565b840191505092915050565b6000610946605e83610f21565b91507f2342617463684465706f7369742066616c6c6261636b28293a2055736520746860008301527f65206062617463684465706f736974282e2e2e29602066756e6374696f6e207460208301527f6f2073656e6420457468657220746f207468697320636f6e74726163742e00006040830152606082019050919050565b60006109d2601b83610f21565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000610a12604e83610f21565b91507f2342617463684465706f7369742062617463684465706f73697428293a20416c60008301527f6c20706172616d657465722061727261792773206d757374206861766520746860208301527f652073616d65206c656e6774682e0000000000000000000000000000000000006040830152606082019050919050565b6000610a9e603a83610f21565b91507f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008301527f6563697069656e74206d617920686176652072657665727465640000000000006020830152604082019050919050565b6000610b04601d83610f21565b91507f416464726573733a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000610b44602183610f21565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610baa600083610f16565b9150600082019050919050565b6000610bc4606883610f21565b91507f2342617463684465706f7369742062617463684465706f73697428293a20457460008301527f686572206465706f7369746564206e6565647320746f206265206174206c656160208301527f73743a203332202a2028706172616d6574657220607075626b6579735b5d602060408301527f6c656e677468292e0000000000000000000000000000000000000000000000006060830152608082019050919050565b6000610c76605983610f21565b91507f2342617463684465706f7369742062617463684465706f73697428293a20416c60008301527f6c20706172616d657465722061727261792773206d757374206861766520612060208301527f6c656e6774682067726561746572207468616e207a65726f2e000000000000006040830152606082019050919050565b610cfe81610f6e565b82525050565b6000610d0f82610b9d565b9150819050919050565b6000602082019050610d2e60008301846108b5565b92915050565b6000604082019050610d4960008301856108a6565b610d566020830184610cf5565b9392505050565b60006080820190508181036000830152610d7881898b6108d3565b90508181036020830152610d8d8187896108d3565b90508181036040830152610da28185876108d3565b9050610db160608301846108c4565b98975050505050505050565b60006020820190508181036000830152610dd78184610900565b905092915050565b60006020820190508181036000830152610df881610939565b9050919050565b60006020820190508181036000830152610e18816109c5565b9050919050565b60006020820190508181036000830152610e3881610a05565b9050919050565b60006020820190508181036000830152610e5881610a91565b9050919050565b60006020820190508181036000830152610e7881610af7565b9050919050565b60006020820190508181036000830152610e9881610b37565b9050919050565b60006020820190508181036000830152610eb881610bb7565b9050919050565b60006020820190508181036000830152610ed881610c69565b9050919050565b6000602082019050610ef46000830184610cf5565b92915050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000610f3d82610f4e565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000610f8382610f8a565b9050919050565b6000610f9582610f9c565b9050919050565b6000610fa782610f4e565b9050919050565b82818337600083830152505050565b60005b83811015610fdb578082015181840152602081019050610fc0565b83811115610fea576000848401525b50505050565b6000601f19601f830116905091905056fea365627a7a72315820e2656b628c68ffd1e92b24afd82b4ca42816054a2e4c9addcff9c1da6bf3c00b6c6578706572696d656e74616cf564736f6c634300050b0040

Verified Source Code Partial Match

Compiler: v0.5.11+commit.22be8592 EVM: petersburg Optimization: No
BatchDeposit.sol 363 lines
pragma solidity 0.5.11;

/// npm package/version - @openzeppelin/contracts-ethereum-package: 2.5.0

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }

    /**
     * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     *
     * _Available since v2.4.0._
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-call-value
        (bool success, ) = recipient.call.value(amount)("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }
}


pragma solidity 0.5.11;

/// npm package/version - @openzeppelin/contracts-ethereum-package: 2.5.0

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}


// SPDX-License-Identifier: MIT

pragma solidity 0.5.11;

/// @notice  Interface of the official Deposit contract from the ETH
///          Foundation.
interface IDeposit {

    /// @notice Submit a Phase 0 DepositData object.
    ///
    /// @param pubkey - A BLS12-381 public key.
    /// @param withdrawal_credentials - Commitment to a public key for withdrawals.
    /// @param signature - A BLS12-381 signature.
    /// @param deposit_data_root - The SHA-256 hash of the SSZ-encoded DepositData object.
    ///                            Used as a protection against malformed input.
    function deposit(
        bytes calldata pubkey,
        bytes calldata withdrawal_credentials,
        bytes calldata signature,
        bytes32 deposit_data_root
    ) external payable;

}


// SPDX-License-Identifier: MIT

pragma solidity 0.5.11;
pragma experimental ABIEncoderV2;

/// @notice  Batch ETH2 deposits, uses the official Deposit contract from the ETH
///          Foundation for each atomic deposit. This contract acts as a for loop.
///          Each deposit size will be an optimal 32 ETH.
///
/// @dev     The batch size has an upper bound due to the block gas limit. Each atomic
///          deposit costs ~62,000 gas. The current block gas-limit is ~12,400,000 gas.
///
/// Author:  Staked Securely, Inc. (https://staked.us/)
contract BatchDeposit {
    using Address for address payable;
    using SafeMath for uint256;

    /*************** STORAGE VARIABLE DECLARATIONS **************/

    uint256 public constant DEPOSIT_AMOUNT = 32 ether;
    // currently points at the Mainnet Deposit Contract
    address public constant DEPOSIT_CONTRACT_ADDRESS = 0x00000000219ab540356cBB839Cbe05303d7705Fa;
    IDeposit private constant DEPOSIT_CONTRACT = IDeposit(DEPOSIT_CONTRACT_ADDRESS);

    /*************** EVENT DECLARATIONS **************/

    /// @notice  Signals a refund of sent-in Ether that was extra and not required.
    ///
    /// @dev     The refund is sent to the msg.sender.
    ///
    /// @param  to - The ETH address receiving the ETH.
    /// @param  amount - The amount of ETH being refunded.
    event LogSendDepositLeftover(address to, uint256 amount);

    /////////////////////// FUNCTION DECLARATIONS BEGIN ///////////////////////

    /********************* PUBLIC FUNCTIONS **********************/

    /// @notice  Empty constructor.
    constructor() public {}

    /// @notice  Fallback function.
    ///
    /// @dev     Used to address parties trying to send in Ether with a helpful
    ///          error message.
    function() external payable {
        revert("#BatchDeposit fallback(): Use the `batchDeposit(...)` function to send Ether to this contract.");
    }

    /// @notice Submit index-matching arrays that form Phase 0 DepositData objects.
    ///         Will create a deposit transaction per index of the arrays submitted.
    ///
    /// @param pubkeys - An array of BLS12-381 public keys.
    /// @param withdrawal_credentials - An array of public keys for withdrawals.
    /// @param signatures - An array of BLS12-381 signatures.
    /// @param deposit_data_roots - An array of the SHA-256 hash of the SSZ-encoded DepositData object.
    function batchDeposit(
        bytes[] calldata pubkeys,
        bytes[] calldata withdrawal_credentials,
        bytes[] calldata signatures,
        bytes32[] calldata deposit_data_roots
    ) external payable {
        require(
            pubkeys.length == withdrawal_credentials.length &&
            pubkeys.length == signatures.length &&
            pubkeys.length == deposit_data_roots.length,
            "#BatchDeposit batchDeposit(): All parameter array's must have the same length."
        );
        require(
            pubkeys.length > 0,
            "#BatchDeposit batchDeposit(): All parameter array's must have a length greater than zero."
        );
        require(
            msg.value >= DEPOSIT_AMOUNT.mul(pubkeys.length),
            "#BatchDeposit batchDeposit(): Ether deposited needs to be at least: 32 * (parameter `pubkeys[]` length)."
        );
        uint256 deposited = 0;

        // Loop through DepositData arrays submitting deposits
        for (uint256 i = 0; i < pubkeys.length; i++) {
            DEPOSIT_CONTRACT.deposit.value(DEPOSIT_AMOUNT)(
                pubkeys[i],
                withdrawal_credentials[i],
                signatures[i],
                deposit_data_roots[i]
            );
            deposited = deposited.add(DEPOSIT_AMOUNT);
        }
        assert(deposited == DEPOSIT_AMOUNT.mul(pubkeys.length));
        uint256 ethToReturn = msg.value.sub(deposited);
        if (ethToReturn > 0) {

          // Emit `LogSendDepositLeftover` log
          emit LogSendDepositLeftover(msg.sender, ethToReturn);

          // This function doesn't guard against re-entrancy, and we're calling an
          // untrusted address, but in this situation there is no state, etc. to
          // take advantage of, so re-entrancy guard is unneccesary gas cost.
          // This function uses call.value(), and handles return values/failures by
          // reverting the transaction.
          (msg.sender).sendValue(ethToReturn);
        }
    }
}

Read Contract

DEPOSIT_AMOUNT 0xec6925a7 → uint256
DEPOSIT_CONTRACT_ADDRESS 0xa524679e → address

Write Contract 1 functions

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

batchDeposit 0xca0bfcce
bytes[] pubkeys
bytes[] withdrawal_credentials
bytes[] signatures
bytes32[] deposit_data_roots

Recent Transactions

No transactions found for this address