Skip to content

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

Open
maxweng wants to merge 2 commits into
masterfrom
feature/uni-1387-unstake-should-fail-if-the-amount
Open

Unstake() fails for getting insufficient assets from AssetManager#158
maxweng wants to merge 2 commits into
masterfrom
feature/uni-1387-unstake-should-fail-if-the-amount

Conversation

@maxweng

@maxweng maxweng commented May 5, 2023

Copy link
Copy Markdown
Member

No description provided.

@linear

linear Bot commented May 5, 2023

Copy link
Copy Markdown
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

codecov Bot commented May 5, 2023

Copy link
Copy Markdown

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

@maxweng maxweng requested review from GeraldHost, kingjacob and twygod May 5, 2023 09:08
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