compress_classic_program_code

Function compress_classic_program_code 

Source
pub fn compress_classic_program_code(
    wasm: &[u8],
) -> Result<Vec<u8>, StylusError>
Expand description

Compress raw WASM into classic Stylus contract bytecode.

Produces [0xEF, 0xF0, 0x00, 0x00, ...brotli(wasm)] (empty dictionary), the inverse of decompress_wasm. This is the on-chain form a Stylus deploy must store for activation to reconstruct the program; raw WASM after the discriminant is rejected because byte 3 is read as the dictionary type and the remainder is brotli-decompressed.