pub fn predicate_address_from_root(bytecode_root: BytecodeRoot) -> Address 
Expand description

Takes the bytecode root of a predicate and generates the address of the predicate.

Arguments

  • bytecode_root: [BytecodeRoot] - The bytecode root of a predicate.

Returns

  • [Address] - The address of the predicate.

Examples

use sway_libs::bytecode::{predicate_address_from_root, BytecodeRoot};

fn foo(predicate_bytecode_root: BytecodeRoot) {
    let predicate_address: Address = predicate_address_from_root(predicate_bytecode_root);
    assert(predicate_address != Address::zero());
}