Skip to main content

load_foundry_creation_code

Function load_foundry_creation_code 

Source
pub fn load_foundry_creation_code(path: impl AsRef<Path>) -> DeployResult<Bytes>
Expand description

Load creation bytecode from a Foundry artifact.

Reads the JSON at path and decodes the creation bytecode from bytecode.object (or the legacy direct-string bytecode field).

ยงErrors

Returns an error when:

  • the file cannot be read,
  • the contents are not valid JSON,
  • the JSON has no bytecode field, or bytecode has neither an object string nor a direct string value,
  • the bytecode hex is empty, still contains unresolved library placeholders (__$...$__), or is otherwise not valid hex.