StakeWise V3 is a decentralized liquid staking protocol that operates on Ethereum and other EVM-compatible chains such as Gnosis Chain. The protocol allows users to stake their assets (ETH, GNO) and receive liquid staking tokens in return, enabling them to maintain liquidity while earning staking rewards.
The StakeWise V3 protocol consists of several key components:
Modular smart contracts that manage staked assets:
- EthVault: For Ethereum staking
- GnoVault: For Gnosis Chain staking
- Specialized variants: Blocklist vaults, private vaults, ERC20 vaults
- OsToken: Over-collateralized staked token
- OsTokenVaultController: Manages the minting and burning of OsToken shares
- OsTokenConfig: Configuration parameters for OsToken operations
- ValidatorsRegistry: Interface with the blockchain's validator system
- KeeperValidators: Approves validator registrations
- ValidatorsChecker: Validates deposit data
- OwnMevEscrow: Accumulates MEV for individual vaults
- SharedMevEscrow: Collects and distributes MEV rewards accross multiple vaults
- Keeper: Updates vault rewards and approves validator registrations
- VaultsRegistry: Tracks all deployed vaults and factories
- RewardSplitter: Distributes fee based on configured shares
- Modular Architecture: Components can be developed independently
- Multi-Chain Support: Works on Ethereum and Gnosis Chain
- MEV Capture: Captures and distributes MEV rewards
- Validator Management: Full lifecycle management of validators
- Customizable Vaults: Different vault types for various use cases
- Over-Collateralized Tokens: Liquid staking with osToken system
- Governance Controls: Admin functions for parameter updates
This project uses Foundry as the development environment.
- Install Foundry:
curl -L https://foundry.paradigm.xyz | bash
foundryup
- Clone the repository and install dependencies:
git clone https://github.com/stakewise/v3-core.git
cd v3-core
forge install
- Create and update .env file
cp .env.example .env
Compile contracts with Foundry:
forge build --skip test
Run tests with Foundry:
FOUNDRY_PROFILE=test forge test --isolate
- Start a local Anvil node (Foundry's local chain):
anvil --fork-url https://eth.merkle.io
- Deploy contracts using Foundry scripts:
# Ethereum
forge script script/UpgradeEthNetwork.s.sol:UpgradeEthNetwork --rpc-url http://localhost:8545 --broadcast
# Gnosis Chain
forge script script/UpgradeGnoNetwork.s.sol:UpgradeGnoNetwork --rpc-url http://localhost:8545 --broadcast
Generate a gas report:
FOUNDRY_PROFILE=test forge test --isolate --gas-report
Detailed documentation for each contract is available in the contracts
directory. For integration purposes, review the interfaces in the contracts/interfaces
directory.
Key interfaces include:
IEthVault.sol
: Ethereum staking vaultsIGnoVault.sol
: Gnosis Chain staking vaultsIOsToken.sol
: Over-collateralized staked tokensIKeeper.sol
: Validator and rewards management
The protocol follows a modular design with several key components:
- Vaults: Hold staked assets and manage validator operations
- Tokens: Represent staked positions with liquid tokens
- Keepers: External services that update rewards and approve validators
- MEV Escrows: Capture and distribute MEV rewards
Contributions are welcome! The project follows standard GitHub flow:
- Fork the repository
- Create a feature branch
- Implement changes with tests
- Submit a pull request
Development happens in the open on GitHub, and we are grateful to the community for contributing bug fixes and improvements.
The license for StakeWise V3 Core is the Business Source License 1.1 (BUSL-1.1), see LICENSE.