Platform: Code4rena
Start Date: 20/01/2022
Pot Size: $50,000 USDC
Total HM: 3
Participants: 35
Period: 7 days
Judge: GalloDaSballo
Total Solo HM: 2
Id: 77
League: ETH
Rank: 11/35
Findings: 1
Award: $405.60
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: pauliax
Also found by: 0x1f8b, Jujic, danb, harleythedog
0x1f8b
Improve require.
Total supply must be more or equal to _liquidityTokenQty in Exchange.removeLiquidity
.
Manual review
Change
require(this.totalSupply() > 0, "Exchange: INSUFFICIENT_LIQUIDITY");
to
require(this.totalSupply() >= _liquidityTokenQty, "Exchange: INSUFFICIENT_LIQUIDITY");
#0 - 0xean
2022-01-31T15:35:06Z
dupe of #175
🌟 Selected for report: harleythedog
0x1f8b
The method to detect a token with fee it's wrong implemented.
The method to detect a token with fee it's wrong implemented in Exchange.addLiquidity:123
. If an attacker send one token to the contract, it will never be empty, so the condition of if (isExchangeEmpty) {
will never happend, and the require never will be made.
if (isExchangeEmpty) { require( IERC20(baseToken).balanceOf(address(this)) == tokenQtys.baseTokenQty, "Exchange: FEE_ON_TRANSFER_NOT_SUPPORTED" ); }
Manual review.
Use a balance difference between before and after.
#0 - 0xean
2022-01-31T14:41:19Z
dupe of #119