Register a Portal
Portals are smart contracts that are registered in the "Portal Registry" and that you can consider as the entrypoint to the Verax Attestation Registry. This is where the payloads to be attested start their journey.
Portal creation
To create a Portal, you must first deploy a contract that inherits the AbstractPortal
abstract contract. This portal contract is where you create attestations in the registry. You have full control over the logic in this contract, so long as it inherits the base AbstractPortal
contract.
The function that you will call to issue an attestation is:
We are also introducing an attestV2
function with the same signature, to cover the new "Modules V2" feature.
The attest
function accepts 2 arguments:
attestationPayload
, the raw attestation data that will be stored in the registryvalidationPayload
, validation logic that the module needs to execute its verification logic
This function allows you to actually create attestations, you can call the various modules and/or apply any other logic you need to. The convention is to keep as much logic as possible in modules, but it is up to you how you implement your own domain logic. You can choose to override this function and add your own logic, or use the function as defined in AbstractPortal
.
While you can put whatever logic you want to in your portal contracts, it is strongly advised that you keep your portal as modular as possible, which means keeping your logic in modules. In the future, we may pivot to no-code portals, which have no contract, and which simply execute a specific chain of modules!
As well as implementing the AbstractPortal
interface, the Portal contract must also implement the IERC165Upgradeable interface, which involves including this function:
Lifecycle Hooks
The AbstractPortal
contract defines the following life cycle hooks:
onAttest
onReplace
onBulkAttest
onBulkReplace
onRevoke
onBulkRevoke
These lifecycle hooks can be overridden in the concrete implementation of the Portal, and can be used to implement additional logic and specific points in the lifecycle of an attestation.
Portal registration
Portal registration takes 5 parameters, defined as follows:
Manually registering a deployed Portal in the PortalRegistry
contract
PortalRegistry
contractOnce you have deployed your Portal contract, you can then register it in the PortalRegistry
contract using the register
function:
A few caveats: a Portal contract must be first deployed and cannot be registered twice under different names. Also, the name, description and owner name must not be empty.
Using a blockchain explorer
Instead of crafting the smart contract call by hand, you can benefit from a chain explorer interface. Let's use the Linea Sepolia explorer, Lineascan.
Retrieve the
PortalRegistry
contract address from the project READMEAccess the
PortalRegistry
contract on LineascanGo to the "Contract" tab
Go to the "Write as Proxy" tab
Connect your wallet and fill the
register
form with the parameters described aboveSend the transaction
Using the official Verax SDK
We have seen rather manual ways to register a Portal, now let's focus on the easiest way: via the Verax SDK.
Check this page to discover how to instantiate the Verax SDK.
Once you have an SDK instance, you can register a Portal like this:
Using a default Portal
If you opted for a default Portal as described here, good news: it was registered while being deployed!
Last updated