Skip to content

Commit f80b46a

Browse files
authored
Nodes manager (#132)
* Add nodes manager * Add validator registration and LTV management to nodes manager * Add fund/withdraw validators and withdrawals manager to nodes manager * Replace deposit queue with direct deposits and add oracle signatures to register validators * Add operator state management with merkle proofs and share donations to nodes manager * Add EthCommunityVault with locked nodesManager as fee recipient and validators manager * Add exit queue, pending penalties, and min balance checks to nodes manager * Refactor nodes manager tests to use EthCommunityVault * Add nonReentrant * Fix snapshot * Add NodesManager and NodesManagerOracle docs * Add unaccountedExitedAssets to SubVaultsRegistry.sol * Convert EthCommunityVault to ERC-20 vault and refactor deposit penalty handling * Remove unused variable * Add EthCommunityVaultCreated event
1 parent 13b12a1 commit f80b46a

File tree

71 files changed

+4350
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4350
-234
lines changed

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,27 @@ REMOVE_PREV_FACTORIES=false
2424
#OS_TOKEN_REDEEMER_OWNER=0x2685C0e39EEAAd383fB71ec3F493991d532A87ae
2525
#OS_TOKEN_REDEEMER_EXIT_QUEUE_UPDATE_DELAY=43200
2626
#VALIDATORS_REGISTRY=0x00000000219ab540356cBB839Cbe05303d7705Fa
27+
#COMMUNITY_VAULT_ADMIN=0x144a98cb1CdBb23610501fE6108858D9B7D24934
28+
#COMMUNITY_VAULT_NAME="SW Community Staked ETH"
29+
#COMMUNITY_VAULT_SYMBOL=csETH
30+
#COMMUNITY_VAULT_FEE_PERCENT=500
31+
#NODES_MANAGER_OWNER=0x144a98cb1CdBb23610501fE6108858D9B7D24934
32+
#NODES_MANAGER_MIN_DEPOSIT_ASSETS=10000000000000000
33+
#NODES_MANAGER_MIN_BALANCE_PERCENT=1000
34+
#NODES_MANAGER_STATE_UPDATE_DELAY=86400
2735

2836
# hoodi
2937
#OS_TOKEN_REDEEMER_OWNER=0xFF2B6d2d5c205b99E2e6f607B6aFA3127B9957B6
3038
#OS_TOKEN_REDEEMER_EXIT_QUEUE_UPDATE_DELAY=43200
3139
#VALIDATORS_REGISTRY=0x00000000219ab540356cBB839Cbe05303d7705Fa
40+
#COMMUNITY_VAULT_ADMIN=0xFF2B6d2d5c205b99E2e6f607B6aFA3127B9957B6
41+
#COMMUNITY_VAULT_NAME="SW Community Staked ETH"
42+
#COMMUNITY_VAULT_SYMBOL=csETH
43+
#COMMUNITY_VAULT_FEE_PERCENT=500
44+
#NODES_MANAGER_OWNER=0xFF2B6d2d5c205b99E2e6f607B6aFA3127B9957B6
45+
#NODES_MANAGER_MIN_DEPOSIT_ASSETS=10000000000000000
46+
#NODES_MANAGER_MIN_BALANCE_PERCENT=1000
47+
#NODES_MANAGER_STATE_UPDATE_DELAY=86400
3248

3349
# chiado
3450
#OS_TOKEN_REDEEMER_OWNER=0xFF2B6d2d5c205b99E2e6f607B6aFA3127B9957B6
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// SPDX-License-Identifier: BUSL-1.1
2+
3+
pragma solidity ^0.8.22;
4+
5+
import {IEthErc20Vault} from "./IEthErc20Vault.sol";
6+
7+
/**
8+
* @title IEthCommunityVault
9+
* @author StakeWise
10+
* @notice Defines the interface for the EthCommunityVault contract
11+
*/
12+
interface IEthCommunityVault is IEthErc20Vault {
13+
/**
14+
* @notice Event emitted on EthCommunityVault creation
15+
* @param admin The address of the Vault admin
16+
* @param nodesManager The address of the nodes manager
17+
* @param capacity The capacity of the Vault
18+
* @param feePercent The fee percent of the Vault
19+
* @param name The name of the ERC20 token
20+
* @param symbol The symbol of the ERC20 token
21+
* @param metadataIpfsHash The IPFS hash of the Vault metadata
22+
*/
23+
event EthCommunityVaultCreated(
24+
address admin,
25+
address nodesManager,
26+
uint256 capacity,
27+
uint16 feePercent,
28+
string name,
29+
string symbol,
30+
string metadataIpfsHash
31+
);
32+
33+
/**
34+
* @dev Struct for initializing the EthCommunityVault contract
35+
* @param admin The address of the Vault admin
36+
* @param nodesManager The address of the nodes manager (fee recipient and validators manager)
37+
* @param capacity The Vault stops accepting deposits after exceeding the capacity
38+
* @param feePercent The fee percent that is charged by the Vault
39+
* @param name The name of the ERC20 token
40+
* @param symbol The symbol of the ERC20 token
41+
* @param metadataIpfsHash The IPFS hash of the Vault's metadata file
42+
*/
43+
struct EthCommunityVaultInitParams {
44+
address admin;
45+
address nodesManager;
46+
uint256 capacity;
47+
uint16 feePercent;
48+
string name;
49+
string symbol;
50+
string metadataIpfsHash;
51+
}
52+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// SPDX-License-Identifier: BUSL-1.1
2+
3+
pragma solidity ^0.8.22;
4+
5+
import {INodesManager} from "./INodesManager.sol";
6+
7+
/**
8+
* @title IEthNodesManager
9+
* @author StakeWise
10+
* @notice Defines the interface for the EthNodesManager contract
11+
*/
12+
interface IEthNodesManager is INodesManager {
13+
/**
14+
* @notice Deposits ETH as bond assets
15+
* @return shares The vault shares received for the deposit
16+
*/
17+
function deposit() external payable returns (uint256 shares);
18+
}

0 commit comments

Comments
 (0)