Labels: good-first-issue, gasguard-rules, bytecode, gasguard
Difficulty: Easy
Module: rules/g006_payable_admin.rs
🧠 Concept
Add rule G006 to recommend adding the payable modifier to strictly restricted administrative functions (onlyOwner, onlyAdmin).
⚠️ Problem
Non-payable functions generate explicit EVM bytecode checks (callvalue / iszero / revert) to verify that no ETH was sent, consuming ~24 extra gas per execution.
📁 Implementation Scope
rules/g006_payable_admin.rs
test/fixtures/g006_samples.sol
🛠️ Requirements
- Identify functions protected by access-control modifiers (e.g.,
onlyOwner).
- If the function is not marked
payable, flag it with an optimization suggestion.
🎯 Acceptance Criteria
Labels:
good-first-issue,gasguard-rules,bytecode,gasguardDifficulty: Easy
Module:
rules/g006_payable_admin.rs🧠 Concept
Add rule
G006to recommend adding thepayablemodifier to strictly restricted administrative functions (onlyOwner,onlyAdmin).Non-payable functions generate explicit EVM bytecode checks (
callvalue/iszero/revert) to verify that no ETH was sent, consuming ~24 extra gas per execution.📁 Implementation Scope
rules/g006_payable_admin.rstest/fixtures/g006_samples.sol🛠️ Requirements
onlyOwner).payable, flag it with an optimization suggestion.🎯 Acceptance Criteria
payable.