Open code423n4 opened 3 years ago
Sorry for all the label changes; was gonna call a decision myself but probably good to open it to others 😅
Sorry, will comment on this within half an hour
The warden is saying that since there's a try catch here: https://github.com/tracer-protocol/perpetual-pools-contracts/blob/646360b0549962352fe0c3f5b214ff8b5f73ba51/contracts/implementation/PoolKeeper.sol#L108
executePriceChange
should revert on failure instead of emitting the error event:
https://github.com/tracer-protocol/perpetual-pools-contracts/blob/646360b0549962352fe0c3f5b214ff8b5f73ba51/contracts/implementation/LeveragedPool.sol#L179
The change could be implemented by refactoring the if
: https://github.com/tracer-protocol/perpetual-pools-contracts/blob/646360b0549962352fe0c3f5b214ff8b5f73ba51/contracts/implementation/LeveragedPool.sol#L178
into a require
I think the finding is correct, as well as the severity, this is in line with code arenas definition:
1 — Low: Low: Assets are not at risk. State handling, function incorrect as to spec, issues with comments.
Handle
cmichel
Vulnerability details
As
PoolKeeper.performUpkeepSinglePool
can handle reverts inpool.poolUpkeep
, theLeveragedPool.executePriceChange
function should revert if the prices are bad:Impact
The keeper will report a valid upkeep when indeed it was invalid.
Recommended Mitigation Steps
Revert instead on price errors.