@boostxyz/sdk 5.1.1 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +108 -108
- package/dist/BoostCore.js.map +1 -1
- package/dist/{Incentive-lNp-ZudZ.cjs → Incentive-BpZePiOD.cjs} +2 -2
- package/dist/Incentive-BpZePiOD.cjs.map +1 -0
- package/dist/{Incentive-DSsxOFKY.js → Incentive-DBZHQ9Np.js} +159 -96
- package/dist/Incentive-DBZHQ9Np.js.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +24 -3
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +367 -19
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/BoostCore.ts +11 -1
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.test.ts +67 -25
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +99 -4
- package/dist/Incentive-DSsxOFKY.js.map +0 -1
- package/dist/Incentive-lNp-ZudZ.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Incentive-DBZHQ9Np.js","sources":["../src/Incentives/ERC20PeggedIncentive.ts","../src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts","../src/Incentives/Incentive.ts"],"sourcesContent":["import {\n erc20PeggedIncentiveAbi,\n readErc20PeggedIncentiveAsset,\n readErc20PeggedIncentiveClaimed,\n readErc20PeggedIncentiveClaims,\n readErc20PeggedIncentiveCurrentReward,\n readErc20PeggedIncentiveGetPeg,\n readErc20PeggedIncentiveIsClaimable,\n readErc20PeggedIncentiveLimit,\n readErc20PeggedIncentiveOwner,\n readErc20PeggedIncentivePeg,\n readErc20PeggedIncentiveReward,\n readErc20PeggedIncentiveTotalClaimed,\n simulateErc20PeggedIncentiveClaim,\n simulateErc20PeggedIncentiveClawback,\n writeErc20PeggedIncentiveClaim,\n writeErc20PeggedIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedIncentive.sol/ERC20PeggedIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20PeggedIncentive as ERC20PeggedIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20PeggedIncentiveAbi };\n\n/**\n * The object representation of a `ERC20PeggedIncentive.InitPayload`\n *\n * @export\n * @interface ERC20PeggedIncentivePayload\n * @typedef {ERC20PeggedIncentivePayload}\n */\nexport interface ERC20PeggedIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The peg to normalize to.\n *\n * @type {Address}\n */\n peg: Address;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * Total spend for the incentive.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * (Optional) The address of the entity that can managed the incentive.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20PeggedIncentive` event types.\n *\n * @export\n * @typedef {ERC20PeggedIncentiveLog}\n * @template {ContractEventName<typeof erc20PeggedIncentiveAbi>} [event=ContractEventName<\n * typeof erc20PeggedIncentiveAbi\n * >]\n */\nexport type ERC20PeggedIncentiveLog<\n event extends ContractEventName<\n typeof erc20PeggedIncentiveAbi\n > = ContractEventName<typeof erc20PeggedIncentiveAbi>,\n> = GenericLog<typeof erc20PeggedIncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20PeggedIncentive\n * @typedef {ERC20PeggedIncentive}\n * @extends {DeployableTarget<ERC20PeggedIncentivePayload>}\n */\nexport class ERC20PeggedIncentive extends DeployableTarget<\n ERC20PeggedIncentivePayload,\n typeof erc20PeggedIncentiveAbi\n> {\n public override readonly abi = erc20PeggedIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_ERC20_INCENTIVE_BASE,\n ...(ERC20PeggedIncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20PeggedIncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20PeggedIncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20PeggedIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20PeggedIncentiveTotalClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20PeggedIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20PeggedIncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the pegged ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async peg(params?: ReadParams) {\n return await readErc20PeggedIncentivePeg(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20PeggedIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max possible rewards payout in reward token)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20PeggedIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20PeggedIncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20PeggedIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20PeggedIncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20PeggedIncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20PeggedIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * read the peg token for the incentive.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} = The address of the token the reward is pegged to\n */\n public async getPeg(params?: ReadParams) {\n return await readErc20PeggedIncentiveGetPeg(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * Builds the claim data for the ERC20PeggedIncentive.\n *\n * @public\n * @param {bigint} rewardAmount\n * @returns {Hash} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20PeggedIncentive.\n */\n public buildClaimData(rewardAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'rewardAmount' }],\n [rewardAmount],\n );\n }\n}\n\n/**\n * Given a {@link ERC20PeggedIncentivePayload}, properly encode a `ERC20PeggedIncentive.InitPayload` for use with {@link ERC20PeggedIncentive} initialization.\n *\n * @param {ERC20PeggedIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {Address} param0.peg - The peg to normalize to.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can manage the incentive.\n * @returns {Hex}\n */\nexport function prepareERC20PeggedIncentivePayload({\n asset,\n peg,\n reward,\n limit,\n manager = zeroAddress,\n}: ERC20PeggedIncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'peg' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [asset, peg, reward, limit, manager],\n );\n}\n","import {\n erc20PeggedVariableCriteriaIncentiveAbi,\n readErc20PeggedVariableCriteriaIncentiveAsset,\n readErc20PeggedVariableCriteriaIncentiveClaimed,\n readErc20PeggedVariableCriteriaIncentiveClaims,\n readErc20PeggedVariableCriteriaIncentiveCurrentReward,\n readErc20PeggedVariableCriteriaIncentiveGetIncentiveCriteria,\n readErc20PeggedVariableCriteriaIncentiveGetMaxReward,\n readErc20PeggedVariableCriteriaIncentiveGetPeg,\n readErc20PeggedVariableCriteriaIncentiveIsClaimable,\n readErc20PeggedVariableCriteriaIncentiveLimit,\n readErc20PeggedVariableCriteriaIncentiveOwner,\n readErc20PeggedVariableCriteriaIncentivePeg,\n readErc20PeggedVariableCriteriaIncentiveReward,\n readErc20PeggedVariableCriteriaIncentiveTotalClaimed,\n simulateErc20PeggedVariableCriteriaIncentiveClaim,\n simulateErc20PeggedVariableCriteriaIncentiveClawback,\n writeErc20PeggedVariableCriteriaIncentiveClaim,\n writeErc20PeggedVariableCriteriaIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedVariableCriteriaIncentive.sol/ERC20PeggedVariableCriteriaIncentive.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport type { AbiEvent } from 'abitype';\nimport {\n type AbiFunction,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n decodeFunctionData,\n encodeAbiParameters,\n parseEther,\n parseEventLogs,\n zeroAddress,\n} from 'viem';\nimport { ERC20PeggedVariableCriteriaIncentive as ERC20PeggedVariableCriteriaIncentiveBases } from '../../dist/deployments.json';\nimport { SignatureType } from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport {\n CheatCodes,\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\nimport type {\n GetIncentiveScalarParams,\n IncentiveCriteria,\n} from './ERC20VariableCriteriaIncentive';\n\nexport { erc20PeggedVariableCriteriaIncentiveAbi };\n\n/**\n * The object representation of a `Erc20PeggedVariableCriteriaIncentive.InitPayload`\n *\n * @export\n * @interface Erc20PeggedVariableCriteriaIncentive\n * @typedef {Erc20PeggedVariableCriteriaIncentive}\n */\nexport interface ERC20PeggedVariableCriteriaIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The peg to normalize to.\n *\n * @type {Address}\n */\n peg: Address;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * Total spend for the incentive.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * Maximum reward each claim is elligible for.\n *\n * @type {bigint}\n */\n maxReward: bigint;\n /**\n * (Optional) The address of the entity that can managed the incentive.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteria;\n}\n\n/**\n * A generic `viem.Log` event with support for `Erc20PeggedVariableCriteriaIncentive` event types.\n *\n * @export\n * @typedef {Erc20PeggedVariableCriteriaIncentiveLog}\n * @template {ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveAbi>} [event=ContractEventName<\n * typeof erc20PeggedVariableCriteriaIncentiveAbi\n * >]\n */\nexport type Erc20PeggedVariableCriteriaIncentiveLog<\n event extends ContractEventName<\n typeof erc20PeggedVariableCriteriaIncentiveAbi\n > = ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveAbi>,\n> = GenericLog<typeof erc20PeggedVariableCriteriaIncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class Erc20PeggedVariableCriteriaIncentive\n * @typedef {ERC20PeggedVariableCriteriaIncentive}\n * @extends {DeployableTarget<ERC20PeggedVariableCriteriaIncentive>}\n */\nexport class ERC20PeggedVariableCriteriaIncentive extends DeployableTarget<\n ERC20PeggedVariableCriteriaIncentivePayload,\n typeof erc20PeggedVariableCriteriaIncentiveAbi\n> {\n public override readonly abi = erc20PeggedVariableCriteriaIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_ERC20_INCENTIVE_BASE,\n ...(ERC20PeggedVariableCriteriaIncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveCurrentReward(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * Retrieves the maximum reward amount per claim.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The maximum reward amount per claim\n */\n public async getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward =\n await readErc20PeggedVariableCriteriaIncentiveGetMaxReward(this._config, {\n ...params,\n address: this.assertValidAddress(),\n });\n\n return maxReward;\n }\n\n /**\n * Fetches the incentive scalar from a transaction hash\n *\n * @param {GetIncentiveScalarParams} params\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}\n */\n public async getIncentiveScalar(\n { chainId, hash, knownSignatures }: GetIncentiveScalarParams,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const totalCost =\n transactionReceipt.gasUsed * transactionReceipt.effectiveGasPrice + // Normal gas cost\n (transactionReceipt.blobGasUsed ?? 0n) *\n (transactionReceipt.blobGasPrice ?? 0n); // Blob gas cost - account for potential undefined values\n return totalCost;\n }\n const logs = transactionReceipt.logs;\n\n if (logs.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n // Decode the event log\n try {\n // Decode function data\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n const scalarValue = (decodedEvents[0]?.args as string[])[\n criteria.fieldIndex\n ];\n\n if (scalarValue === undefined) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode event log for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else if (criteria.criteriaType === SignatureType.FUNC) {\n // Fetch the transaction data\n const transaction = await getTransaction(this._config, {\n chainId,\n hash,\n });\n try {\n // Decode function data\n const func = knownSignatures[criteria.signature] as AbiFunction;\n const decodedFunction = decodeFunctionData({\n abi: [func],\n data: transaction.input,\n });\n const scalarValue = decodedFunction.args[criteria.fieldIndex] as string;\n if (scalarValue === undefined || scalarValue === null) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode function data for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else {\n throw new InvalidCriteriaTypeError(\n `Invalid criteria type ${criteria.criteriaType}`,\n );\n }\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveTotalClaimed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the pegged ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async peg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentivePeg(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max possible rewards payout in reward token)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveClaim(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n const hash = await writeErc20PeggedVariableCriteriaIncentiveClaim(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveClawback(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n const hash = await writeErc20PeggedVariableCriteriaIncentiveClawback(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveIsClaimable(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * read the peg token for the incentive.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} = The address of the token the reward is pegged to\n */\n public async getPeg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveGetPeg(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n\n /**\n *Functions from the ERC20VariableIncentive contract\n */\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getIncentiveCriteria(\n params?: ReadParams,\n ): Promise<IncentiveCriteria> {\n try {\n const criteria =\n await readErc20PeggedVariableCriteriaIncentiveGetIncentiveCriteria(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return criteria;\n } catch (e) {\n throw new IncentiveCriteriaNotFoundError(e as Error);\n }\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedVariableCriteriaIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedVariableCriteriaIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedVariableCriteriaIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedVariableCriteriaIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.\n *\n * @public\n * @param {bigint} signedAmount\n * @returns {Hash} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentivePayload.\n */\n public buildClaimData(signedAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'signedAmount' }],\n [signedAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public async decodeClaimData(claimData: Hex) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n const [reward, maxReward] = await Promise.all([\n this.reward(),\n this.getMaxReward(),\n ]);\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n * Use this function instead of `decodeClaimData` if you have reward details.\n *\n * @public\n * @param {Hex} claimData\n * @param {bigint} [reward]\n * @param {bigint} [maxReward]\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimDataWithRewardDetails(\n claimData: Hex,\n reward: bigint,\n maxReward: bigint,\n ) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n}\n\n/**\n * Given a {@link ERC20PeggedVariableCriteriaIncentivePayload}, properly encode a `ERC20PeggedVariableCriteriaIncentivePayload.InitPayload` for use with {@link ERC20PeggedVariableCriteriaIncentivePayload} initialization.\n *\n * @param {ERC20PeggedVariableCriteriaIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {Address} param0.peg - The peg to normalize to.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can manage the incentive.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20PeggedVariableCriteriaIncentivePayload({\n asset,\n peg,\n reward,\n limit,\n maxReward = 0n,\n manager = zeroAddress,\n criteria,\n}: ERC20PeggedVariableCriteriaIncentivePayload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'peg' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n { type: 'uint256', name: 'maxReward' },\n {\n type: 'tuple',\n name: 'criteria',\n components: [\n { type: 'uint8', name: 'criteriaType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n ],\n },\n ],\n },\n ],\n [\n {\n asset,\n peg,\n reward,\n limit,\n manager,\n maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n },\n },\n ],\n );\n}\n","import { aIncentiveAbi } from '@boostxyz/evm';\nimport {\n AAllowListIncentive,\n ACGDAIncentive,\n AERC20Incentive,\n AERC20PeggedIncentive,\n AERC20PeggedVariableCriteriaIncentive,\n AERC20VariableCriteriaIncentive,\n AERC20VariableIncentive,\n // AERC20VariableCriteriaIncentive\n APointsIncentive,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport type { ReadParams } from '../utils';\nimport { AllowListIncentive } from './AllowListIncentive';\nimport { CGDAIncentive } from './CGDAIncentive';\nimport { ERC20Incentive } from './ERC20Incentive';\nimport { ERC20PeggedIncentive } from './ERC20PeggedIncentive';\nimport { ERC20PeggedVariableCriteriaIncentive } from './ERC20PeggedVariableCriteriaIncentive';\nimport { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n// import { ERC1155Incentive } from './ERC1155Incentive';\nimport { PointsIncentive } from './PointsIncentive';\n\nexport {\n AllowListIncentive,\n CGDAIncentive,\n // ERC1155Incentive,\n ERC20Incentive,\n ERC20PeggedIncentive,\n ERC20PeggedVariableCriteriaIncentive,\n PointsIncentive,\n ERC20VariableIncentive,\n ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A union type representing all valid protocol Incentive implementations\n *\n * @export\n * @typedef {Incentive}\n */\nexport type Incentive =\n | AllowListIncentive\n | CGDAIncentive\n | ERC20Incentive\n // | ERC1155Incentive\n | ERC20PeggedIncentive\n | ERC20PeggedVariableCriteriaIncentive\n | PointsIncentive\n | ERC20VariableIncentive\n | ERC20VariableCriteriaIncentive;\n\n/**\n * A map of Incentive component interfaces to their constructors.\n *\n * @type {{ \"0xc5b24b8e\": typeof PointsIncentive; \"0x8c901437\": typeof ERC20Incentive; \"0x4414fbb4\": typeof ERC20PeggedIncentive; \"0xf60c99c9\": typeof ERC20PeggedVariableCriteriaIncentive; \"0x56586338\": typeof AllowListIncentive; \"0xa39e44d9\": typeof CGDAIncentive; \"0xa8e4af1e\": typeof ERC20VariableIncentive; \"0x90318111\": typeof ERC20VariableCriteriaIncentive }}\n */\nexport const IncentiveByComponentInterface = {\n [APointsIncentive as Hex]: PointsIncentive,\n [AERC20Incentive as Hex]: ERC20Incentive,\n [AERC20PeggedVariableCriteriaIncentive as Hex]:\n ERC20PeggedVariableCriteriaIncentive,\n [AERC20PeggedIncentive as Hex]: ERC20PeggedIncentive,\n [AAllowListIncentive]: AllowListIncentive,\n // [AERC1155Incentive as Hex]: ERC1155Incentive,\n [ACGDAIncentive as Hex]: CGDAIncentive,\n [AERC20VariableIncentive as Hex]: ERC20VariableIncentive,\n [AERC20VariableCriteriaIncentive as Hex]: ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Incentive}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function incentiveFromAddress(\n options: DeployableOptions,\n address: Address,\n params?: ReadParams,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aIncentiveAbi,\n functionName: 'getComponentInterface',\n address,\n ...params,\n })) as keyof typeof IncentiveByComponentInterface;\n const Ctor = IncentiveByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(IncentiveByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["_ERC20PeggedIncentive","DeployableTarget","erc20PeggedIncentiveAbi","params","readErc20PeggedIncentiveOwner","readErc20PeggedIncentiveCurrentReward","readErc20PeggedIncentiveClaims","readErc20PeggedIncentiveTotalClaimed","address","readErc20PeggedIncentiveClaimed","readErc20PeggedIncentiveAsset","readErc20PeggedIncentivePeg","readErc20PeggedIncentiveReward","readErc20PeggedIncentiveLimit","payload","request","result","simulateErc20PeggedIncentiveClaim","prepareClaimPayload","writeErc20PeggedIncentiveClaim","simulateErc20PeggedIncentiveClawback","writeErc20PeggedIncentiveClawback","readErc20PeggedIncentiveIsClaimable","readErc20PeggedIncentiveGetPeg","claims","limit","_payload","_options","options","bytecode","prepareERC20PeggedIncentivePayload","amount","encodeAbiParameters","rewardAmount","ERC20PeggedIncentiveBases","RegistryType","ERC20PeggedIncentive","asset","peg","reward","manager","zeroAddress","_ERC20PeggedVariableCriteriaIncentive","erc20PeggedVariableCriteriaIncentiveAbi","readErc20PeggedVariableCriteriaIncentiveOwner","readErc20PeggedVariableCriteriaIncentiveCurrentReward","readErc20PeggedVariableCriteriaIncentiveGetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","scalarValue","_a","DecodedArgsError","e","transaction","getTransaction","func","decodeFunctionData","InvalidCriteriaTypeError","readErc20PeggedVariableCriteriaIncentiveClaims","readErc20PeggedVariableCriteriaIncentiveTotalClaimed","readErc20PeggedVariableCriteriaIncentiveClaimed","readErc20PeggedVariableCriteriaIncentiveAsset","readErc20PeggedVariableCriteriaIncentivePeg","readErc20PeggedVariableCriteriaIncentiveReward","readErc20PeggedVariableCriteriaIncentiveLimit","simulateErc20PeggedVariableCriteriaIncentiveClaim","writeErc20PeggedVariableCriteriaIncentiveClaim","simulateErc20PeggedVariableCriteriaIncentiveClawback","writeErc20PeggedVariableCriteriaIncentiveClawback","readErc20PeggedVariableCriteriaIncentiveIsClaimable","readErc20PeggedVariableCriteriaIncentiveGetPeg","totalClaimed","readErc20PeggedVariableCriteriaIncentiveGetIncentiveCriteria","IncentiveCriteriaNotFoundError","prepareERC20PeggedVariableCriteriaIncentivePayload","signedAmount","claimData","boostClaimData","decodeAbiParameters","claimAmount","maxReward","parseEther","ERC20PeggedVariableCriteriaIncentiveBases","ERC20PeggedVariableCriteriaIncentive","IncentiveByComponentInterface","APointsIncentive","PointsIncentive","AERC20Incentive","ERC20Incentive","AERC20PeggedVariableCriteriaIncentive","AERC20PeggedIncentive","AAllowListIncentive","AllowListIncentive","ACGDAIncentive","CGDAIncentive","AERC20VariableIncentive","ERC20VariableIncentive","AERC20VariableCriteriaIncentive","ERC20VariableCriteriaIncentive","incentiveFromAddress","interfaceId","readContract","aIncentiveAbi","Ctor","InvalidComponentInterfaceError"],"mappings":";;;;;;;;;;;;;;;;ywoBA2GaA,IAAN,MAAMA,UAA6BC,EAGxC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAA8B,KAAK,SAAS;AAAA,MACvD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cAAcA,GAAqB;AACvC,WAAA,MAAME,EAAsC,KAAK,SAAS;AAAA,MAC/D,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,OAAOA,GAAqB;AAChC,WAAA,MAAMG,EAA+B,KAAK,SAAS;AAAA,MACxD,SAAS,KAAK,mBAAmB;AAAA,MACjC,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EAC3B,CAACC,EAAsB,GAAGC;AAAA,EAC1B,CAACC,EAA4C,GAC3CN;AAAA,EACF,CAACO,EAA4B,GAAGjE;AAAA,EAChC,CAACkE,EAAmB,GAAGC;AAAA;AAAA,EAEvB,CAACC,EAAqB,GAAGC;AAAA,EACzB,CAACC,EAA8B,GAAGC;AAAA,EAClC,CAACC,EAAsC,GAAGC;AAC5C;AAYsB,eAAAC,GACpBlF,GACApB,GACAL,GACA;AACA,QAAM4G,IAAe,MAAMC,GAAapF,EAAQ,QAAQ;AAAA,IACtD,KAAKqF;AAAAA,IACL,cAAc;AAAA,IACd,SAAAzG;AAAA,IACA,GAAGL;AAAA,EAAA,CACJ,GACK+G,IAAOnB,EAA8BgB,CAAW;AACtD,MAAI,CAACG;AACH,UAAM,IAAIC;AAAA,MACR,OAAO,KAAKpB,CAA6B;AAAA,MACzCgB;AAAA,IAAA;AAGG,SAAA,IAAIG,EAAKtF,GAASpB,CAAO;AAClC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { erc20PeggedVariableCriteriaIncentiveAbi } from '@boostxyz/evm';
|
|
2
|
-
import { type Address, type ContractEventName } from 'viem';
|
|
2
|
+
import { type Address, type ContractEventName, type Hex } from 'viem';
|
|
3
3
|
import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
|
|
4
4
|
import { DeployableTarget } from '../Deployable/DeployableTarget';
|
|
5
5
|
import { type ClaimPayload } from '../claiming';
|
|
@@ -1013,11 +1013,32 @@ export declare class ERC20PeggedVariableCriteriaIncentive extends DeployableTarg
|
|
|
1013
1013
|
* Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
|
|
1014
1014
|
*
|
|
1015
1015
|
* @public
|
|
1016
|
-
* @param {bigint}
|
|
1016
|
+
* @param {bigint} signedAmount
|
|
1017
1017
|
* @returns {Hash} Returns the encoded claim data
|
|
1018
1018
|
* @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
|
|
1019
1019
|
*/
|
|
1020
|
-
buildClaimData(
|
|
1020
|
+
buildClaimData(signedAmount: bigint): `0x${string}`;
|
|
1021
|
+
/**
|
|
1022
|
+
* Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.
|
|
1023
|
+
* Useful when deriving amount claimed from logs.
|
|
1024
|
+
*
|
|
1025
|
+
* @public
|
|
1026
|
+
* @param {Hex} claimData
|
|
1027
|
+
* @returns {BigInt} Returns the reward amount from a claim data payload
|
|
1028
|
+
*/
|
|
1029
|
+
decodeClaimData(claimData: Hex): Promise<bigint>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.
|
|
1032
|
+
* Useful when deriving amount claimed from logs.
|
|
1033
|
+
* Use this function instead of `decodeClaimData` if you have reward details.
|
|
1034
|
+
*
|
|
1035
|
+
* @public
|
|
1036
|
+
* @param {Hex} claimData
|
|
1037
|
+
* @param {bigint} [reward]
|
|
1038
|
+
* @param {bigint} [maxReward]
|
|
1039
|
+
* @returns {BigInt} Returns the reward amount from a claim data payload
|
|
1040
|
+
*/
|
|
1041
|
+
decodeClaimDataWithRewardDetails(claimData: Hex, reward: bigint, maxReward: bigint): bigint;
|
|
1021
1042
|
}
|
|
1022
1043
|
/**
|
|
1023
1044
|
* Given a {@link ERC20PeggedVariableCriteriaIncentivePayload}, properly encode a `ERC20PeggedVariableCriteriaIncentivePayload.InitPayload` for use with {@link ERC20PeggedVariableCriteriaIncentivePayload} initialization.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20PeggedVariableCriteriaIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uCAAuC,EAkBxC,MAAM,eAAe,CAAC;AAIvB,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ERC20PeggedVariableCriteriaIncentive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;IACU,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU;IAI7C;;;;;;;OAOG;IACU,0BAA0B,CAAC,MAAM,CAAC,EAAE,UAAU;IAQ3D;;OAEG;IAEH;;;;;;OAMG;IACU,oBAAoB,CAC/B,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,iBAAiB,CAAC;IAiB7B;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,2CAA2C,EACtD,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAa1B;;;;;;OAMG;IACI,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAIvC;;;;;;;OAOG;IACI,cAAc,CAAC,YAAY,EAAE,MAAM;IAO1C;;;;;;;OAOG;IACU,eAAe,CAAC,SAAS,EAAE,GAAG;IAqC3C;;;;;;;;;;OAUG;IACI,gCAAgC,CACrC,SAAS,EAAE,GAAG,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM;CAiCpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kDAAkD,CAAC,EACjE,KAAK,EACL,GAAG,EACH,MAAM,EACN,KAAK,EACL,SAAc,EACd,OAAqB,EACrB,QAAQ,GACT,EAAE,2CAA2C,iBA2C7C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../generated-CRD9XfOT.cjs");require("../componentInterfaces-D7r9xJmt.cjs");require("@wagmi/core");require("../errors.cjs");const n=require("./AllowListIncentive.cjs"),i=require("./CGDAIncentive.cjs"),t=require("./ERC20Incentive.cjs"),e=require("../Incentive-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../generated-CRD9XfOT.cjs");require("../componentInterfaces-D7r9xJmt.cjs");require("@wagmi/core");require("../errors.cjs");const n=require("./AllowListIncentive.cjs"),i=require("./CGDAIncentive.cjs"),t=require("./ERC20Incentive.cjs"),e=require("../Incentive-BpZePiOD.cjs"),r=require("./ERC20VariableCriteriaIncentive.cjs"),c=require("./ERC20VariableIncentive.cjs"),v=require("./PointsIncentive.cjs");exports.AllowListIncentive=n.AllowListIncentive;exports.CGDAIncentive=i.CGDAIncentive;exports.ERC20Incentive=t.ERC20Incentive;exports.ERC20PeggedIncentive=e.ERC20PeggedIncentive;exports.ERC20PeggedVariableCriteriaIncentive=e.ERC20PeggedVariableCriteriaIncentive;exports.IncentiveByComponentInterface=e.IncentiveByComponentInterface;exports.incentiveFromAddress=e.incentiveFromAddress;exports.ERC20VariableCriteriaIncentive=r.ERC20VariableCriteriaIncentive;exports.ERC20VariableIncentive=c.ERC20VariableIncentive;exports.PointsIncentive=v.PointsIncentive;
|
|
2
2
|
//# sourceMappingURL=Incentive.cjs.map
|
|
@@ -5,7 +5,7 @@ import "../errors.js";
|
|
|
5
5
|
import { AllowListIncentive as a } from "./AllowListIncentive.js";
|
|
6
6
|
import { CGDAIncentive as p } from "./CGDAIncentive.js";
|
|
7
7
|
import { ERC20Incentive as I } from "./ERC20Incentive.js";
|
|
8
|
-
import { E as C, a as f, I as s, i as x } from "../Incentive-
|
|
8
|
+
import { E as C, a as f, I as s, i as x } from "../Incentive-DBZHQ9Np.js";
|
|
9
9
|
import { ERC20VariableCriteriaIncentive as l } from "./ERC20VariableCriteriaIncentive.js";
|
|
10
10
|
import { ERC20VariableIncentive as d } from "./ERC20VariableIncentive.js";
|
|
11
11
|
import { PointsIncentive as b } from "./PointsIncentive.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./BoostRegistry.cjs"),l=require("./BoostCore.cjs"),A=require("./Boost.cjs"),u=require("./Actions/Action.cjs"),a=require("./Actions/EventAction.cjs"),g=require("./AllowLists/AllowList.cjs"),y=require("./AllowLists/SimpleAllowList.cjs"),I=require("./SimpleDenyList-DIb4xX3j.cjs"),d=require("./Budget-N0YEfSt2.cjs"),t=require("./Budgets/ManagedBudget.cjs"),D=require("./Deployable/Deployable.cjs"),T=require("./Deployable/Contract.cjs"),V=require("./Deployable/DeployableTarget.cjs"),P=require("./Deployable/DeployableTargetWithRBAC.cjs"),v=require("./Incentives/AllowListIncentive.cjs"),R=require("./Incentives/CGDAIncentive.cjs"),S=require("./Incentives/ERC20Incentive.cjs"),o=require("./Incentive-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./BoostRegistry.cjs"),l=require("./BoostCore.cjs"),A=require("./Boost.cjs"),u=require("./Actions/Action.cjs"),a=require("./Actions/EventAction.cjs"),g=require("./AllowLists/AllowList.cjs"),y=require("./AllowLists/SimpleAllowList.cjs"),I=require("./SimpleDenyList-DIb4xX3j.cjs"),d=require("./Budget-N0YEfSt2.cjs"),t=require("./Budgets/ManagedBudget.cjs"),D=require("./Deployable/Deployable.cjs"),T=require("./Deployable/Contract.cjs"),V=require("./Deployable/DeployableTarget.cjs"),P=require("./Deployable/DeployableTargetWithRBAC.cjs"),v=require("./Incentives/AllowListIncentive.cjs"),R=require("./Incentives/CGDAIncentive.cjs"),S=require("./Incentives/ERC20Incentive.cjs"),o=require("./Incentive-BpZePiOD.cjs"),m=require("./Incentives/ERC20VariableIncentive.cjs"),C=require("./Incentives/ERC20VariableCriteriaIncentive.cjs"),b=require("./Incentives/PointsIncentive.cjs"),s=require("./Validators/SignerValidator.cjs"),p=require("./Validators/LimitedSignerValidator.cjs"),c=require("./Validators/Validator.cjs"),e=require("./errors.cjs"),i=require("./utils.cjs"),B=require("./claiming.cjs"),n=require("./transfers.cjs"),F=require("./Auth/PassthroughAuth.cjs"),r=require("./generated-CRD9XfOT.cjs");exports.BOOST_REGISTRY_ADDRESS=E.BOOST_REGISTRY_ADDRESS;exports.BOOST_REGISTRY_ADDRESSES=E.BOOST_REGISTRY_ADDRESSES;exports.BoostRegistry=E.BoostRegistry;exports.BOOST_CORE_ADDRESS=l.BOOST_CORE_ADDRESS;exports.BOOST_CORE_ADDRESSES=l.BOOST_CORE_ADDRESSES;exports.BoostCore=l.BoostCore;exports.FEE_DENOMINATOR=l.FEE_DENOMINATOR;exports.Boost=A.Boost;exports.prepareBoostPayload=A.prepareBoostPayload;exports.ActionByComponentInterface=u.ActionByComponentInterface;exports.actionFromAddress=u.actionFromAddress;exports.EventAction=a.EventAction;exports.FilterType=a.FilterType;exports.PrimitiveType=a.PrimitiveType;exports.SignatureType=a.SignatureType;exports.anyActionParameter=a.anyActionParameter;exports.isEventActionPayloadSimple=a.isEventActionPayloadSimple;exports.prepareEventActionPayload=a.prepareEventActionPayload;exports.transactionSenderClaimant=a.transactionSenderClaimant;exports.AllowListByComponentInterface=g.AllowListByComponentInterface;exports.OpenAllowList=g.OpenAllowList;exports.allowListFromAddress=g.allowListFromAddress;exports.LIST_MANAGER_ROLE=y.LIST_MANAGER_ROLE;exports.SimpleAllowList=y.SimpleAllowList;exports.prepareSimpleAllowListPayload=y.prepareSimpleAllowListPayload;exports.SimpleDenyList=I.SimpleDenyList;exports.prepareSimpleDenyListPayload=I.prepareSimpleDenyListPayload;exports.BudgetByComponentInterface=d.BudgetByComponentInterface;exports.ManagedBudgetWithFees=d.ManagedBudgetWithFees;exports.budgetFromAddress=d.budgetFromAddress;exports.prepareManagedBudgetWithFeesPayload=d.prepareManagedBudgetWithFeesPayload;exports.ManagedBudget=t.ManagedBudget;exports.ManagedBudgetRoles=t.ManagedBudgetRoles;exports.isERC1155TransferPayload=t.isERC1155TransferPayload;exports.isFungibleTransfer=t.isFungibleTransfer;exports.prepareManagedBudgetPayload=t.prepareManagedBudgetPayload;exports.prepareTransfer=t.prepareTransfer;exports.Deployable=D.Deployable;exports.Contract=T.Contract;exports.DeployableTarget=V.DeployableTarget;exports.DeployableTargetWithRBAC=P.DeployableTargetWithRBAC;exports.Roles=P.Roles;exports.AllowListIncentive=v.AllowListIncentive;exports.prepareAllowListIncentivePayload=v.prepareAllowListIncentivePayload;exports.CGDAIncentive=R.CGDAIncentive;exports.prepareCGDAIncentivePayload=R.prepareCGDAIncentivePayload;exports.ERC20Incentive=S.ERC20Incentive;exports.prepareERC20IncentivePayload=S.prepareERC20IncentivePayload;exports.ERC20PeggedIncentive=o.ERC20PeggedIncentive;exports.ERC20PeggedVariableCriteriaIncentive=o.ERC20PeggedVariableCriteriaIncentive;exports.IncentiveByComponentInterface=o.IncentiveByComponentInterface;exports.incentiveFromAddress=o.incentiveFromAddress;exports.prepareERC20PeggedIncentivePayload=o.prepareERC20PeggedIncentivePayload;exports.prepareERC20PeggedVariableCriteriaIncentivePayload=o.prepareERC20PeggedVariableCriteriaIncentivePayload;exports.ERC20VariableIncentive=m.ERC20VariableIncentive;exports.prepareERC20VariableIncentivePayload=m.prepareERC20VariableIncentivePayload;exports.ERC20VariableCriteriaIncentive=C.ERC20VariableCriteriaIncentive;exports.gasRebateIncentiveCriteria=C.gasRebateIncentiveCriteria;exports.prepareERC20VariableCriteriaIncentivePayload=C.prepareERC20VariableCriteriaIncentivePayload;exports.PointsIncentive=b.PointsIncentive;exports.preparePointsIncentivePayload=b.preparePointsIncentivePayload;exports.SignerValidator=s.SignerValidator;exports.prepareSignerValidatorClaimDataPayload=s.prepareSignerValidatorClaimDataPayload;exports.prepareSignerValidatorInputParams=s.prepareSignerValidatorInputParams;exports.prepareSignerValidatorPayload=s.prepareSignerValidatorPayload;exports.LimitedSignerValidator=p.LimitedSignerValidator;exports.prepareLimitedSignerValidatorClaimDataPayload=p.prepareLimitedSignerValidatorClaimDataPayload;exports.prepareLimitedSignerValidatorInputParams=p.prepareLimitedSignerValidatorInputParams;exports.prepareLimitedSignerValidatorPayload=p.prepareLimitedSignerValidatorPayload;exports.BoostValidatorEOA=c.BoostValidatorEOA;exports.ValidatorByComponentInterface=c.ValidatorByComponentInterface;exports.decodeClaimData=c.decodeClaimData;exports.validatorFromAddress=c.validatorFromAddress;exports.BoostCoreNoIdentifierEmitted=e.BoostCoreNoIdentifierEmitted;exports.BoostNotFoundError=e.BoostNotFoundError;exports.BudgetMustAuthorizeBoostCore=e.BudgetMustAuthorizeBoostCore;exports.ContractAddressRequiredError=e.ContractAddressRequiredError;exports.DecodedArgsError=e.DecodedArgsError;exports.DecodedArgsMalformedError=e.DecodedArgsMalformedError;exports.DeployableAlreadyDeployedError=e.DeployableAlreadyDeployedError;exports.DeployableBuildParametersUnspecifiedError=e.DeployableBuildParametersUnspecifiedError;exports.DeployableMissingPayloadError=e.DeployableMissingPayloadError;exports.DeployableUnknownOwnerProvidedError=e.DeployableUnknownOwnerProvidedError;exports.DeployableWagmiConfigurationRequiredError=e.DeployableWagmiConfigurationRequiredError;exports.FieldActionValidationError=e.FieldActionValidationError;exports.FieldValueNotComparableError=e.FieldValueNotComparableError;exports.FieldValueUndefinedError=e.FieldValueUndefinedError;exports.FunctionDataDecodeError=e.FunctionDataDecodeError;exports.IncentiveCriteriaNotFoundError=e.IncentiveCriteriaNotFoundError;exports.IncentiveNotCloneableError=e.IncentiveNotCloneableError;exports.InvalidComponentInterfaceError=e.InvalidComponentInterfaceError;exports.InvalidCriteriaTypeError=e.InvalidCriteriaTypeError;exports.InvalidNumericalCriteriaError=e.InvalidNumericalCriteriaError;exports.InvalidProtocolChainIdError=e.InvalidProtocolChainIdError;exports.MustInitializeBudgetError=e.MustInitializeBudgetError;exports.NoConnectedChainIdError=e.NoConnectedChainIdError;exports.NoContractAddressUponReceiptError=e.NoContractAddressUponReceiptError;exports.NoEventActionStepsProvidedError=e.NoEventActionStepsProvidedError;exports.NoMatchingLogsError=e.NoMatchingLogsError;exports.TooManyEventActionStepsProvidedError=e.TooManyEventActionStepsProvidedError;exports.UnknownTransferPayloadSupplied=e.UnknownTransferPayloadSupplied;exports.UnparseableAbiParamError=e.UnparseableAbiParamError;exports.UnrecognizedFilterTypeError=e.UnrecognizedFilterTypeError;exports.ValidationAbiMissingError=e.ValidationAbiMissingError;exports.CheatCodes=i.CheatCodes;exports.RegistryType=i.RegistryType;exports.TRANSFER_SIGNATURE=i.TRANSFER_SIGNATURE;exports.assertValidAddressByChainId=i.assertValidAddressByChainId;exports.awaitResult=i.awaitResult;exports.bytes4=i.bytes4;exports.getDeployedContractAddress=i.getDeployedContractAddress;exports.getErc20Balance=i.getErc20Balance;exports.StrategyType=B.StrategyType;exports.prepareClaimPayload=B.prepareClaimPayload;exports.AssetType=n.AssetType;exports.prepareERC1155Payload=n.prepareERC1155Payload;exports.prepareERC1155Transfer=n.prepareERC1155Transfer;exports.prepareFungiblePayload=n.prepareFungiblePayload;exports.prepareFungibleTransfer=n.prepareFungibleTransfer;exports.prepareTransferPayload=n.prepareTransferPayload;exports.PassthroughAuth=F.PassthroughAuth;exports.allowListIncentiveAbi=r.B;exports.boostCoreAbi=r.I;exports.boostRegistryAbi=r.ce;exports.cgdaIncentiveAbi=r.A;exports.erc20IncentiveAbi=r.f;exports.erc20PeggedIncentiveAbi=r.v;exports.erc20PeggedVariableCriteriaIncentiveAbi=r.l;exports.erc20VariableCriteriaIncentiveAbi=r.d;exports.erc20VariableIncentiveAbi=r.g;exports.limitedSignerValidatorAbi=r.V;exports.managedBudgetAbi=r.w;exports.managedBudgetWithFeesAbi=r.o;exports.passthroughAuthAbi=r.We;exports.pointsIncentiveAbi=r.N;exports.rbacAbi=r.H;exports.signerValidatorAbi=r.k;exports.simpleAllowListAbi=r.C;exports.simpleDenyListAbi=r.E;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { DeployableTargetWithRBAC as re, Roles as ae } from "./Deployable/Deploy
|
|
|
15
15
|
import { AllowListIncentive as te, prepareAllowListIncentivePayload as ie } from "./Incentives/AllowListIncentive.js";
|
|
16
16
|
import { CGDAIncentive as de, prepareCGDAIncentivePayload as pe } from "./Incentives/CGDAIncentive.js";
|
|
17
17
|
import { ERC20Incentive as se, prepareERC20IncentivePayload as ce } from "./Incentives/ERC20Incentive.js";
|
|
18
|
-
import { E as Ee, a as ge, I as Ae, i as ye, p as Ce, b as Ie } from "./Incentive-
|
|
18
|
+
import { E as Ee, a as ge, I as Ae, i as ye, p as Ce, b as Ie } from "./Incentive-DBZHQ9Np.js";
|
|
19
19
|
import { ERC20VariableIncentive as fe, prepareERC20VariableIncentivePayload as Pe } from "./Incentives/ERC20VariableIncentive.js";
|
|
20
20
|
import { ERC20VariableCriteriaIncentive as Re, gasRebateIncentiveCriteria as Se, prepareERC20VariableCriteriaIncentivePayload as ue } from "./Incentives/ERC20VariableCriteriaIncentive.js";
|
|
21
21
|
import { PointsIncentive as De, preparePointsIncentivePayload as xe } from "./Incentives/PointsIncentive.js";
|
package/dist/utils.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@wagmi/core"),s=require("viem"),r=require("./errors.cjs"),c={abi:{"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{name:"Transfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0}]},"Transfer(address indexed,address indexed,uint256 indexed)":{name:"Transfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0}]},"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e":{name:"Purchased",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"uint256"},{type:"uint256"}]},"Purchased(address indexed,address indexed,uint256 indexed,uint256,uint256)":{name:"Purchased",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"uint256"},{type:"uint256"}]},"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x0667086d08417333ce63f40d5bc2ef6fd330e25aaaf317b7c489541f8fe600fa":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"}]},"NameRegistered(string,bytes32 indexed,address indexed,uint256)":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"}]},"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f":{name:"DelegateChanged",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0}]},"DelegateChanged(address indexed,address indexed,address indexed)":{name:"DelegateChanged",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0}]},"0xe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb0":{name:"SwappedV3",type:"event",inputs:[{type:"bytes16"},{type:"address"},{type:"uint256"},{type:"address"},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"SwappedV3(bytes16,address,uint256,address,address indexed,address indexed,address indexed,uint256,uint256,uint256)":{name:"SwappedV3",type:"event",inputs:[{type:"bytes16"},{type:"address"},{type:"uint256"},{type:"address"},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4":{name:"VoteCast",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256"},{type:"uint8"},{type:"uint256"},{type:"string"}]},"VoteCast(address indexed,uint256,uint8,uint256,string)":{name:"VoteCast",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256"},{type:"uint8"},{type:"uint256"},{type:"string"}]},"0x7ac572687bf4e66a8514fc2ec464fc2644c78bcb1d80a225fc51a33e0ee38bfa":{name:"Minted",type:"event",inputs:[{type:"uint8"},{type:"address"},{type:"uint256"},{type:"uint256"}]},"Minted(uint8,address,uint256,uint256)":{name:"Minted",type:"event",inputs:[{type:"uint8"},{type:"address"},{type:"uint256"},{type:"uint256"}]},"0x2a29f7402bd32f0e4bbe17d44be064f7f64d96ee174ed7cb27936d869bf9a888":{name:"Minted",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint8"},{type:"uint8"},{type:"address",indexed:!0},{type:"tuple",components:[{type:"uint32"},{type:"uint256"},{type:"address"},{type:"uint32"},{type:"uint32"},{type:"uint32"},{type:"address"},{type:"bool"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},{type:"uint256",indexed:!0}]},"Minted(address indexed,uint8,uint8,address indexed,(uint32,uint256,address,uint32,uint32,uint32,address,bool,uint256,uint256,uint256,uint256,uint256),uint256 indexed)":{name:"Minted",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint8"},{type:"uint8"},{type:"address",indexed:!0},{type:"tuple",components:[{type:"uint32"},{type:"uint256"},{type:"address"},{type:"uint32"},{type:"uint32"},{type:"uint32"},{type:"address"},{type:"bool"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},{type:"uint256",indexed:!0}]},"0xc773e203af3f3079b18c21f98bb8d8ccd2fea097d631d448df89de4edbe7a2a8":{name:"ZoraTimedSaleStrategyRewards",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"}]},"ZoraTimedSaleStrategyRewards(address indexed,uint256 indexed,address,uint256,address,uint256,address,uint256,address,uint256,address,uint256)":{name:"ZoraTimedSaleStrategyRewards",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"}]},"0x0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547":{name:"BoostClaimed",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"bytes"}]},"BoostClaimed(uint256 indexed,uint256 indexed,address indexed,address,bytes)":{name:"BoostClaimed",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"bytes"}]},"0x116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd":{name:"BoostCreated",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"address"},{type:"address"},{type:"address"}]},"BoostCreated(uint256 indexed,address indexed,address indexed,uint256,address,address,address)":{name:"BoostCreated",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"address"},{type:"address"},{type:"address"}]},"0x72d6b4b5ad0fb12b8a7bb3bcb60edd774c096403d611437859c156ecb3c03a36":{name:"SecondaryBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"}]},"SecondaryBuy(address indexed,address indexed,address indexed,uint256,uint256)":{name:"SecondaryBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"}]},"0x6779abc30cb1bfb05c1170de8e2ef5828c19a2590043d2fd9579d945929fd8a4":{name:"CoopTokenBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"CoopTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":{name:"CoopTokenBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"0xeb3adfe7d8294092cd6b0e7ce95ed01c11d3c5d5d3dc1fecdeb87de43c5e40b2":{name:"CoopTokenSell",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"CoopTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":{name:"CoopTokenSell",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"0xd5468362e31bdcdc9884e72dcf3b00f9d46086067621224b7cb759308d597c6c":{name:"CoopTokenFees",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"CoopTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)":{name:"CoopTokenFees",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b":{name:"InfoIndexed",type:"event",inputs:[{type:"address",indexed:!0},{type:"string",indexed:!0}]},"InfoIndexed(address indexed,string indexed)":{name:"InfoIndexed",type:"event",inputs:[{type:"address",indexed:!0},{type:"string",indexed:!0}]},"0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c":{name:"Info",type:"event",inputs:[{type:"address"},{type:"string"}]},"Info(address,string)":{name:"Info",type:"event",inputs:[{type:"address"},{type:"string"}]}},selectors:{"Transfer(address indexed,address indexed,uint256 indexed)":"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":"Transfer(address indexed,address indexed,uint256 indexed)","Purchased(address indexed,address indexed,uint256 indexed,uint256,uint256)":"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e","0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e":"Purchased(address indexed,address indexed,uint256 indexed,uint256,uint256)","NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)":"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27","0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27":"NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)","NameRegistered(string,bytes32 indexed,address indexed,uint256)":"0x0667086d08417333ce63f40d5bc2ef6fd330e25aaaf317b7c489541f8fe600fa","0x0667086d08417333ce63f40d5bc2ef6fd330e25aaaf317b7c489541f8fe600fa":"NameRegistered(string,bytes32 indexed,address indexed,uint256)","DelegateChanged(address indexed,address indexed,address indexed)":"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f","0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f":"DelegateChanged(address indexed,address indexed,address indexed)","SwappedV3(bytes16,address,uint256,address,address indexed,address indexed,address indexed,uint256,uint256,uint256)":"0xe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb0","0xe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb0":"SwappedV3(bytes16,address,uint256,address,address indexed,address indexed,address indexed,uint256,uint256,uint256)","VoteCast(address indexed,uint256,uint8,uint256,string)":"0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4","0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4":"VoteCast(address indexed,uint256,uint8,uint256,string)","Minted(uint8,address,uint256,uint256)":"0x7ac572687bf4e66a8514fc2ec464fc2644c78bcb1d80a225fc51a33e0ee38bfa","0x7ac572687bf4e66a8514fc2ec464fc2644c78bcb1d80a225fc51a33e0ee38bfa":"Minted(uint8,address,uint256,uint256)","Minted(address indexed,uint8,uint8,address indexed,(uint32,uint256,address,uint32,uint32,uint32,address,bool,uint256,uint256,uint256,uint256,uint256),uint256 indexed)":"0x2a29f7402bd32f0e4bbe17d44be064f7f64d96ee174ed7cb27936d869bf9a888","0x2a29f7402bd32f0e4bbe17d44be064f7f64d96ee174ed7cb27936d869bf9a888":"Minted(address indexed,uint8,uint8,address indexed,(uint32,uint256,address,uint32,uint32,uint32,address,bool,uint256,uint256,uint256,uint256,uint256),uint256 indexed)","ZoraTimedSaleStrategyRewards(address indexed,uint256 indexed,address,uint256,address,uint256,address,uint256,address,uint256,address,uint256)":"0xc773e203af3f3079b18c21f98bb8d8ccd2fea097d631d448df89de4edbe7a2a8","0xc773e203af3f3079b18c21f98bb8d8ccd2fea097d631d448df89de4edbe7a2a8":"ZoraTimedSaleStrategyRewards(address indexed,uint256 indexed,address,uint256,address,uint256,address,uint256,address,uint256,address,uint256)","BoostClaimed(uint256 indexed,uint256 indexed,address indexed,address,bytes)":"0x0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547","0x0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547":"BoostClaimed(uint256 indexed,uint256 indexed,address indexed,address,bytes)","BoostCreated(uint256 indexed,address indexed,address indexed,uint256,address,address,address)":"0x116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd","0x116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd":"BoostCreated(uint256 indexed,address indexed,address indexed,uint256,address,address,address)","SecondaryBuy(address indexed,address indexed,address indexed,uint256,uint256)":"0x72d6b4b5ad0fb12b8a7bb3bcb60edd774c096403d611437859c156ecb3c03a36","0x72d6b4b5ad0fb12b8a7bb3bcb60edd774c096403d611437859c156ecb3c03a36":"SecondaryBuy(address indexed,address indexed,address indexed,uint256,uint256)","CoopTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":"0x6779abc30cb1bfb05c1170de8e2ef5828c19a2590043d2fd9579d945929fd8a4","0x6779abc30cb1bfb05c1170de8e2ef5828c19a2590043d2fd9579d945929fd8a4":"CoopTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)","CoopTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":"0xeb3adfe7d8294092cd6b0e7ce95ed01c11d3c5d5d3dc1fecdeb87de43c5e40b2","0xeb3adfe7d8294092cd6b0e7ce95ed01c11d3c5d5d3dc1fecdeb87de43c5e40b2":"CoopTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)","CoopTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)":"0xd5468362e31bdcdc9884e72dcf3b00f9d46086067621224b7cb759308d597c6c","0xd5468362e31bdcdc9884e72dcf3b00f9d46086067621224b7cb759308d597c6c":"CoopTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)","InfoIndexed(address indexed,string indexed)":"0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b","0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b":"InfoIndexed(address indexed,string indexed)","Info(address,string)":"0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c","0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c":"Info(address,string)"}};var p=(e=>(e[e.ACTION=0]="ACTION",e[e.ALLOW_LIST=1]="ALLOW_LIST",e[e.BUDGET=2]="BUDGET",e[e.INCENTIVE=3]="INCENTIVE",e[e.VALIDATOR=4]="VALIDATOR",e))(p||{}),y=(e=>(e[e.ANY_ACTION_PARAM=255]="ANY_ACTION_PARAM",e[e.TX_SENDER_CLAIMANT=255]="TX_SENDER_CLAIMANT",e[e.GAS_REBATE_INCENTIVE=255]="GAS_REBATE_INCENTIVE",e))(y||{});const x=c.selectors["Transfer(address indexed,address indexed,uint256 indexed)"];function b(e){return s.slice(s.isHex(e)?s.keccak256(e):s.keccak256(s.toHex(e)),0,4)}async function f(e,t,n){const d=await a.waitForTransactionReceipt(e,{...n,hash:await t});if(!d.contractAddress)throw new r.NoContractAddressUponReceiptError(d);return d.contractAddress}async function o(e,t,n){const{hash:d,result:i}=await t;return await a.waitForTransactionReceipt(e,{...n,hash:d}),i}function m(e,t,n){let d;const i=a.getChainId(e);if(i&&t[i]&&(d=i),n!==void 0?t[n]&&(d=n):i!==void 0&&t[i]&&(d=i),d===void 0){const u=a.getAccount(e);u.chainId!==void 0&&t[u.chainId]&&(d=u.chainId)}if(d===void 0&&(d=11155111),!t[d])throw new r.InvalidProtocolChainIdError(d,Object.keys(t).map(Number));return{chainId:d,address:t[d]}}async function g(e,t,n,d){return await a.readContract(e,{...d,functionName:"balanceOf",address:t,args:[n],abi:[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"}]})}exports.CheatCodes=y;exports.RegistryType=p;exports.TRANSFER_SIGNATURE=x;exports.assertValidAddressByChainId=m;exports.awaitResult=o;exports.bytes4=b;exports.getDeployedContractAddress=f;exports.getErc20Balance=g;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@wagmi/core"),s=require("viem"),r=require("./errors.cjs"),x={abi:{"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{name:"Transfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0}]},"Transfer(address indexed,address indexed,uint256 indexed)":{name:"Transfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0}]},"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e":{name:"Purchased",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"uint256"},{type:"uint256"}]},"Purchased(address indexed,address indexed,uint256 indexed,uint256,uint256)":{name:"Purchased",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"uint256"},{type:"uint256"}]},"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x0667086d08417333ce63f40d5bc2ef6fd330e25aaaf317b7c489541f8fe600fa":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"}]},"NameRegistered(string,bytes32 indexed,address indexed,uint256)":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"}]},"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f":{name:"DelegateChanged",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0}]},"DelegateChanged(address indexed,address indexed,address indexed)":{name:"DelegateChanged",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0}]},"0xe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb0":{name:"SwappedV3",type:"event",inputs:[{type:"bytes16"},{type:"address"},{type:"uint256"},{type:"address"},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"SwappedV3(bytes16,address,uint256,address,address indexed,address indexed,address indexed,uint256,uint256,uint256)":{name:"SwappedV3",type:"event",inputs:[{type:"bytes16"},{type:"address"},{type:"uint256"},{type:"address"},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4":{name:"VoteCast",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256"},{type:"uint8"},{type:"uint256"},{type:"string"}]},"VoteCast(address indexed,uint256,uint8,uint256,string)":{name:"VoteCast",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256"},{type:"uint8"},{type:"uint256"},{type:"string"}]},"0x7ac572687bf4e66a8514fc2ec464fc2644c78bcb1d80a225fc51a33e0ee38bfa":{name:"Minted",type:"event",inputs:[{type:"uint8"},{type:"address"},{type:"uint256"},{type:"uint256"}]},"Minted(uint8,address,uint256,uint256)":{name:"Minted",type:"event",inputs:[{type:"uint8"},{type:"address"},{type:"uint256"},{type:"uint256"}]},"0x2a29f7402bd32f0e4bbe17d44be064f7f64d96ee174ed7cb27936d869bf9a888":{name:"Minted",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint8"},{type:"uint8"},{type:"address",indexed:!0},{type:"tuple",components:[{type:"uint32"},{type:"uint256"},{type:"address"},{type:"uint32"},{type:"uint32"},{type:"uint32"},{type:"address"},{type:"bool"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},{type:"uint256",indexed:!0}]},"Minted(address indexed,uint8,uint8,address indexed,(uint32,uint256,address,uint32,uint32,uint32,address,bool,uint256,uint256,uint256,uint256,uint256),uint256 indexed)":{name:"Minted",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint8"},{type:"uint8"},{type:"address",indexed:!0},{type:"tuple",components:[{type:"uint32"},{type:"uint256"},{type:"address"},{type:"uint32"},{type:"uint32"},{type:"uint32"},{type:"address"},{type:"bool"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},{type:"uint256",indexed:!0}]},"0xc773e203af3f3079b18c21f98bb8d8ccd2fea097d631d448df89de4edbe7a2a8":{name:"ZoraTimedSaleStrategyRewards",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"}]},"ZoraTimedSaleStrategyRewards(address indexed,uint256 indexed,address,uint256,address,uint256,address,uint256,address,uint256,address,uint256)":{name:"ZoraTimedSaleStrategyRewards",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"}]},"0x0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547":{name:"BoostClaimed",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"bytes"}]},"BoostClaimed(uint256 indexed,uint256 indexed,address indexed,address,bytes)":{name:"BoostClaimed",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"bytes"}]},"0x116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd":{name:"BoostCreated",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"address"},{type:"address"},{type:"address"}]},"BoostCreated(uint256 indexed,address indexed,address indexed,uint256,address,address,address)":{name:"BoostCreated",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"address"},{type:"address"},{type:"address"}]},"0x72d6b4b5ad0fb12b8a7bb3bcb60edd774c096403d611437859c156ecb3c03a36":{name:"SecondaryBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"}]},"SecondaryBuy(address indexed,address indexed,address indexed,uint256,uint256)":{name:"SecondaryBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"}]},"0x6779abc30cb1bfb05c1170de8e2ef5828c19a2590043d2fd9579d945929fd8a4":{name:"CoopTokenBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"CoopTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":{name:"CoopTokenBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"0x49c4606c4f7f601127761fb65a512e6bca424f62b165476cf1cfdfa51772a6ab":{name:"WowTokenBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"WowTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":{name:"WowTokenBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"0xeb3adfe7d8294092cd6b0e7ce95ed01c11d3c5d5d3dc1fecdeb87de43c5e40b2":{name:"CoopTokenSell",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"CoopTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":{name:"CoopTokenSell",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"0x0693c83d190a3d36d2ed6c3ac51b1335d2a3588d96f3f3601c8b1e780d0f952a":{name:"WowTokenSell",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"WowTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":{name:"WowTokenSell",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"0xd5468362e31bdcdc9884e72dcf3b00f9d46086067621224b7cb759308d597c6c":{name:"CoopTokenFees",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"CoopTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)":{name:"CoopTokenFees",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0xf349fe0373a901f0506d5343f4a872f385a7f0c26371d7b9e6bf5584b69d75fc":{name:"WowTokenFees",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"WowTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)":{name:"WowTokenFees",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x3be2a577c218a9e2fca79115ab0381630afc182ee832bcad4011c37d323b4843":{name:"CoopTokenTransfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"CoopTokenTransfer(address indexed,address indexed,uint256,uint256,uint256,uint256)":{name:"CoopTokenTransfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0xd19736ba1cd2ffc8c99f90d6c6163e59274d333c89e471cd6668d93849835ac5":{name:"WowTokenTransfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"WowTokenTransfer(address indexed,address indexed,uint256,uint256,uint256,uint256)":{name:"WowTokenTransfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b":{name:"InfoIndexed",type:"event",inputs:[{type:"address",indexed:!0},{type:"string",indexed:!0}]},"InfoIndexed(address indexed,string indexed)":{name:"InfoIndexed",type:"event",inputs:[{type:"address",indexed:!0},{type:"string",indexed:!0}]},"0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c":{name:"Info",type:"event",inputs:[{type:"address"},{type:"string"}]},"Info(address,string)":{name:"Info",type:"event",inputs:[{type:"address"},{type:"string"}]}},selectors:{"Transfer(address indexed,address indexed,uint256 indexed)":"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":"Transfer(address indexed,address indexed,uint256 indexed)","Purchased(address indexed,address indexed,uint256 indexed,uint256,uint256)":"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e","0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e":"Purchased(address indexed,address indexed,uint256 indexed,uint256,uint256)","NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)":"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27","0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27":"NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)","NameRegistered(string,bytes32 indexed,address indexed,uint256)":"0x0667086d08417333ce63f40d5bc2ef6fd330e25aaaf317b7c489541f8fe600fa","0x0667086d08417333ce63f40d5bc2ef6fd330e25aaaf317b7c489541f8fe600fa":"NameRegistered(string,bytes32 indexed,address indexed,uint256)","DelegateChanged(address indexed,address indexed,address indexed)":"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f","0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f":"DelegateChanged(address indexed,address indexed,address indexed)","SwappedV3(bytes16,address,uint256,address,address indexed,address indexed,address indexed,uint256,uint256,uint256)":"0xe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb0","0xe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb0":"SwappedV3(bytes16,address,uint256,address,address indexed,address indexed,address indexed,uint256,uint256,uint256)","VoteCast(address indexed,uint256,uint8,uint256,string)":"0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4","0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4":"VoteCast(address indexed,uint256,uint8,uint256,string)","Minted(uint8,address,uint256,uint256)":"0x7ac572687bf4e66a8514fc2ec464fc2644c78bcb1d80a225fc51a33e0ee38bfa","0x7ac572687bf4e66a8514fc2ec464fc2644c78bcb1d80a225fc51a33e0ee38bfa":"Minted(uint8,address,uint256,uint256)","Minted(address indexed,uint8,uint8,address indexed,(uint32,uint256,address,uint32,uint32,uint32,address,bool,uint256,uint256,uint256,uint256,uint256),uint256 indexed)":"0x2a29f7402bd32f0e4bbe17d44be064f7f64d96ee174ed7cb27936d869bf9a888","0x2a29f7402bd32f0e4bbe17d44be064f7f64d96ee174ed7cb27936d869bf9a888":"Minted(address indexed,uint8,uint8,address indexed,(uint32,uint256,address,uint32,uint32,uint32,address,bool,uint256,uint256,uint256,uint256,uint256),uint256 indexed)","ZoraTimedSaleStrategyRewards(address indexed,uint256 indexed,address,uint256,address,uint256,address,uint256,address,uint256,address,uint256)":"0xc773e203af3f3079b18c21f98bb8d8ccd2fea097d631d448df89de4edbe7a2a8","0xc773e203af3f3079b18c21f98bb8d8ccd2fea097d631d448df89de4edbe7a2a8":"ZoraTimedSaleStrategyRewards(address indexed,uint256 indexed,address,uint256,address,uint256,address,uint256,address,uint256,address,uint256)","BoostClaimed(uint256 indexed,uint256 indexed,address indexed,address,bytes)":"0x0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547","0x0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547":"BoostClaimed(uint256 indexed,uint256 indexed,address indexed,address,bytes)","BoostCreated(uint256 indexed,address indexed,address indexed,uint256,address,address,address)":"0x116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd","0x116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd":"BoostCreated(uint256 indexed,address indexed,address indexed,uint256,address,address,address)","SecondaryBuy(address indexed,address indexed,address indexed,uint256,uint256)":"0x72d6b4b5ad0fb12b8a7bb3bcb60edd774c096403d611437859c156ecb3c03a36","0x72d6b4b5ad0fb12b8a7bb3bcb60edd774c096403d611437859c156ecb3c03a36":"SecondaryBuy(address indexed,address indexed,address indexed,uint256,uint256)","CoopTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":"0x6779abc30cb1bfb05c1170de8e2ef5828c19a2590043d2fd9579d945929fd8a4","0x6779abc30cb1bfb05c1170de8e2ef5828c19a2590043d2fd9579d945929fd8a4":"CoopTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)","WowTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":"0x49c4606c4f7f601127761fb65a512e6bca424f62b165476cf1cfdfa51772a6ab","0x49c4606c4f7f601127761fb65a512e6bca424f62b165476cf1cfdfa51772a6ab":"WowTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)","CoopTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":"0xeb3adfe7d8294092cd6b0e7ce95ed01c11d3c5d5d3dc1fecdeb87de43c5e40b2","0xeb3adfe7d8294092cd6b0e7ce95ed01c11d3c5d5d3dc1fecdeb87de43c5e40b2":"CoopTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)","WowTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":"0x0693c83d190a3d36d2ed6c3ac51b1335d2a3588d96f3f3601c8b1e780d0f952a","0x0693c83d190a3d36d2ed6c3ac51b1335d2a3588d96f3f3601c8b1e780d0f952a":"WowTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)","CoopTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)":"0xd5468362e31bdcdc9884e72dcf3b00f9d46086067621224b7cb759308d597c6c","0xd5468362e31bdcdc9884e72dcf3b00f9d46086067621224b7cb759308d597c6c":"CoopTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)","WowTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)":"0xf349fe0373a901f0506d5343f4a872f385a7f0c26371d7b9e6bf5584b69d75fc","0xf349fe0373a901f0506d5343f4a872f385a7f0c26371d7b9e6bf5584b69d75fc":"WowTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)","CoopTokenTransfer(address indexed,address indexed,uint256,uint256,uint256,uint256)":"0x3be2a577c218a9e2fca79115ab0381630afc182ee832bcad4011c37d323b4843","0x3be2a577c218a9e2fca79115ab0381630afc182ee832bcad4011c37d323b4843":"CoopTokenTransfer(address indexed,address indexed,uint256,uint256,uint256,uint256)","WowTokenTransfer(address indexed,address indexed,uint256,uint256,uint256,uint256)":"0xd19736ba1cd2ffc8c99f90d6c6163e59274d333c89e471cd6668d93849835ac5","0xd19736ba1cd2ffc8c99f90d6c6163e59274d333c89e471cd6668d93849835ac5":"WowTokenTransfer(address indexed,address indexed,uint256,uint256,uint256,uint256)","InfoIndexed(address indexed,string indexed)":"0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b","0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b":"InfoIndexed(address indexed,string indexed)","Info(address,string)":"0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c","0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c":"Info(address,string)"}};var p=(e=>(e[e.ACTION=0]="ACTION",e[e.ALLOW_LIST=1]="ALLOW_LIST",e[e.BUDGET=2]="BUDGET",e[e.INCENTIVE=3]="INCENTIVE",e[e.VALIDATOR=4]="VALIDATOR",e))(p||{}),y=(e=>(e[e.ANY_ACTION_PARAM=255]="ANY_ACTION_PARAM",e[e.TX_SENDER_CLAIMANT=255]="TX_SENDER_CLAIMANT",e[e.GAS_REBATE_INCENTIVE=255]="GAS_REBATE_INCENTIVE",e))(y||{});const c=x.selectors["Transfer(address indexed,address indexed,uint256 indexed)"];function f(e){return s.slice(s.isHex(e)?s.keccak256(e):s.keccak256(s.toHex(e)),0,4)}async function b(e,t,n){const d=await a.waitForTransactionReceipt(e,{...n,hash:await t});if(!d.contractAddress)throw new r.NoContractAddressUponReceiptError(d);return d.contractAddress}async function o(e,t,n){const{hash:d,result:i}=await t;return await a.waitForTransactionReceipt(e,{...n,hash:d}),i}function T(e,t,n){let d;const i=a.getChainId(e);if(i&&t[i]&&(d=i),n!==void 0?t[n]&&(d=n):i!==void 0&&t[i]&&(d=i),d===void 0){const u=a.getAccount(e);u.chainId!==void 0&&t[u.chainId]&&(d=u.chainId)}if(d===void 0&&(d=11155111),!t[d])throw new r.InvalidProtocolChainIdError(d,Object.keys(t).map(Number));return{chainId:d,address:t[d]}}async function m(e,t,n,d){return await a.readContract(e,{...d,functionName:"balanceOf",address:t,args:[n],abi:[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"}]})}exports.CheatCodes=y;exports.RegistryType=p;exports.TRANSFER_SIGNATURE=c;exports.assertValidAddressByChainId=T;exports.awaitResult=o;exports.bytes4=f;exports.getDeployedContractAddress=b;exports.getErc20Balance=m;
|
|
2
2
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../src/utils.ts"],"sourcesContent":["import { events } from '@boostxyz/signatures';\nimport {\n type Config,\n type ReadContractParameters,\n type SimulateContractParameters,\n type WatchContractEventParameters,\n getAccount,\n getChainId,\n readContract,\n waitForTransactionReceipt,\n} from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport type {\n Abi,\n AbiEvent,\n Address,\n ContractEventName,\n ContractFunctionName,\n GetLogsParameters,\n Hash,\n Hex,\n Log,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport { isHex, keccak256, slice, toHex } from 'viem';\nimport {\n InvalidProtocolChainIdError,\n NoContractAddressUponReceiptError,\n} from './errors';\n\nexport type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;\n\n/**\n * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.\n *\n * @export\n * @enum {number}\n */\nexport enum RegistryType {\n ACTION = 0,\n ALLOW_LIST = 1,\n BUDGET = 2,\n INCENTIVE = 3,\n VALIDATOR = 4,\n}\n\n/**\n * Enum encapsulating all the different cheat codes for criteria modules.\n * An Event Action action step criteria with a `fieldIndex` set to `CheatCodes.ANY_ACTION_PARAM`, fieldType set to `PrimitiveType.BYTES`, and `filterType` set to `FilterType.EQUAL` will always return true when validating the field, regardless of inputs\n * An Event Action `ActionClaimant` with a `fieldIndex` set to `CheatCodes.TX_SENDER_CLAIMANT`, will always validate with the sender of a given transaction.\n *\n *\n * @export\n * @enum {number}\n */\nexport enum CheatCodes {\n /* An Event Action action step criteria with a `fieldIndex` set to `CheatCodes.ANY_ACTION_PARAM`, fieldType set to `PrimitiveType.BYTES`, and `filterType` set to `FilterType.EQUAL` will always return true when validating the field, regardless of inputs */\n ANY_ACTION_PARAM = 255,\n /* An Event Action `ActionClaimant` with a `fieldIndex` set to `CheatCodes.TX_SENDER_CLAIMANT`, will always validate with the sender of a given transaction. */\n TX_SENDER_CLAIMANT = 255,\n /* For use with `ERC20VariableCriteriaIncentive`, if the criteria's `fieldIndex` is set to `CheatCodes.GAS_REBATE_INCENTIVE`, will claim an incentive amount equal to the transaction's gas used. */\n GAS_REBATE_INCENTIVE = 255,\n}\n\n/**\n * The signature for the Transfer event for both ERC20 and ERC721.\n *\n * @type {Hex}\n */\nexport const TRANSFER_SIGNATURE = events.selectors[\n 'Transfer(address indexed,address indexed,uint256 indexed)'\n] as Hex;\n\n/**\n * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (writeContract)[https://viem.sh/docs/contract/writeContract]\n *\n * @export\n * @typedef {WriteParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type WriteParams = Partial<\n Omit<SimulateContractParameters, 'address' | 'args' | 'functionName' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (readContract)[https://viem.sh/docs/contract/readContract]\n *\n * @export\n * @typedef {ReadParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type ReadParams = Partial<\n Omit<ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `watchContractEvent` parameters without fields like `address`, and `abi` that are expected to be provided the SDK.\n * See (watchContractEvent)[https://wagmi.sh/core/api/actions/watchContractEvent]\n *\n * @export\n * @typedef {WatchParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi> | undefined} [eventName=undefined]\n */\nexport type WatchParams<\n abi extends Abi,\n eventName extends ContractEventName<abi> | undefined = undefined,\n> = Partial<\n Omit<WatchContractEventParameters<abi, eventName>, 'address' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `getLogs` parameters without fields like `address` that are expected to be provided the SDK.\n * See (getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]\n *\n * @export\n * @typedef {GetLogsParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} event\n * @template {ExtractAbiEvent<abi, event>} [abiEvent=ExtractAbiEvent<abi, event>]\n * @template {| readonly AbiEvent[]\n * | readonly unknown[]\n * | undefined} [abiEvents=abiEvent extends AbiEvent ? [abiEvent] : undefined]\n */\nexport type GetLogsParams<\n abi extends Abi,\n event extends ContractEventName<abi>,\n abiEvent extends ExtractAbiEvent<abi, event> = ExtractAbiEvent<abi, event>,\n abiEvents extends\n | readonly AbiEvent[]\n | readonly unknown[]\n | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined,\n> = Partial<Omit<GetLogsParameters<abiEvent, abiEvents>, 'address'>> & {\n chainId?: number | undefined;\n};\n\n/**\n * A generic `viem.Log` event with typed `args` support via a given `Abi` and `ContractEventName`\n *\n * @export\n * @typedef {GenericLog}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} [event=ContractEventName<abi>]\n */\nexport type GenericLog<\n abi extends Abi,\n event extends ContractEventName<abi> = ContractEventName<abi>,\n> = Log<bigint, number, false, ExtractAbiEvent<abi, event>, false>;\n\n/**\n * Helper utility to convert a string to a `bytes4` type\n *\n * @export\n * @param {string} input\n * @returns {Hex}\n */\nexport function bytes4(input: string) {\n return slice(isHex(input) ? keccak256(input) : keccak256(toHex(input)), 0, 4);\n}\n\n/**\n * Utility function to wait for a transaction receipt, and extract the contractAddress\n *\n * @export\n * @async\n * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {Promise<Hash>} hash - A transaction hash promise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}\n * @returns {Promise<Address>}\n * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received\n */\nexport async function getDeployedContractAddress(\n config: Config,\n hash: Promise<Hash>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n) {\n const receipt = await waitForTransactionReceipt(config, {\n ...waitParams,\n hash: await hash,\n });\n if (!receipt.contractAddress)\n throw new NoContractAddressUponReceiptError(receipt);\n return receipt.contractAddress;\n}\n\n/**\n * Utility type to encapsulate a transaction hash, and the simulated result prior to submitting the transaction.\n *\n * @export\n * @typedef {HashAndSimulatedResult}\n * @template [T=unknown]\n */\nexport type HashAndSimulatedResult<T = unknown> = { hash: Hash; result: T };\n\n/**\n * Helper function to wait for a transaction receipt given a hash promise.\n *\n * @export\n * @async\n * @template [Result=unknown]\n * @param {WagmiConfig} config\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\nexport async function awaitResult<Result = unknown>(\n config: Config,\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n): Promise<Result> {\n const { hash, result } = await hashPromise;\n await waitForTransactionReceipt(config, {\n ...waitParams,\n hash,\n });\n return result;\n}\n\n/**\n * Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.\n *\n * @export\n * @param {Config} config\n * @param {Record<string, Address>} addressByChainId\n * @param {number} desiredChainId\n * @returns {{ chainId: number, address: Address }}\n * @throws {@link InvalidProtocolChainIdError}\n */\nexport function assertValidAddressByChainId(\n config: Config,\n addressByChainId: Record<number, Address>,\n desiredChainId?: number,\n): { chainId: number; address: Address } {\n let chainId: number | undefined = undefined;\n\n const wagmiChainId = getChainId(config);\n if (wagmiChainId && addressByChainId[wagmiChainId]) chainId = wagmiChainId;\n // if manually providing a chain id for some contract operation, try to use it\n if (desiredChainId !== undefined) {\n if (addressByChainId[desiredChainId]) chainId = desiredChainId;\n } else if (wagmiChainId !== undefined) {\n // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it\n if (addressByChainId[wagmiChainId]) chainId = wagmiChainId;\n }\n // chainId is still undefined, try to get chain id off viem client\n if (chainId === undefined) {\n const wagmiAccount = getAccount(config);\n if (wagmiAccount.chainId !== undefined) {\n // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it\n if (addressByChainId[wagmiAccount.chainId])\n chainId = wagmiAccount.chainId;\n }\n }\n // if chainId is STILL undefined, use our default addresses\n // TODO: update this when on prod network\n if (chainId === undefined) chainId = Number(__DEFAULT_CHAIN_ID__);\n if (!addressByChainId[chainId])\n throw new InvalidProtocolChainIdError(\n chainId,\n Object.keys(addressByChainId).map(Number),\n );\n // biome-ignore lint/style/noNonNullAssertion: this type should be narrowed by the above statement but isn't?\n return { chainId, address: addressByChainId[chainId]! };\n}\n\n/**\n * Check an ERC20's balance for a given asset and\n *\n * @public\n * @async\n * @param {Config} [config]\n * @param {Address} [asset]\n * @param {Address} [owner]\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The erc20 balance\n */\nexport async function getErc20Balance(\n config: Config,\n asset: Address,\n owner: Address,\n params?: ReadParams,\n) {\n return await readContract(config, {\n ...params,\n functionName: 'balanceOf',\n address: asset,\n args: [owner],\n abi: [\n {\n constant: true,\n inputs: [\n {\n name: '_owner',\n type: 'address',\n },\n ],\n name: 'balanceOf',\n outputs: [\n {\n name: 'balance',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n });\n}\n"],"names":["RegistryType","CheatCodes","TRANSFER_SIGNATURE","events","bytes4","input","slice","isHex","keccak256","toHex","getDeployedContractAddress","config","hash","waitParams","receipt","waitForTransactionReceipt","NoContractAddressUponReceiptError","awaitResult","hashPromise","result","assertValidAddressByChainId","addressByChainId","desiredChainId","chainId","wagmiChainId","getChainId","wagmiAccount","getAccount","InvalidProtocolChainIdError","getErc20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AAc,IAAaC,EAAAD,GACvCE,IAAiB,QAEtBH,EAAiBG,CAAY,IAAaD,EAAAC,GAG5CD,IAAY,OAAW,CACnB,MAAAG,EAAeC,aAAWhB,CAAM,EAClCe,EAAa,UAAY,QAEvBL,EAAiBK,EAAa,OAAO,IACvCH,EAAUG,EAAa,QAE7B,CAII,GADAH,IAAY,SAAqBA,EAAO,UACxC,CAACF,EAAiBE,CAAO,EAC3B,MAAM,IAAIK,EAAA,4BACRL,EACA,OAAO,KAAKF,CAAgB,EAAE,IAAI,MAAM,CAAA,EAG5C,MAAO,CAAE,QAAAE,EAAS,QAASF,EAAiBE,CAAO,CAAG,CACxD,CAaA,eAAsBM,EACpBlB,EACAmB,EACAC,EACAC,EACA,CACO,OAAA,MAAMC,eAAatB,EAAQ,CAChC,GAAGqB,EACH,aAAc,YACd,QAASF,EACT,KAAM,CAACC,CAAK,EACZ,IAAK,CACH,CACE,SAAU,GACV,OAAQ,CACN,CACE,KAAM,SACN,KAAM,SACR,CACF,EACA,KAAM,YACN,QAAS,CACP,CACE,KAAM,UACN,KAAM,SACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,CACF,CAAA,CACD,CACH"}
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../src/utils.ts"],"sourcesContent":["import { events } from '@boostxyz/signatures';\nimport {\n type Config,\n type ReadContractParameters,\n type SimulateContractParameters,\n type WatchContractEventParameters,\n getAccount,\n getChainId,\n readContract,\n waitForTransactionReceipt,\n} from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport type {\n Abi,\n AbiEvent,\n Address,\n ContractEventName,\n ContractFunctionName,\n GetLogsParameters,\n Hash,\n Hex,\n Log,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport { isHex, keccak256, slice, toHex } from 'viem';\nimport {\n InvalidProtocolChainIdError,\n NoContractAddressUponReceiptError,\n} from './errors';\n\nexport type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;\n\n/**\n * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.\n *\n * @export\n * @enum {number}\n */\nexport enum RegistryType {\n ACTION = 0,\n ALLOW_LIST = 1,\n BUDGET = 2,\n INCENTIVE = 3,\n VALIDATOR = 4,\n}\n\n/**\n * Enum encapsulating all the different cheat codes for criteria modules.\n * An Event Action action step criteria with a `fieldIndex` set to `CheatCodes.ANY_ACTION_PARAM`, fieldType set to `PrimitiveType.BYTES`, and `filterType` set to `FilterType.EQUAL` will always return true when validating the field, regardless of inputs\n * An Event Action `ActionClaimant` with a `fieldIndex` set to `CheatCodes.TX_SENDER_CLAIMANT`, will always validate with the sender of a given transaction.\n *\n *\n * @export\n * @enum {number}\n */\nexport enum CheatCodes {\n /* An Event Action action step criteria with a `fieldIndex` set to `CheatCodes.ANY_ACTION_PARAM`, fieldType set to `PrimitiveType.BYTES`, and `filterType` set to `FilterType.EQUAL` will always return true when validating the field, regardless of inputs */\n ANY_ACTION_PARAM = 255,\n /* An Event Action `ActionClaimant` with a `fieldIndex` set to `CheatCodes.TX_SENDER_CLAIMANT`, will always validate with the sender of a given transaction. */\n TX_SENDER_CLAIMANT = 255,\n /* For use with `ERC20VariableCriteriaIncentive`, if the criteria's `fieldIndex` is set to `CheatCodes.GAS_REBATE_INCENTIVE`, will claim an incentive amount equal to the transaction's gas used. */\n GAS_REBATE_INCENTIVE = 255,\n}\n\n/**\n * The signature for the Transfer event for both ERC20 and ERC721.\n *\n * @type {Hex}\n */\nexport const TRANSFER_SIGNATURE = events.selectors[\n 'Transfer(address indexed,address indexed,uint256 indexed)'\n] as Hex;\n\n/**\n * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (writeContract)[https://viem.sh/docs/contract/writeContract]\n *\n * @export\n * @typedef {WriteParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type WriteParams = Partial<\n Omit<SimulateContractParameters, 'address' | 'args' | 'functionName' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (readContract)[https://viem.sh/docs/contract/readContract]\n *\n * @export\n * @typedef {ReadParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type ReadParams = Partial<\n Omit<ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `watchContractEvent` parameters without fields like `address`, and `abi` that are expected to be provided the SDK.\n * See (watchContractEvent)[https://wagmi.sh/core/api/actions/watchContractEvent]\n *\n * @export\n * @typedef {WatchParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi> | undefined} [eventName=undefined]\n */\nexport type WatchParams<\n abi extends Abi,\n eventName extends ContractEventName<abi> | undefined = undefined,\n> = Partial<\n Omit<WatchContractEventParameters<abi, eventName>, 'address' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `getLogs` parameters without fields like `address` that are expected to be provided the SDK.\n * See (getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]\n *\n * @export\n * @typedef {GetLogsParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} event\n * @template {ExtractAbiEvent<abi, event>} [abiEvent=ExtractAbiEvent<abi, event>]\n * @template {| readonly AbiEvent[]\n * | readonly unknown[]\n * | undefined} [abiEvents=abiEvent extends AbiEvent ? [abiEvent] : undefined]\n */\nexport type GetLogsParams<\n abi extends Abi,\n event extends ContractEventName<abi>,\n abiEvent extends ExtractAbiEvent<abi, event> = ExtractAbiEvent<abi, event>,\n abiEvents extends\n | readonly AbiEvent[]\n | readonly unknown[]\n | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined,\n> = Partial<Omit<GetLogsParameters<abiEvent, abiEvents>, 'address'>> & {\n chainId?: number | undefined;\n};\n\n/**\n * A generic `viem.Log` event with typed `args` support via a given `Abi` and `ContractEventName`\n *\n * @export\n * @typedef {GenericLog}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} [event=ContractEventName<abi>]\n */\nexport type GenericLog<\n abi extends Abi,\n event extends ContractEventName<abi> = ContractEventName<abi>,\n> = Log<bigint, number, false, ExtractAbiEvent<abi, event>, false>;\n\n/**\n * Helper utility to convert a string to a `bytes4` type\n *\n * @export\n * @param {string} input\n * @returns {Hex}\n */\nexport function bytes4(input: string) {\n return slice(isHex(input) ? keccak256(input) : keccak256(toHex(input)), 0, 4);\n}\n\n/**\n * Utility function to wait for a transaction receipt, and extract the contractAddress\n *\n * @export\n * @async\n * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {Promise<Hash>} hash - A transaction hash promise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}\n * @returns {Promise<Address>}\n * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received\n */\nexport async function getDeployedContractAddress(\n config: Config,\n hash: Promise<Hash>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n) {\n const receipt = await waitForTransactionReceipt(config, {\n ...waitParams,\n hash: await hash,\n });\n if (!receipt.contractAddress)\n throw new NoContractAddressUponReceiptError(receipt);\n return receipt.contractAddress;\n}\n\n/**\n * Utility type to encapsulate a transaction hash, and the simulated result prior to submitting the transaction.\n *\n * @export\n * @typedef {HashAndSimulatedResult}\n * @template [T=unknown]\n */\nexport type HashAndSimulatedResult<T = unknown> = { hash: Hash; result: T };\n\n/**\n * Helper function to wait for a transaction receipt given a hash promise.\n *\n * @export\n * @async\n * @template [Result=unknown]\n * @param {WagmiConfig} config\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\nexport async function awaitResult<Result = unknown>(\n config: Config,\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n): Promise<Result> {\n const { hash, result } = await hashPromise;\n await waitForTransactionReceipt(config, {\n ...waitParams,\n hash,\n });\n return result;\n}\n\n/**\n * Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.\n *\n * @export\n * @param {Config} config\n * @param {Record<string, Address>} addressByChainId\n * @param {number} desiredChainId\n * @returns {{ chainId: number, address: Address }}\n * @throws {@link InvalidProtocolChainIdError}\n */\nexport function assertValidAddressByChainId(\n config: Config,\n addressByChainId: Record<number, Address>,\n desiredChainId?: number,\n): { chainId: number; address: Address } {\n let chainId: number | undefined = undefined;\n\n const wagmiChainId = getChainId(config);\n if (wagmiChainId && addressByChainId[wagmiChainId]) chainId = wagmiChainId;\n // if manually providing a chain id for some contract operation, try to use it\n if (desiredChainId !== undefined) {\n if (addressByChainId[desiredChainId]) chainId = desiredChainId;\n } else if (wagmiChainId !== undefined) {\n // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it\n if (addressByChainId[wagmiChainId]) chainId = wagmiChainId;\n }\n // chainId is still undefined, try to get chain id off viem client\n if (chainId === undefined) {\n const wagmiAccount = getAccount(config);\n if (wagmiAccount.chainId !== undefined) {\n // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it\n if (addressByChainId[wagmiAccount.chainId])\n chainId = wagmiAccount.chainId;\n }\n }\n // if chainId is STILL undefined, use our default addresses\n // TODO: update this when on prod network\n if (chainId === undefined) chainId = Number(__DEFAULT_CHAIN_ID__);\n if (!addressByChainId[chainId])\n throw new InvalidProtocolChainIdError(\n chainId,\n Object.keys(addressByChainId).map(Number),\n );\n // biome-ignore lint/style/noNonNullAssertion: this type should be narrowed by the above statement but isn't?\n return { chainId, address: addressByChainId[chainId]! };\n}\n\n/**\n * Check an ERC20's balance for a given asset and\n *\n * @public\n * @async\n * @param {Config} [config]\n * @param {Address} [asset]\n * @param {Address} [owner]\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The erc20 balance\n */\nexport async function getErc20Balance(\n config: Config,\n asset: Address,\n owner: Address,\n params?: ReadParams,\n) {\n return await readContract(config, {\n ...params,\n functionName: 'balanceOf',\n address: asset,\n args: [owner],\n abi: [\n {\n constant: true,\n inputs: [\n {\n name: '_owner',\n type: 'address',\n },\n ],\n name: 'balanceOf',\n outputs: [\n {\n name: 'balance',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n });\n}\n"],"names":["RegistryType","CheatCodes","TRANSFER_SIGNATURE","events","bytes4","input","slice","isHex","keccak256","toHex","getDeployedContractAddress","config","hash","waitParams","receipt","waitForTransactionReceipt","NoContractAddressUponReceiptError","awaitResult","hashPromise","result","assertValidAddressByChainId","addressByChainId","desiredChainId","chainId","wagmiChainId","getChainId","wagmiAccount","getAccount","InvalidProtocolChainIdError","getErc20Balance","asset","owner","params","readContract"],"mappings":"49mBAsCY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,WAAa,CAAb,EAAA,aACAA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YALUA,IAAAA,GAAA,CAAA,CAAA,EAiBAC,GAAAA,IAEVA,EAAAA,EAAA,iBAAmB,GAAnB,EAAA,mBAEAA,EAAAA,EAAA,mBAAqB,GAArB,EAAA,qBAEAA,EAAAA,EAAA,qBAAuB,GAAvB,EAAA,uBANUA,IAAAA,GAAA,CAAA,CAAA,EAcC,MAAAC,EAAqBC,EAAO,UACvC,2DACF,EAyFO,SAASC,EAAOC,EAAe,CACpC,OAAOC,EAAM,MAAAC,EAAA,MAAMF,CAAK,EAAIG,EAAU,UAAAH,CAAK,EAAIG,EAAA,UAAUC,EAAM,MAAAJ,CAAK,CAAC,EAAG,EAAG,CAAC,CAC9E,CAasB,eAAAK,EACpBC,EACAC,EACAC,EACA,CACM,MAAAC,EAAU,MAAMC,EAAA,0BAA0BJ,EAA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