Verax Attestation Registry
  • 👋Introduction
  • ⚒️Getting Started
  • Core Concepts
    • High-Level Overview
    • Attestations
    • Schemas
    • Linked Data
    • Modules
    • Portals
    • Ecosystem
  • Developer Guides
    • ♒For Attestation Issuers
      • Create and register a Schema
      • Create a Module
      • Register a Module
      • Create a Portal
      • Register a Portal
      • Create an Attestation
      • Encoding Attestation Data
      • Revoke an Attestation
      • Replace an Attestation
      • Link Attestations
      • Bulk Create Attestations
      • EAS compatibility
    • 🧑‍🏫Tutorials
      • From a Schema to an Attestation
      • Using Ceramic to store the Attestation Payload
    • 🚀Examples
    • 🌐Using the Subgraph
    • 🛠️Using the SDK
  • Discover
    • 📚Modules Standard Library
      • ECDSAModule
      • ERC1271Module
      • FeeModule
      • IndexerModule
      • IssuersModule
      • SchemaModule
      • SenderModule
    • 🤝Integrations
  • Get Involved
    • Get in Touch
    • Contribute
    • Governance
      • Governance Charter
      • Governance Parameters
      • Overview of Governance
      • Proposal Templates
Powered by GitBook
On this page
  • Link to the code
  • When to use this module?
  • When not to use this module?
  • How to use this module?
  • How to check the authorized sender(s)?
  1. Discover
  2. Modules Standard Library

SchemaModule

Description of the official SchemaModule contract. This module aims to provide a standard way of checking if the Schema ID used in an attestation request is authorized for a given portal.

PreviousIssuersModuleNextSenderModule

Last updated 1 year ago

Link to the code

When to use this module?

An Issuer might want to restrict the Schemas with which an attestation can be issued through his portal. To avoid re-developing this feature for each portal, Verax proposes a standard module to that effect.

Once this module is set for a portal, any attestation request going through the portal will need to use an authorized Schema.

The list of authorized Schemas may change over time, that's why the issuer can add and/or remove authorized Schemas easily via this module.

Only the address identified as the 'owner' of a portal can edit the list of authorized Schemas for his portal.

When not to use this module?

If the logic of your authorization mechanism goes beyond "Schema 0x… is/isn't authorized", you'll probably need a custom module to enforce your rules.

How to use this module?

  1. Add one or multiple authorized Schema(s) for a given portal, by calling the setAuthorizedSchemaIds function

  2. Pass the address of this module when registering your portal

  3. Change the list of authorized Schemas for a given portal, by calling the setAuthorizedSchemaIdsfunction again

  4. An event is emitted when the list is updated, containing all the changes

How to check the authorized sender(s)?

  1. The SchemaModule exposes an authorizedSchemaIds mapping

  2. Anyone can call this public mapping for a portal address and get the list of authorized Schema IDs

📚
https://github.com/Consensys/linea-attestation-registry/blob/dev/contracts/src/stdlib/SchemaModule.sol