KintoAppRegistry

Deployment Address:

Mainnet: 0x5A2b641b84b0230C8e75F55d5afd27f4Dbd59d5b

Interface: IKintoAppRegistry.sol


Basics

The easiest way to register a new app is to use the registerApp method. It registers a new app and mints the NFT to the creator.

For example, if you want to register a new app, you can call:

registerApp(<NAME>, <PARENT_CONTRACT>, <APP_CONTRACTS>, <APP_LIMITS>)

App Limits

Every app has limits that define its rate and gas usage.

The following limits will be used to define the app's properties.

NameNumber

RATE_LIMIT_PERIOD

1

RATE_LIMIT_THRESHOLD

10

GAS_LIMIT_PERIOD

30

GAS_LIMIT_THRESHOLD

0.01

Using the following call method, you can quickly check an app's limits:

getContractLimits(<CONTRACT_ADDRESS>)

Apps can sponsor other contracts, allowing them to operate under their limits.

For example, to check whether a contract is sponsored by an app:

isSponsored(<APP_ADDRESS>, <CONTRACT_ADDRESS>)

State Functions

Privileged roles can call the following functions.


function registerApp(string calldata _name, address parentContract, address[] calldata appContracts, uint256[4] calldata appLimits) external;

function updateMetadata(string calldata _name, address parentContract, address[] calldata appContracts, uint256[4] calldata appLimits) external;

function setSponsoredContracts(address _app, address[] calldata _contracts, bool[] calldata _flags) external;

function enableDSA(address app) external;

1. registerApp

This function registers a new app and mints the NFT to the creator. Only KYC verified addresses can call this function.

Function Interface:

function registerApp(string calldata _name, address parentContract, address[] calldata appContracts, uint256[4] calldata appLimits) external;
ParameterTypeExplanation

_name

string calldata

The name of the app

parentContract

address

The address of the parent contract

appContracts

address[] calldata

The addresses of the child contracts

appLimits

uint256[4] calldata

The limits of the app


2. updateMetadata

This function updates the metadata of an app. Only the app developer can call this function.

Function Interface:

function updateMetadata(string calldata _name, address parentContract, address[] calldata appContracts, uint256[4] calldata appLimits) external;
ParameterTypeExplanation

_name

string calldata

The name of the app

parentContract

address

The address of the parent contract

appContracts

address[] calldata

The addresses of the child contracts

appLimits

uint256[4] calldata

The limits of the app


3. setSponsoredContracts

This function sets the sponsored contracts for an app. Only the app developer can call this function.

Function Interface:

function setSponsoredContracts(address _app, address[] calldata _contracts, bool[] calldata _flags) external;
ParameterTypeExplanation

_app

address

The address of the app

_contracts

address[] calldata

The addresses of the contracts

_flags

bool[] calldata

The flags of the contracts


4. enableDSA

This function enables DSA for an app. Only the contract owner can call this function.

Function Interface:

function enableDSA(address app) external;
ParameterTypeExplanation

app

address

The address of the app


View Functions

Anyone can call the following functions without a transaction to retrieve information from the contract.

function name() external pure returns (string memory);

function symbol() external pure returns (string memory);

function getAppMetadata(address _contract) external view returns (IKintoAppRegistry.Metadata memory);

function getContractLimits(address _contract) external view returns (uint256[4] memory);

function isSponsored(address _app, address _contract) external view returns (bool);

function getSponsor(address _contract) external view returns (address);

function supportsInterface(bytes4 interfaceId);

1. name

This function gets the token name.

Function Interface:

function name() external pure override returns (string memory);
ParameterTypeExplanation

Returns the token name

2. symbol

This function gets the token symbol.

Function Interface:

function symbol() external pure override returns (string memory);
ParameterTypeExplanation

Returns the token symbol


3. getAppMetadata

This function returns the metadata of the app.

Function Interface:

function getAppMetadata(address _contract) external view override returns (IKintoAppRegistry.Metadata memory);
ParameterTypeExplanation

_contract

address

The address of the app


4. getContractLimits

This function returns the limits of the app.

Function Interface:

function getContractLimits(address _contract) external view override returns (uint256[4] memory);
ParameterTypeExplanation

_contract

address

The address of the app


5. isSponsored

This function checks whether a contract is sponsored by an app.

Function Interface:

function isSponsored(address _app, address _contract) external view override returns (bool);
ParameterTypeExplanation

_app

address

The address of the app

_contract

address

The address of the contract


6. getSponsor

This function returns the sponsoring contract for a given contract.

Function Interface:

function getSponsor(address _contract) external view override returns (address);
ParameterTypeExplanation

_contract

address

The address of the contract

7. supportsInterface

Returns whether the contract implements the interface defined by the id

Function interface:

function supportsInterface(bytes4 interfaceId);
ParameterTypeExplanation

interfaceId

bytes4

id of the interface to be checked

Last updated