-
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
[Vaults] feat: Dashboard UX updates #915
base: feat/vaults
Are you sure you want to change the base?
Conversation
function _burn(uint256 _amountOfShares) internal { | ||
STETH.transferSharesFrom(msg.sender, address(vaultHub), _amountOfShares); | ||
function _burn(address _sender, uint256 _amountOfShares) internal { | ||
if (_sender == address(this)) { |
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 might be able to skip this check, hear me out. I check steth code.
You need to set infinity steth allowance to address(this)
at contract init.
This will allow you to call transferSharesFrom
with _sender==address(this)
.
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.
Infinity steth allowance looks acceptable to me here. However, the condition also does not bother me much.
I need feedback from more experienced individuals (like AP or EM) because having an unlimited allowance doesn’t seem safu.
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.
Looks like we have woo wide permissions for the contact when adding infinity steth allowance, so better stick with original code.
test/0.8.25/vaults/dashboard/contracts/LidoLocator__HarnessForDashboard.sol
Outdated
Show resolved
Hide resolved
test/0.8.25/vaults/dashboard/contracts/LidoLocator__HarnessForDashboard.sol
Outdated
Show resolved
Hide resolved
|
||
uint256 stETHAmount = WSTETH.unwrap(_amountOfWstETH); | ||
uint256 sharesAmount = STETH.getSharesByPooledEth(stETHAmount); |
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.
Do we need this? Isn't _amountOfWstETH
already the same as 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.
It seems that using _amountOfWstETH
is the correct approach. However, we need to conduct a test with small numbers to check for rounding issues.
function _burn(uint256 _amountOfShares) internal { | ||
STETH.transferSharesFrom(msg.sender, address(vaultHub), _amountOfShares); | ||
function _burn(address _sender, uint256 _amountOfShares) internal { | ||
if (_sender == address(this)) { |
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.
Infinity steth allowance looks acceptable to me here. However, the condition also does not bother me much.
I need feedback from more experienced individuals (like AP or EM) because having an unlimited allowance doesn’t seem safu.
…ashboard-ux-updates
Hardhat Unit Tests Coverage Summary
Diff against master
Results for commit: 186e266 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
A short summary of the changes.
Context
General
Dashboard Contract
LidoLocator
for retrievingstETH
andwstETH
contract addresses.stETH
towstETH
.getMintableShares
toprojectedMintableShares
.mintWstETH
to utilize the initial approval ofstETH
.burnWstETH
to align with changes in the_burn
method.burnWithPermit
to align with changes in the_burn
method.burnWstETHWithPermit
to align with changes in the_burn
method.burn
->burnShares
mint
->mintShares
burn
/fund
methods to accommodate changes in_burn/_fund
:_fund
now takesvalue
as an argument._burn
now accepts_sender
and_amountOfShares
as arguments._sender
type, eithertransferShares
ortransferSharesFrom
is executed.transferShares
is used if the operation originates from the Dashboard contract to avoid additionalstETH
approvals.Delegation Contract
fund
/burn
methods to account for updates to_burn/_fund
in the Dashboard contract.Testing
Permit
functionality when the shares-to-stETH
ratio is not 1:1 (e.g.,1 share = 0.5 stETH
,1 share = 2 stETH
).LidoLocator
setup in the constructor.Additional Notes
Permit
mechanism withstETH
during rebalancing of the shares-to-stETH
ratio will still use thevalue
ofstETH
tokens. As a result, the values passed to theburnWithPermit
method and those signed in thePermit
may differ. To address this, theStETHPermit
contract would need updates, but this could introduce unnecessary overhead.Problem
What problem this PR solves, link relevant issue if it exists
Solution
Your proposed solution