Asset Retrieval
Learn how to retrieve assets from a budget or incentive
The Boost V2 Docs are under active development and will be subject to changes.
There are two locations assets are stored within the Boost Protocol, budgets and incentives.
Both budgets and incentives only allow authorized users to retrieve funds, requiring the sender to either be the owner, or have the Roles.MANAGER
Retrieve from Budget
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.
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.
Retrieve from Incentive
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.
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 a tuple containing:
- The amount that was successfully clawed back
- The address of the token that was retrieved