pub struct storeTransientReturn {}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.
Container type for the return parameters of the storeTransient(address,bytes32,bytes32) function.
Implementations§
Source§impl storeTransientReturn
impl storeTransientReturn
fn _tokenize(&self) -> <storeTransientCall as SolCall>::ReturnToken<'_>
Trait Implementations§
Source§impl Clone for storeTransientReturn
impl Clone for storeTransientReturn
Auto Trait Implementations§
impl Freeze for storeTransientReturn
impl RefUnwindSafe for storeTransientReturn
impl Send for storeTransientReturn
impl Sync for storeTransientReturn
impl Unpin for storeTransientReturn
impl UnsafeUnpin for storeTransientReturn
impl UnwindSafe for storeTransientReturn
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: 0 bytes