You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
After token transfering it doesn't check how the balance increased. Provided by user _amount param is saved to the Deposit struct. Also share amount that is minted depends on _amount param.
The same is for increaseLockfunction.
When user withdraw then saved amount is transferred back.
Impact
Protocol calculates more deposited tokens for the depositor. When people will start withdrawing their staked funds some of them can be left without some part. Also protocol mints a bigger share for the depositor.
Code Snippet
Provided above.
Tool used
Manual Review
Recommendation
Check balance before and after sending tokens to the pool. Use the difference as provided amount.
The text was updated successfully, but these errors were encountered:
rvierdiiev
medium
Protocol doesn't work proper with fee-on-transfer tokens
Summary
When fee-on-transfer tokens will be used for staking then protocol will lost some funds.
Vulnerability Detail
Some ERC20 tokens may take fee when transfer assets.
This is how
deposit
function works.After token transfering it doesn't check how the balance increased. Provided by user
_amount
param is saved to theDeposit
struct. Also share amount that is minted depends on_amount
param.The same is for
increaseLock
function.When user withdraw then saved amount is transferred back.
Impact
Protocol calculates more deposited tokens for the depositor. When people will start withdrawing their staked funds some of them can be left without some part. Also protocol mints a bigger share for the depositor.
Code Snippet
Provided above.
Tool used
Manual Review
Recommendation
Check balance before and after sending tokens to the pool. Use the difference as provided amount.
The text was updated successfully, but these errors were encountered: