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

The Managed Budget contract is designed to hold and distribute assets that can be used to deploy boosts. The Boost SDK provides several methods to manage and view the available funds in a budget.

API

allocate

Allocates assets to the budget. The caller must have already approved the contract to transfer the asset. If the asset transfer fails, the allocation will revert.

Before using allocate, you must approve the ManagedBudget to spend the asset you want to allocate.

You can also directly transfer tokens to the ManagedBudget contract address instead of using the allocate function. This allows you to bypass the approval process for ERC20 tokens.

Parameters

transfer
parameters
Omit<wagmi.WriteContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying writeContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<boolean>
boolean

Returns true if the allocation was successful.

available

Shows the available balance of an asset in the budget.

Parameters

asset
string

The address of the asset. Leave blank to get the balance of the native asset. (ie: ETH)

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<bigint>
bigint

The available balance of the asset.

distributed

Get the total amount of an asset distributed from the budget.

Parameters

asset
string

The address of the asset. Leave blank to get the distributed amount of the native asset. (ie: ETH)

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<bigint>
bigint

The total amount of the asset distributed from the budget.

total

Get the total amount of an asset allocated to the budget, including any that have been distributed.

total = available + distributed

Parameters

asset
string

The address of the asset. Leave blank to get the total amount of the native asset. (ie: ETH)

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<bigint>
bigint

The total amount of the asset allocated to the budget, including any that have been distributed.