2024-11-28 05:59:12 -06:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity ^0.8.26;
|
|
|
|
|
|
|
|
error BadThing(uint256 arg1, uint256 arg2, uint256 arg3, bool arg4);
|
2024-12-12 02:20:16 -06:00
|
|
|
error BadThing2(uint256 arg1, uint256 arg2, uint256 arg3, uint256 arg4);
|
2024-11-28 05:59:12 -06:00
|
|
|
|
|
|
|
contract C {
|
|
|
|
function Foo() public pure {
|
|
|
|
revert BadThing({
|
|
|
|
arg1: uint256(0),
|
|
|
|
arg2: uint256(1),
|
|
|
|
arg3: uint256(2),
|
|
|
|
arg4: false
|
|
|
|
});
|
|
|
|
}
|
2024-12-12 02:20:16 -06:00
|
|
|
function Bar() public pure {
|
|
|
|
revert BadThing2({
|
|
|
|
arg1: uint256(0),
|
|
|
|
arg2: uint256(1),
|
|
|
|
arg3: uint256(2),
|
|
|
|
arg4: uint256(3)
|
|
|
|
});
|
|
|
|
}
|
2024-12-12 09:06:39 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// purpose of this is to test that generation of metadata for contract that emits one error produces valid Go code
|
|
|
|
contract C2 {
|
|
|
|
function Foo() public pure {
|
|
|
|
revert BadThing({
|
|
|
|
arg1: uint256(0),
|
|
|
|
arg2: uint256(1),
|
|
|
|
arg3: uint256(2),
|
|
|
|
arg4: false
|
|
|
|
});
|
|
|
|
}
|
2024-11-28 05:59:12 -06:00
|
|
|
}
|