ContractId
A contract's ID is a unique, deterministic identifier analogous to a contract's address in the EVM. Contracts cannot own UTXOs but they can own assets.
The ContractId
type is a struct containing a value of a b256
type.
pub struct ContractId {
bits: b256,
}
Casting between an ContractId
and b256
can be done in the following way:
let variable1 = 0x000000000000000000000000000000000000000000000000000000000000002A;
let my_contract_id = ContractId::from(variable1);
let variable2: b256 = my_contract_id.into();
// variable1 == variable2