SorobanContractParserException
extends ErrorException
in package
Exception thrown when parsing Soroban smart contract WASM bytecode fails
This exception is raised during contract bytecode parsing when required metadata sections are missing or malformed. The parser expects contracts to embed metadata in WASM custom sections following SEP-47 (Contract Metadata) and SEP-48 (Contract Specification) standards.
Two specific error scenarios trigger this exception:
-
Missing Environment Meta Entry: The contractenvmetav0 custom section is missing or cannot be decoded from the WASM bytecode. This section contains the Soroban interface version that the contract requires.
-
Missing Contract Spec Entries: The contractspecv0 custom section is missing or contains no valid spec entries. This section defines function signatures, user-defined types, and event definitions.
These errors typically indicate:
- Corrupted or incomplete WASM bytecode
- Contract compiled without proper metadata embedding
- Invalid contract deployment or storage
- Incorrect contract code retrieval
The exception is thrown by SorobanContractParser::parseContractByteCode() and may be propagated through SorobanServer methods that retrieve and parse contract information.