Protocol Level Entities
Introduction
These queries can be used to get Superform-specific protocol data across the various modules.
Core Concepts
SuperRegistry
SuperRegistry maintains a single source of truth for the various deployments of the contracts in the protocol within the chain. It keeps looking for various events which set or update contract addresses and maintains that in a single entity. To get the protocol deployments, use the ID "protocolDeployedAddress"
with a query like this-
{
superRegistry (id:"protocolDeployedAddress"){
chainID
superRouterAddress
superformFactoryAddress
superRBACAddress
superPositionsAddress
payMasterAddress
coreStateRegistryAddress
paymentAdminAddress
paymentHelperAddress
payloadHelperAddress
twoStepsRegistryProcessor
coreRegistryUpdaterAddress
coreRegistryProcessorAddress
superTransmuterAddress
timelockStateRegistryAddress
broadcastRegistryAddress
broadcastRegistryProcessorAddress
permit2Address
stateRegistries(first:5){
chainId
address
}
bridgeValidatorAddress(first:5){
bridgeValidatorId
bridgeValidatorAddress
}
bridgeAddress(first:5){
bridgeId
bridgeAddress
}
ambAddress(first:5){
ambId
ambAddress
}
quorumsRequired(first:5){
srcChainId
quorumRequired
}
routers(first:5){
superFormRouterId
stateSyncerAddress
routerAddress
}
}
}
The fields can be explained as follows-
chainID-
Chain ID on which the SuperRegistry is deployedstateRegistryAddress-
This maintains the latest Address of the State registry Smart ContractsuperformFactoryAddress-
This maintains the latest Address of the Superform Factory Smart Contract which helps in deployment of forms and Superforms.superPositionsAddress-
This maintains the latest Address of the SuperPositions Smart Contract which mints and maintains the SuperPositionssuperRBACAddress-
This maintains the latest Address of the SuperRBAC Smart Contract which help in the Role Based Access of the ProtocolsuperRouterAddress-
This maintains the latest Address of the SuperRouter Smart Contract which routes the deposits and withdrawals for both same chain and cross chain transactionspayMasterAddress-
This maintains the latest Address of the PayMaster Smart Contract which helps in paying for gases for the userscoreStateRegistryAddress-
This maintains the latest Address of the Core State Registry Smart Contract.paymentAdminAddress-
This maintains the latest Address of the Payment Admin Smart Contract which helps the PayMaster Smart Contract.paymentHelperAddress-
This maintains the latest Address of the Payment Helper Smart Contract which helps the PayMaster Smart Contract.payloadHelperAddress-
This maintains the latest address of Payload Helper Smart Contract which helps in decoding various payloads on destination chain.twoStepsRegistryProcessor-
This maintains the latest Address of the Two Steps Registry Smart Contract.coreRegistryUpdaterAddress-
This maintains the latest Address of the Core Registry Updater Smart Contract.permit2Address-
This maintains the latest Address of the Permit2 Smart Contract.coreRegistryProcessorAddress-
This maintains the latest Address of the Core Registry Processor Smart Contract.coreRegistryProcessorUpdater-
This maintains the latest Address of the Core Registry Updater Smart Contract.superTransmuterAddress-
This maintains the latest Address of the SuperTransmuter Smart Contract.timelockStateRegistryAddress-
This maintains the latest Address of the Timelock State Registry Smart Contract.broadcastRegistryAddress-
This maintains the latest Address of the Broadcasting Registry Smart Contract.broadcastRegistryProcessorAddress-
This maintains the latest Address of the Broadcast Registry Processor Smart Contract.quorumsRequired-
This is a list quorums required for messages of different source chains. The fields of quorumsRequired are-srcChainId-
Chain ID of the chain from where messages are comingquorumRequired-
Quorum Required for the chain mentioned by it
routers-
This is a list of SuperFormRouters deployed in the protocol. Eachrouter
has the following fields-superFormRouterId-
ID of the SuperFormRouteraddress-
Address of the contract on the specific chain
bridgeValidatorAddress-
This is a list of Bridge Validator Smart Contracts. EachbridgeValidator
has the following fields-Id-
ID of the specific Bridge ValidatorstateSyncerAddress-
Address of the stateSyncer contractrouterAddress-
Address of the SuperFormRouter contract
bridgeAddress-
This is a list of Bridge Smart Contracts Available for the chain. Eachbridge
has the following fields-Id-
ID of the specific Bridgeaddress-
Address of the contract for the Bridge On The Chain
ambAddress-
This is a list of AMB Smart Contracts Deployed on the chain. EachAMB
has the following fields-ambId-
ID of the specific BridgeambAddress-
Address of the contract for the AMB On The Chain
Also apart from querying SuperRegistry in the specified manner, each quorumsRequired
, routers
, bridgeValidatorAddress
, bridgeAddress
and ambAddress
can be queried individually in a manner like this-
{
quorumsRequired(first:5){
srcChainId
quorumRequired
}
bridgeAddresses (first:5) {
bridgeId
bridgeAddress
}
ambAddress (ambId: 1){
ambId
ambAddress
}
routers(first:5){
superFormRouterId
stateSyncerAddress
routerAddress
}
}
Protocol Metrics
Protocol Metrics keeps a track of some of the critical protocol wide metrices. Various flows keep updating the fields within ProtocolMetrics and they can be queried using ID "protocolUniversalMetrics"
and a query like this-
{
protocolMetrics (id:"protocolUniversalMetrics"){
totalSuperformsCreated
totalBeaconFormsCreated
totalxChainTransactions
totalSingleChainTransactions
}
}
The fields within ProtocolMetrics are as follows-
totalSuperformsCreated-
This is the total number of superforms that have been created in the chaintotalBeaconFormsCreated-
This is the total number of forms that have been created in the chaintotalxChainTransactions-
Total number of Cross Chain Transactions (deposits/ withdrawals) that been created from the specified chaintotalSingleChainTransactions-
Total number of Same Chain Transactions (deposits/ withdrawals) that been completed in the specified chain
Last updated
Was this helpful?