Platform: Code4rena
Start Date: 07/01/2022
Pot Size: $80,000 USDC
Total HM: 21
Participants: 37
Period: 7 days
Judge: 0xean
Total Solo HM: 14
Id: 71
League: ETH
Rank: 26/37
Findings: 2
Award: $143.16
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: WatchPug
Also found by: Dravee, Ruhum, cmichel, pmerkleplant
149.5717 INSURE - $52.35
90.8114 USDC - $90.81
pmerkleplant
There exist ERC20 tokens that charge a fee for every transfer.
This kind of token does not work correctly with the PoolTemplate::deposit
function.
The PoolTemplate::deposit
function mints an amount of iTokens
based on the function's
parameter _amount
, see line 239.
However, in case the deposit token is a fee-on transfer token the amount of tokens the vault
receives would be less than _amount
and therefore the minting would be off.
To disable depositing of fee-on transfer tokens, add the following code in
Vault::addValue
around line 136:
uint256 oldBalance = token.balanceOf(address(this)); IERC20(token).safeTransferFrom(_from, address(this), _amount); uint256 newBalance = token.balanceOf(address(this)); require(oldBalance + _amount == newBalance);
#0 - oishun1112
2022-01-16T05:56:10Z
only USDC is deposit-able. we don't implement this in terms of total gas.
#1 - oishun1112
2022-01-19T05:10:42Z