arb_precompiles/
arbdebug.rs

1use alloy_evm::precompiles::{DynPrecompile, PrecompileInput};
2use alloy_primitives::Address;
3use revm::precompile::{PrecompileError, PrecompileId, PrecompileResult};
4
5/// ArbDebug precompile address (0xff).
6pub const ARBDEBUG_ADDRESS: Address = Address::new([
7    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8    0x00, 0x00, 0x00, 0xff,
9]);
10
11pub fn create_arbdebug_precompile() -> DynPrecompile {
12    DynPrecompile::new_stateful(PrecompileId::custom("arbdebug"), handler)
13}
14
15fn handler(_input: PrecompileInput<'_>) -> PrecompileResult {
16    // ArbDebug is gated by the DebugPrecompile wrapper in Go.
17    // In production, all calls are rejected.
18    Err(PrecompileError::other(
19        "ArbDebug is only available in debug mode",
20    ))
21}