Type Definition
Object representing Solidity compiler metadata embedded in contract bytecode. Encoded in CBOR format and appended to deployed bytecode.Quick Reference
- Extract
- Decode
API Methods
Constructors
from(raw)- Create from raw CBOR bytesfromBytecode(bytecode)- Extract from contract bytecode
Processing
decode(raw)- Decode CBOR to metadata objectencode(metadata)- Encode metadata to CBOR
Usage Patterns
Extracting Compiler Information
Contract Verification
Creating Custom Metadata
Metadata Format
Solidity appends CBOR-encoded metadata to bytecode:ipfs: IPFS hash of source metadata JSON (32 bytes)bzzr0/bzzr1: Swarm hashes (legacy, 32 bytes)solc: Compiler version stringexperimental: Boolean flag
Related
- ContractCode - Full deployed bytecode
- RuntimeCode - Bytecode without metadata
- SourceMap - Source code mapping
Specification
- Solidity Metadata - Official metadata format
- CBOR - Concise Binary Object Representation
- IPFS - InterPlanetary File System

