pub struct EvmContract {
pub name: String,
pub functions: Vec<EvmFunction>,
pub storage_layout: StorageLayout,
pub constructor_code: Vec<EvmInstruction>,
pub metadata: HashMap<String, String>,
}Expand description
A full EVM smart contract.
Contains the constructor code, runtime functions, and storage layout.
Fields§
§name: StringContract name.
functions: Vec<EvmFunction>Runtime functions (public entry points).
storage_layout: StorageLayoutStorage variable layout.
constructor_code: Vec<EvmInstruction>Constructor bytecode (deployed as init code).
metadata: HashMap<String, String>Compiler metadata comments.
Implementations§
Source§impl EvmContract
impl EvmContract
Sourcepub fn add_function(&mut self, func: EvmFunction)
pub fn add_function(&mut self, func: EvmFunction)
Add a function to this contract.
Sourcepub fn allocate_storage(&mut self, name: impl Into<String>) -> u64
pub fn allocate_storage(&mut self, name: impl Into<String>) -> u64
Allocate a storage slot for a state variable.
Trait Implementations§
Source§impl Clone for EvmContract
impl Clone for EvmContract
Source§fn clone(&self) -> EvmContract
fn clone(&self) -> EvmContract
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EvmContract
impl RefUnwindSafe for EvmContract
impl Send for EvmContract
impl Sync for EvmContract
impl Unpin for EvmContract
impl UnsafeUnpin for EvmContract
impl UnwindSafe for EvmContract
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
Mutably borrows from an owned value. Read more