Back to Sway

Address

docs/reference/src/documentation/operations/namespace/address.md

0.71.0651 B
Original Source

Address

In the UTXO model each output has an address.

The Address type is a struct containing a value of a b256 type.

sway
{{#include ../../../code/operations/namespace/src/lib.sw:address}}

The value of an Address is a hash of either:

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:

sway
{{#include ../../../code/operations/namespace/src/lib.sw:address_cast}}