refillSepEthNormal behavior:
The refillSepEth() function should validate input conditions before accepting Sepolia ETH refills from the contract owner.
Specifically:
amountToRefill > 0
msg.value == amountToRefill
Issue:
The current implementation uses require statements with string error messages, which are less gas efficient than using if conditions combined with custom errors (introduced in Solidity 0.8.4).
Example of current code:
Example of proposed alternative:
Why?
require(..., "error message") stores a full string in contract bytecode, increasing deployment cost.
if (...) revert CustomError() encodes errors more efficiently, saving runtime gas.
Likelihood: High (always executed since validation is mandatory).
Impact: Medium (this does not break functionality but increases gas cost for every refill).
Each refill call incurs higher gas usage.
On mainnet or with frequent refills, costs add up.
Not exploitable by attackers — but still suboptimal design.
Replace require with if + revert CustomError for all input validation:
This ensures gas efficiency while preserving functionality and security guarantees.
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.