Creates an instance of BoostCore.
Static
Readonly
addressesA static property representing a map of stringified chain ID's to the address of the deployed implementation on chain
Readonly
abiProtected
_payloadThe deployable payload used either for contract construction or initialization
Protected
_configProtected
_addressThe internally managed address for this contract
Protected
Optional
_accountIf it exists, Viem Local Account, if in a Node environment
A getter that will return Boost core's static addresses by numerical chain ID
A getter returning this contract's deployed address, if it exists.
Create a new Boost.
Optional
_params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Returns a simulated Boost creation.
Optional
_params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Claims one incentive from a given Boost
by boostId
and incentiveId
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Claim an incentive for a Boost
The ID of the Boost
The ID of the Incentive
The address of the referrer (if any)
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Claims one incentive for a given Boost
on behalf of another user by boostId
and incentiveId
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Claim an incentive for a Boost on behalf of another user
The ID of the Boost
The ID of the Incentive
The address of the referrer (if any)
The data for the claim
The address of the user eligible for the incentive payout
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Get a Boost by index, will return a new Boost with correct target implementations instantiated, ie (await core.getBoost(0n)).allowList instanceof SimpleAllowList
vs SimpleDenyList
Optional
params: Partial<Omit<ReadContractParameters, Replace the current auth scheme.
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Set the createBoostAuth address
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Set the protocol fee receiver address. This function is only callable by the owner.
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Set the protocol fee receiver address. This function is only callable by the owner.
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Retrieves the claim information from a transaction receipt.
The parameters required to get the transaction receipt.
The hash of the transaction.
Optional
chainThe claim information if found, undefined otherwise.
This method retrieves the transaction receipt using the provided parameters, then parses the logs to find the 'BoostClaimed' event. If found, it returns the arguments of the event, which include the boost ID, incentive ID, claimer address, and claimed amount.
const claimInfo = await boostCore.getClaimFromTransaction({
hash: '0x...',
chainId: 1
});
if (claimInfo) {
console.log(`Boost ${claimInfo.boostId} claimed by ${claimInfo.claimer}`);
}
Calculate the protocol fee for ERC20 or ETH assets for a given amount. Fees are collected when initializing new incentives, or clawing back from incentives.
Optional
amount: bigintOptional
params: Partial<Omit<ReadContractParameters, const fee = await core.calculateProtocolFee(
await incentive.getTotalBudget()
)
const totalIncentiveFundAmount = desiredAmount + fee
await erc20.approve(budget.assertValidAddress(), totalIncentiveFundAmount);
await budget.allocate({
amount: totalIncentiveFundAmount,
asset: erc20.assertValidAddress(),
target: '0xME',
});
Bound PassthroughAuth constructor that reuses the same configuration as the Boost Core instance.
Optional
address: `0x${string}`Bound EventAction constructor that reuses the same configuration as the Boost Core instance.
Optional
isBase: booleanBound OpenAllowList constructor that reuses the same configuration as the Boost Core instance.
Optional
isBase: booleanBound SimpleAllowList constructor that reuses the same configuration as the Boost Core instance.
Optional
isBase: booleanBound SimpleDenyList constructor that reuses the same configuration as the Boost Core instance.
Optional
isBase: booleanBound ManagedBudget constructor that reuses the same configuration as the Boost Core instance.
Bound AllowListIncentive constructor that reuses the same configuration as the Boost Core instance.
Bound CGDAIncentive constructor that reuses the same configuration as the Boost Core instance.
Bound ERC20Incentive constructor that reuses the same configuration as the Boost Core instance.
Bound PointsIncentive constructor that reuses the same configuration as the Boost Core instance.
Bound SignerValidator constructor that reuses the same configuration as the Boost Core instance.
Optional
isBase: booleanBound LimitedSignerValidator constructor that reuses the same configuration as the Boost Core instance.
Optional
isBase: booleanBound ERC20VariableCriteriaIncentive constructor that reuses the same configuration as the Boost Core instance.
Optional
isBase: booleanBound ERC20VariableIncentive constructor that reuses the same configuration as the Boost Core instance.
Optional
isBase: booleanBase parameter constructor, should return a partial viem.deployContract
parameters shape including abi, bytecode, and arguments, if any.
Expected to be overridden by protocol contracts.
Optional
_payload: [`0x${string}`, `0x${string}`]Optional
_options: DeployableOptionsHigh level deployment function to deploy and await the contract address.
This is mainly a convenience method to easily deploy a contract, but will not initialize a Cloneable
,
which makes it useless for Boost components.
Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
Optional
_payload: [`0x${string}`, `0x${string}`]Optional
_options: DeployableOptionsOptional
waitParams: Omit<WaitForTransactionReceiptParameters, "hash">The lower level contract deployment function that does not await for the transaction receipt.
This is mainly a convenience method to easily deploy a contract, but will not initialize a Cloneable
,
which makes it useless for Boost components.
Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
Optional
_payload: [`0x${string}`, `0x${string}`]Optional
_options: DeployableOptionsWill set this contract's internal Wagmi Configuration and return the instance for chaining.
Utility function to validate the existence of an address on this Contract.
ContractAddressRequiredError if no address exists on this Contract instance
A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].
Accepts eventName
and eventNames
as optional parameters to narrow the returned log types.
Optional
params: Omit<GetLogsParams<readonly [{ const logs = contract.getLogs({ eventName: 'EventName' })
const logs = contract.getLogs({ eventNames: ['EventName'] })
@public
@async
@template {ContractEvent} event
@template {ExtractAbiEvent<
ContractAbi,
event
>} [abiEvent=ExtractAbiEvent<ContractAbi, event>]
@param {?Omit<
GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,
'event' | 'events'
> & {
eventName?: event;
eventNames?: event[];
}} [params]
@returns {Promise<GetLogsReturnType<abiEvent, abiEvent
A typed wrapper for wagmi.watchContractEvent
Optional
params: Partial<Omit<UnionCompute<WatchContractEventParameters<readonly [{ Protected
optionallyProtected
validateProtected
Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.
Optional
_payload: POptional
_options: DeployableOptionsProtected
awaitProtected
Optional
waitParams: Omit<WaitForTransactionReceiptParameters, "hash">
The core contract for the Boost protocol. Used to create and retrieve deployed Boosts.
Export
BoostCore