Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.boost.xyz/llms.txt

Use this file to discover all available pages before exploring further.

The ERC20 Incentive is an essential protocol incentive that allows for the distribution of native and ERC-20 assets, supporting raffle functionality as well as basic fixed rewards. On Boost creation, a predetermined amount of the specified asset is transferred into this incentive from the associated budget.
The One-Time Actions docs are under active development and will be subject to changes.

Smart Contract

Read the smart contracts

Typedoc

See technical documentation

SDK Implementation

See the source

Key Features

  • Supports native assets as well as any ERC20
  • Rewards fixed at time of creation
  • Raffle functionality, with full incentive balance going to random claimant
Unlike budgets, allowlists, and validators, incentives cannot be re-used between multiple Boosts.

Create a new ERC20Incentive

import { BoostCore } from '@boostxyz/sdk/BoostCore'
import { StrategyType } from '@boostxyz/sdk/claiming'
import { config } from "./config";

const core = new BoostCore({ config });

await core.createBoost({
  maxParticipants: 10n,
  budget,
  action,
  allowList,
  incentives: [
    core.ERC20Incentive({
      asset: '0xERC20' || zeroAddress, // use zero address for native assets
      reward: parseEther("1"), // how much to distribute on each claim, with the RAFFLE stratgy, the total reward is `parseEther("1") * limit`
      limit: 10n, // how many times can this incentive be claimed
      strategy: StrategyType.POOL || StrategyType.RAFFLE,
      manager: budget.assertValidAddress(),
    }),
  ],
});

Get an existing ERC20Incentive

// if an incentive address is known, directly construct it
const incentive = core.ERC20Incentive("0xc55F719709bDad022B320E76f9DfF7e6F5680767")

// or if you want a budget from a specific chain
const incentiveOnBase = core.ERC20Incentive(
  "0xc55F719709bDad022B320E76f9DfF7e6F5680767",
  { chainId: 8453 }
)

// or accessible off of a a pre-exiting Boost
const boost = await core.getBoost(0n)
const incentive = boost.incentives.find(incentive => incentive instanceof ERC20Incentive)