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

Reject constant modifier on the fallback function #963

Closed
wants to merge 1 commit into from

Conversation

axic
Copy link
Member

@axic axic commented Aug 26, 2016

Partially fixes #562

@chriseth
Copy link
Contributor

What is the reasoning behind this? I would actually argue that a fallback function should rather be constant, because it usually does not have enough gas to modify storage.

@axic
Copy link
Member Author

axic commented Aug 31, 2016

Actually this goes a bit further. constant would mean the state cannot be changed, but receiving value changes the state also (updates the balance). And that is the reason of existence of the fallback.

@chriseth
Copy link
Contributor

chriseth commented Aug 31, 2016

But that would mean that payable and constant always exclude each other. I would actually not go that far, we have to yet defined what constant actually means.

@axic axic force-pushed the strict-fallback branch from d5e01d6 to f736709 Compare August 31, 2016 21:35
@chriseth
Copy link
Contributor

chriseth commented Sep 5, 2016

I would say this is now superseded by #665 - constant and payable are mutually exclusive. If you want a constant fallback function, it is still fine, I would say.

@chriseth chriseth closed this Sep 5, 2016
@axic
Copy link
Member Author

axic commented Sep 6, 2016

I think, especially in the light of #992, neither constant, view or pure apply to fallback functions. The main point of view and pure are the ability to receive an output data, which the fallback function cannot do anymore (well, it can via inline assembly).

Therefore constant (even the old-world version) should be disabled for fallbacks.

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.

Strict fallback handling
2 participants