Contracts
We are currently in Base and Polygon testnet.
Overview
The MentaportCertificateRegistry is a smart contract that creates and issues digital certificates to verify content authenticity. These certificates are issued as Soulbound Non-Fungible Tokens (NFTs), meaning they are unique digital tokens that cannot be transferred from one owner to another, effectively binding them to the owner's digital identity. This ensures that the authenticity and the origin of the content remain verifiable and securely linked to its issuer.
Based on ERC721 standard and OpenZeppelin libraries.
Key Features
- Issuing Certificates: Mint unique NFTs as certificates.
- Manage Project: Create and manage projects for different content creators.
- Role-Based Access: Control access with roles like admin, minter, and signer.
- Pause/Unpause: Pause and unpause the registry on a project-by-project basis.
All these functionalities are abstracted away for a better user experience. They are all handled in our admin portal and certificate app.
Using the Certificate Registry Contract
1. Project Management
Add Project
AAs a content creator, the admin team will create a new project with the required parameters, including name, the total number of certificates to be issued, which can always be updated, the wallet address of the owner (or use account abstraction to generate one), and the base URI used for managing the metadata of the NFT certificates issued.
If the creator doesn't have a wallet or does not provide one, we generate one for them with their email using account abstraction.
Update a Project
The project owner can modify the project's main parameter. The registry contract offers content creators the opportunity to update a specific attribute, such as the total supply base URI or owner address.
Updating the address will make any new certificate owned by it. It will not transfer certificates already created (they are soulbound).
Pause/Unpause a Project
The project management functionality allows the project owner to pause and unpause the project at any time to mitigate some issues, pause minting until project updates are performed, or just pause minting for a certain period of time.
Managing the Registry
The contract admin can pause the entire contract. Mentaport Certificate Registry inherits the Pausable contract from Open Zeppelin. It allows the admin to pause and unpause the whole contract and its functionalities, such as adding projects and minting certificates.
Token Management
To update the certificate (token) metadata, the contract allows the owner to update the token URI to a new URI if a metadata change is required. The call will require specifying the tokenId and the new token URI.
2. Minting Certificates
The project owner can mint certificates until the maximum supply is reached (if any was specified), provided the project and its registry contract are active and not paused.
To mint a certificate, the user must supply a project Id and a mint request, which includes a timestamp and the project's URI (Uniform Resource Identifier). Access controls restrict the ability to mint, and only wallets designated with a minter role can perform this action. Certificates are minted directly in the wallet of the content creator who owns the project.
3. Utility Functions
There are other utility and getter functions for the users to query the contract
Get Total Mints for a Project
Function to query the total number of certificates minted for a project specified by the project Id.
Retrieve Project Details
Function to query all the project details specified by the project Id.
Resolving tokenId / project Id
The tokenId and project Id are represented by splitting a unit256 into two uint128. The upper part is for the project Id, and the lower part is for the token Id.
To find the project Id for a specific tokenId, the user needs to query the function 'getProjectIdFromTokenId' and provide the tokenId as a parameter. The returned response will be the project Id.
Following these steps, you can effectively utilize the Mentaport Certificate Registry smart contract to manage projects and issue certificates.