Skip to content

stakefish/eth2-batch-deposit

Repository files navigation

Batch Deposit Contract

pipeline status coverage report

This contract enables depositing to the ETH2 Deposit Contract multiple times in a single transaction.

Setup

This project uses Hardhat.

  1. Clone the repository
  2. npm install

Usage

Compile

npx hardhat compile

Test

Run the full test suite against the built-in Hardhat network:

npm test
# or
npx hardhat test

Local node

Start a local Hardhat node, then deploy or interact with it:

npx hardhat node

Deploy

Deployment is handled by scripts/deploy.js, which deploys BatchDeposit, waits for confirmations, and verifies the contract on Etherscan. Supported networks are configured in hardhat.config.js (mainnet, hoodi, holesky).

npx hardhat run scripts/deploy.js --network <network>

The script reads RPC URLs, private keys, and the Etherscan API key from environment variables (see .env):

  • MAINNET_RPC_URL / MAINNET_PRIVATE_KEY
  • HOODI_RPC_URL / HOODI_PRIVATE_KEY
  • HOLESKY_RPC_URL / HOLESKY_PRIVATE_KEY
  • ETHERSCAN_API_KEY

Functional tests

The supported assertion libraries are the chai assertion library and hardhat-chai-matchers (bundled with @nomicfoundation/hardhat-toolbox). Tests are written with Mocha.

You can find the tests under the test folder and run them all with npm test.

Code coverage

Run code coverage with:

npm run coverage
# or
npx hardhat coverage

Formatting

npm run format

Use older version of solidity

Refer to https://github.com/crytic/solc-select

Security testing

Refer to https://github.com/crytic/slither

About

Batch Deposit and Service Fee collection Smart Contract for ETH 2.0

Resources

License

Stars

17 stars

Watchers

5 watching

Forks

Packages

 
 
 

Contributors