-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Vaults #874
base: develop
Are you sure you want to change the base?
feat: Vaults #874
Conversation
Vault factory
β¦56k1-4.0.4 build(deps): bump secp256k1 from 4.0.3 to 4.0.4
fix: return value and stuff
Co-authored-by: Logachev Nikita <[email protected]>
feat: add separate step for vaults deployment
# Conflicts: # contracts/0.8.9/oracle/AccountingOracle.sol # contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol # lib/protocol/helpers/accounting.ts # lib/state-file.ts # package.json # scripts/scratch/steps/0090-deploy-non-aragon-contracts.ts # test/0.8.9/oracle/accountingOracle.submitReportExtraData.test.ts # test/0.8.9/sanityChecker/oracleReportSanityChecker.misc.test.ts # test/deploy/accountingOracle.ts # test/integration/protocol-happy-path.integration.ts # test/suite/index.ts # yarn.lock
β¦estions # Conflicts: # contracts/0.8.25/vaults/StakingVault.sol
// _getTPE is super wide used | ||
uint256 externalShares = EXTERNAL_SHARES_POSITION.getStorageUint256(); | ||
uint256 internalShares = _getTotalShares() - externalShares; | ||
return externalShares.mul(_internalEther).div(internalShares); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
precision loss here can add up in getPooledEthForShares()
and we get double loss on conversion.
Probably, worth to redesign conversion functions in StETH.sol
to use internal ETH instead.
based on second review
β¦estions # Conflicts: # contracts/0.8.25/vaults/Delegation.sol # test/0.8.25/vaults/delegation/delegation.test.ts
[SI] Vaults UX suggestions
β¦ault [Vaults] Immutably fix the node operator in the basic `StakingVault`
function mintWstETH( | ||
address _recipient, | ||
uint256 _tokens | ||
) external payable virtual onlyRole(DEFAULT_ADMIN_ROLE) fundAndProceed { | ||
_mint(address(this), _tokens); | ||
|
||
STETH.approve(address(WSTETH), _tokens); | ||
uint256 wstETHAmount = WSTETH.wrap(_tokens); | ||
WSTETH.transfer(_recipient, wstETHAmount); | ||
} |
Check warning
Code scanning / Slither
Unused return Medium
function valuation() public view returns (uint256) { | ||
ERC7201Storage storage $ = _getStorage(); | ||
return uint256(int256(int128($.report.valuation) + $.inOutDelta - $.report.inOutDelta)); | ||
} |
Check warning
Code scanning / Slither
Potential Arithmetic Overflow Medium
In [uint256(int256(int128($.report.valuation) + $.inOutDelta - $.report.inOutDelta))](contracts/0.8.25/vaults/StakingVault.sol#L171) intermidiate expressions returns type of lower order:
... + REF_1016 returns int128, but the type of the resulting expression is uint256.
β¦awn-7.0.6' into feat/dependabot-updates
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.10.5 to 3.10.11. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](aio-libs/aiohttp@v3.10.5...v3.10.11) --- updated-dependencies: - dependency-name: aiohttp dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [@eslint/plugin-kit](https://github.com/eslint/rewrite) from 0.2.0 to 0.2.4. - [Release notes](https://github.com/eslint/rewrite/releases) - [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json) - [Commits](eslint/rewrite@core-v0.2.0...plugin-kit-v0.2.4) --- updated-dependencies: - dependency-name: "@eslint/plugin-kit" dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
β¦into feat/dependabot-updates
β¦lugin-kit-0.2.4' into feat/dependabot-updates
feat: dependabot updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
contract BeaconChainDepositLogistics { | ||
uint256 internal constant PUBLIC_KEY_LENGTH = 48; | ||
uint256 internal constant SIGNATURE_LENGTH = 96; | ||
uint256 internal constant DEPOSIT_SIZE = 32 ether; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* We cannot use the BeaconChainDepositor contract from the common library because | ||
* it is using an older Solidity version. We also cannot have a common contract with a version | ||
* range because that would break the verification of the old contracts using the 0.8.9 version of this contract. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't be relevant once non-32ETH deposits incorporated
function _makeBeaconChainDeposits32ETH( | ||
uint256 _keysCount, | ||
bytes memory _withdrawalCredentials, | ||
bytes memory _publicKeysBatch, | ||
bytes memory _signaturesBatch | ||
) internal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function _makeBeaconChainDeposits32ETH( | |
uint256 _keysCount, | |
bytes memory _withdrawalCredentials, | |
bytes memory _publicKeysBatch, | |
bytes memory _signaturesBatch | |
) internal { | |
function _makeBeaconChainDeposits( | |
uint256 _keysCount, | |
bytes memory _withdrawalCredentials, | |
bytes memory _publicKeysBatch, | |
bytes memory _signaturesBatch, | |
uint256[] memory _depositSizes | |
) internal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π§ may check signatures using EIP-2537
MemUtils.copyBytes(_signature, sigPart1, 0, 0, 64); | ||
MemUtils.copyBytes(_signature, sigPart2, 64, 0, SIGNATURE_LENGTH - 64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use state-of-the-art assembly MCOPY (https://soliditylang.org/blog/2024/01/26/solidity-0.8.24-release-announcement)
@@ -0,0 +1,514 @@ | |||
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> | |
// SPDX-FileCopyrightText: 2025 Lido <[email protected]> |
STETH.transfer(address(vaultHub), stETHAmount); | ||
|
||
uint256 sharesAmount = STETH.getSharesByPooledEth(stETHAmount); | ||
|
||
vaultHub.burnSharesBackedByVault(address(stakingVault), sharesAmount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's reuse _burn
* @param _permit data required for the stETH.permit() method to set the allowance | ||
*/ | ||
function burnWithPermit( | ||
uint256 _tokens, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint256 _tokens, | |
uint256 _amountOfShares, |
|
||
/** | ||
* @notice Burns stETH tokens from the sender backed by the vault using EIP-2612 Permit. | ||
* @param _tokens Amount of stETH tokens to burn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outdated
IERC20Permit(token).permit( | ||
owner, | ||
spender, | ||
permitInput.value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STETH.transfer(address(vaultHub), stETHAmount); | ||
|
||
uint256 sharesAmount = STETH.getSharesByPooledEth(stETHAmount); | ||
|
||
vaultHub.burnSharesBackedByVault(address(stakingVault), sharesAmount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's reuse _burn
# Conflicts: # .github/workflows/tests-integration-mainnet.yml # package.json # yarn.lock
feat: vaults Devnet 2 β Holesky
β π§ Under construction π§ β
Staking Vaults
New way of isolated staking, through separate vaults, with optional stETH liquidity