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
An out-of-gas execution is useful for other people trying to mock contract implementations.
Details
A way of doing this might be executing an invalid bytecode that forces all gas to be used up. This can be achieved by using an assert(false) natively in Solidity without any complicated loop/assembly/precompile.
EIP-141 defines the 0xfe as the standard for invalid opcode that uses up all the gas and reverts execution.
Context
An out-of-gas execution is useful for other people trying to mock contract implementations.
Details
A way of doing this might be executing an invalid bytecode that forces all gas to be used up. This can be achieved by using an
assert(false)
natively in Solidity without any complicated loop/assembly/precompile.EIP-141 defines the
0xfe
as the standard for invalid opcode that uses up all the gas and reverts execution.More info is also in wolflo's evm-opcodes repo.
Alternatives
Gnosis implements out-of-gas execution mocking by doing low-level calls to EC (precompile 0x6):
https://github.com/gnosis/mock-contract/blob/b0f735ddc62d5000b50667011d69142a4dee9c71/contracts/MockContract.sol#L300-L308
Security concerns
Still considering the implications of this new feature.
Has the feature been requested before?
The text was updated successfully, but these errors were encountered: