Source Code
Latest 11 from a total of 11 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Deposit Multiple... | 23924191 | 99 days ago | IN | 320 ETH | 0.00002041 | ||||
| Deposit Multiple... | 21905927 | 382 days ago | IN | 32 ETH | 0.00011622 | ||||
| Deposit Multiple... | 21371146 | 456 days ago | IN | 64 ETH | 0.00247812 | ||||
| Deposit Multiple... | 21178813 | 483 days ago | IN | 160 ETH | 0.00901091 | ||||
| Deposit Multiple... | 19651585 | 696 days ago | IN | 32 ETH | 0.00100281 | ||||
| Deposit Multiple... | 19024008 | 784 days ago | IN | 32 ETH | 0.00334915 | ||||
| Deposit Multiple... | 19022998 | 785 days ago | IN | 32 ETH | 0.00309541 | ||||
| Deposit Multiple... | 19022805 | 785 days ago | IN | 96 ETH | 0.00601567 | ||||
| Deposit Multiple... | 19022784 | 785 days ago | IN | 32 ETH | 0.00307865 | ||||
| Deposit Multiple... | 18928621 | 798 days ago | IN | 32 ETH | 0.00239471 | ||||
| Deposit Multiple... | 18928554 | 798 days ago | IN | 32 ETH | 0.00246405 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 23924191 | 99 days ago | 32 ETH | ||||
| Deposit | 21905927 | 382 days ago | 32 ETH | ||||
| Deposit | 21371146 | 456 days ago | 32 ETH | ||||
| Deposit | 21371146 | 456 days ago | 32 ETH | ||||
| Deposit | 21178813 | 483 days ago | 32 ETH | ||||
| Deposit | 21178813 | 483 days ago | 32 ETH | ||||
| Deposit | 21178813 | 483 days ago | 32 ETH | ||||
| Deposit | 21178813 | 483 days ago | 32 ETH | ||||
| Deposit | 21178813 | 483 days ago | 32 ETH | ||||
| Deposit | 19651585 | 696 days ago | 32 ETH | ||||
| Deposit | 19024008 | 784 days ago | 32 ETH | ||||
| Deposit | 19022998 | 785 days ago | 32 ETH | ||||
| Deposit | 19022805 | 785 days ago | 32 ETH | ||||
| Deposit | 19022805 | 785 days ago | 32 ETH | ||||
| Deposit | 19022805 | 785 days ago | 32 ETH | ||||
| Deposit | 19022784 | 785 days ago | 32 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MultipleDeposit
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 1500000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Interfaces/IDepositContract.sol";
contract MultipleDeposit {
// address of the ETH2 deposit contracts on their respective networks and can be verified here: https://ethereum.org/en/staking/deposit-contract/
// verified deposit contract: https://etherscan.io/address/0x00000000219ab540356cbb839cbe05303d7705fa
address constant public MAINNET_DEPOSIT_ACCOUNT = 0x00000000219ab540356cBB839Cbe05303d7705Fa;
mapping (bytes32 => uint) public depositAmount; // amount sent per pubkey
IDepositContract public depositContract;
uint constant public STAKE_AMOUNT = 32 ether; // best amount for 1 validator
event ValidatorDeposited(address indexed _depositor, bytes _pubkey, uint _amount);
constructor()
{
require(block.chainid == 1, "MultipleDeposit: mainnet only");
depositContract = IDepositContract(MAINNET_DEPOSIT_ACCOUNT);
}
/// @dev make multiple deposits for different pubkey and withdrawal address combination
/// for detail meaning of the parameters, check the mainnet deposit contract source
/// these data are generated by the staking deposit cli https://github.com/ethereum/staking-deposit-cli
/// @param _forkVersion intended network for the given deposit json reserved for testnet use only
/// @param _pubkey list of pubkeys of the stakers
/// @param _withdrawal_credentials withdrawal address associated with each pubkey
/// @param _signature associated signature(signed by the corresponding pubkey holder(s))
/// @param _deposit_data_root associated data root to prevent malformed input
function depositMultipleValidators(
uint _forkVersion,
bytes[] calldata _pubkey,
bytes[] calldata _withdrawal_credentials,
bytes[] calldata _signature,
bytes32[] calldata _deposit_data_root)
external payable
{
uint noValidators = _pubkey.length;
require(0 == _forkVersion, "MultipleDeposit: deposit to wrong chain");
// supplied data must match
require( (noValidators > 0)
&& (_withdrawal_credentials.length == noValidators)
&& (_signature.length == noValidators)
&& (_deposit_data_root.length == noValidators), "MultipleDeposit: validator params don't match");
// tx caller must supply correct ETH for the deposit
require(msg.value == noValidators*STAKE_AMOUNT, "MultipleDeposit: incorrect ETH amount");
for (uint ii; ii < noValidators;) {
// prevent sending too much
bytes32 phash = keccak256(_pubkey[ii]);
depositAmount[phash] += STAKE_AMOUNT;
require(depositAmount[phash] <= 32 ether, "MultipleDeposit: already sent 32 ETH");
// withdrawal wallet locked-in the same as deposit wallet for the protection of validator owner
_checkWithdrawalCredential(_withdrawal_credentials[ii]);
// make the deposit to the deposit contract that would be picked up and accounted under the given pubkey in the Consensus Layer
// the data would be checked by the deposit contract for correctness and would revert if it is wrong
depositContract.deposit{value: STAKE_AMOUNT}(_pubkey[ii], _withdrawal_credentials[ii], _signature[ii], _deposit_data_root[ii]);
// event for tracking purpose of who and when the deposit is made
emit ValidatorDeposited(msg.sender, _pubkey[ii], STAKE_AMOUNT);
// gas optimization
unchecked {
ii++;
}
}
}
// ensure ETH provider is the same as withdrawal address, this means there is no 'deposit onbehalf of'
function _checkWithdrawalCredential(bytes calldata _withdrawal_credential) private view {
bytes memory xx = _withdrawal_credential;
bytes1 prefix = xx[0];
xx[0] = 0;
(address eth1Address) = abi.decode(xx, (address));
require(prefix == bytes1(uint8(1)) && msg.sender == eth1Address, "MultipleDeposit: ETH1 address not match");
}
}//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
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);
}{
"optimizer": {
"enabled": true,
"runs": 1500000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_depositor","type":"address"},{"indexed":false,"internalType":"bytes","name":"_pubkey","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ValidatorDeposited","type":"event"},{"inputs":[],"name":"MAINNET_DEPOSIT_ACCOUNT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKE_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"depositAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositContract","outputs":[{"internalType":"contract IDepositContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_forkVersion","type":"uint256"},{"internalType":"bytes[]","name":"_pubkey","type":"bytes[]"},{"internalType":"bytes[]","name":"_withdrawal_credentials","type":"bytes[]"},{"internalType":"bytes[]","name":"_signature","type":"bytes[]"},{"internalType":"bytes32[]","name":"_deposit_data_root","type":"bytes32[]"}],"name":"depositMultipleValidators","outputs":[],"stateMutability":"payable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50466001146100655760405162461bcd60e51b815260206004820152601d60248201527f4d756c7469706c654465706f7369743a206d61696e6e6574206f6e6c79000000604482015260640160405180910390fd5b600180546001600160a01b0319166f219ab540356cbb839cbe05303d7705fa179055610b50806100966000396000f3fe60806040526004361061005a5760003560e01c8063dfc8832811610043578063dfc88328146100b4578063e94ad65b146100fd578063faf5625f1461012a57600080fd5b806301fecab61461005f5780633a651b471461009f575b600080fd5b34801561006b57600080fd5b5061008c61007a3660046107c1565b60006020819052908152604090205481565b6040519081526020015b60405180910390f35b6100b26100ad366004610826565b610147565b005b3480156100c057600080fd5b506100d86f219ab540356cbb839cbe05303d7705fa81565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610096565b34801561010957600080fd5b506001546100d89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561013657600080fd5b5061008c6801bc16d674ec80000081565b8689156101db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d756c7469706c654465706f7369743a206465706f73697420746f2077726f6e60448201527f6720636861696e0000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000811180156101ea57508581145b80156101f557508381145b801561020057508181145b61028c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4d756c7469706c654465706f7369743a2076616c696461746f7220706172616d60448201527f7320646f6e2774206d617463680000000000000000000000000000000000000060648201526084016101d2565b61029f6801bc16d674ec80000082610925565b341461032d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d756c7469706c654465706f7369743a20696e636f727265637420455448206160448201527f6d6f756e7400000000000000000000000000000000000000000000000000000060648201526084016101d2565b60005b818110156105ff5760008a8a8381811061034c5761034c610962565b905060200281019061035e9190610991565b60405161036c9291906109f6565b604051809103902090506801bc16d674ec80000060008083815260200190815260200160002060008282546103a19190610a06565b90915550506000818152602081905260409020546801bc16d674ec800000101561044c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4d756c7469706c654465706f7369743a20616c72656164792073656e7420333260448201527f204554480000000000000000000000000000000000000000000000000000000060648201526084016101d2565b61047889898481811061046157610461610962565b90506020028101906104739190610991565b61060c565b60015473ffffffffffffffffffffffffffffffffffffffff1663228951186801bc16d674ec8000008d8d868181106104b2576104b2610962565b90506020028101906104c49190610991565b8d8d888181106104d6576104d6610962565b90506020028101906104e89190610991565b8d8d8a8181106104fa576104fa610962565b905060200281019061050c9190610991565b8d8d8c81811061051e5761051e610962565b905060200201356040518963ffffffff1660e01b81526004016105479796959493929190610a68565b6000604051808303818588803b15801561056057600080fd5b505af1158015610574573d6000803e3d6000fd5b50505050503373ffffffffffffffffffffffffffffffffffffffff167f3ab46c03bb9f10977da496dc5164cd671df680a8bf167db40794b004ffd509fe8c8c858181106105c3576105c3610962565b90506020028101906105d59190610991565b6801bc16d674ec8000006040516105ee93929190610ab9565b60405180910390a250600101610330565b5050505050505050505050565b600082828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508451949550938593508492501515905061065c5761065c610962565b602001015160f81c60f81b9050600060f81b8260008151811061068157610681610962565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000828060200190518101906106c69190610add565b90507fff0000000000000000000000000000000000000000000000000000000000000082167f010000000000000000000000000000000000000000000000000000000000000014801561072e57503373ffffffffffffffffffffffffffffffffffffffff8216145b6107ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d756c7469706c654465706f7369743a20455448312061646472657373206e6f60448201527f74206d617463680000000000000000000000000000000000000000000000000060648201526084016101d2565b5050505050565b6000602082840312156107d357600080fd5b5035919050565b60008083601f8401126107ec57600080fd5b50813567ffffffffffffffff81111561080457600080fd5b6020830191508360208260051b850101111561081f57600080fd5b9250929050565b600080600080600080600080600060a08a8c03121561084457600080fd5b8935985060208a013567ffffffffffffffff8082111561086357600080fd5b61086f8d838e016107da565b909a50985060408c013591508082111561088857600080fd5b6108948d838e016107da565b909850965060608c01359150808211156108ad57600080fd5b6108b98d838e016107da565b909650945060808c01359150808211156108d257600080fd5b506108df8c828d016107da565b915080935050809150509295985092959850929598565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561095d5761095d6108f6565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126109c657600080fd5b83018035915067ffffffffffffffff8211156109e157600080fd5b60200191503681900382131561081f57600080fd5b8183823760009101908152919050565b80820180821115610a1957610a196108f6565b92915050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b608081526000610a7c60808301898b610a1f565b8281036020840152610a8f81888a610a1f565b90508281036040840152610aa4818688610a1f565b91505082606083015298975050505050505050565b604081526000610acd604083018587610a1f565b9050826020830152949350505050565b600060208284031215610aef57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610b1357600080fd5b939250505056fea2646970667358221220b65d073e57d63a850c56423e1bf923900771fd5939820246ff778748f4fd734364736f6c63430008100033
Deployed Bytecode
0x60806040526004361061005a5760003560e01c8063dfc8832811610043578063dfc88328146100b4578063e94ad65b146100fd578063faf5625f1461012a57600080fd5b806301fecab61461005f5780633a651b471461009f575b600080fd5b34801561006b57600080fd5b5061008c61007a3660046107c1565b60006020819052908152604090205481565b6040519081526020015b60405180910390f35b6100b26100ad366004610826565b610147565b005b3480156100c057600080fd5b506100d86f219ab540356cbb839cbe05303d7705fa81565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610096565b34801561010957600080fd5b506001546100d89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561013657600080fd5b5061008c6801bc16d674ec80000081565b8689156101db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d756c7469706c654465706f7369743a206465706f73697420746f2077726f6e60448201527f6720636861696e0000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000811180156101ea57508581145b80156101f557508381145b801561020057508181145b61028c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4d756c7469706c654465706f7369743a2076616c696461746f7220706172616d60448201527f7320646f6e2774206d617463680000000000000000000000000000000000000060648201526084016101d2565b61029f6801bc16d674ec80000082610925565b341461032d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d756c7469706c654465706f7369743a20696e636f727265637420455448206160448201527f6d6f756e7400000000000000000000000000000000000000000000000000000060648201526084016101d2565b60005b818110156105ff5760008a8a8381811061034c5761034c610962565b905060200281019061035e9190610991565b60405161036c9291906109f6565b604051809103902090506801bc16d674ec80000060008083815260200190815260200160002060008282546103a19190610a06565b90915550506000818152602081905260409020546801bc16d674ec800000101561044c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4d756c7469706c654465706f7369743a20616c72656164792073656e7420333260448201527f204554480000000000000000000000000000000000000000000000000000000060648201526084016101d2565b61047889898481811061046157610461610962565b90506020028101906104739190610991565b61060c565b60015473ffffffffffffffffffffffffffffffffffffffff1663228951186801bc16d674ec8000008d8d868181106104b2576104b2610962565b90506020028101906104c49190610991565b8d8d888181106104d6576104d6610962565b90506020028101906104e89190610991565b8d8d8a8181106104fa576104fa610962565b905060200281019061050c9190610991565b8d8d8c81811061051e5761051e610962565b905060200201356040518963ffffffff1660e01b81526004016105479796959493929190610a68565b6000604051808303818588803b15801561056057600080fd5b505af1158015610574573d6000803e3d6000fd5b50505050503373ffffffffffffffffffffffffffffffffffffffff167f3ab46c03bb9f10977da496dc5164cd671df680a8bf167db40794b004ffd509fe8c8c858181106105c3576105c3610962565b90506020028101906105d59190610991565b6801bc16d674ec8000006040516105ee93929190610ab9565b60405180910390a250600101610330565b5050505050505050505050565b600082828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508451949550938593508492501515905061065c5761065c610962565b602001015160f81c60f81b9050600060f81b8260008151811061068157610681610962565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000828060200190518101906106c69190610add565b90507fff0000000000000000000000000000000000000000000000000000000000000082167f010000000000000000000000000000000000000000000000000000000000000014801561072e57503373ffffffffffffffffffffffffffffffffffffffff8216145b6107ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d756c7469706c654465706f7369743a20455448312061646472657373206e6f60448201527f74206d617463680000000000000000000000000000000000000000000000000060648201526084016101d2565b5050505050565b6000602082840312156107d357600080fd5b5035919050565b60008083601f8401126107ec57600080fd5b50813567ffffffffffffffff81111561080457600080fd5b6020830191508360208260051b850101111561081f57600080fd5b9250929050565b600080600080600080600080600060a08a8c03121561084457600080fd5b8935985060208a013567ffffffffffffffff8082111561086357600080fd5b61086f8d838e016107da565b909a50985060408c013591508082111561088857600080fd5b6108948d838e016107da565b909850965060608c01359150808211156108ad57600080fd5b6108b98d838e016107da565b909650945060808c01359150808211156108d257600080fd5b506108df8c828d016107da565b915080935050809150509295985092959850929598565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561095d5761095d6108f6565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126109c657600080fd5b83018035915067ffffffffffffffff8211156109e157600080fd5b60200191503681900382131561081f57600080fd5b8183823760009101908152919050565b80820180821115610a1957610a196108f6565b92915050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b608081526000610a7c60808301898b610a1f565b8281036020840152610a8f81888a610a1f565b90508281036040840152610aa4818688610a1f565b91505082606083015298975050505050505050565b604081526000610acd604083018587610a1f565b9050826020830152949350505050565b600060208284031215610aef57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610b1357600080fd5b939250505056fea2646970667358221220b65d073e57d63a850c56423e1bf923900771fd5939820246ff778748f4fd734364736f6c63430008100033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.