Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x0194512e77d798E4871973d9cB9D7DDFC0fFd801
Balance 0 ETH
Nonce 1
Code Size 5661 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

5661 bytes
0x6080604052600436106100b15760003560e01c80638456cb5911610069578063c82655b71161004e578063c82655b7146101c8578063ddca3f431461032e578063f2fde38b14610355576100b1565b80638456cb59146101755780638da5cb5b1461018a576100b1565b80635c975abb1161009a5780635c975abb1461010d5780636a1db1bf14610136578063715018a614610160576100b1565b80633f4ba83a146100b657806351cff8d9146100cd575b600080fd5b3480156100c257600080fd5b506100cb610395565b005b3480156100d957600080fd5b506100cb600480360360208110156100f057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610435565b34801561011957600080fd5b506101226105cc565b604080519115158252519081900360200190f35b34801561014257600080fd5b506100cb6004803603602081101561015957600080fd5b50356105d5565b34801561016c57600080fd5b506100cb61077b565b34801561018157600080fd5b506100cb610862565b34801561019657600080fd5b5061019f610900565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100cb600480360360808110156101de57600080fd5b8101906020810181356401000000008111156101f957600080fd5b82018360208201111561020b57600080fd5b8035906020019184600183028401116401000000008311171561022d57600080fd5b91939092909160208101903564010000000081111561024b57600080fd5b82018360208201111561025d57600080fd5b8035906020019184600183028401116401000000008311171561027f57600080fd5b91939092909160208101903564010000000081111561029d57600080fd5b8201836020820111156102af57600080fd5b803590602001918460018302840111640100000000831117156102d157600080fd5b9193909290916020810190356401000000008111156102ef57600080fd5b82018360208201111561030157600080fd5b8035906020019184602083028401116401000000008311171561032357600080fd5b509092509050610921565b34801561033a57600080fd5b50610343610f68565b60408051918252519081900360200190f35b34801561036157600080fd5b506100cb6004803603602081101561037857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610f6e565b61039d611107565b600054610100900473ffffffffffffffffffffffffffffffffffffffff90811691161461042b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61043361110b565b565b61043d611107565b600054610100900473ffffffffffffffffffffffffffffffffffffffff9081169116146104cb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116610537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061145d6021913960400191505060405180910390fd5b6040805147808252915173ffffffffffffffffffffffffffffffffffffffff8416917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a260405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f193505050501580156105c7573d6000803e3d6000fd5b505050565b60005460ff1690565b6105dd611107565b600054610100900473ffffffffffffffffffffffffffffffffffffffff90811691161461066b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6002548114156106c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806114d46026913960400191505060405180910390fd5b633b9aca0081061561073957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f466565206d7573742062652061206d756c7469706c65206f6620475745490000604482015290519081900360640190fd5b600254604080519182526020820183905280517f5fc463da23c1b063e66f9e352006a7fbe8db7223c455dc429e881a2dfe2f94f19281900390910190a1600255565b610783611107565b600054610100900473ffffffffffffffffffffffffffffffffffffffff90811691161461081157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806114ae6026913960400191505060405180910390fd5b61086a611107565b600054610100900473ffffffffffffffffffffffffffffffffffffffff9081169116146108f857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6104336111f7565b600054610100900473ffffffffffffffffffffffffffffffffffffffff1690565b60005460ff161561099357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b633b9aca003406156109f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061147e6030913960400191505060405180910390fd5b6801bc16d674ec800000341015610a6857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f42617463684465706f7369743a20416d6f756e7420697320746f6f206c6f7700604482015290519081900360640190fd5b8080610abf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806115b16037913960400191505060405180910390fd5b6064811115610b19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180611551603a913960400191505060405180910390fd5b603081028814610b74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061158b6026913960400191505060405180910390fd5b606081028414610bcf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611433602a913960400191505060405180910390fd5b60208614610c28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806114fa6036913960400191505060405180910390fd5b6000610c5882610c4c6801bc16d674ec8000006002546112bd90919063ffffffff16565b9063ffffffff61133a16565b9050803414610cb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806113fc6037913960400191505060405180910390fd5b60025433907f06c5efeff5c320943d265dc4e5f1af95ad523555ce0c1957e367dda5514572df90610ce9908563ffffffff61133a16565b60408051918252519081900360200190a260005b82811015610f5b576060610d1c60306001840181029084028d8f6113ad565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092935060609250610d6a9150506001840182028483028a8c6113ad565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506001549293505073ffffffffffffffffffffffffffffffffffffffff909116905063228951186801bc16d674ec800000848e8e868d8d8b818110610ddc57fe5b905060200201356040518763ffffffff1660e01b815260040180806020018060200180602001858152602001848103845289818151815260200191508051906020019080838360005b83811015610e3d578181015183820152602001610e25565b50505050905090810190601f168015610e6a5780820380516001836020036101000a031916815260200191505b5084810383528781526020018888808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092018681038452885181528851602091820193918a019250908190849084905b83811015610ee4578181015183820152602001610ecc565b50505050905090810190601f168015610f115780820380516001836020036101000a031916815260200191505b50985050505050505050506000604051808303818588803b158015610f3557600080fd5b505af1158015610f49573d6000803e3d6000fd5b50505050505050806001019050610cfd565b5050505050505050505050565b60025490565b610f76611107565b600054610100900473ffffffffffffffffffffffffffffffffffffffff90811691161461100457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116611070576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806113d66026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff8085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b3390565b60005460ff1661117c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6111cd611107565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b60005460ff161561126957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586111cd611107565b60008282018381101561133157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b60008261134957506000611334565b8282028284828161135657fe5b0414611331576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806115306021913960400191505060405180910390fd5b600080858511156113bc578182fd5b838611156113c8578182fd5b505082019391909203915056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737342617463684465706f7369743a20416d6f756e74206973206e6f7420616c69676e65642077697468207075626b657973206e756d62657242617463684465706f7369743a205369676e61747572657320636f756e7420646f6e2774206d61746368596f752063616e2774206275726e20746865736520657468206469726563746c7942617463684465706f7369743a204465706f7369742076616c7565206e6f74206d756c7469706c65206f6620475745494f776e61626c653a2072656e6f756e63654f776e6572736869702069732064697361626c6564466565206d75737420626520646966666572656e742066726f6d2063757272656e74206f6e6542617463684465706f7369743a205769746864726177616c2043726564656e7469616c7320636f756e7420646f6e2774206d61746368536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7742617463684465706f7369743a20596f752063616e206465706f736974206d6178203130302076616c696461746f727320617420612074696d6542617463684465706f7369743a205075626b657920636f756e7420646f6e2774206d6174636842617463684465706f7369743a20596f752073686f756c64206465706f736974206174206c65617374206f6e652076616c696461746f72a2646970667358221220eacb351e6d2591c0cf9408285043c99e9aa6f49b90277e56a464fb65d30e1cea64736f6c634300060b0033

Verified Source Code Full Match

Compiler: v0.6.11+commit.5ef660b1 EVM: istanbul Optimization: Yes (5000000 runs)
BatchDepositMainnet.sol 531 lines
//                                                                           ,,---.
//                                                                         .-^^,_  `.
//                                                                    ;`, / 3 ( o\   }
//         __             __                     ___              __  \  ;   \`, /  ,'
//        /\ \__         /\ \                  /'___\ __         /\ \ ;_/^`.__.-"  ,'
//    ____\ \ ,_\    __  \ \ \/'\      __     /\ \__//\_\    ____\ \ \___     `---'
//   /',__\\ \ \/  /'__`\ \ \ , <    /'__`\   \ \ ,__\/\ \  /',__\\ \  _ `\
//  /\__, `\\ \ \_/\ \L\.\_\ \ \\`\ /\  __/  __\ \ \_/\ \ \/\__, `\\ \ \ \ \
//  \/\____/ \ \__\ \__/.\_\\ \_\ \_\ \____\/\_\\ \_\  \ \_\/\____/ \ \_\ \_\
//   \/___/   \/__/\/__/\/_/ \/_/\/_/\/____/\/_/ \/_/   \/_/\/___/   \/_/\/_/
//
// stakefish Eth2 Batch Deposit contract
//
// ### WARNING ###
// DO NOT USE THIS CONTRACT DIRECTLY. THIS CONTRACT IS ONLY TO BE USED 
// BY STAKING VIA stakefish's WEBSITE LOCATED AT: https://stake.fish
//
// This contract allows deposit of multiple validators in one transaction
// and also collects the validator service fee for stakefish
//
// SPDX-License-Identifier: Apache-2.0

pragma solidity 0.6.11;





/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}





/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!_paused, "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(_paused, "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}





/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}





/**
 * @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.
     */
    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.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        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.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}





// Deposit contract interface
interface IDepositContract {
    /// @notice A processed deposit event.
    event DepositEvent(
        bytes pubkey,
        bytes withdrawal_credentials,
        bytes amount,
        bytes signature,
        bytes index
    );

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

    /// @notice Query the current deposit root hash.
    /// @return The deposit root hash.
    function get_deposit_root() external view returns (bytes32);

