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

The ERC20 Incentive is designed to store and distribute assets that can be claimed by users. The Boost SDK provides several methods to retrieve information about claim state, as well as drawing raffles.

API

claims

Retrieves the total number of completed claims.

Parameters

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Total claims
Promise<bigint>

Returns the total number of claims.

claimed

Checks if an address has previously claimed this incentive.

Parameters

address
Address

The address to check claimed status.

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Has claimed
Promise<boolean>

Returns true if address has claimed the incentive.

drawRaffle

When using an ERC20 Incentive initialized with a RAFFLE strategy. Pick a random entry from a list of all claims and transfer the reward to them. Only callable by incentive. managers.

Parameters

parameters
Omit<wagmi.WriteContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

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

Success
Promise<void>

Promise that successfully resolves if a winner has been paid out

entries

By index, retrieve the address in the list of all raffle entries.

Parameters

index
bigint

The raffle entry address to retrieve by index

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Raffle entry
Promise<Address>

Returns the entry’s address

isClaimable

Check if an incentive is claimable by an address. Will return false if the recipient has already claimed, or total incentive claims has met the configured limit.

Parameters

address
Address

The address to check eligibility for.

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Eligibility
Promise<boolean>

Returns true if address can claim incentive.

limit

The total number of times this incentive can be claimed, or max number of entries for raffles.

Parameters

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Claim limit
Promise<bigint>

Returns the maximum number of claims

getRemainingClaimPotential

Retrieves the number of remaining possible claims for an incentive by comparing total claims against the limit. Note that this does not check if a specific user is eligible to claim.

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Remaining claims
Promise<bigint>

Returns the number of remaining possible claims (limit minus current claims)

canBeClaimed

Checks if any claims remain for an incentive by comparing total claims against the limit. Returns a boolean indicating if claims are still possible. Note that this does not check if a specific user is eligible to claim.

parameters
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>

Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Has remaining claims
Promise<boolean>

Returns true if there are remaining claims available, false otherwise