The _validatePrice
function in KeeperProxy makes redundant external calls to the same contract interface, resulting in unnecessary gas costs for users.
The function creates multiple instances of IPerpetualVault
interface to interact with the same contract, incurring unnecessary gas costs from repeated external calls.
Severity: Low
Effects:
Extra ~700 gas per redundant interface call
Increased transaction costs for users
Cumulative impact scales with protocol usage
No security risks, purely gas optimization
Manual code review
Gas profiler
Solidity compiler optimization analysis
Cache the interface instance to reduce gas costs:
Operation | Before | After | Savings |
---|---|---|---|
Interface Calls | 2 | 1 | ~700 gas |
Total per TX | ~1,400 | ~700 | ~700 gas |
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.