Address
In the UTXO model each output has an address.
The Address
type is a struct containing a value of a b256
type.
pub struct Address {
bits: b256,
}
The value of an Address
is a hash of either:
- A public key
- Predicate
The Address
type is completely separate from a ContractId
and thus it should not be used when dealing with an address of a deployed contract.
Casting between an Address
and b256
can be done in the following way:
let variable1 = 0x000000000000000000000000000000000000000000000000000000000000002A;
let my_address = Address::from(variable1);
let variable2: b256 = my_address.into();
// variable1 == variable2