20,000 USDC
View results
Submission Details
Severity: gas
Valid

`setPool` should `revert` on else condition.

Details

The setPool function checks whether the pool balance is greater than or less than the previous balance of the pool and based on it either it creates the pool or updates it.

But if the pool balance will be equal then no transfer will happen and no balance will be updated, and we will unnecessarily emit these events PoolBalanceUpdated and either PoolCreated or PoolUpdated.

Recommendations

We should add the else condition which reverts when no balance changes.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.