Skip to content
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

Unstake() fails for getting insufficient assets from AssetManager #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maxweng
Copy link
Member

@maxweng maxweng commented May 5, 2023

No description provided.

@linear
Copy link

linear bot commented May 5, 2023

UNI-1387 Unstake should fail if the amount withdrawal is not correct

Currently, the UserManager records the difference between the unstaking amount and the actual amount of tokens received from the underlying money markets but has the unstake() transaction goes thru anyways. E.g. https://optimistic.etherscan.io/tx/0x99a2e738b1ea04bc1b84474dfcd1318679e4397b96e34cc2525c634c53447609

But the problem jacob thinks is the end users won't know what happened if they receives a different amount than the one they ask for. So, jacob is proposing to have the unstake() transaction to fail altogether when the receiving token amount is different from the unstaking amount.

@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Merging #158 (70a7fc3) into master (632d7fb) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #158      +/-   ##
==========================================
- Coverage   82.78%   82.76%   -0.02%     
==========================================
  Files          20       20              
  Lines         918      917       -1     
  Branches      174      174              
==========================================
- Hits          760      759       -1     
  Misses         96       96              
  Partials       62       62              
Impacted Files Coverage Δ
contracts/user/UserManager.sol 90.72% <100.00%> (-0.04%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants