@vattelum/document-registry
v0.2.0-pre
Published
Vattelum Document References — Solidity wire format and read interface for citing, resolving, and verifying documents and contracts across on-chain registries.
Maintainers
Readme
@vattelum/document-registry
Solidity wire format and read interface for the Vattelum Document References standard.
Install
forge install vattelum/document-registryThen in foundry.toml:
remappings = [
"@vattelum/document-registry/=lib/document-registry/solidity/src/"
]Alternative (npm + manual remapping):
npm install @vattelum/document-registryUse
pragma solidity ^0.8.29;
import {
IDocumentRegistry,
Document,
DocumentReference,
RELATION_GOVERNS,
DOC_TYPE_ORIGINAL
} from "@vattelum/document-registry/DocumentRegistry.sol";
contract MyRegistry is IDocumentRegistry {
function getDocument(uint256 c, uint256 d, uint256 v)
external view returns (Document memory) { /* ... */ }
function getReferences(uint256 c, uint256 d, uint256 v)
external view returns (DocumentReference[] memory) { /* ... */ }
function getHistory(uint256 c, uint256 d)
external view returns (Document[] memory) { /* ... */ }
}The compiler refuses to compile if any required read is missing or its signature is wrong — that is the first conformance gate.
Conformance test
test/Conformance.t.sol ships with the package. Run it against any deployed
registry to certify shape conformance.
Standard
Full normative reference: see the repository root README.
License
MIT.
