Skip to content

fix(gas-increment-by-one): ignore denominated literals - #814

Open
pengbanban wants to merge 1 commit into
protofire:developfrom
pengbanban:my_feature
Open

pengbanban wants to merge 1 commit into
protofire:developfrom
pengbanban:my_feature

Conversation

@pengbanban

Copy link
Copy Markdown

The increment-by-one rule treats 1 ether as the literal value one and recommends ++balance for balance += 1 ether. That suggestion changes the amount by one wei rather than one ether.

Require an undenominated numeric literal in all three literal checks. The new cases cover compound assignment and both operand positions of ordinary assignment.

The focused gas-increment-by-one suite passes all 21 cases. The full lint/test suite has not been run.

Signed-off-by: pengbanban <pengqichugui@outlook.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant