-
Notifications
You must be signed in to change notification settings - Fork 79
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 unexpected transfers of value (was: Add an equivalent of "payable" to the runtime) #836
Comments
The negated approach is saner, this is special functionality and should thus be optin. |
I think there's reasonable justification for doing the breaking approach, if we can do it soon. Receiving funds unexpectedly would very likely lead to their loss. I would say that being able to receive funds is the special functionality. |
Thats a reasonable argument, but is there precedent for it? More importantly for FEVM, isnt accepting funds the default mode? |
Just to confirm, @Stebalien, given the location of this issue, you're proposing this as a safety feature for the built-in actors runtime (which is essentially just a support library). It's not something that would be available or enforced for any user actors, though of course they could copy the pattern. |
Related discussion about being able to refuse bare sends of value (which would require VM support): filecoin-project/ref-fvm#835 |
Yes.
Yes. However, the default in solidity is to reject funds. |
I've renamed this "Reject unexpected transfers of value" to reflect the behavioural change. I concur that support in the Runtime would be a good way to get it. This will become valuable as user-programmed contracts/actors emerge, and we can do the development/user community a favour by preventing the built-in actors from accepting their funds. |
Specifically:
rt.payable()
where a call gets reverted if:rt.payable
was not called at some point.We could, alternatively, have a
rt.not_payable()
. That's the "less breaking" approach.The text was updated successfully, but these errors were encountered: