Ensures that the given bytecode has the correct prefix. If the bytecode already starts with "0x", it is returned as is. Otherwise, the prefix "0x" is added to the bytecode.
import { ensureBytecodePrefix } from "thirdweb/utils/bytecode/prefix";const bytecode = "363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3";const prefixedBytecode = ensureBytecodePrefix(bytecode);console.log(prefixedBytecode);
function ensureBytecodePrefix(bytecode: string): Hex;
The bytecode to ensure the prefix for.
let bytecode: string;
let returnType: ox__Hex.Hex;
The bytecode with the correct prefix.