pub struct Contract(_);
Expand description
Deployable representation of a contract code.
Implementations§
source§impl Contract
impl Contract
sourcepub fn root(&self) -> Bytes32
pub fn root(&self) -> Bytes32
Calculate the code root of the contract, using Self::root_from_code
.
sourcepub fn root_from_code<B>(bytes: B) -> Bytes32where
B: AsRef<[u8]>,
pub fn root_from_code<B>(bytes: B) -> Bytes32where B: AsRef<[u8]>,
Calculate the code root from a contract.
https://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/id/contract.md#contract-id
sourcepub fn initial_state_root<'a, I>(storage_slots: I) -> Bytes32where
I: Iterator<Item = &'a StorageSlot>,
pub fn initial_state_root<'a, I>(storage_slots: I) -> Bytes32where I: Iterator<Item = &'a StorageSlot>,
Calculate the root of the initial storage slots for this contract
sourcepub fn default_state_root() -> Bytes32
pub fn default_state_root() -> Bytes32
The default state root value without any entries
sourcepub fn id(
&self,
salt: &Salt,
root: &Bytes32,
state_root: &Bytes32
) -> ContractId
pub fn id( &self, salt: &Salt, root: &Bytes32, state_root: &Bytes32 ) -> ContractId
Calculate and return the contract id, provided a salt, code root and state root.
https://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/id/contract.md#contract-id
Trait Implementations§
source§impl PartialEq<Contract> for Contract
impl PartialEq<Contract> for Contract
source§impl TryFrom<&Transaction> for Contract
impl TryFrom<&Transaction> for Contract
§type Error = CheckError
type Error = CheckError
The type returned in the event of a conversion error.
impl Eq for Contract
impl StructuralEq for Contract
impl StructuralPartialEq for Contract
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§
§impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
impl<T> Base32Len for Twhere T: AsRef<[u8]>,
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> StorageAsMut for T
impl<T> StorageAsMut for T
fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,
fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,
§impl<T> StorageAsRef for T
impl<T> StorageAsRef for T
fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,
fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)