> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boost.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Initializing Components

<Warning>
  The One-Time Actions docs are under active development and will be subject to changes.
</Warning>

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.

<Warning>
  `Incentives` are not re-usable between multiple Boosts, and cannot be initialized by the registry.
</Warning>

## What is a base implementation?

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](https://github.com/rabbitholegg/boost-protocol/blob/main/packages/evm/contracts/budgets/ManagedBudget.sol) is a base implementation that satisfies the [Budget](https://github.com/rabbitholegg/boost-protocol/blob/main/packages/evm/contracts/budgets/ABudget.sol) interface.

## API

### `initialize`

Deploys and initializes a new instance of a registered component's base implementation and returns the component with its address attached.

```ts theme={null}
const budget = await registry.initialize('MyNewBudget', core.ManagedBudget({
  owner: '0xME',
  authorized: ['0xME', core.assertValidAddress()],
  roles: [Roles.ADMIN, Roles.MANAGER]
}))
```

<Note>
  Clones are uniquely identified by hashing the component's type, base address, your address, and name. For example, you cannot initialize two `ManagedBudget`'s with the same `displayName`
</Note>

#### Parameters

<ParamField path="displayName" type="string" required>
  A display name for the new instance. Must be unique per account and base implementation.
</ParamField>

<ParamField path="target" type="AllowList | Budget | Action" required>
  An instance of the component you'd like to initialize.
</ParamField>

<ParamField path="parameters" type="Omit<wagmi.WriteContractParameters, 'address' | 'args' | 'functionName' | 'abi'>">
  Optional parameters to pass to the underlying `writeContract` method. Checkout [wagmi's documentation](https://wagmi.sh/core/api/actions/writeContract#parameters) for more information. `address`, `args`, `functionName`, `abi` are handled for you under the hood.
</ParamField>

#### Returns

<ResponseField name="target" type="Promise<AllowList | Budget | Action>" required>
  Returns the target parameter with its deployed address attached.

  ```ts theme={null}
  const budget = await registry.initialize('MyNewBudget', ...)
  isAddress(budget.assertValidAddress()) // true
  ```

  You can then reuse it during Boost creation.

  ```ts theme={null}
  await core.createBoost({ budget, ...otherComponents })
  // or you can re-use with its address if you already have it
  await core.createBoost({ budget: core.ManagedBudget(budget.assertValidAddress()), ...otherComponents })
  ```
</ResponseField>
