Function sway_libs::bytecode::predicate_address_from_root
pub fn predicate_address_from_root(bytecode_root: b256) -> Address
Expand description
Takes the bytecode root of a predicate and generates the address of the predicate.
Arguments
bytecode_root
: [b256] - The bytecode root of a predicate.
Returns
- [Address] - The address of the predicate.
Examples
use sway_libs::bytecode::predicate_address_from_root;
fn foo(predicate_bytecode_root: b256) {
let predicate_address = predicate_address_from_root(predicate_bytecode_root);
assert(predicate_address != Address::zero());
}