Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Batch Deposit and Service Fee collection Smart Contract for ETH 2.0

License

Notifications You must be signed in to change notification settings

foundryservices/eth2-batch-deposit

 
 

Repository files navigation

Batch Deposit Contract

pipeline status coverage report

This contract enable to deposit to the ETH2 Deposit Contract multiple times in a single transaction.

Usage

You can test the contract on both goerli testnet or in your local development environment.

Integrated ganache-chi

  1. Clone
  2. npm install
  3. In a terminal run npx ganache-cli
  4. In another terminal run npx truffle deploy

Test on your local blockchain

  1. Clone the repository
  2. Install Ganache and Truffle
  3. Run ganache and quick start an empty workspace
  4. Tun truffle deploy to compile & deploy, or just truffle test to compile, deploy and test automatically.

Test on Goerli

  1. Get some funds from the faucet
  2. Replace mnemonic in ./scripts/test_goerli.js
  3. Replace fake data with some real eth2 validator informations
  4. Check if the smart contract address is correct
  5. Run the script with cd scripts && node test_goerli.js

Functional tests

Assertion libraries supported are chai assertion library and truffle-assertions. Tests are written with Mocha.

You can find test under tests folder and run all the tests using truffle test command

Code coverage

You can test code coverage by simply running npm run coverage, a local blockchain at port 8545 will be automatically provided and shutdown after all the tests are done.

Deploy

To deploy in production is reccomended to use Remix IDE, expected gas usage is around 492,831.

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 53.1%
  • Solidity 46.9%