Skip to content

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 for create_certificate and mint_certificate.
  • DEFAULT_ADMIN_ROLE — Administrative actions such as granting/revoking roles and calling increase_maximum_mints.

At initialization, deployment configuration assigns the relayer (minter) and admin roles.

Mint cap

  • mints counts completed mints across all collections.
  • maximum_mints is the current cap; when reached, further mints revert until an admin increases the cap (IncreaseMaximumMints event).
  • MaximumMintsReached is emitted when the last allowed mint under the cap occurs.

Events (high level)

EventMeaning
CertificateCreatedNew collection deployed; includes id and address.
CertificateMintedA mint completed via the factory path.
IncreaseMaximumMintsGlobal cap was raised.
MaximumMintsReachedCap hit on the final allowed mint.

HTTP API

Factory HTTP routes live under /factory. See Factory routes for JSON shapes and examples.

Released under License.