Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

`onlyOwner`-Gated Functions Guaranteed to Revert When Called by Normal Users Can Be Marked as `payable`

Summary

Functions using the onlyOwner modifier can be marked as payable to lower the gas cost for legitimiate callers.

Vulnerability Details

Functions using the onlyOwner modifier, such as MerkleAirdrop::claimFees, can be marked as payable to lower the gas cost for legitimiate callers by 90 gas units.

Impact

By not marking the function as payable, callers will endure a higher gas cost when calling the function.

Tools Used

Manual Analysis

Recommendations

Mark the MerkleAirdrop::claimFees function as payable.

- function claimFees() external onlyOwner {
+ function claimFees() external payable onlyOwner {
(bool succ,) = payable(owner()).call{ value: address(this).balance }("");
if (!succ) {
revert MerkleAirdrop__TransferFailed();
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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