-
Notifications
You must be signed in to change notification settings - Fork 194
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: master
Are you sure you want to change the base?
feat: Vaults #874
Conversation
chore: add vaults reporting to accounting
Vault fees and oracle reports refactoring
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
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.
π
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 restore it later
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.
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.
Slither found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Hardhat Unit Tests Coverage Summary
Diff against master
Results for commit: 6286561 Minimum allowed coverage is β»οΈ This comment has been updated with latest results |
Co-authored-by: Eugene Mamin <[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.
π
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.
maybe restore later
@@ -0,0 +1,482 @@ | |||
// SPDX-FileCopyrightText: 2023 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: 2023 Lido <[email protected]> | |
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> |
import {ILidoLocator} from "../common/interfaces/ILidoLocator.sol"; | ||
import {IBurner} from "../common/interfaces/IBurner.sol"; | ||
import {IPostTokenRebaseReceiver} from "./interfaces/IPostTokenRebaseReceiver.sol"; | ||
import {IStakingRouter} from "./interfaces/IStakingRouter.sol"; | ||
import {IOracleReportSanityChecker} from "./interfaces/IOracleReportSanityChecker.sol"; | ||
import {IWithdrawalQueue} from "./interfaces/IWithdrawalQueue.sol"; | ||
import {ILido} from "./interfaces/ILido.sol"; | ||
import {ReportValues} from "contracts/common/interfaces/ReportValues.sol"; |
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.
Why not embedded in the file here? (Lido contract has embedded ones)
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.
For the sake of consistency: let's use one way or another
|
||
/// @title Lido Accounting contract | ||
/// @author folkyatina | ||
/// @notice contract is responsible for handling oracle reports |
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.
/// @notice contract is responsible for handling oracle reports | |
/// @notice contract is responsible for handling accounting oracle reports |
/// @notice contract is responsible for handling oracle reports | ||
/// calculating all the state changes that is required to apply the report | ||
/// and distributing calculated values to relevant parts of the protocol | ||
contract Accounting is VaultHub { |
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.
surprising to see that Accounting is VaultHub
ReportValues memory _report, | ||
PreReportState memory _pre, | ||
CalculatedValues memory _update, | ||
uint256 _simulatedShareRate |
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 _simulatedShareRate | |
uint256 _withdrawalShareRate |
let's unify naming
} | ||
|
||
// Distribute protocol fee (treasury & node operators) | ||
if (_update.sharesToMintAsFees > 0) { |
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.
this name might be misleading, should be named smth 'sharesToMintAsLidoV2ProtocolFees'
|
||
_updateVaults( | ||
_report.vaultValues, | ||
_report.netCashFlows, |
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.
wdim 'cashflows'
_update.vaultsTreasuryFeeShares | ||
); | ||
|
||
_notifyObserver(_contracts.postTokenRebaseReceiver, _report, _pre, _update); |
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.
_notifyObserver(_contracts.postTokenRebaseReceiver, _report, _pre, _update); | |
_notifyRebaseObserver(_contracts.postTokenRebaseReceiver, _report, _pre, _update); |
} | ||
} | ||
|
||
/// @dev mints treasury rewards |
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.
only for Lido V2 protocol fee though
β π§ Under construction π§ β
Staking Vaults
New way of isolated staking, through separate vaults, with optional stETH liquidity