pub trait MemoryAccess {
// Required method
fn pay_for_memory_grow(&self, pages: u16);
}Expand description
Provides the ability to pay for memory growth of a Stylus contract.
Required Methods§
Sourcefn pay_for_memory_grow(&self, pages: u16)
fn pay_for_memory_grow(&self, pages: u16)
The entrypoint! macro handles importing this hostio, which is required if the
program’s memory grows. Otherwise compilation through the ArbWasm precompile will revert.
Internally the Stylus VM forces calls to this hostio whenever new WASM pages are allocated.
Calls made voluntarily will unproductively consume gas.