Open hats-bug-reporter[bot] opened 1 month ago
As per competition rules, are excluded:
For what we are concerned now, those contracts were made for sDAI as a collateral, but I do understand that the parameter name and comments make it look like it could be any ERC20.
Even if it's technically excluded, it may still be good to follow the standard recommendations such that we can reuse the base router if we were to make some "arbitrary ERC20 token" router in the future.
Note that if we do give a reward for this one, this would be from in addition of the reward pool not to penalize other hunters.
Hey, sorry for the initial reporter but this https://github.com/hats-finance/SeeR-PM-0x899bc13919880db76edf4ccd72bdfa5dfa666fb7/issues/103 was submitted first and was displayed late due to a bug on hat side. I've talked with the team and they confirmed that the #103 was the first submitted.
Github username: -- Twitter username: -- Submission hash (on-chain): 0x684e732c9ad1f5a40e473dfb9375ef659a6e3144aa088c2543f18f441bd1c2aa Severity: high
Description: Description\ Some ERC20 tokens might return
false
instead of reverting in case of transfer failures. EIP20 states that:Callers MUST handle
falsefrom
returns (bool success). Callers MUST NOT assume that
falseis never returned!
https://eips.ethereum.org/EIPS/eip-20
Router.sol
does not check the return value oftransfer
andtransferFrom
when transferringcollateralToken
. This might lead to inconsistent state for the Seer protocol. This will lead to the fallowing scenariosredeemPositions()
will succeed even when the actual transfer of tokens has failedcollateralToken.transfer(msg.sender, finalBalance - initialBalance);//@audit return value not checked in collateral token:
} } }