-
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
[Draft] Vaults UX suggestions #893
base: feat-immutable-operator-in-vault
Are you sure you want to change the base?
[Draft] Vaults UX suggestions #893
Conversation
@@ -159,6 +233,15 @@ contract Dashboard is AccessControlEnumerable { | |||
_withdraw(_recipient, _ether); | |||
} | |||
|
|||
/** | |||
* @notice Withdraws stETH tokens from the staking vault to wrapped ether. Approvals for the passed amounts should be done before. |
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.
Sorry, didn't get what it should do. RN, ether is still on the dashboard contract. Should it be transferred to msg.sender or some other recepient?
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.
@folkyatina The idea is to send to the fundByWeth
method the amount of WETH that needs to be "unwrap" to the ETH and then fund Vault
WETH withdraw method https://github.com/gnosis/canonical-weth/blob/master/contracts/WETH9.sol#L38
Now I understand that it seems that this code will not work correctly
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.
Updated
Co-authored-by: Aleksei Potapkin <[email protected]>
Co-authored-by: Aleksei Potapkin <[email protected]>
… into feat/vaults-suggestions
Hardhat Unit Tests Coverage Summary
Diff against master
Results for commit: 3d5fbb8 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
…estions # Conflicts: # package.json # test/0.8.25/vaults/dashboard/dashboard.test.ts # yarn.lock
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
…feat/steth-permit
fix: StETH harness contract for dashboard tests
…estions # Conflicts: # test/0.8.25/vaults/dashboard/dashboard.test.ts
… into feat/vaults-suggestions
chore: extract some vaults helpers to library
…ance/core into feat/vaults-suggestions
…estions # Conflicts: # contracts/0.8.25/vaults/StakingVault.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.
Approved.
However, there are a couple of naming suggestions to consider.
PS. Please note that at the moment, tests are failing because managementDue
is being removed in the target branch, causing the tests not to work. T_T
* @notice Funds the staking vault with wrapped ether. Approvals for the passed amounts should be done before. | ||
* @param _wethAmount Amount of wrapped ether to fund the staking vault with | ||
*/ | ||
function fundByWeth(uint256 _wethAmount) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { |
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 fundByWeth(uint256 _wethAmount) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { | |
function fundWeth(uint256 _wethAmount) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { |
* @param _recipient Address of the recipient | ||
* @param _ether Amount of ether to withdraw | ||
*/ | ||
function withdrawToWeth(address _recipient, uint256 _ether) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { |
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 withdrawToWeth(address _recipient, uint256 _ether) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { | |
function withdrawWeth(address _recipient, uint256 _ether) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { |
A short summary of the changes.
Context
Problem
What problem this PR solves, link relevant issue if it exists
Solution
Your proposed solution