Retrieval
The Boost V2 Docs are under active development and will be subject to changes.
The ManagedBudget contract allows authorized users to clawback or disburse funds from the budget.
API
clawback
The clawback function is used to reclaim available funds from the budget. Can only be called by owner or admin.
- Using
clawback
with0n
will reclaim all available funds for the given asset. - Use the zero address (
0x0000000000000000000000000000000000000000
) to clawback native assets (ie. ETH).
Parameters
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
Returns true if the clawback was successful.
clawbackFromTarget
The clawback function allows authorized users (admin or manager) to reclaim assets from a Boost’s incentive back to its associated budget.
The amount reclaimed will be subject to protocol fee collection, so attempting to reclaim an amount where reclaimAmount + calculatedProtocolFee > incentiveBalance
will revert with an InsufficientFunds
error.
For ERC20Incentive
, the amount specified in the clawback data must be an exact multiple of the reward value set in the incentive. Otherwise, the transaction will fail.
Depending on the type of incentive, calculating the clawback amount will be different.
Using clawbackFromTarget
will modify the amount of the asset marked as distributed via the budget.
Parameters
The address of the contract implementing clawback
, typically the Boost Core contract address.
The encoded clawback data payload. Generate this using incentive.buildClawbackData(amount)
.
The ID of the Boost containing the target incentive.
The index of the incentive to clawback from.
Returns
Returns a tuple containing:
- The amount that was successfully clawed back
- The address of the token that was retrieved
disburse
Transfers available funds from the budget to a specified recipient. You must have the manager, admin or owner role to call this function.
The disburse
method is authorized for the MANAGER
role. Be aware that this allows a manager to disburse funds from the budget at will. Make sure you trust the manager before giving them authorization.
Parameters
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
Returns true if the disbursement was successful.
disburseBatch
Transfers available funds from the budget to a list of specified recipients. You must have the manager, admin or owner role to call this function. This method is more gas-efficient for multiple transfers.
Parameters
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
Returns true if the disbursement was successful.