Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions MIPS/MIP-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ The Solidity selector for `dippedIntoReserve` is `0x3a61584e`.

### Gas Cost

The gas cost of calling `dippedIntoReserve()` should be constant. Implementations should incrementally update their violation state, rather than iterating over the set of modified accounts in the current transaction on each call to the precompile.

A precise gas cost for the method is TBD pending benchmarking.
Calling `dippedIntoReserve()` has a gas cost equivalent to one warm `sload`. Implementations should incrementally update their violation state, rather than iterating over the set of modified accounts in the current transaction on each call to the precompile.

### Semantics

The method `dippedIntoReserve()` evaluates the condition that `DippedIntoReserve` (Algorithm 3 of the initial spec) would return, substituting the current state for the post-execution state. The check considers all accounts touched in the transaction, regardless of call depth.

The return value is ABI-encoded as a Solidity `bool`—i.e., a 32-byte word in returndata, consistent with standard Solidity ABI encoding. This means callers can invoke the precompile via a normal contract call and decode the result using standard ABI decoding.

Calldata must consist of exactly the 4-byte function selector (`0x3a61584e`). Any other calldata is invalid: if the selector does not match `dippedIntoReserve()` (i.e. the selector is unrecognized), or if extra calldata is appended beyond the selector, the precompile must revert.
Calldata must consist of exactly the 4-byte function selector (`0x3a61584e`). Any other calldata is invalid: if the selector does not match `dippedIntoReserve()` (i.e. the selector is unrecognized) the contract must revert with the error message "method not supported". If extra calldata is appended beyond the selector, the precompile must revert with the error message "input is invalid".

The method `dippedIntoReserve()` is not payable and must revert with the error message "value is nonzero" when called with a nonzero value.

The precompile must be invoked via `CALL`. Invocations via `STATICCALL`, `DELEGATECALL`, or `CALLCODE` must revert.

Expand All @@ -53,7 +53,7 @@ Reverts consume all gas provided to the call frame. This is consistent with the

A previous design proposed adding a new opcode with similar semantics. Since this introspection feature is intended for direct use by smart contract developers (e.g., in bundler entrypoint contracts), a precompile was chosen because it can be called immediately without requiring compiler or toolchain updates.

The semantics described above (strict calldata validation, ABI-encoded return values, and all-gas-consuming reverts) are chosen for explicit consistency with the existing Monad staking precompile.
The semantics described above (strict calldata validation, ABI-encoded return values, rejecting calls with value, revert messages, and all-gas-consuming reverts) are chosen for explicit consistency with the existing Monad staking precompile.

## Backwards Compatibility

Expand Down