-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rule to prohibit calls of .send #5
Conversation
92f0241
to
c38aa9b
Compare
test/no-send.js
Outdated
} | ||
}; | ||
|
||
describe ('[RULE] no-send', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change description to [RULE] no-send: Rejections
(this is convention throughout Solium)
rules/no-send.js
Outdated
|
||
schema: [], | ||
|
||
fixable: 'code' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove fixable: 'code'
- this property is set only if the rule supplies at least 1 fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, good catch :) I had a fixable in before (changing send
to transfer
) but I removed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that must've been the case (has happened with me too!)
c38aa9b
to
56b7499
Compare
@duaraghav8 I did some digging and it appears there is no way in solparse to detect that the type of an Identifier (in the test example's case If so, some options:
|
@TristanH That's right, I've had the same thought before of the rare case where user might have defined a
So leave out this edge case. |
Gotcha -- that's what I suspected. Thanks for the detailed explanation, the symbol table would be awesome if it was implemented, but I agree probably out of scope :) In that case I think this PR should be good to go! |
It is :) Allow me to review all other PRs, merging will begin in ~2 days |
@TristanH merged! Also |
|
Oh crap, sorry about that @duaraghav8 I'm looking now. |
Ah, I just passed in |
And yeah, also |
In response to the Augur Bug Bounty: Prohibit use of send
Let me know if there are any fixes/improvements needed :)
Also, currently looking at how to not detect e.g user-defined classes with
send
functions, but I'm not sure if there's a way to detect that the type of a callee (in the test's casemsg.sender
) is anaddress
. Any ideas?