Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

@TilakMaddy TilakMaddy marked this pull request as ready for review December 15, 2024 11:01
@TilakMaddy TilakMaddy requested a review from DaniPopes December 15, 2024 15:20
Copy link
Member

@DaniPopes DaniPopes left a 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

gcx.dcx()
.warn("contract has a payable fallback function, but no receive ether function")
.span(contract.name.span)
.help("consider adding a `receive() external payable { ... }`")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"consider changing fallback to receive" maybe?


if payable_fallback_found && !receive_found {
gcx.dcx()
.warn("contract has a payable fallback function, but no receive ether function")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also add the error code

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