Struct fuels_programs::contract::Contract
source · pub struct Contract { /* private fields */ }Expand description
Contract is a struct to interface with a contract. That includes things such as
compiling, deploying, and running transactions against a contract.
Implementations§
source§impl Contract
impl Contract
pub fn new(binary: Vec<u8>, salt: Salt, storage_slots: Vec<StorageSlot>) -> Self
pub fn with_salt(self, salt: impl Into<Salt>) -> Self
pub fn contract_id(&self) -> ContractId
pub fn state_root(&self) -> Bytes32
pub fn code_root(&self) -> Bytes32
sourcepub async fn deploy(
self,
account: &impl Account,
tx_parameters: TxParameters
) -> Result<Bech32ContractId>
pub async fn deploy( self, account: &impl Account, tx_parameters: TxParameters ) -> Result<Bech32ContractId>
Deploys a compiled contract to a running node To deploy a contract, you need an account with enough assets to pay for deployment. This account will also receive the change.
pub fn load_from( binary_filepath: &str, configuration: LoadConfiguration ) -> Result<Self>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Contract
impl Send for Contract
impl Sync for Contract
impl Unpin for Contract
impl UnwindSafe for Contract
Blanket Implementations§
source§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Returns a reference to the underlying type as
Any.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