Search code examples
exceptiontransactionsethereumsolidityevm

Can Ethereum transaction (calling contract function) fail for reasons other than assert()/require()/revert() or gas issues?


When running a private Ethereum network not requiring gas for transactions, can a contract function transaction fail for some "unpredictable" issue, other than explicit invocation of assert()/require()/revert(), for example dividing by 0 or some other issue with EVM or beyond EVM?


Solution

    • division by zero

    • integer overflow/underflow in Solidity 0.8+ (previous versions let the number overflow, 0.8 throws an exception)

    • accessing out-of-bounds array index

    • message call (aka internal transaction) to an address that does not implement the called function (might have been selfdestruct or changed implementation behind a proxy)

    These I could think of right now. I'm sure there's more examples, generally runtime errors cause by some logical mistake.