pub fn compute_predicate_address_with_configurables(
ref mut bytecode: Vec<u8>,
configurables: ContractConfigurables,
) -> 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
: [ContractConfigurables] - The configurable values to swap.
Returns
- [Address] - The address of the predicate.
Reverts
- When the bytecode is empty.
Examples
use sway_libs::bytecode::{compute_predicate_address, ContractConfigurables};
fn foo(my_bytecode: Vec<u8>, my_configurables: ContractConfigurables) {
let mut my_bytecode = my_bytecode;
let predicate_address: Address = compute_predicate_address(my_bytecode, my_configurables);
assert(predicate_address != Address::zero());
}