function f() external {
// revert MyError();
bytes4 errorSelector = this.MyError.selector;
assembly {
mstore(0, errorSelector)
revert(00x1c, 40x04)
}
}
function f() external {
// revert MyErrorWithValue(555);
bytes4 errorSelector = this.MyErrorWithValue.selector;
assembly {
mstore(0, errorSelector)
mstore(4, 555)
revert(00x1c, 0x24)
}
}
function h() external {
// revert MyErrorWithValues(555, 666);
bytes4 errorSelector = this.MyErrorWithTwoValues.selector;
assembly {
let ptr := mload(0x40)
mstore(ptr, errorSelector)
mstore(add(ptr, 0x04), 555)
mstore(add(ptr, 0x24), 666)
revert(add(ptr, 0x1c), 0x44)
}
}
for correctly returning only the 4bytes or custom error selector which is stored left padded in 0 slot of memory the offset should change from 0x00 to 0x1c