Platform: Code4rena
Start Date: 21/10/2021
Pot Size: $80,000 ETH
Total HM: 28
Participants: 15
Period: 7 days
Judge: ghoulsol
Total Solo HM: 19
Id: 42
League: ETH
Rank: 11/15
Findings: 4
Award: $551.35
🌟 Selected for report: 2
🚀 Solo Findings: 0
nikitastupin
Some tokens do not revert in case of failure and return false
instead. If one of these tokens is used in Mochi, settleLiquidation
will not revert if the transfer fails, and an attacker can call settleLiquidation
for free.
Slither
Use SafeERC20
, or ensure that the transfer
return value is checked.
https://github.com/crytic/slither/wiki/Detector-Documentation#unchecked-transfer
#0 - r2moon
2021-10-27T13:25:43Z
duplicated with https://github.com/code-423n4/2021-10-mochi-findings/issues/75
🌟 Selected for report: nikitastupin
nikitastupin
The ChainlinkAdapter
calls out to a Chainlink oracle receiving the latestRoundData()
. If there is a problem with Chainlink starting a new round and finding consensus on the new value for the oracle (e.g. Chainlink nodes abandon the oracle, chain congestion, vulnerability/attacks on the chainlink system) consumers of this contract may continue using outdated stale or incorrect data (if oracles are unable to submit no new round is started).
Add the following checks:
... ( roundId, rawPrice, , updateTime, answeredInRound ) = AggregatorV3Interface(XXXXX).latestRoundData(); require(rawPrice > 0, "Chainlink price <= 0"); require(updateTime != 0, "Incomplete round"); require(answeredInRound >= roundId, "Stale price"); ...
🌟 Selected for report: nikitastupin
0.0768 ETH - $319.56
nikitastupin
https://github.com/code-423n4/2021-10-mochi/blob/806ebf2a364c01ff54d546b07d1bdb0e928f42c6/projects/mochi-cssr/contracts/adapter/UniswapV2TokenAdapter.sol#L142-L143 - we can safely remove this string reducing gas cost of the function.
Found by Solidity compiler:
Warning: This declaration shadows an existing declaration. --> @mochifi/cssr/contracts/adapter/UniswapV2TokenAdapter.sol:142:17: | 142 | uint256 liq = sushiCSSR.getLiquidity(_asset,key); | ^^^^^^^^^^^ Note: The shadowed declaration is here: --> @mochifi/cssr/contracts/adapter/UniswapV2TokenAdapter.sol:141:62: | 141 | try sushiCSSR.getLiquidity(_asset, key) returns (uint256 liq) { | ^^^^^^^^^^^