pub struct storeTransientCall {
pub target: Address,
pub slot: FixedBytes<32>,
pub value: FixedBytes<32>,
}Expand description
Stores a value to an address’ transient storage slot.
The value lasts until the end of the current transaction, like a value written with TSTORE.
This writes the journal directly rather than executing TSTORE.
With isolation enabled (the default), each top-level CALL from a test runs as its own
transaction with empty transient storage, so a value the test stored is not visible to that
call, even though a later loadTransient in the test still returns it. For the target to see
the value, store it and call the target inside the same call, for example through a helper.
STATICCALL and DELEGATECALL stay in the surrounding transaction and can see its values;
DELEGATECALL uses the caller’s transient storage, not the target’s.
Example usage, where f is non-view and helper.storeAndCall stores then calls target.f():
vm.storeTransient(address(target), slot, value);
target.f(); // With isolation, f reads 0 from slot.
helper.storeAndCall(address(target), slot, value); // f reads value.
Function with signature storeTransient(address,bytes32,bytes32) and selector 0x89b5a4cd.
function storeTransient(address target, bytes32 slot, bytes32 value) external;Fields§
§target: Address§slot: FixedBytes<32>§value: FixedBytes<32>Trait Implementations§
Source§impl CheatcodeDef for storeTransientCall
impl CheatcodeDef for storeTransientCall
Source§impl Clone for storeTransientCall
impl Clone for storeTransientCall
Source§impl Debug for storeTransientCall
impl Debug for storeTransientCall
Source§impl JsonAbiExt for storeTransientCall
impl JsonAbiExt for storeTransientCall
Source§impl SolCall for storeTransientCall
impl SolCall for storeTransientCall
Source§const SIGNATURE: &'static str = "storeTransient(address,bytes32,bytes32)"
const SIGNATURE: &'static str = "storeTransient(address,bytes32,bytes32)"
Source§type Parameters<'a> = (Address, FixedBytes<32>, FixedBytes<32>)
type Parameters<'a> = (Address, FixedBytes<32>, FixedBytes<32>)
Source§type Token<'a> = <<storeTransientCall as SolCall>::Parameters<'a> as SolType>::Token<'a>
type Token<'a> = <<storeTransientCall as SolCall>::Parameters<'a> as SolType>::Token<'a>
Source§type Return = storeTransientReturn
type Return = storeTransientReturn
Source§type ReturnTuple<'a> = ()
type ReturnTuple<'a> = ()
Source§type ReturnToken<'a> = <<storeTransientCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>
type ReturnToken<'a> = <<storeTransientCall 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_with_config(
data: &[u8],
config: AbiDecoderConfig,
) -> Result<Self::Return>
fn abi_decode_returns_with_config( data: &[u8], config: AbiDecoderConfig, ) -> 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_with_config(
data: &[u8],
config: AbiDecoderConfig,
) -> Result<Self, Error>
fn abi_decode_raw_with_config( data: &[u8], config: AbiDecoderConfig, ) -> 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_with_config(
data: &[u8],
config: AbiDecoderConfig,
) -> Result<Self, Error>
fn abi_decode_with_config( data: &[u8], config: AbiDecoderConfig, ) -> 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 storeTransientCall
impl RefUnwindSafe for storeTransientCall
impl Send for storeTransientCall
impl Sync for storeTransientCall
impl Unpin for storeTransientCall
impl UnsafeUnpin for storeTransientCall
impl UnwindSafe for storeTransientCall
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: 84 bytes