Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xFA5f9EAa65FFb2A75de092eB7f3fc84FC86B5b18
Balance 0 ETH
Nonce 1
Code Size 3725 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

3725 bytes
0x6080604052600436106100e15760003560e01c80638456cb591161007f578063d8dfeb4511610059578063d8dfeb451461020e578063e94ad65b14610223578063f2fde38b14610238578063f4fbdfac1461025857610107565b80638456cb59146101c25780638da5cb5b146101d7578063a5ab1d31146101f957610107565b80634903e8be116100bb5780634903e8be146101635780634f498c73146101785780635c975abb1461018b578063715018a6146101ad57610107565b80631b9a93231461010c5780633f4ba83a1461013757806343ba591d1461014e57610107565b366101075760405162461bcd60e51b81526004016100fe90610bb3565b60405180910390fd5b600080fd5b34801561011857600080fd5b5061012161026d565b60405161012e9190610db9565b60405180910390f35b34801561014357600080fd5b5061014c610272565b005b34801561015a57600080fd5b506101216102bb565b34801561016f57600080fd5b506101216102c0565b61014c61018636600461092b565b6102c5565b34801561019757600080fd5b506101a0610603565b60405161012e9190610a41565b3480156101b957600080fd5b5061014c61060c565b3480156101ce57600080fd5b5061014c61069b565b3480156101e357600080fd5b506101ec6106e2565b60405161012e9190610a14565b34801561020557600080fd5b506101216106f6565b34801561021a57600080fd5b506101216106fb565b34801561022f57600080fd5b506101ec610708565b34801561024457600080fd5b5061014c6102533660046108fd565b610717565b34801561026457600080fd5b506101216107e3565b606081565b61027a6107e8565b6001600160a01b031661028b6106e2565b6001600160a01b0316146102b15760405162461bcd60e51b81526004016100fe90610cc6565b6102b96107ec565b565b606481565b603081565b6102cd610603565b156102ea5760405162461bcd60e51b81526004016100fe90610c58565b8680158015906102fb575060648111155b6103175760405162461bcd60e51b81526004016100fe90610b00565b61032a816801bc16d674ec800000610e07565b34146103485760405162461bcd60e51b81526004016100fe90610cfb565b858114801561035657508381145b801561036157508181145b61037d5760405162461bcd60e51b81526004016100fe90610c04565b60005b818110156105be5760308a8a838181106103aa57634e487b7160e01b600052603260045260246000fd5b90506020028101906103bc9190610dc2565b9050146103db5760405162461bcd60e51b81526004016100fe90610a9d565b60208888838181106103fd57634e487b7160e01b600052603260045260246000fd5b905060200281019061040f9190610dc2565b90501461042e5760405162461bcd60e51b81526004016100fe90610d69565b606086868381811061045057634e487b7160e01b600052603260045260246000fd5b90506020028101906104629190610dc2565b9050146104815760405162461bcd60e51b81526004016100fe90610c82565b6002546001600160a01b031663228951186801bc16d674ec8000008c8c858181106104bc57634e487b7160e01b600052603260045260246000fd5b90506020028101906104ce9190610dc2565b8c8c878181106104ee57634e487b7160e01b600052603260045260246000fd5b90506020028101906105009190610dc2565b8c8c8981811061052057634e487b7160e01b600052603260045260246000fd5b90506020028101906105329190610dc2565b8c8c8b81811061055257634e487b7160e01b600052603260045260246000fd5b905060200201356040518963ffffffff1660e01b815260040161057b9796959493929190610a4c565b6000604051808303818588803b15801561059457600080fd5b505af11580156105a8573d6000803e3d6000fd5b5050505050806105b790610e26565b9050610380565b507f2d8a08b6430a894aea608bcaa6013d5d3e263bc49110605e4d4ba76930ae5c2933826040516105f0929190610a28565b60405180910390a1505050505050505050565b60015460ff1690565b6106146107e8565b6001600160a01b03166106256106e2565b6001600160a01b03161461064b5760405162461bcd60e51b81526004016100fe90610cc6565b60015460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360018054610100600160a81b0319169055565b6106a36107e8565b6001600160a01b03166106b46106e2565b6001600160a01b0316146106da5760405162461bcd60e51b81526004016100fe90610cc6565b6102b961085a565b60015461010090046001600160a01b031690565b602081565b6801bc16d674ec80000081565b6002546001600160a01b031681565b61071f6107e8565b6001600160a01b03166107306106e2565b6001600160a01b0316146107565760405162461bcd60e51b81526004016100fe90610cc6565b6001600160a01b03811661077c5760405162461bcd60e51b81526004016100fe90610b6d565b6001546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600181565b3390565b6107f4610603565b6108105760405162461bcd60e51b81526004016100fe90610ad2565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6108436107e8565b6040516108509190610a14565b60405180910390a1565b610862610603565b1561087f5760405162461bcd60e51b81526004016100fe90610c58565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586108436107e8565b60008083601f8401126108c5578182fd5b50813567ffffffffffffffff8111156108dc578182fd5b60208301915083602080830285010111156108f657600080fd5b9250929050565b60006020828403121561090e578081fd5b81356001600160a01b0381168114610924578182fd5b9392505050565b6000806000806000806000806080898b031215610946578384fd5b883567ffffffffffffffff8082111561095d578586fd5b6109698c838d016108b4565b909a50985060208b0135915080821115610981578586fd5b61098d8c838d016108b4565b909850965060408b01359150808211156109a5578586fd5b6109b18c838d016108b4565b909650945060608b01359150808211156109c9578384fd5b506109d68b828c016108b4565b999c989b5096995094979396929594505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b600060808252610a6060808301898b6109ea565b8281036020840152610a7381888a6109ea565b90508281036040840152610a888186886109ea565b91505082606083015298975050505050505050565b6020808252818101527f4162797373457468324465706f7369746f723a2077726f6e67207075626b6579604082015260600190565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b60208082526047908201527f4162797373457468324465706f7369746f723a20796f752063616e206465706f60408201527f736974206f6e6c79203120746f20313030206e6f64657320706572207472616e60608201526639b0b1ba34b7b760c91b608082015260a00190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526031908201527f4162797373457468324465706f7369746f723a20646f206e6f742073656e6420604082015270455448206469726563746c79206865726560781b606082015260800190565b60208082526034908201527f4162797373457468324465706f7369746f723a20616d6f756e74206f662070616040820152730e4c2dacae8cae4e640c8de40dcde40dac2e8c6d60631b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526024908201527f4162797373457468324465706f7369746f723a2077726f6e67207369676e61746040820152637572657360e01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526048908201527f4162797373457468324465706f7369746f723a2074686520616d6f756e74206f60408201527f662045544820646f6573206e6f74206d617463682074686520616d6f756e74206060820152676f66206e6f64657360c01b608082015260a00190565b60208082526030908201527f4162797373457468324465706f7369746f723a2077726f6e672077697468647260408201526f6177616c2063726564656e7469616c7360801b606082015260800190565b90815260200190565b6000808335601e19843603018112610dd8578283fd5b83018035915067ffffffffffffffff821115610df2578283fd5b6020019150368190038213156108f657600080fd5b6000816000190483118215151615610e2157610e21610e41565b500290565b6000600019821415610e3a57610e3a610e41565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220250057050b8191c5295e7546f5c4608ed1d063366331ac4685ce828309b1890164736f6c63430008010033

