pub struct registerSloadHookCall {
pub target: Address,
pub callback: FixedBytes<4>,
}Expand description
Registers a callback invoked after each SLOAD against target’s effective storage account,
including when its code runs by delegatecall.
The callback must have the signature function(address,bytes32,bytes32) external.
Registering another callback for the same target and access kind replaces it. Registration
survives EVM reverts, while callback state follows the enclosing EVM context and rolls back
with it. Callback reverts propagate through the storage operation. Hooks are suppressed in
the callback and its entire call subtree. The callback must authenticate
msg.sender == address(vm) to prevent external spoofing. Callback execution is hidden from
mocks, expectations, log recording, and storage-access recording. It does not inherit
staticness. The callback runs as an ordinary call frame and consumes one of the 1024
protocol call-depth slots; a load at the maximum legal call depth can have its callback
rejected as too deep, propagating as a failure of the load.
Function with signature registerSloadHook(address,bytes4) and selector 0x37c7cf5e.
function registerSloadHook(address target, bytes4 callback) external;Fields§
§target: Address§callback: FixedBytes<4>Trait Implementations§
Source§impl CheatcodeDef for registerSloadHookCall
impl CheatcodeDef for registerSloadHookCall
Source§impl Clone for registerSloadHookCall
impl Clone for registerSloadHookCall
Source§fn clone(&self) -> registerSloadHookCall
fn clone(&self) -> registerSloadHookCall
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for registerSloadHookCall
impl Debug for registerSloadHookCall
Source§impl JsonAbiExt for registerSloadHookCall
impl JsonAbiExt for registerSloadHookCall
Source§impl SolCall for registerSloadHookCall
impl SolCall for registerSloadHookCall
Source§const SIGNATURE: &'static str = "registerSloadHook(address,bytes4)"
const SIGNATURE: &'static str = "registerSloadHook(address,bytes4)"
Source§type Parameters<'a> = (Address, FixedBytes<4>)
type Parameters<'a> = (Address, FixedBytes<4>)
Source§type Token<'a> = <<registerSloadHookCall as SolCall>::Parameters<'a> as SolType>::Token<'a>
type Token<'a> = <<registerSloadHookCall as SolCall>::Parameters<'a> as SolType>::Token<'a>
Source§type Return = registerSloadHookReturn
type Return = registerSloadHookReturn
Source§type ReturnTuple<'a> = ()
type ReturnTuple<'a> = ()
Source§type ReturnToken<'a> = <<registerSloadHookCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>
type ReturnToken<'a> = <<registerSloadHookCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>
Source§fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self
fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self
Source§fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_>
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_>
Source§fn abi_decode_returns(data: &[u8]) -> Result<Self::Return>
fn abi_decode_returns(data: &[u8]) -> Result<Self::Return>
Source§fn abi_decode_returns_validate(data: &[u8]) -> Result<Self::Return>
fn abi_decode_returns_validate(data: &[u8]) -> Result<Self::Return>
§fn abi_encoded_size(&self) -> usize
fn abi_encoded_size(&self) -> usize
§fn abi_decode_raw(data: &[u8]) -> Result<Self, Error>
fn abi_decode_raw(data: &[u8]) -> Result<Self, Error>
§fn abi_decode_raw_validate(data: &[u8]) -> Result<Self, Error>
fn abi_decode_raw_validate(data: &[u8]) -> Result<Self, Error>
§fn abi_decode(data: &[u8]) -> Result<Self, Error>
fn abi_decode(data: &[u8]) -> Result<Self, Error>
§fn abi_decode_validate(data: &[u8]) -> Result<Self, Error>
fn abi_decode_validate(data: &[u8]) -> Result<Self, Error>
§fn abi_encode_raw(&self, out: &mut Vec<u8>)
fn abi_encode_raw(&self, out: &mut Vec<u8>)
§fn abi_encode(&self) -> Vec<u8> ⓘ
fn abi_encode(&self) -> Vec<u8> ⓘ
§fn abi_encode_returns(ret: &Self::Return) -> Vec<u8> ⓘ
fn abi_encode_returns(ret: &Self::Return) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl Freeze for registerSloadHookCall
impl RefUnwindSafe for registerSloadHookCall
impl Send for registerSloadHookCall
impl Sync for registerSloadHookCall
impl Unpin for registerSloadHookCall
impl UnsafeUnpin for registerSloadHookCall
impl UnwindSafe for registerSloadHookCall
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes