/contracts

StakeWise smart contracts.

Primary LanguageJavaScriptOtherNOASSERTION

StakeWise smart contracts

CircleCI Discord

The StakeWise smart contracts for liquid non-custodial ETH2 staking.

Check our Harbour contracts for custodial ETH2 staking.

We also support GNO staking. Check contracts for gnosis chain.

Audits and bug bounty

All audit reports are presented in the audits folder

Feel free to join our bug bounty program

Documentation

You can find the documentation for every contract in the contracts directory. For integration, check the contracts/interfaces directory. The documentation is also available on the official documentation page.

Pool

The Pool contract is an entry point for deposits into the StakeWise Pool. This contract stores ETH collected from the users before it is sent to the ETH2 Validator Registration Contract.

StakedEthToken

The StakedEthToken is an ERC-20 contract. It reflects the deposits made by the stakers in the form of sETH2 tokens. The tokens are mapped 1 to 1 to ETH. The total supply of sETH2 is the sum of all the StakeWise Pool's validators' effective balances, plus an additional amount of up to (32 ETH - 1 Wei) ETH awaiting inclusion into a new validator.

RewardEthToken

The RewardEthToken is an ERC-20 contract. It reflects the rewards accumulated by the stakers in the form of rETH2 tokens. The tokens are mapped 1 to 1 to ETH. The total supply of rETH2 is the amount that is above the effective balance of all the validators registered for the StakeWise Pool.

Oracle

Oracles contract stores accounts responsible for submitting or updating values based on the off-chain data.

Deployments

Mainnet

Check more details and previous versions at https://github.com/stakewise/contracts/blob/master/networks/mainnet.md

Goerli testnet

Check more details and previous versions at https://github.com/stakewise/contracts/blob/master/networks/goerli.md

Development

NB! You would have to define the initialize function for the contracts that don't have it when deploying for the first time.

  1. Install dependencies:

    yarn install
  2. Compile optimized contracts:

    yarn compile --optimizer
  3. Update network parameters in hardhat.config.js. Learn more at Hardhat config options.

  4. Change settings if needed.

  5. Deploy StakeWise contracts to the selected network:

    yarn deploy-contracts --network rinkeby

Contributing

Development of the project happens in the open on GitHub, and we are grateful to the community for contributing bug fixes and improvements.

Contact us

License

The project is GNU AGPL v3.