lotus/itests/contracts/Errors.sol
Steven Allen 00b6d06041
feat: eth: parse revert data ()
We don't really want to do this in the FVM because it's Ethereum
specific, but this makes sense to do in the Ethereum API.

See:

See https://docs.soliditylang.org/en/latest/control-structures.html#panic-via-assert-and-error-via-require
2023-02-17 01:18:03 +00:00

25 lines
479 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract Errors {
error CustomError();
function failRevertEmpty() public {
revert();
}
function failRevertReason() public {
revert("my reason");
}
function failAssert() public {
assert(false);
}
function failDivZero() public {
int a = 1;
int b = 0;
a / b;
}
function failCustom() public {
revert CustomError();
}
}