Verified Source Code Full Match

Compiler: v0.8.1+commit.df193b15 EVM: istanbul Optimization: Yes (200 runs)
Context.sol 24 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/*
 * @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) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}
Ownable.sol 68 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";
/**
 * @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.
 */
abstract 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 () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual 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;
    }
}
Pausable.sol 90 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Context.sol";

/**
 * @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.
 */
abstract 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 () {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual 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());
    }
}
ReentrancyGuard.sol 62 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}
AbyssEth2Depositor.sol 127 lines
/*
░█████╗░██████╗░██╗░░░██╗░██████╗░██████╗  ███████╗██╗███╗░░██╗░█████╗░███╗░░██╗░█████╗░███████╗
██╔══██╗██╔══██╗╚██╗░██╔╝██╔════╝██╔════╝  ██╔════╝██║████╗░██║██╔══██╗████╗░██║██╔══██╗██╔════╝
███████║██████╦╝░╚████╔╝░╚█████╗░╚█████╗░  █████╗░░██║██╔██╗██║███████║██╔██╗██║██║░░╚═╝█████╗░░
██╔══██║██╔══██╗░░╚██╔╝░░░╚═══██╗░╚═══██╗  ██╔══╝░░██║██║╚████║██╔══██║██║╚████║██║░░██╗██╔══╝░░
██║░░██║██████╦╝░░░██║░░░██████╔╝██████╔╝  ██║░░░░░██║██║░╚███║██║░░██║██║░╚███║╚█████╔╝███████╗
╚═╝░░╚═╝╚═════╝░░░░╚═╝░░░╚═════╝░╚═════╝░  ╚═╝░░░░░╚═╝╚═╝░░╚══╝╚═╝░░╚═╝╚═╝░░╚══╝░╚════╝░╚══════╝
*/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "../contracts/interfaces/IDepositContract.sol";

contract AbyssEth2Depositor is ReentrancyGuard, Pausable, Ownable {

    /**
     * @dev Eth2 Deposit Contract address.
     */
    IDepositContract public depositContract;

    /**
     * @dev Minimal and maximum amount of nodes per transaction.
     */
    uint256 public constant nodesMinAmount = 1;
    uint256 public constant nodesMaxAmount = 100;
    uint256 public constant pubkeyLength = 48;
    uint256 public constant credentialsLength = 32;
    uint256 public constant signatureLength = 96;

    /**
     * @dev Collateral size of one node.
     */
    uint256 public constant collateral = 32 ether;

    /**
     * @dev Setting Eth2 Smart Contract address during construction.
     */
    constructor(bool mainnet, address depositContract_) {
        if (mainnet == true) {
            depositContract = IDepositContract(0x00000000219ab540356cBB839Cbe05303d7705Fa);
        } else if (depositContract_ == 0x0000000000000000000000000000000000000000) {
            depositContract = IDepositContract(0x8c5fecdC472E27Bc447696F431E425D02dd46a8c);
        } else {
            depositContract = IDepositContract(depositContract_);
        }
    }

    /**
     * @dev This contract will not accept direct ETH transactions.
     */
    receive() external payable {
        revert("AbyssEth2Depositor: do not send ETH directly here");
    }

    /**
     * @dev Function that allows to deposit up to 100 nodes at once.
     *
     * - pubkeys                - Array of BLS12-381 public keys.
     * - withdrawal_credentials - Array of commitments to a public keys for withdrawals.
     * - signatures             - Array of BLS12-381 signatures.
     * - deposit_data_roots     - Array of the SHA-256 hashes of the SSZ-encoded DepositData objects.
     */
    function deposit(
        bytes[] calldata pubkeys,
        bytes[] calldata withdrawal_credentials,
        bytes[] calldata signatures,
        bytes32[] calldata deposit_data_roots
    ) external payable whenNotPaused {

        uint256 nodesAmount = pubkeys.length;

        require(nodesAmount > 0 && nodesAmount <= 100, "AbyssEth2Depositor: you can deposit only 1 to 100 nodes per transaction");
        require(msg.value == collateral * nodesAmount, "AbyssEth2Depositor: the amount of ETH does not match the amount of nodes");


        require(
            withdrawal_credentials.length == nodesAmount &&
            signatures.length == nodesAmount &&
            deposit_data_roots.length == nodesAmount,
            "AbyssEth2Depositor: amount of parameters do no match");

        for (uint256 i = 0; i < nodesAmount; ++i) {
            require(pubkeys[i].length == pubkeyLength, "AbyssEth2Depositor: wrong pubkey");
            require(withdrawal_credentials[i].length == credentialsLength, "AbyssEth2Depositor: wrong withdrawal credentials");
            require(signatures[i].length == signatureLength, "AbyssEth2Depositor: wrong signatures");

            IDepositContract(address(depositContract)).deposit{value: collateral}(
                pubkeys[i],
                withdrawal_credentials[i],
                signatures[i],
                deposit_data_roots[i]
            );

        }

        emit DepositEvent(msg.sender, nodesAmount);
    }

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

    event DepositEvent(address from, uint256 nodesAmount);
}
IDepositContract.sol 38 lines
// SPDX-License-Identifier: CC0-1.0

pragma solidity ^0.8.0;

// This interface is designed to be compatible with the Vyper version.
/// @notice This is the Ethereum 2.0 deposit contract interface.
/// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs
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);
}

Read Contract

collateral 0xd8dfeb45 → uint256
credentialsLength 0xa5ab1d31 → uint256
depositContract 0xe94ad65b → address
nodesMaxAmount 0x43ba591d → uint256
nodesMinAmount 0xf4fbdfac → uint256
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
pubkeyLength 0x4903e8be → uint256
signatureLength 0x1b9a9323 → uint256

Write Contract 5 functions

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

deposit 0x4f498c73
bytes[] pubkeys
bytes[] withdrawal_credentials
bytes[] signatures
bytes32[] deposit_data_roots
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters

Recent Transactions

No transactions found for this address