Skip to content

About App Registry

Miao ZhiCheng edited this page Jul 31, 2023 · 15 revisions

A super app composes agreements with business logic.

A contract may opt-in to be a super app through the app registry provided in the host contract.

App Whitelisting

In a host contract deployment where APP_WHITE_LISTING_ENABLED is set to true, you will need to provide an non-empty key, or have your app factory whitelisted by the governance.

Notes:

  • It is currently enabled on mainnets, but we intend to remove it as soon as possible.
    • On CELO mainnet, the restriction has been removed.

The app whitelisting guide is available here: https://github.com/superfluid-finance/protocol-monorepo/wiki/Super-App-White-listing-Guide.

There are different ways of having the super app registered:

(Deprecated) registerApp

It is equivalent to registerAppWithKey with an empty registration key.

This is to reduce the procedural differences between testnet and mainnet super app development.

registerAppWithKey

  • You must obtain a registration key for networks where APP_WHITE_LISTING_ENABLED is set.
  • registerAppWithKey is meant to be used by an EOA, in fact the tx.origin of the app registration transaction must be whitelisted (checked via getAppRegistrationConfigKey of the governance contract.)
  • Each key should also carry an expiration date specified in getAppRegistrationConfigKey.
  • The smart contract that calls the registerAppWithKey must be in its constructor.
    • It is defensive rule to prevent a "smart contract" to become a super app after a period of time, which may confuse or even take advantage its users.

registerAppByFactory

registerAppWithKey has a fundamental limitation: for a use case where many new functionally-equivalent super apps need to be spawned, it is simply not possible, due to the APP_RULE_REGISTRATION_ONLY_IN_CONSTRUCTOR rule.

To address that a more relaxed rule is introduced to allow a known factory contract to be whitelisted by the governance (getAppFactoryConfigKey governance method), so that the factory contract can have unlimited quota to create new super apps.

Super App Examples

More example of how to use them can be found in: https://docs.superfluid.finance/superfluid/developers/developer-guides/super-apps/super-app.

Clone this wiki locally