The refillSepEth(uint256 amountToRefill) function is declared as payable, which already encodes the amount of ETH sent via msg.value.
However, the function redundantly requires an additional parameter amountToRefill to specify the same number and checks that both match.
This argument adds no functional or security benefit and can be entirely replaced by msg.value.
It slightly increases gas costs and creates confusion about the function’s intended usage.
Likelihood: Medium
| Factor | Observation | Likelihood Influence |
|---|---|---|
| Access Level | Only callable by the owner | Low |
| Exploit Potential | None — cannot be abused for gain | Low |
| Developer Confusion | Moderate — easy to misunderstand | Medium |
| Usage Frequency | Rare — admin-only function | Low |
Impact: Low
| Impact Area | Description |
|---|---|
| Functional | No impact — function still behaves correctly. |
| Gas | Slightly higher due to extra calldata and redundant checks. |
| Clarity | Misleading — implies the two values could differ when they cannot. |
| Maintainability | Adds unnecessary complexity and confusion. |
| Auditability | Introduces redundant logic that distracts from core behavior. |
| Step | Input | Expected Result |
|---|---|---|
| 1️⃣ | msg.value = 1 ether, amountToRefill = 2 ether |
Reverts |
| 2️⃣ | msg.value = 1 ether, amountToRefill = 1 ether |
Succeeds |
Simplify the function to rely solely on msg.value.
This reduces calldata size, removes redundancy, and improves readability.
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.