29318 - [SC - Insight] Timelock contract should use canExecuteTransact...
Last updated
Was this helpful?
Last updated
Was this helpful?
Submitted on Mar 13th 2024 at 22:35:50 UTC by @shanb1605 for
Report ID: #29318
Report type: Smart Contract
Report severity: Insight
Target: https://github.com/immunefi-team/vaults/blob/main/src/Timelock.sol
Impacts:
Contract fails to deliver promised returns, but doesn't lose value
The Timelock contract's executeTransaction()
has multiple checks before executing a transaction:
Instead of these multiple checks immunefi should consider using canExecuteTransaction()
Using multiple require
statements may cost too much gas to execute transaction.
Immunefi promises to offer a smooth arbitration between the project and Whitehat, using multiple require
statements will cost too much gas to execute.
Immunefi can add this snippet if they wish to handle this as a single require statement:
I have commented out unnecessary require statements on executeTransaction()
and added a single line of code as per recommendation.
Also, I have changed the function visibility of canExecuteTransaction()
from external
to public
Run forge test --mp test/foundry/Timelock.t.sol and everything works fine :)