LibMeta

Git Source

Need a place to put data that can be handled offchain like ABIs that IS NOT etherscan.

Functions

isRainMetaV1

Returns true if the metadata bytes are prefixed by the Rain meta magic number. DOES NOT attempt to validate the body of the metadata as offchain tooling will be required for this.

function isRainMetaV1(bytes memory meta_) internal pure returns (bool);

Parameters

NameTypeDescription
meta_bytesThe data that may be rain metadata.

Returns

NameTypeDescription
<none>boolTrue if meta_ is metadata, false otherwise.

checkMetaUnhashed

Reverts if the provided meta_ is NOT metadata according to isRainMetaV1.

function checkMetaUnhashed(bytes memory meta_) internal pure;

Parameters

NameTypeDescription
meta_bytesThe metadata bytes to check.

checkMetaHashed

Reverts if the provided meta_ is NOT metadata according to isRainMetaV1 OR it does not match the expected hash of its data.

function checkMetaHashed(bytes32 expectedHash_, bytes memory meta_) internal pure;

Parameters

NameTypeDescription
expectedHash_bytes32
meta_bytesThe metadata to check.