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

Swaps out configurable values in a contract or predicate’s bytecode.

Arguments

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

Returns

  • [Vec] - The resulting bytecode containing the new configurable values.

Examples

use sway_libs::bytecode::sway_configurables;

fn foo(my_bytecode: Vec<u8>, my_configurables: Vec<(u64, Vec<u8>)>) {
    let mut my_bytecode = my_bytecode;
    let resulting_bytecode = swap_configurables(my_bytecode, my_configurables);
    assert(resulting_bytecode != my_bytecode);
}