InsureDAO contest - pmerkleplant's results

Anyone can create an insurance pool like Uniswap.

General Information

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

InsureDAO

Findings Distribution

Researcher Performance

Rank: 26/37

Findings: 2

Award: $143.16

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: WatchPug

Also found by: Dravee, Ruhum, cmichel, pmerkleplant

Labels

bug
duplicate
2 (Med Risk)
sponsor acknowledged

Awards

149.5717 INSURE - $52.35

90.8114 USDC - $90.81

External Links

Handle

pmerkleplant

Vulnerability details

Impact

There exist ERC20 tokens that charge a fee for every transfer.

This kind of token does not work correctly with the PoolTemplate::deposit function.

Proof of Concept

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.

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter