Skip to content

Magic number warning#190

Open
mushketyk wants to merge 5 commits intoduaraghav8:developfrom
mushketyk:magic-number
Open

Magic number warning#190
mushketyk wants to merge 5 commits intoduaraghav8:developfrom
mushketyk:magic-number

Conversation

@mushketyk
Copy link
Copy Markdown
Contributor

@mushketyk mushketyk commented Apr 4, 2018

I've also implemented a couple of helper functions that should make writing unit tests for rules easier.

Implements one of the rules in #44

@mushketyk
Copy link
Copy Markdown
Contributor Author

I've removed deprecated: true from the "magic-to-const" rule that accidentally was added there.

@duaraghav8
Copy link
Copy Markdown
Owner

@mushketyk Am I right in understanding that this rule intends to flag any numbers in the code being used without being declared as constants first? Like callMySolidityFunction(42); should be flagged but var foo = 42; callMySolidityFunction(foo); shouldn't, right?

I'm confused because you only seem to pass on the number if its declared as a constant state variable.

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.

2 participants