pub fn compute_bytecode_root_with_configurables(
    ref mut bytecode: Vec<u8>,
    configurables: Vec<(u64, Vec<u8>)>,
) -> b256 
Expand description

Takes the bytecode of a contract or predicate and configurables and computes the bytecode root.

Arguments

  • bytecode: [Vec] - The bytecode of a contract or predicate.
  • configurables: [Vec<(u64, Vec)] - The configurable values to swap.

Returns

  • [b256] - The bytecode root of the contract or predicate.

Examples

use sway_libs::bytecode::compute_bytecode_root_with_configurables;

fn foo(my_bytecode: Vec<u8>, my_configurables: Vec<(u64, Vec<u8>)>) {
    let mut my_bytecode = my_bytecode;
    let bytecode_root = compute_bytecode_root_with_configurables(my_bytecode, my_configurables);
    assert(bytecode_root != b256::zero());
}