-
Notifications
You must be signed in to change notification settings - Fork 193
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
Add regression test on malicious stETH recovery by recoverERC721
(selfOwnedStETHBurner)
#444
Conversation
Feat: merge-ready protocol
Add a test to address the issue #443 regarding missing explicit check on the posibility to recover stETH through the `recoverERC721` func.
assertBn(await lido.balanceOf(anotherAccount), stETH(0)) | ||
// submit 10 ETH to mint 10 stETH | ||
await web3.eth.sendTransaction({ from: anotherAccount, to: lido.address, value: ETH(10) }) | ||
// check 10 stETH minted on balance | ||
assertBn(await lido.balanceOf(anotherAccount), stETH(10)) | ||
// transfer 5 stETH to the burner account | ||
await lido.transfer(burner.address, stETH(5), { from: anotherAccount }) | ||
// transfer 5 stETH to voting | ||
await lido.transfer(voting, stETH(5), { from: anotherAccount }) | ||
|
||
// request 5 stETH to be burned later | ||
await lido.approve(burner.address, stETH(5), { from: voting }) | ||
await burner.requestBurnMyStETH(stETH(5), { from: voting }) | ||
|
||
// check balances one last time | ||
assertBn(await lido.balanceOf(anotherAccount), stETH(0)) | ||
assertBn(await lido.balanceOf(voting), stETH(0)) | ||
assertBn(await lido.balanceOf(burner.address), stETH(10)) |
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's not clear for me, why we need to put 10 stETH and trying to recover only 1 and why a such complicated way was used to top up the burner.
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.
Hey, addressed the issues within the updated code, thank you 🙏
The top-up process is rather complicated because of design requirements (only voting can request the burning & explicit allowance required).
Please check out the updated code 👍
Add a test to address issue #443 regarding missing explicit check
on the possibility to recover stETH through the
recoverERC721
func.