The Boost V2 Docs are under active development and will be subject to changes.

The Boost Registry contract is a key touchpoint within the protocol, allowing users to initialize components they intend to re-use across multiple Boosts, like Budgets or AllowLists.

Unless you’re an advanced user, you will likely never need to deploy your own and registry contract. The SDK comes preconfigured with the correct contract addresses for all deployed core implementations.

The registry aspect to the Registry is just that, a registry of valid Action, AllowList, Budget, Incentive and Validator implementations that can be utilized and extended by clients of the protocol.

Going forward, the term component in reference to a Boost, refers to any Action, AllowList, Budget, Incentive or Validator.

As opposed to upgrading the source of the protocol contracts over time to add features, the Boost team will, as needed, register new implementations that adhere to Action, AllowList, Budget, Incentive or Validator interfaces that can then be leveraged in the creation of new Boosts.

In most cases, you’ll be interacting with the registry to initialize budgets that you can then use and reuse in your Boosts. For example,

import { BoostCore } from '@boostxyz/sdk/BoostCore'
import { BoostRegistry } from '@boostxyz/sdk/BoostRegistry'
import { ManagedBudget, Roles } from '@boostxyz/sdk'

const registry = new BoostRegistry({ config: wagmiConfig }),
  core = new BoostCore({ config: wagmiConfig })
const coreAddress = core.assertValidAddress()

// to create a new budget and grant the correct permissions to the protocol
const budget = await registry.initialize('MyNewBudget', core.ManagedBudget({
  owner: '0xME',
  authorized: ['0xME', coreAddress],
  roles: [Roles.ADMIN, Roles.MANAGER]
}))
// or use an existing one, ensuring the protocol has the correct level of access
budget = core.ManagedBudget('0xEXISTING_BUDGET_ADDRESS')
// if you've successfully used this budget with the protocol before, you won't need to do this
if ((await budget.isAuthorized(coreAddress)) === false) {
  await budget.grantRoles(coreAddress, Roles.MANAGER)
}

Ideally, you’ll store a record of your budgets in some database, but the registry does contain some helpers to retrieve information about components you’ve initialized. For example, you can retrieve the address of the budget initialized above with the following flow.

import { ManagedBudget, Roles } from '@boostxyz/sdk'
import { RegistryType } from '@boostxyz/sdk/BoostRegistry'

// get the initialized budget's unique identifier
const identifier = await registry.getCloneIdentifier(RegistryType.BUDGET, ManagedBudget.BASE, '0xME', "MyNewBudget")
// use the identifier to retrieve the deployed address
const budgetAddress = await registry.getClone(identifier)
// instantiate a `ManagedBudget` to access further SDK functionality
const budget = core.ManagedBudget(budgetAddress)

Any component you initialize through the registry can be retrieved this way as well by passing the address you used to interact with the registry.

const identifiers = await registry.getClones('0xME')
const allCloneAddresses = await Promise.all(identifiers.map(identifier => registry.getClone(identifier)))

What does it mean to clone a base implmentation?

Boost components aren’t instantiated traditionally, with parameters supplied to the contract’s constructor on deployment. Instead, to ensure each Boost component is compliant with a registered base implementation, and save on gas, components are either cloned from a deployed base contract and initialized ahead of time through registry before being referenced in Boost creation, or, for some components, initialized at time of Boost creation, like Incentives.

A base implementation is any deployed contract registered with the registry, thus valid for use with Boost creation, that satisfies the interfaces for either Action, AllowList, Budget, Incentive or Validator. For example, ManagedBudget is a base implementation that satisfies the Budget interface.