Appearance
Factory contract
The factory contract is the hub for deploying certificate collections and for minting through those collections while enforcing roles and a global mint cap.
Responsibilities
- Deploy a new certificate collection from the immutable blueprint via
create_certificate(name_, symbol_, base_uri_). - Mint a token on a given collection with
mint_certificate(certificate_, data_, to_), passing the full certificate struct tuple. - Track how many collections exist and map id → collection address (
certificate_count,certificates). - Store certificate details (id, address, collection name) for registry views used by indexers and APIs.
Access control
MINTER_ROLE— Required forcreate_certificateandmint_certificate.DEFAULT_ADMIN_ROLE— Administrative actions such as granting/revoking roles and callingincrease_maximum_mints.
At initialization, deployment configuration assigns the relayer (minter) and admin roles.
Mint cap
mintscounts completed mints across all collections.maximum_mintsis the current cap; when reached, further mints revert until an admin increases the cap (IncreaseMaximumMintsevent).MaximumMintsReachedis emitted when the last allowed mint under the cap occurs.
Events (high level)
| Event | Meaning |
|---|---|
CertificateCreated | New collection deployed; includes id and address. |
CertificateMinted | A mint completed via the factory path. |
IncreaseMaximumMints | Global cap was raised. |
MaximumMintsReached | Cap hit on the final allowed mint. |
HTTP API
Factory HTTP routes live under /factory. See Factory routes for JSON shapes and examples.