pub fn compute_predicate_address_with_configurables(
ref mut bytecode: Vec<u8>,
configurables: Vec<(u64, Vec<u8>)>,
) -> Address
Expand description
Takes the bytecode of a predicate and configurables and computes the address of a predicate.
Arguments
bytecode
: [Vec] - The bytecode of a predicate.configurables
: [Vec<(u64, Vec)] - The configurable values to swap.
Returns
- [Address] - The address of the predicate.
Examples
use sway_libs::bytecode::compute_predicate_address;
fn foo(my_bytecode: Vec<u8>, my_configurables: Vec<(u64, Vec<u8>)>) {
let mut my_bytecode = my_bytecode;
let predicate_address = compute_predicate_address(my_bytecode, my_configurables);
assert(predicate_address != Address::zero());
}