Closed jacqueswww closed 6 years ago
Whether a secondary keyword for 0xfd (INVALID) asserts are necessary, should be discussed - however I much prefer only having assert
, having multiple require/assert/require keywords tends to just be confusing. And I don't really see the need for a throw/assert keyword that drains all gas ?
Yeah, I agree. I don't think there is a need to use the opcode that drains all gas. Perhaps this INVALID opcode might not be as useful as originally intended? Unless it is there as a means to punish abuse of the system, like in overflows, recursion issues, loop issues, etc.
This is the suggested template for new VIPs.
Preamble
Simple Summary
The
assert
statement should be converted to use REVERT opcode.Abstract
Suggests changing the
assert
statement to using REVERT opcode underlying, allowing gas to be remaining gas be returned.Motivation
Most scenarios one would prefer remaing gas to be sent back, and not completely absorbed. Currently the assert statement in Viper produces a an invalid jump, draining all gas.
Specification
Syntax wise assert statys exactly the same:
Backwards Compatibility
Previous Dapps or contracts that assumed gas will completely spent after a failed assert, will now receive gas back. It doesn't effect compatibility much, as viper isn't used in production yet.
References
https://github.com/ethereum/eips/issues/140
Copyright
Copyright and related rights waived via CC0