-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: warn when payable fallback function found but no receive function #170
base: main
Are you sure you want to change the base?
feat: warn when payable fallback function found but no receive function #170
Conversation
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.
lgtm, I would like to hold off on this because there is currently no way to turn off warnings
1ddded1
to
adc0aae
Compare
contract P3 { | ||
fallback() external payable {} | ||
|
||
receive() external payable {} |
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 add annotations for the warnings //~
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.
It's a bit strange 🤔 .. I tried
- Same line variant (//~ WARN: ...)
- Next line variant(//~^ WARN: ...)
but they both fail on cargo uitest payable_fallback
😕
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.
pushed a fix 8433135
the diagnostic was missing the main span (.span()
) but then it also required a workaround for a edge case in ui_test
https://github.com/ethereum/solidity/blob/03e2739809769ae0c8d236a883aadc900da60536/libsolidity/analysis/ContractLevelChecker.cpp#L544C1-L554C2