the contract or library bytecode to test for metadata hash.
An object where the bytecode is the executable code and
metadata is the metadata hash when the metadata is present.
The executable code without metadata when it is present.
Otherwise, the original bytecode.
The metadata if present. Otherwise undefined.
See https://docs.soliditylang.org/en/latest/metadata.html#encoding-of-the-metadata-hash-in-the-bytecode.
Generated using TypeDoc v0.25.2
Splits
bufferinto the executable EVM bytecode and the embedded metadata hash. The metadata hash may be placed by the Solidity compiler as a compilation fingerprint. It may include the compiler version and the hash of the compilation input, i.e. the source code and compilation settings.The bytecode might have been compiled with no metadata or with a different language that does not include metadata. In this case the
metadataproperty isundefinedand thebytecodeproperty is the originalbuffer.The metadata hash is placed at the end of the EVM bytecode and encoded using CBOR. We use
cbor-jsto decode the metadata hash. Ifmetadatacontains an IPFS hash, it is encoded using base 58. We usebase58-jsto encode the IPFS hash. If metadata contains a Swarm hash, i.e.bzzr0orbzzr1, it is encoded using hexadecimal.