-
Notifications
You must be signed in to change notification settings - Fork 24
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
AUDIT: 36903 #192
base: master
Are you sure you want to change the base?
AUDIT: 36903 #192
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #192 +/- ##
==========================================
+ Coverage 80.70% 80.71% +0.01%
==========================================
Files 91 91
Lines 9944 9953 +9
==========================================
+ Hits 8025 8034 +9
Misses 1919 1919 ☔ View full report in Codecov by Sentry. |
Need to remove overlap code from #191 |
vault_fee_token_account.clone(), | ||
token_program.clone(), | ||
]; | ||
process_update_vault_balance(program_id, &accounts)?; |
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.
this can brick minting if gets in state where effective rate isn't ok?
process_update_vault
first thing in themint_to
function. This is the least invasive way of solving this issue, at the cost of some double checking of accountsEntry:
36903 (High) "The vault reward mechanism can be sandwiched by MEV"
UpdateVaultBalance is not strictly required before mint, or other actions involving vault.deposited_tokens, so new depositors can claim an unfairly large portion of rewards. The reports describe a scenario where rewards have been deposited, but the vault balance has not yet been updated. If a new depositor mints tokens before the balance update, they are included in the reward distribution calculation. In this way, they can claim a share of rewards that they did not contribute to.
The following are duplicates of this submission:
37311 "Attackers can steal rewards by depositing, updating vault balance and withdrawing immediately after a large reward is deposited"
27295 "Rewards can be stolen by depositing immediately after reward tokens get sent to vault"
37315 "Theft of Unclaimed Yields Due to Improper Reward Distribution in Vault Program"