The ERC20 Pegged Variable Criteria Incentive is a specialized protocol incentive that allows for the distribution of ERC-20 assets with rewards pegged to the value of another token, where the reward amount is determined by transaction criteria. This enables creating dynamic rewards that maintain a specific value relative to a pegged asset, with the actual reward amount varying based on transaction data.

The Boost V2 Docs are under active development and will be subject to changes.

Key Features

  • Rewards pegged to the value of another token
  • Dynamic reward amounts based on transaction criteria
  • Variable reward calculation using event or function data
  • Maximum reward cap per claim
  • Total distribution limit in reward asset tokens
  • Managed access for incentive control and clawbacks

Unlike budgets, allowlists, and validators, incentives cannot be re-used between multiple Boosts.

To peg rewards to the chain’s native token (e.g., ETH), use zeroAddress (0x0000000000000000000000000000000000000000) as the peg parameter. This tells the protocol to use the native token’s price for calculations.

Setting Up Incentive Criteria

The incentive criteria determines how the reward amount is extracted from transaction data. You can configure it to read values from either contract events or function calls.

Criteria Configuration

The criteria object requires four fields:

  • criteriaType: Either SignatureType.EVENT for event logs or SignatureType.FUNC for function calls
  • signature: The event or function signature to match against
  • fieldIndex: Which parameter in the event/function to extract the value from (0-based index)
  • targetContract: The contract address to watch for the event/function

You can use the @boostxyz/signatures package to get pre-defined event signatures instead of using raw hex values. For example: import { selectors } from '@boostxyz/signatures/events'

Example: Event-based Criteria

Here’s an example setting up criteria to extract an amount from a Transfer event:

import { selectors } from '@boostxyz/signatures/events'
import { SignatureType } from '@boostxyz/sdk/claiming'

const criteria = {
  criteriaType: SignatureType.EVENT,
  // Use pre-defined signature for Transfer(address,address,uint256)
  signature: selectors['Transfer(address indexed,address indexed,uint256)'],
  fieldIndex: 2, // Extract amount from the third parameter
  targetContract: '0xTokenContract' // Contract to watch for events
}

Example: Function-based Criteria

Here’s an example setting up criteria to extract an amount from a mint function:

import { selectors } from '@boostxyz/signatures/functions'
import { SignatureType } from '@boostxyz/sdk/claiming'

const criteria = {
  criteriaType: SignatureType.FUNC,
  // Use pre-defined signature for mint(uint256)
  signature: selectors['mint(uint256)'],
  fieldIndex: 0, // Extract amount from the first parameter
  targetContract: '0xNFTContract' // Contract to watch for function calls
}

The extracted value will be used to calculate the reward amount, which is then capped by the maxReward parameter if necessary.

Create a new ERC20PeggedVariableCriteriaIncentive

The manager parameter specifies an address that has administrative control over the incentive. This address can perform management operations like triggering clawbacks of undistributed rewards if needed.

Get an existing ERC20PeggedVariableCriteriaIncentive