From f74e4c694e0ea9bb290fac7551681497bea42b57 Mon Sep 17 00:00:00 2001 From: Dmitri Tsumak Date: Tue, 30 Jul 2024 11:51:01 +0300 Subject: [PATCH] Fix gno genesis vault pool escrow assets (#96) * Fix gno genesis vault pool escrow assets * Fix version --- .openzeppelin/holesky.json | 8 +- .openzeppelin/unknown-100.json | 430 ++++++++++++++++++ .openzeppelin/unknown-10200.json | 430 ++++++++++++++++++ contracts/vaults/gnosis/GnoGenesisVault.sol | 6 +- deployments/holesky-vault-upgrades.json | 2 +- deployments/holesky.json | 2 +- helpers/constants.ts | 4 +- package-lock.json | 4 +- package.json | 2 +- test/gnosis/GnoGenesisVault.spec.ts | 4 +- .../GnoGenesisVault.spec.ts.snap | 2 +- test/shared/fixtures.ts | 3 - 12 files changed, 879 insertions(+), 18 deletions(-) diff --git a/.openzeppelin/holesky.json b/.openzeppelin/holesky.json index 799aab60..46df65cc 100644 --- a/.openzeppelin/holesky.json +++ b/.openzeppelin/holesky.json @@ -1730,8 +1730,8 @@ } } }, - "34a06aacf8c6e9788d4435a10e1c1cffd11bd3be6cc42ec58e5c3dc5528326b4": { - "address": "0x81603191A36DC1ab72d8Ae1499f309ab2A64B0aA", + "faf1d17536e85a08e7d60558bad476aeae45f0a8181cc5de431fa5cad8cf4ba4": { + "address": "0x6e16fc22013e07B8C8e6d4b30280F44d42A60a97", "layout": { "solcVersion": "0.8.22", "storage": [ @@ -5364,8 +5364,8 @@ } } }, - "e0a360d5faf1f7a57ffd49f8eec2c5ce30753cce21d4f62cde26ecf4dd1be05b": { - "address": "0x6415926885A628DCc5960C8870562e728E94Dd7E", + "6218823b2d9374cabd46f3389d0a05d6d9ec2a5d8a560f619b74ea2d72ec3633": { + "address": "0x35dC754f157b32Ba0941ffCD89d16d3D0B2cA6CF", "layout": { "solcVersion": "0.8.22", "storage": [ diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index 1e80350a..c8d96224 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -3461,6 +3461,436 @@ ] } } + }, + "fb84fa3d440720f5dc9c584e769141149097024e470dbd787763dcbceb6dca02": { + "address": "0x5f9ee59Ad0ECb38A2F584956286311796fED12C6", + "layout": { + "solcVersion": "0.8.22", + "storage": [ + { + "label": "admin", + "offset": 0, + "slot": "0", + "type": "t_address", + "contract": "VaultAdmin", + "src": "contracts/vaults/modules/VaultAdmin.sol:16" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultAdmin", + "src": "contracts/vaults/modules/VaultAdmin.sol:49" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultVersion", + "src": "contracts/vaults/modules/VaultVersion.sol:66" + }, + { + "label": "feeRecipient", + "offset": 0, + "slot": "101", + "type": "t_address", + "contract": "VaultFee", + "src": "contracts/vaults/modules/VaultFee.sol:21" + }, + { + "label": "feePercent", + "offset": 20, + "slot": "101", + "type": "t_uint16", + "contract": "VaultFee", + "src": "contracts/vaults/modules/VaultFee.sol:24" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultFee", + "src": "contracts/vaults/modules/VaultFee.sol:62" + }, + { + "label": "_totalShares", + "offset": 0, + "slot": "152", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:23" + }, + { + "label": "_totalAssets", + "offset": 16, + "slot": "152", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:24" + }, + { + "label": "queuedShares", + "offset": 0, + "slot": "153", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:27" + }, + { + "label": "_unclaimedAssets", + "offset": 16, + "slot": "153", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:28" + }, + { + "label": "_exitQueue", + "offset": 0, + "slot": "154", + "type": "t_struct(History)14077_storage", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:29" + }, + { + "label": "_exitRequests", + "offset": 0, + "slot": "155", + "type": "t_mapping(t_bytes32,t_uint256)", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:31" + }, + { + "label": "_balances", + "offset": 0, + "slot": "156", + "type": "t_mapping(t_address,t_uint256)", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:32" + }, + { + "label": "_capacity", + "offset": 0, + "slot": "157", + "type": "t_uint256", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:34" + }, + { + "label": "totalExitingAssets", + "offset": 0, + "slot": "158", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:37" + }, + { + "label": "_totalExitingTickets", + "offset": 16, + "slot": "158", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:38" + }, + { + "label": "_totalExitedTickets", + "offset": 0, + "slot": "159", + "type": "t_uint256", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:39" + }, + { + "label": "__gap", + "offset": 0, + "slot": "160", + "type": "t_array(t_uint256)48_storage", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:331" + }, + { + "label": "_validatorsRoot", + "offset": 0, + "slot": "208", + "type": "t_bytes32", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:39" + }, + { + "label": "_validatorIndex", + "offset": 0, + "slot": "209", + "type": "t_uint256", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:42" + }, + { + "label": "_validatorsManager", + "offset": 0, + "slot": "210", + "type": "t_address", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:44" + }, + { + "label": "_initialDomainSeparator", + "offset": 0, + "slot": "211", + "type": "t_bytes32", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:46" + }, + { + "label": "__gap", + "offset": 0, + "slot": "212", + "type": "t_array(t_uint256)49_storage", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:228" + }, + { + "label": "__gap", + "offset": 0, + "slot": "261", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultEnterExit", + "src": "contracts/vaults/modules/VaultEnterExit.sol:270" + }, + { + "label": "_positions", + "offset": 0, + "slot": "311", + "type": "t_mapping(t_address,t_struct(OsTokenPosition)12309_storage)", + "contract": "VaultOsToken", + "src": "contracts/vaults/modules/VaultOsToken.sol:32" + }, + { + "label": "__gap", + "offset": 0, + "slot": "312", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultOsToken", + "src": "contracts/vaults/modules/VaultOsToken.sol:296" + }, + { + "label": "_ownMevEscrow", + "offset": 0, + "slot": "362", + "type": "t_address", + "contract": "VaultMev", + "src": "contracts/vaults/modules/VaultMev.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "363", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultMev", + "src": "contracts/vaults/modules/VaultMev.sol:77" + }, + { + "label": "__gap", + "offset": 0, + "slot": "413", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultGnoStaking", + "src": "contracts/vaults/modules/VaultGnoStaking.sol:202" + }, + { + "label": "__gap", + "offset": 0, + "slot": "463", + "type": "t_array(t_uint256)50_storage", + "contract": "GnoVault", + "src": "contracts/vaults/gnosis/GnoVault.sol:138" + }, + { + "label": "__gap", + "offset": 0, + "slot": "513", + "type": "t_array(t_uint256)50_storage", + "contract": "GnoGenesisVault", + "src": "contracts/vaults/gnosis/GnoGenesisVault.sol:233" + } + ], + "types": { + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)105_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(ReentrancyGuardStorage)229_storage": { + "label": "struct ReentrancyGuardUpgradeable.ReentrancyGuardStorage", + "members": [ + { + "label": "_status", + "type": "t_uint256", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Checkpoint)14071_storage)dyn_storage": { + "label": "struct ExitQueue.Checkpoint[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)48_storage": { + "label": "uint256[48]", + "numberOfBytes": "1536" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(OsTokenPosition)12309_storage)": { + "label": "mapping(address => struct IVaultOsToken.OsTokenPosition)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(Checkpoint)14071_storage": { + "label": "struct ExitQueue.Checkpoint", + "members": [ + { + "label": "totalTickets", + "type": "t_uint160", + "offset": 0, + "slot": "0" + }, + { + "label": "exitedAssets", + "type": "t_uint96", + "offset": 20, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(History)14077_storage": { + "label": "struct ExitQueue.History", + "members": [ + { + "label": "checkpoints", + "type": "t_array(t_struct(Checkpoint)14071_storage)dyn_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OsTokenPosition)12309_storage": { + "label": "struct IVaultOsToken.OsTokenPosition", + "members": [ + { + "label": "shares", + "type": "t_uint128", + "offset": 0, + "slot": "0" + }, + { + "label": "cumulativeFeePerShare", + "type": "t_uint128", + "offset": 16, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint128": { + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint160": { + "label": "uint160", + "numberOfBytes": "20" + }, + "t_uint96": { + "label": "uint96", + "numberOfBytes": "12" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.ReentrancyGuard": [ + { + "contract": "ReentrancyGuardUpgradeable", + "label": "_status", + "type": "t_uint256", + "src": "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol:40", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } } } } diff --git a/.openzeppelin/unknown-10200.json b/.openzeppelin/unknown-10200.json index 1fc4f257..72e826c4 100644 --- a/.openzeppelin/unknown-10200.json +++ b/.openzeppelin/unknown-10200.json @@ -3461,6 +3461,436 @@ ] } } + }, + "3c077bb04c0450635865be5e5a4779f71caae84a44a8f9a09f4232320971d58a": { + "address": "0x2e27110bA825dF484bC7b0Ea9F0C50D276583F12", + "layout": { + "solcVersion": "0.8.22", + "storage": [ + { + "label": "admin", + "offset": 0, + "slot": "0", + "type": "t_address", + "contract": "VaultAdmin", + "src": "contracts/vaults/modules/VaultAdmin.sol:16" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultAdmin", + "src": "contracts/vaults/modules/VaultAdmin.sol:49" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultVersion", + "src": "contracts/vaults/modules/VaultVersion.sol:66" + }, + { + "label": "feeRecipient", + "offset": 0, + "slot": "101", + "type": "t_address", + "contract": "VaultFee", + "src": "contracts/vaults/modules/VaultFee.sol:21" + }, + { + "label": "feePercent", + "offset": 20, + "slot": "101", + "type": "t_uint16", + "contract": "VaultFee", + "src": "contracts/vaults/modules/VaultFee.sol:24" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultFee", + "src": "contracts/vaults/modules/VaultFee.sol:62" + }, + { + "label": "_totalShares", + "offset": 0, + "slot": "152", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:23" + }, + { + "label": "_totalAssets", + "offset": 16, + "slot": "152", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:24" + }, + { + "label": "queuedShares", + "offset": 0, + "slot": "153", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:27" + }, + { + "label": "_unclaimedAssets", + "offset": 16, + "slot": "153", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:28" + }, + { + "label": "_exitQueue", + "offset": 0, + "slot": "154", + "type": "t_struct(History)14077_storage", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:29" + }, + { + "label": "_exitRequests", + "offset": 0, + "slot": "155", + "type": "t_mapping(t_bytes32,t_uint256)", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:31" + }, + { + "label": "_balances", + "offset": 0, + "slot": "156", + "type": "t_mapping(t_address,t_uint256)", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:32" + }, + { + "label": "_capacity", + "offset": 0, + "slot": "157", + "type": "t_uint256", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:34" + }, + { + "label": "totalExitingAssets", + "offset": 0, + "slot": "158", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:37" + }, + { + "label": "_totalExitingTickets", + "offset": 16, + "slot": "158", + "type": "t_uint128", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:38" + }, + { + "label": "_totalExitedTickets", + "offset": 0, + "slot": "159", + "type": "t_uint256", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:39" + }, + { + "label": "__gap", + "offset": 0, + "slot": "160", + "type": "t_array(t_uint256)48_storage", + "contract": "VaultState", + "src": "contracts/vaults/modules/VaultState.sol:331" + }, + { + "label": "_validatorsRoot", + "offset": 0, + "slot": "208", + "type": "t_bytes32", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:39" + }, + { + "label": "_validatorIndex", + "offset": 0, + "slot": "209", + "type": "t_uint256", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:42" + }, + { + "label": "_validatorsManager", + "offset": 0, + "slot": "210", + "type": "t_address", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:44" + }, + { + "label": "_initialDomainSeparator", + "offset": 0, + "slot": "211", + "type": "t_bytes32", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:46" + }, + { + "label": "__gap", + "offset": 0, + "slot": "212", + "type": "t_array(t_uint256)49_storage", + "contract": "VaultValidators", + "src": "contracts/vaults/modules/VaultValidators.sol:228" + }, + { + "label": "__gap", + "offset": 0, + "slot": "261", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultEnterExit", + "src": "contracts/vaults/modules/VaultEnterExit.sol:270" + }, + { + "label": "_positions", + "offset": 0, + "slot": "311", + "type": "t_mapping(t_address,t_struct(OsTokenPosition)12309_storage)", + "contract": "VaultOsToken", + "src": "contracts/vaults/modules/VaultOsToken.sol:32" + }, + { + "label": "__gap", + "offset": 0, + "slot": "312", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultOsToken", + "src": "contracts/vaults/modules/VaultOsToken.sol:296" + }, + { + "label": "_ownMevEscrow", + "offset": 0, + "slot": "362", + "type": "t_address", + "contract": "VaultMev", + "src": "contracts/vaults/modules/VaultMev.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "363", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultMev", + "src": "contracts/vaults/modules/VaultMev.sol:77" + }, + { + "label": "__gap", + "offset": 0, + "slot": "413", + "type": "t_array(t_uint256)50_storage", + "contract": "VaultGnoStaking", + "src": "contracts/vaults/modules/VaultGnoStaking.sol:202" + }, + { + "label": "__gap", + "offset": 0, + "slot": "463", + "type": "t_array(t_uint256)50_storage", + "contract": "GnoVault", + "src": "contracts/vaults/gnosis/GnoVault.sol:138" + }, + { + "label": "__gap", + "offset": 0, + "slot": "513", + "type": "t_array(t_uint256)50_storage", + "contract": "GnoGenesisVault", + "src": "contracts/vaults/gnosis/GnoGenesisVault.sol:233" + } + ], + "types": { + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)105_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(ReentrancyGuardStorage)229_storage": { + "label": "struct ReentrancyGuardUpgradeable.ReentrancyGuardStorage", + "members": [ + { + "label": "_status", + "type": "t_uint256", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Checkpoint)14071_storage)dyn_storage": { + "label": "struct ExitQueue.Checkpoint[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)48_storage": { + "label": "uint256[48]", + "numberOfBytes": "1536" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(OsTokenPosition)12309_storage)": { + "label": "mapping(address => struct IVaultOsToken.OsTokenPosition)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(Checkpoint)14071_storage": { + "label": "struct ExitQueue.Checkpoint", + "members": [ + { + "label": "totalTickets", + "type": "t_uint160", + "offset": 0, + "slot": "0" + }, + { + "label": "exitedAssets", + "type": "t_uint96", + "offset": 20, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(History)14077_storage": { + "label": "struct ExitQueue.History", + "members": [ + { + "label": "checkpoints", + "type": "t_array(t_struct(Checkpoint)14071_storage)dyn_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OsTokenPosition)12309_storage": { + "label": "struct IVaultOsToken.OsTokenPosition", + "members": [ + { + "label": "shares", + "type": "t_uint128", + "offset": 0, + "slot": "0" + }, + { + "label": "cumulativeFeePerShare", + "type": "t_uint128", + "offset": 16, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint128": { + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint160": { + "label": "uint160", + "numberOfBytes": "20" + }, + "t_uint96": { + "label": "uint96", + "numberOfBytes": "12" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.ReentrancyGuard": [ + { + "contract": "ReentrancyGuardUpgradeable", + "label": "_status", + "type": "t_uint256", + "src": "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol:40", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } } } } diff --git a/contracts/vaults/gnosis/GnoGenesisVault.sol b/contracts/vaults/gnosis/GnoGenesisVault.sol index 74403e9e..b6997f45 100644 --- a/contracts/vaults/gnosis/GnoGenesisVault.sol +++ b/contracts/vaults/gnosis/GnoGenesisVault.sol @@ -25,7 +25,7 @@ import {GnoVault, IGnoVault} from './GnoVault.sol'; */ contract GnoGenesisVault is Initializable, GnoVault, IGnoGenesisVault { // slither-disable-next-line shadowing-state - uint8 private constant _version = 2; + uint8 private constant _version = 3; /// @custom:oz-upgrades-unsafe-allow state-variable-immutable IGnoPoolEscrow private immutable _poolEscrow; @@ -88,6 +88,9 @@ contract GnoGenesisVault is Initializable, GnoVault, IGnoGenesisVault { function initialize( bytes calldata params ) external virtual override(IGnoVault, GnoVault) reinitializer(_version) { + // if admin is already set, it's an upgrade from version 2 to 3, no initialization required + if (admin != address(0)) return; + // initialize deployed vault (address _admin, GnoVaultInitParams memory initParams) = abi.decode( params, @@ -208,6 +211,7 @@ contract GnoGenesisVault is Initializable, GnoVault, IGnoGenesisVault { { return super._vaultAssets() + + _gnoToken.balanceOf(address(_poolEscrow)) + IGnoValidatorsRegistry(_validatorsRegistry).withdrawableAmount(address(_poolEscrow)); } diff --git a/deployments/holesky-vault-upgrades.json b/deployments/holesky-vault-upgrades.json index 4fedbd43..583ce108 100644 --- a/deployments/holesky-vault-upgrades.json +++ b/deployments/holesky-vault-upgrades.json @@ -18,7 +18,7 @@ "2": "0x01d34aeE72325F1d4A748f13C2169404523eCEE0" }, "0x11a6b7bef0f97d298d56e5af2aa94330353808e861cbac86172faad21b10c505": { - "2": "0x6415926885A628DCc5960C8870562e728E94Dd7E" + "2": "0x35dC754f157b32Ba0941ffCD89d16d3D0B2cA6CF" }, "0x43d6c07ac63953f42a28f0366affe9895fd54f84336314dd012087bd0941df67": { "2": "0x288F9dc773Dd0E3DC94F975BD24e5018FFc55293" diff --git a/deployments/holesky.json b/deployments/holesky.json index f6c52307..5bd416c8 100644 --- a/deployments/holesky.json +++ b/deployments/holesky.json @@ -3,7 +3,7 @@ "Keeper": "0xB580799Bf7d62721D1a523f0FDF2f5Ed7BA4e259", "DepositDataRegistry": "0xAC0F906E433d58FA868F936E8A43230473652885", "EthValidatorsChecker": "0x3a633173b90362D89656432452Bf2BD8D6786856", - "EthGenesisVault": "0x0bD7de255880d0e4DBD8cA6081a129FD56Ecb661", + "EthGenesisVault": "0x8A94e1d22D83990205843cda08376d16F150c9bb", "EthVaultFactory": "0xA1424Bd00e6940A58B1232ad4160A77dD0AC3099", "EthPrivVaultFactory": "0x8023518b2192FB5384DAdc596765B3dD1cdFe471", "EthBlocklistVaultFactory": "0x90a9428b8c58cA80B28aAF46B936D42e87797449", diff --git a/helpers/constants.ts b/helpers/constants.ts index 19f66ea6..398f374c 100644 --- a/helpers/constants.ts +++ b/helpers/constants.ts @@ -47,8 +47,8 @@ export const NETWORKS: { // EthGenesisVault genesisVault: { admin: '0xFF2B6d2d5c205b99E2e6f607B6aFA3127B9957B6', - poolEscrow: '0x1f10dB396120183Fc309d45110979879866Db0D2', - rewardToken: '0xF3d3071905A6495a4D2f8650E8b3baaAE827DD13', + poolEscrow: '0xA9f21D016E2846BC9Be972Cf45d9e410283c971e', + rewardToken: '0x2ee2E20702B5881a1171c5dbEd01C3d1e49Bf632', capacity: parseEther('1000000'), // 1m ETH feePercent: 500, // 5% }, diff --git a/package-lock.json b/package-lock.json index 986ec465..901df224 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stakewise/v3-core", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@stakewise/v3-core", - "version": "2.0.0", + "version": "2.0.1", "license": "BUSL-1.1", "dependencies": { "@openzeppelin/contracts": "5.0.0", diff --git a/package.json b/package.json index 0c8ebc74..e904a9f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stakewise/v3-core", - "version": "2.0.0", + "version": "2.0.1", "description": "Liquid staking protocol for Ethereum", "main": "index.js", "scripts": { diff --git a/test/gnosis/GnoGenesisVault.spec.ts b/test/gnosis/GnoGenesisVault.spec.ts index be08fff6..112a77df 100644 --- a/test/gnosis/GnoGenesisVault.spec.ts +++ b/test/gnosis/GnoGenesisVault.spec.ts @@ -86,7 +86,7 @@ describe('GnoGenesisVault', () => { const adminAddr = await admin.getAddress() // VaultVersion - expect(await vault.version()).to.be.eq(2) + expect(await vault.version()).to.be.eq(3) expect(await vault.vaultId()).to.be.eq(`0x${keccak256('GnoGenesisVault').toString('hex')}`) // VaultFee @@ -95,7 +95,7 @@ describe('GnoGenesisVault', () => { }) it('has version', async () => { - expect(await vault.version()).to.eq(2) + expect(await vault.version()).to.eq(3) }) describe('migrate', () => { diff --git a/test/gnosis/__snapshots__/GnoGenesisVault.spec.ts.snap b/test/gnosis/__snapshots__/GnoGenesisVault.spec.ts.snap index f520e679..7e9ab30f 100644 --- a/test/gnosis/__snapshots__/GnoGenesisVault.spec.ts.snap +++ b/test/gnosis/__snapshots__/GnoGenesisVault.spec.ts.snap @@ -10,7 +10,7 @@ Object { exports[`GnoGenesisVault pulls withdrawals on claim exited assets 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 155206, + "gasUsed": 156114, } `; diff --git a/test/shared/fixtures.ts b/test/shared/fixtures.ts index 6504e22b..0963623f 100644 --- a/test/shared/fixtures.ts +++ b/test/shared/fixtures.ts @@ -238,9 +238,6 @@ export const createPriceFeed = async function ( export const createRewardSplitterFactory = async function (): Promise { const signer = await ethers.provider.getSigner() - if (MAINNET_FORK.enabled) { - return RewardSplitterFactory__factory.connect(mainnetDeployment.RewardSplitterFactory, signer) - } let factory = await ethers.getContractFactory('RewardSplitter') const rewardSplitterImpl = await factory.deploy()