Learn about how to interact with an ERC20Variable Incentive using the SDK
The ERC20 Variable Incentive is a protocol incentive that allows for a variable distribution of native and ERC-20 assets, with each claim amount being determined dynamically at claim time. On Boost creation, a predetermined amount of the specified asset is transferred into this incentive from the associated budget.
The Boost V2 Docs are under active development and will be subject to changes.
import { BoostCore } from '@boostxyz/sdk/BoostCore'import { config } from "./config";const core = new BoostCore({ config });await core.createBoost({ maxParticipants: 10n, budget, action, allowList, incentives: [ core.ERC20VariableIncentive({ asset: '0xERC20' || zeroAddress, // use zero address for native assets reward: parseEther('0.5'), // Amount to multiply a claim amount by, if 0n or 1 ether, user will be transferred the whole amount asserted at claim time. limit: parseEther('1'), // The total budget allocated to this incentive }), ],});
// if an incentive address is known, directly construct itconst incentive = core.ERC20VariableIncentive("0xc55F719709bDad022B320E76f9DfF7e6F5680767")// or if you want a budget from a specific chainconst incentiveOnBase = core.ERC20VariableIncentive( "0xc55F719709bDad022B320E76f9DfF7e6F5680767", { chainId: 8453 })// or accessible off of a a pre-exiting Boostconst boost = await core.getBoost(0n)const incentive = boost.incentives.find(incentive => incentive instanceof ERC20VariableIncentive)