Skip to content

Commit 6687d6d

Browse files
committed
Add status codes to EXT*CALL spec
1 parent 6301d20 commit 6687d6d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spec/eof.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,16 @@ The following instructions are introduced in EOF code:
317317
- The `gas_limit` input is removed.
318318
- The `output_offset` and `output_size` is removed.
319319
- The `gas_limit` will be set to `(gas_left / 64) * 63` (as if the caller used `gas()` in place of `gas_limit`).
320-
- `EXTDELEGATECALL` to a non-EOF contract (legacy contract, EOA, empty account) is disallowed, and it returns `1` (same as when the callee frame `reverts`) to signal failure. Only initial gas cost of `EXTDELEGATECALL` is consumed (similarly to the call depth check) and the target address still becomes warm. We allow legacy to EOF path for existing proxy contracts to be able to use EOF upgrades.
321320
- No address trimming is performed on the `target_address`, and if the address has more than 20 bytes the operation halts with an exceptional failure.
321+
- Push a status code on the operand stack:
322+
- `0` if the call was successful.
323+
- `1` any of the following is true:
324+
- Gas available to callee is less than `MIN_CALLEE_GAS` (2300).
325+
- (only `EXTCALL`) Balance of the current account is less than `value`.
326+
- Current call stack depth equals `1024`.
327+
- (only `EXTDELEGATECALL`) `target_address` account in the state doesn't have EOF code to execute (in particular, [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) delegations should be resolved, as if `EXTCALL` was used)
328+
- the execution has reverted.
329+
- `2` if the call has failed.
322330

323331
**NOTE**: The replacement instructions `EXT*CALL` continue being treated as **undefined** in legacy code.
324332

0 commit comments

Comments
 (0)