// Initialize your incentive configuration
const erc20Incentive = core.ERC20Incentive({
asset: '0xERC20',
strategy: StrategyType.POOL,
reward: 100n,
limit: 10n,
manager: budget.assertValidAddress(),
});
// Acquire the total amount that can be distributed from the incentive
const totalBudget = await erc20Incentive.getTotalBudget()
// Calculate the protocol fee
const fee = await core.calculateProtocolFee(totalBudget)
// Calculate the total amount required to fund the incentive
const totalFundingAmount = totalBudget + fee
// Approve your erc20 to send the full funding amount to the budget
await writeContract(wagmiConfig, {
abi: erc20Abi,
address: '0xERC20', // The address of the ERC20 token you want to approve
functionName: 'approve',
args: [
budget.assertValidAddress(), // The address of the budget account
totalFundingAmount
],
})
// Allocate assets to the budget from your account
await budget.allocate({
amount: totalFundingAmount,
asset: '0xERC20',
target: "0xME",
})
// On create, `totalBudget` will be transferred to incentive, and `fee` will be transferred to the protocol
const boost = await core.createBoost({
...otherParams,
incentives: [erc20Incentive],
});