@aragon/templates-shared

1.0.1 • Public • Published

Aragon Base template and shared template helpers

New templates can be easily created by building upon BaseTemplate and TokenCache. This package also provides a set of helpers for running tests on templates.

BaseTemplate usage

The BaseTemplate contract should be extended by a new template. It provides a set of internal functions with actions common to all templates, such as installing apps, granting permissions, etc.

Make sure to consider the following rules when using BaseTemplate:

  • _transferRootPermissionsFromTemplateAndFinalizeDAO() should be used only at the end of organization setup to transfer the "root" permissions to their final owners. This is usually the last action that the template will be able to take on the organization itself, as after calling this function, the template should not hold any permissions on the organization.
  • You can optionally use _registerId() afterwards to register the org on ENS.

TokenCache usage

Depending on the complexity of a template, you may need to initialize a template in more than one transaction. When doing so, the template needs to cache information about a partially built organization by a particular user. TokenCache's _cacheToken() and _popTokenCache() may be useful in cases where you only need to cache a single token.

/@aragon/templates-shared/

    Package Sidebar

    Install

    npm i @aragon/templates-shared

    Weekly Downloads

    11

    Version

    1.0.1

    License

    GPL-3.0-or-later

    Unpacked Size

    5.02 MB

    Total Files

    50

    Last publish

    Collaborators

    • giorgi_2009
    • jjavieralv
    • brickpop
    • arabot-1
    • hack0
    • aragon-ci