    /// @notice Query the current deposit count.
    /// @return The deposit count encoded as a little endian 64-bit number.
    function get_deposit_count() external view returns (bytes memory);
}


contract BatchDeposit is Pausable, Ownable {
    using SafeMath for uint256;

    address depositContract;
    uint256 private _fee;

    uint256 constant PUBKEY_LENGTH = 48;
    uint256 constant SIGNATURE_LENGTH = 96;
    uint256 constant CREDENTIALS_LENGTH = 32;
    uint256 constant MAX_VALIDATORS = 100;
    uint256 constant DEPOSIT_AMOUNT = 32 ether;

    event FeeChanged(uint256 previousFee, uint256 newFee);
    event Withdrawn(address indexed payee, uint256 weiAmount);
    event FeeCollected(address indexed payee, uint256 weiAmount);

    constructor(address depositContractAddr, uint256 initialFee) public {
        require(initialFee % 1 gwei == 0, "Fee must be a multiple of GWEI");

        depositContract = depositContractAddr;
        _fee = initialFee;
    }

    /**
     * @dev Performs a batch deposit, asking for an additional fee payment.
     */
    function batchDeposit(
        bytes calldata pubkeys, 
        bytes calldata withdrawal_credentials, 
        bytes calldata signatures, 
        bytes32[] calldata deposit_data_roots
    ) 
        external payable whenNotPaused 
    {
        // sanity checks
        require(msg.value % 1 gwei == 0, "BatchDeposit: Deposit value not multiple of GWEI");
        require(msg.value >= DEPOSIT_AMOUNT, "BatchDeposit: Amount is too low");

        uint256 count = deposit_data_roots.length;
        require(count > 0, "BatchDeposit: You should deposit at least one validator");
        require(count <= MAX_VALIDATORS, "BatchDeposit: You can deposit max 100 validators at a time");

        require(pubkeys.length == count * PUBKEY_LENGTH, "BatchDeposit: Pubkey count don't match");
        require(signatures.length == count * SIGNATURE_LENGTH, "BatchDeposit: Signatures count don't match");
        require(withdrawal_credentials.length == 1 * CREDENTIALS_LENGTH, "BatchDeposit: Withdrawal Credentials count don't match");

        uint256 expectedAmount = _fee.add(DEPOSIT_AMOUNT).mul(count);
        require(msg.value == expectedAmount, "BatchDeposit: Amount is not aligned with pubkeys number");

        emit FeeCollected(msg.sender, _fee.mul(count));

        for (uint256 i = 0; i < count; ++i) {
            bytes memory pubkey = bytes(pubkeys[i*PUBKEY_LENGTH:(i+1)*PUBKEY_LENGTH]);
            bytes memory signature = bytes(signatures[i*SIGNATURE_LENGTH:(i+1)*SIGNATURE_LENGTH]);

            IDepositContract(depositContract).deposit{value: DEPOSIT_AMOUNT}(
                pubkey,
                withdrawal_credentials,
                signature,
                deposit_data_roots[i]
            );
        }
    }

    /**
     * @dev Withdraw accumulated fee in the contract
     *
     * @param receiver The address where all accumulated funds will be transferred to.
     * Can only be called by the current owner.
     */
    function withdraw(address payable receiver) public onlyOwner {       
        require(receiver != address(0), "You can't burn these eth directly");

        uint256 amount = address(this).balance;
        emit Withdrawn(receiver, amount);
        receiver.transfer(amount);
    }

    /**
     * @dev Change the validator fee (`newOwner`).
     * Can only be called by the current owner.
     */
    function changeFee(uint256 newFee) public onlyOwner {
        require(newFee != _fee, "Fee must be different from current one");
        require(newFee % 1 gwei == 0, "Fee must be a multiple of GWEI");

        emit FeeChanged(_fee, newFee);
        _fee = newFee;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function pause() public onlyOwner {
        _pause();
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function unpause() public onlyOwner {
        _unpause();
    }

    /**
     * @dev Returns the current fee
     */
    function fee() public view returns (uint256) {
        return _fee;
    }
  
    /**
     * Disable renunce ownership
     */
    function renounceOwnership() public override onlyOwner {
        revert("Ownable: renounceOwnership is disabled");
    }
}

Read Contract

fee 0xddca3f43 → uint256
owner 0x8da5cb5b → address
paused 0x5c975abb → bool

Write Contract 7 functions

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

batchDeposit 0xc82655b7
bytes pubkeys
bytes withdrawal_credentials
bytes signatures
bytes32[] deposit_data_roots
changeFee 0x6a1db1bf
uint256 newFee
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
withdraw 0x51cff8d9
address receiver

Recent Transactions

No transactions found for this address