You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it time to consider adding more safety mechanisms into Solidity. One good candidate is cleaning up the handling of transaction values.
Any method (including the fallback) silently accepts transaction values, it has to manually ensured and dealt with. Please check #562 for the fallback change proposal.
I propose a breaking change so that every method accepting transaction values must explicitly mark methods accordingly with the acceptValue keyword.
Any other non-private/internal method should start with a check for transaction value and should throw if it is non-zero. This could be eventually moved into the ABI dispatcher. If no method is marked as value acceptor, then it is a simple once-off check in the dispatcher.
Libraries should reject values in all cases. This means a once-off check in the dispatcher.
I think it time to consider adding more safety mechanisms into Solidity. One good candidate is cleaning up the handling of transaction values.
Any method (including the fallback) silently accepts transaction values, it has to manually ensured and dealt with. Please check #562 for the fallback change proposal.
I propose a breaking change so that every method accepting transaction values must explicitly mark methods accordingly with the
acceptValue
keyword.Any other non-private/internal method should start with a check for transaction value and should throw if it is non-zero. This could be eventually moved into the ABI dispatcher. If no method is marked as value acceptor, then it is a simple once-off check in the dispatcher.
Libraries should reject values in all cases. This means a once-off check in the dispatcher.
The same restrictions apply to the fallback method, on top of what Strict fallback handling #562 proposes.
For interface JSON definition see Payable as a parameter in the ABI interface JSON #500
Some of the above could be accomplished with a modifier, albeit without the strictness and the option to optimise it (i.e. in the ABI dispatcher):
The text was updated successfully, but these errors were encountered: