@boostxyz/sdk 7.8.0 → 8.0.0-canary.0
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/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +1 -1
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +4 -4
- package/dist/Actions/EventAction.js +97 -97
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/{AllowList-DiU7g4Hs.js → AllowList-CWqAYlwr.js} +28 -28
- package/dist/{AllowList-DiU7g4Hs.js.map → AllowList-CWqAYlwr.js.map} +1 -1
- package/dist/{AllowList-BJ9HQGFs.cjs → AllowList-Lpqz7tn9.cjs} +2 -2
- package/dist/{AllowList-BJ9HQGFs.cjs.map → AllowList-Lpqz7tn9.cjs.map} +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.js +8 -8
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +106 -23
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +518 -451
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +46 -46
- package/dist/{Budget-YIhV65cc.js → Budget-BPPXnBAK.js} +36 -36
- package/dist/{Budget-YIhV65cc.js.map → Budget-BPPXnBAK.js.map} +1 -1
- package/dist/{Budget-D_zhh1rh.cjs → Budget-rZm-AY09.cjs} +2 -2
- package/dist/{Budget-D_zhh1rh.cjs.map → Budget-rZm-AY09.cjs.map} +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.js +24 -24
- package/dist/Deployable/Contract.cjs +1 -1
- package/dist/Deployable/Contract.cjs.map +1 -1
- package/dist/Deployable/Contract.d.ts +8 -0
- package/dist/Deployable/Contract.d.ts.map +1 -1
- package/dist/Deployable/Contract.js +14 -4
- package/dist/Deployable/Contract.js.map +1 -1
- package/dist/Deployable/Deployable.cjs +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +7 -0
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +13 -4
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +7 -7
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +16 -16
- package/dist/{Incentive-CrnbYN_a.cjs → Incentive-Bse5BKbF.cjs} +2 -2
- package/dist/{Incentive-CrnbYN_a.cjs.map → Incentive-Bse5BKbF.cjs.map} +1 -1
- package/dist/{Incentive-CeoEla-t.js → Incentive-D1sYPD0W.js} +23 -23
- package/dist/{Incentive-CeoEla-t.js.map → Incentive-D1sYPD0W.js.map} +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.js +17 -17
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.js +38 -38
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.js +13 -13
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +6 -6
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js +22 -22
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts +6 -6
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +91 -91
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +6 -6
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +9 -9
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts +6 -6
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +9 -9
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +12 -12
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.js +2 -2
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.js +10 -10
- package/dist/{SimpleDenyList-Dr03aOeP.js → SimpleDenyList-BtEUdiAj.js} +14 -14
- package/dist/{SimpleDenyList-Dr03aOeP.js.map → SimpleDenyList-BtEUdiAj.js.map} +1 -1
- package/dist/{SimpleDenyList-7-VTqfsH.cjs → SimpleDenyList-DEoMIYhE.cjs} +2 -2
- package/dist/{SimpleDenyList-7-VTqfsH.cjs.map → SimpleDenyList-DEoMIYhE.cjs.map} +1 -1
- package/dist/{Validator-rYW7PMwW.cjs → Validator-DHS4vjSa.cjs} +2 -2
- package/dist/{Validator-rYW7PMwW.cjs.map → Validator-DHS4vjSa.cjs.map} +1 -1
- package/dist/{Validator-DgvB9wge.js → Validator-Kpvmj9Bs.js} +9 -9
- package/dist/{Validator-DgvB9wge.js.map → Validator-Kpvmj9Bs.js.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.js +17 -17
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +3 -3
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/{deployments-CHQ30INq.js → deployments-Coa8CGi2.js} +67 -67
- package/dist/{deployments-CHQ30INq.js.map → deployments-Coa8CGi2.js.map} +1 -1
- package/dist/{deployments-BjBgk03b.cjs → deployments-Dgzcz4Ev.cjs} +2 -2
- package/dist/deployments-Dgzcz4Ev.cjs.map +1 -0
- package/dist/deployments.json +46 -46
- package/dist/generated-BzLYuFx3.cjs +3 -0
- package/dist/generated-BzLYuFx3.cjs.map +1 -0
- package/dist/{generated-B6mEIx8i.js → generated-D6oDILUw.js} +250 -193
- package/dist/generated-D6oDILUw.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +16 -16
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/BoostCore.test.ts +34 -23
- package/src/BoostCore.ts +124 -26
- package/src/Deployable/Contract.ts +11 -0
- package/src/Deployable/Deployable.ts +10 -0
- package/src/utils.ts +0 -1
- package/dist/deployments-BjBgk03b.cjs.map +0 -1
- package/dist/generated-B6mEIx8i.js.map +0 -1
- package/dist/generated-dd4FN0Fo.cjs +0 -3
- package/dist/generated-dd4FN0Fo.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20PeggedVariableCriteriaIncentiveV2.js","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts"],"sourcesContent":["import {\n erc20PeggedVariableCriteriaIncentiveV2Abi,\n readErc20PeggedVariableCriteriaIncentiveV2Asset,\n readErc20PeggedVariableCriteriaIncentiveV2Claimed,\n readErc20PeggedVariableCriteriaIncentiveV2Claims,\n readErc20PeggedVariableCriteriaIncentiveV2CurrentReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria,\n readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetPeg,\n readErc20PeggedVariableCriteriaIncentiveV2IsClaimable,\n readErc20PeggedVariableCriteriaIncentiveV2Limit,\n readErc20PeggedVariableCriteriaIncentiveV2Owner,\n readErc20PeggedVariableCriteriaIncentiveV2Peg,\n readErc20PeggedVariableCriteriaIncentiveV2Reward,\n readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed,\n simulateErc20PeggedVariableCriteriaIncentiveV2Claim,\n simulateErc20PeggedVariableCriteriaIncentiveV2Clawback,\n writeErc20PeggedVariableCriteriaIncentiveV2Claim,\n writeErc20PeggedVariableCriteriaIncentiveV2Clawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedVariableCriteriaIncentiveV2.sol/ERC20PeggedVariableCriteriaIncentiveV2.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 zeroHash,\n} from 'viem';\nimport { ERC20PeggedVariableCriteriaIncentiveV2 as ERC20PeggedVariableCriteriaIncentiveV2Bases } from '../../dist/deployments.json';\nimport {\n SignatureType,\n decodeAndReorderLogArgs,\n getScalarValueFromTuple,\n isCriteriaFieldIndexTuple,\n} 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 GetIncentiveScalarV2Params,\n IncentiveCriteriaV2,\n} from './ERC20VariableCriteriaIncentiveV2';\n\nexport { erc20PeggedVariableCriteriaIncentiveV2Abi };\n\n/**\n * The object representation of a `Erc20PeggedVariableCriteriaIncentiveV2.InitPayload`\n *\n * @export\n * @interface Erc20PeggedVariableCriteriaIncentiveV2\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2}\n */\nexport interface ERC20PeggedVariableCriteriaIncentiveV2Payload {\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: IncentiveCriteriaV2;\n}\n\n/**\n * A generic `viem.Log` event with support for `Erc20PeggedVariableCriteriaIncentiveV2` event types.\n *\n * @export\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2Log}\n * @template {ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>} [event=ContractEventName<\n * typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n * >]\n */\nexport type Erc20PeggedVariableCriteriaIncentiveV2Log<\n event extends ContractEventName<\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n > = ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>,\n> = GenericLog<typeof erc20PeggedVariableCriteriaIncentiveV2Abi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class Erc20PeggedVariableCriteriaIncentive\n * @typedef {ERC20PeggedVariableCriteriaIncentiveV2}\n * @extends {DeployableTarget<ERC20PeggedVariableCriteriaIncentiveV2>}\n */\nexport class ERC20PeggedVariableCriteriaIncentiveV2 extends DeployableTarget<\n ERC20PeggedVariableCriteriaIncentiveV2Payload,\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n> {\n public override readonly abi = erc20PeggedVariableCriteriaIncentiveV2Abi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(import.meta.env?.VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE\n ? {\n 31337: import.meta.env\n .VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE,\n }\n : {}),\n ...(ERC20PeggedVariableCriteriaIncentiveV2Bases 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 readErc20PeggedVariableCriteriaIncentiveV2Owner(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 readErc20PeggedVariableCriteriaIncentiveV2CurrentReward(\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 readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\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, logs }: GetIncentiveScalarV2Params,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\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\n // if logs are provided, use them to extract the scalar\n if (logs && logs.length > 0) {\n try {\n // only check logs that match the criteria signature\n const signatureMatchingLogs = logs\n .filter((log) => log.topics && log.topics[0] === criteria.signature)\n .map((log) => decodeAndReorderLogArgs(eventAbi, log));\n\n if (signatureMatchingLogs.length > 0) {\n for (const log of signatureMatchingLogs) {\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n log.args as unknown[],\n criteria.fieldIndex,\n );\n }\n const scalarValue = log.args\n ? (log.args as string[])[criteria.fieldIndex]\n : undefined;\n if (scalarValue !== undefined) {\n return BigInt(scalarValue);\n }\n }\n }\n } catch (e) {\n throw new DecodedArgsError(\n `An error occurred while extracting scalar from logs: ${(e as Error).message}`,\n );\n }\n }\n\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n const receiptLogs = transactionReceipt.logs;\n\n if (receiptLogs.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 const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs: receiptLogs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedEvents[0]?.args as unknown[],\n criteria.fieldIndex,\n );\n }\n\n const scalarValue =\n decodedEvents[0] && decodedEvents[0].args\n ? (decodedEvents[0].args as string[])[criteria.fieldIndex]\n : undefined;\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\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedFunction.args as unknown[],\n criteria.fieldIndex,\n );\n }\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 readErc20PeggedVariableCriteriaIncentiveV2Claims(\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 * 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 readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed(\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 readErc20PeggedVariableCriteriaIncentiveV2Claimed(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2Asset(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 readErc20PeggedVariableCriteriaIncentiveV2Peg(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 readErc20PeggedVariableCriteriaIncentiveV2Reward(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2Limit(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 simulateErc20PeggedVariableCriteriaIncentiveV2Claim(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 writeErc20PeggedVariableCriteriaIncentiveV2Claim(\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 simulateErc20PeggedVariableCriteriaIncentiveV2Clawback(\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 writeErc20PeggedVariableCriteriaIncentiveV2Clawback(\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 readErc20PeggedVariableCriteriaIncentiveV2IsClaimable(\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 readErc20PeggedVariableCriteriaIncentiveV2GetPeg(\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 * 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<IncentiveCriteriaV2> {\n try {\n const criteria =\n await readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria(\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 * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing\n * the existing `limit` field by `netAmount`. The entire payload is then re-encoded\n * via `prepareERC20PeggedIncentivePayload(...)`.\n *\n * @public\n * @param {bigint} netAmount - The additional limit to add to this incentive.\n * @returns {Hex} The ABI-encoded payload with the updated `limit`.\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n return prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset: (await this.asset()) ?? zeroAddress,\n peg: this.payload?.peg ?? zeroAddress,\n reward: this.payload?.reward ?? 0n,\n limit: netAmount,\n maxReward: this.payload?.maxReward ?? 0n,\n manager: this.payload?.manager ?? zeroAddress,\n criteria: this.payload?.criteria ?? {\n criteriaType: 0,\n signature: zeroHash,\n fieldIndex: 0,\n targetContract: zeroAddress,\n valueType: 0,\n },\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedVariableCriteriaIncentiveV2Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedVariableCriteriaIncentiveV2Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedVariableCriteriaIncentiveV2Abi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedVariableCriteriaIncentiveV2Payload(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 ERC20PeggedVariableCriteriaIncentiveV2Payload.\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 ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {Promise<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 ERC20PeggedVariableCriteriaIncentiveV2, 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 ERC20PeggedVariableCriteriaIncentiveV2Payload}, properly encode a `ERC20PeggedVariableCriteriaIncentiveV2Payload.InitPayload` for use with {@link ERC20PeggedVariableCriteriaIncentiveV2Payload} initialization.\n *\n * @param {ERC20PeggedVariableCriteriaIncentiveV2Payload} 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 prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset,\n peg,\n reward,\n limit,\n maxReward = 0n,\n manager = zeroAddress,\n criteria,\n}: ERC20PeggedVariableCriteriaIncentiveV2Payload) {\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 { type: 'uint8', name: 'valueType' },\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 valueType: criteria.valueType,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20PeggedVariableCriteriaIncentiveV2","DeployableTarget","erc20PeggedVariableCriteriaIncentiveV2Abi","params","readErc20PeggedVariableCriteriaIncentiveV2Owner","readErc20PeggedVariableCriteriaIncentiveV2CurrentReward","readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward","chainId","hash","knownSignatures","logs","criteria","SignatureType","eventAbi","CheatCodes","transactionReceipt","getTransactionReceipt","signatureMatchingLogs","log","decodeAndReorderLogArgs","isCriteriaFieldIndexTuple","getScalarValueFromTuple","scalarValue","e","DecodedArgsError","receiptLogs","NoMatchingLogsError","decodedEvents","parseEventLogs","_a","transaction","getTransaction","func","decodedFunction","decodeFunctionData","InvalidCriteriaTypeError","readErc20PeggedVariableCriteriaIncentiveV2Claims","readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed","address","readErc20PeggedVariableCriteriaIncentiveV2Claimed","readErc20PeggedVariableCriteriaIncentiveV2Asset","readErc20PeggedVariableCriteriaIncentiveV2Peg","readErc20PeggedVariableCriteriaIncentiveV2Reward","readErc20PeggedVariableCriteriaIncentiveV2Limit","payload","request","result","simulateErc20PeggedVariableCriteriaIncentiveV2Claim","prepareClaimPayload","writeErc20PeggedVariableCriteriaIncentiveV2Claim","simulateErc20PeggedVariableCriteriaIncentiveV2Clawback","writeErc20PeggedVariableCriteriaIncentiveV2Clawback","readErc20PeggedVariableCriteriaIncentiveV2IsClaimable","readErc20PeggedVariableCriteriaIncentiveV2GetPeg","totalClaimed","limit","readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria","IncentiveCriteriaNotFoundError","netAmount","prepareERC20PeggedVariableCriteriaIncentiveV2Payload","zeroAddress","_b","_c","_d","_e","zeroHash","_payload","_options","options","bytecode","amount","encodeAbiParameters","signedAmount","claimData","boostClaimData","decodeAbiParameters","claimAmount","reward","maxReward","parseEther","__vite_import_meta_env__","ERC20PeggedVariableCriteriaIncentiveV2Bases","RegistryType","ERC20PeggedVariableCriteriaIncentiveV2","asset","peg","manager"],"mappings":";;;;;;;;;w3jBAiJaA,IAAN,MAAMA,UAA+CC,EAG1D;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkC/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAgD,KAAK,SAAS;AAAA,MACzE,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;AAC9C,WAAO,MAAME;AAAAA,MACX,KAAK;AAAA,MACL;AAAA,QACE,SAAS,KAAK,mBAAmB;AAAA,QACjC,MAAM,CAAC;AAAA;AAAA,QAEP,GAAIF;AAAA,MACN;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,aAAaA,GAAsC;AAUvD,WARL,MAAMG;AAAAA,MACJ,KAAK;AAAA,MACL;AAAA,QACE,GAAGH;AAAA,QACH,SAAS,KAAK,mBAAmB;AAAA,MACnC;AAAA,IAAA;AAAA,EAIN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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D;AACF,GAAkD;AACzC,SAAA4D;AAAA,IACL;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,YAAY;AAAA,UACV,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,UACjC,EAAE,MAAM,WAAW,MAAM,MAAM;AAAA,UAC/B,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,UAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,UACjC,EAAE,MAAM,WAAW,MAAM,UAAU;AAAA,UACnC,EAAE,MAAM,WAAW,MAAM,YAAY;AAAA,UACrC;AAAA,YACE,MAAM;AAAA,YACN,MAAM;AAAA,YACN,YAAY;AAAA,cACV,EAAE,MAAM,SAAS,MAAM,eAAe;AAAA,cACtC,EAAE,MAAM,WAAW,MAAM,YAAY;AAAA,cACrC,EAAE,MAAM,SAAS,MAAM,aAAa;AAAA,cACpC,EAAE,MAAM,WAAW,MAAM,iBAAiB;AAAA,cAC1C,EAAE,MAAM,SAAS,MAAM,YAAY;AAAA,YACrC;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE,OAAAa;AAAA,QACA,KAAAC;AAAA,QACA,QAAAR;AAAA,QACA,OAAAtB;AAAA,QACA,SAAA+B;AAAA,QACA,WAAAR;AAAA,QACA,UAAU;AAAA,UACR,cAAcnE,EAAS;AAAA,UACvB,WAAWA,EAAS;AAAA,UACpB,YAAYA,EAAS;AAAA,UACrB,gBAAgBA,EAAS;AAAA,UACzB,WAAWA,EAAS;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ERC20PeggedVariableCriteriaIncentiveV2.js","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts"],"sourcesContent":["import {\n erc20PeggedVariableCriteriaIncentiveV2Abi,\n readErc20PeggedVariableCriteriaIncentiveV2Asset,\n readErc20PeggedVariableCriteriaIncentiveV2Claimed,\n readErc20PeggedVariableCriteriaIncentiveV2Claims,\n readErc20PeggedVariableCriteriaIncentiveV2CurrentReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria,\n readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetPeg,\n readErc20PeggedVariableCriteriaIncentiveV2IsClaimable,\n readErc20PeggedVariableCriteriaIncentiveV2Limit,\n readErc20PeggedVariableCriteriaIncentiveV2Owner,\n readErc20PeggedVariableCriteriaIncentiveV2Peg,\n readErc20PeggedVariableCriteriaIncentiveV2Reward,\n readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed,\n simulateErc20PeggedVariableCriteriaIncentiveV2Claim,\n simulateErc20PeggedVariableCriteriaIncentiveV2Clawback,\n writeErc20PeggedVariableCriteriaIncentiveV2Claim,\n writeErc20PeggedVariableCriteriaIncentiveV2Clawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedVariableCriteriaIncentiveV2.sol/ERC20PeggedVariableCriteriaIncentiveV2.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 zeroHash,\n} from 'viem';\nimport { ERC20PeggedVariableCriteriaIncentiveV2 as ERC20PeggedVariableCriteriaIncentiveV2Bases } from '../../dist/deployments.json';\nimport {\n SignatureType,\n decodeAndReorderLogArgs,\n getScalarValueFromTuple,\n isCriteriaFieldIndexTuple,\n} 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 GetIncentiveScalarV2Params,\n IncentiveCriteriaV2,\n} from './ERC20VariableCriteriaIncentiveV2';\n\nexport { erc20PeggedVariableCriteriaIncentiveV2Abi };\n\n/**\n * The object representation of a `Erc20PeggedVariableCriteriaIncentiveV2.InitPayload`\n *\n * @export\n * @interface Erc20PeggedVariableCriteriaIncentiveV2\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2}\n */\nexport interface ERC20PeggedVariableCriteriaIncentiveV2Payload {\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: IncentiveCriteriaV2;\n}\n\n/**\n * A generic `viem.Log` event with support for `Erc20PeggedVariableCriteriaIncentiveV2` event types.\n *\n * @export\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2Log}\n * @template {ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>} [event=ContractEventName<\n * typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n * >]\n */\nexport type Erc20PeggedVariableCriteriaIncentiveV2Log<\n event extends ContractEventName<\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n > = ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>,\n> = GenericLog<typeof erc20PeggedVariableCriteriaIncentiveV2Abi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class Erc20PeggedVariableCriteriaIncentive\n * @typedef {ERC20PeggedVariableCriteriaIncentiveV2}\n * @extends {DeployableTarget<ERC20PeggedVariableCriteriaIncentiveV2>}\n */\nexport class ERC20PeggedVariableCriteriaIncentiveV2 extends DeployableTarget<\n ERC20PeggedVariableCriteriaIncentiveV2Payload,\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n> {\n public override readonly abi = erc20PeggedVariableCriteriaIncentiveV2Abi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(import.meta.env?.VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE\n ? {\n 31337: import.meta.env\n .VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE,\n }\n : {}),\n ...(ERC20PeggedVariableCriteriaIncentiveV2Bases 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 readErc20PeggedVariableCriteriaIncentiveV2Owner(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 readErc20PeggedVariableCriteriaIncentiveV2CurrentReward(\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 readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\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, logs }: GetIncentiveScalarV2Params,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\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\n // if logs are provided, use them to extract the scalar\n if (logs && logs.length > 0) {\n try {\n // only check logs that match the criteria signature\n const signatureMatchingLogs = logs\n .filter((log) => log.topics && log.topics[0] === criteria.signature)\n .map((log) => decodeAndReorderLogArgs(eventAbi, log));\n\n if (signatureMatchingLogs.length > 0) {\n for (const log of signatureMatchingLogs) {\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n log.args as unknown[],\n criteria.fieldIndex,\n );\n }\n const scalarValue = log.args\n ? (log.args as string[])[criteria.fieldIndex]\n : undefined;\n if (scalarValue !== undefined) {\n return BigInt(scalarValue);\n }\n }\n }\n } catch (e) {\n throw new DecodedArgsError(\n `An error occurred while extracting scalar from logs: ${(e as Error).message}`,\n );\n }\n }\n\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n const receiptLogs = transactionReceipt.logs;\n\n if (receiptLogs.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 const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs: receiptLogs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedEvents[0]?.args as unknown[],\n criteria.fieldIndex,\n );\n }\n\n const scalarValue =\n decodedEvents[0] && decodedEvents[0].args\n ? (decodedEvents[0].args as string[])[criteria.fieldIndex]\n : undefined;\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\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedFunction.args as unknown[],\n criteria.fieldIndex,\n );\n }\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 readErc20PeggedVariableCriteriaIncentiveV2Claims(\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 * 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 readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed(\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 readErc20PeggedVariableCriteriaIncentiveV2Claimed(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2Asset(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 readErc20PeggedVariableCriteriaIncentiveV2Peg(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 readErc20PeggedVariableCriteriaIncentiveV2Reward(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2Limit(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 simulateErc20PeggedVariableCriteriaIncentiveV2Claim(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 writeErc20PeggedVariableCriteriaIncentiveV2Claim(\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 simulateErc20PeggedVariableCriteriaIncentiveV2Clawback(\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 writeErc20PeggedVariableCriteriaIncentiveV2Clawback(\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 readErc20PeggedVariableCriteriaIncentiveV2IsClaimable(\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 readErc20PeggedVariableCriteriaIncentiveV2GetPeg(\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 * 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<IncentiveCriteriaV2> {\n try {\n const criteria =\n await readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria(\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 * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing\n * the existing `limit` field by `netAmount`. The entire payload is then re-encoded\n * via `prepareERC20PeggedIncentivePayload(...)`.\n *\n * @public\n * @param {bigint} netAmount - The additional limit to add to this incentive.\n * @returns {Hex} The ABI-encoded payload with the updated `limit`.\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n return prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset: (await this.asset()) ?? zeroAddress,\n peg: this.payload?.peg ?? zeroAddress,\n reward: this.payload?.reward ?? 0n,\n limit: netAmount,\n maxReward: this.payload?.maxReward ?? 0n,\n manager: this.payload?.manager ?? zeroAddress,\n criteria: this.payload?.criteria ?? {\n criteriaType: 0,\n signature: zeroHash,\n fieldIndex: 0,\n targetContract: zeroAddress,\n valueType: 0,\n },\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedVariableCriteriaIncentiveV2Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedVariableCriteriaIncentiveV2Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedVariableCriteriaIncentiveV2Abi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedVariableCriteriaIncentiveV2Payload(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 ERC20PeggedVariableCriteriaIncentiveV2Payload.\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 ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {Promise<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 ERC20PeggedVariableCriteriaIncentiveV2, 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 ERC20PeggedVariableCriteriaIncentiveV2Payload}, properly encode a `ERC20PeggedVariableCriteriaIncentiveV2Payload.InitPayload` for use with {@link ERC20PeggedVariableCriteriaIncentiveV2Payload} initialization.\n *\n * @param {ERC20PeggedVariableCriteriaIncentiveV2Payload} 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 prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset,\n peg,\n reward,\n limit,\n maxReward = 0n,\n manager = zeroAddress,\n criteria,\n}: ERC20PeggedVariableCriteriaIncentiveV2Payload) {\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 { type: 'uint8', name: 'valueType' },\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 valueType: criteria.valueType,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20PeggedVariableCriteriaIncentiveV2","DeployableTarget","erc20PeggedVariableCriteriaIncentiveV2Abi","params","readErc20PeggedVariableCriteriaIncentiveV2Owner","readErc20PeggedVariableCriteriaIncentiveV2CurrentReward","readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward","chainId","hash","knownSignatures","logs","criteria","SignatureType","eventAbi","CheatCodes","transactionReceipt","getTransactionReceipt","signatureMatchingLogs","log","decodeAndReorderLogArgs","isCriteriaFieldIndexTuple","getScalarValueFromTuple","scalarValue","e","DecodedArgsError","receiptLogs","NoMatchingLogsError","decodedEvents","parseEventLogs","_a","transaction","getTransaction","func","decodedFunction","decodeFunctionData","InvalidCriteriaTypeError","readErc20PeggedVariableCriteriaIncentiveV2Claims","readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed","address","readErc20PeggedVariableCriteriaIncentiveV2Claimed","readErc20PeggedVariableCriteriaIncentiveV2Asset","readErc20PeggedVariableCriteriaIncentiveV2Peg","readErc20PeggedVariableCriteriaIncentiveV2Reward","readErc20PeggedVariableCriteriaIncentiveV2Limit","payload","request","result","simulateErc20PeggedVariableCriteriaIncentiveV2Claim","prepareClaimPayload","writeErc20PeggedVariableCriteriaIncentiveV2Claim","simulateErc20PeggedVariableCriteriaIncentiveV2Clawback","writeErc20PeggedVariableCriteriaIncentiveV2Clawback","readErc20PeggedVariableCriteriaIncentiveV2IsClaimable","readErc20PeggedVariableCriteriaIncentiveV2GetPeg","totalClaimed","limit","readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria","IncentiveCriteriaNotFoundError","netAmount","prepareERC20PeggedVariableCriteriaIncentiveV2Payload","zeroAddress","_b","_c","_d","_e","zeroHash","_payload","_options","options","bytecode","amount","encodeAbiParameters","signedAmount","claimData","boostClaimData","decodeAbiParameters","claimAmount","reward","maxReward","parseEther","__vite_import_meta_env__","ERC20PeggedVariableCriteriaIncentiveV2Bases","RegistryType","ERC20PeggedVariableCriteriaIncentiveV2","asset","peg","manager"],"mappings":";;;;;;;;;k8jBAiJaA,IAAN,MAAMA,UAA+CC,EAG1D;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkC/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAgD,KAAK,SAAS;AAAA,MACzE,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;AAC9C,WAAO,MAAME;AAAAA,MACX,KAAK;AAAA,MACL;AAAA,QACE,SAAS,KAAK,mBAAmB;AAAA,QACjC,MAAM,CAAC;AAAA;AAAA,QAEP,GAAIF;AAAA,MACN;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,aAAaA,GAAsC;AAUvD,WARL,MAAMG;AAAAA,MACJ,KAAK;AAAA,MACL;AAAA,QACE,GAAGH;AAAA,QACH,SAAS,KAAK,mBAAmB;AAAA,MACnC;AAAA,IAAA;AAAA,EAIN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,mBACX,EAAE,SAAAI,GAAS,MAAAC,GAAM,iBAAAC,GAAiB,MAAAC,KAClCP,GACiB;;AACjB,UAAMQ,IAAW,MAAM,KAAK,qBAAqBR,CAAM;AACnD,QAAAQ,EAAS,iBAAiBC,EAAc,OAAO;AAC3C,YAAAC,IAAWJ,EAAgBE,EAAS,SAAS;AA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;AAAA,UAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,UACjC,EAAE,MAAM,WAAW,MAAM,UAAU;AAAA,UACnC,EAAE,MAAM,WAAW,MAAM,YAAY;AAAA,UACrC;AAAA,YACE,MAAM;AAAA,YACN,MAAM;AAAA,YACN,YAAY;AAAA,cACV,EAAE,MAAM,SAAS,MAAM,eAAe;AAAA,cACtC,EAAE,MAAM,WAAW,MAAM,YAAY;AAAA,cACrC,EAAE,MAAM,SAAS,MAAM,aAAa;AAAA,cACpC,EAAE,MAAM,WAAW,MAAM,iBAAiB;AAAA,cAC1C,EAAE,MAAM,SAAS,MAAM,YAAY;AAAA,YACrC;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE,OAAAa;AAAA,QACA,KAAAC;AAAA,QACA,QAAAR;AAAA,QACA,OAAAtB;AAAA,QACA,SAAA+B;AAAA,QACA,WAAAR;AAAA,QACA,UAAU;AAAA,UACR,cAAcnE,EAAS;AAAA,UACvB,WAAWA,EAAS;AAAA,UACpB,YAAYA,EAAS;AAAA,UACrB,gBAAgBA,EAAS;AAAA,UACzB,WAAWA,EAAS;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../generated-dd4FN0Fo.cjs"),m=require("@wagmi/core"),t=require("viem"),h=require("../deployments-BjBgk03b.cjs"),g=require("../Actions/EventAction.cjs"),c=require("../errors.cjs"),I=require("../utils.cjs"),w=require("./ERC20VariableIncentive.cjs"),A="0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6120aa806100895f395ff3fe608060405260043610610277575f3560e01c8063715018a61161014b578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b14610703578063fe9fbb8014610716578063fee81cf414610735575f80fd5b8063ec87621c146106dc578063f04e283e146106f0575f80fd5b8063db09da12116100ac578063db09da1214610689578063dcc21361146106a8578063dcc59b6f146106c7575f80fd5b8063c884ef8314610646578063d54ad2a114610674575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf146105f4578063be4994f814610613578063c213f3f914610632575f80fd5b8063a4d66daf146105be578063a871ced2146105d3575f80fd5b8063715018a61461053857806375b238fc1461054057806377548687146105545780638da5cb5b146105a6575f80fd5b806330db555f116101f55780634a4ee7b1116101ab578063514e62fc11610191578063514e62fc146104e657806354d1f13d1461051b57806366a78e6c14610523575f80fd5b80634a4ee7b1146104a75780634e7165a2146104ba575f80fd5b80634359d28a116101db5780634359d28a14610420578063439fab911461043f578063474f5a441461045e575f80fd5b806330db555f146103b057806338d52e0f146103cf575f80fd5b80631cd64df41161024a5780632569296211610230578063256929621461033d57806328d6183b146103455780632de948071461037f575f80fd5b80631cd64df4146102f4578063228cb73314610329575f80fd5b806301ffc9a71461027b57806307621eca146102af578063183a4f6e146102cc5780631c10893f146102e1575b5f80fd5b348015610286575f80fd5b5061029a61029536600461180a565b610766565b60405190151581526020015b60405180910390f35b3480156102ba575f80fd5b505f545b6040519081526020016102a6565b6102df6102da366004611850565b6107c1565b005b6102df6102ef366004611888565b6107ce565b3480156102ff575f80fd5b5061029a61030e366004611888565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610334575f80fd5b506102be5f5481565b6102df6107e4565b348015610350575f80fd5b506040517f52b8e45c0000000000000000000000000000000000000000000000000000000081526020016102a6565b34801561038a575f80fd5b506102be6103993660046118b2565b638b78c6d8600c9081525f91909152602090205490565b3480156103bb575f80fd5b506102df6103ca366004611850565b610831565b3480156103da575f80fd5b506003546103fb9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102a6565b34801561042b575f80fd5b506102df61043a366004611915565b6108ed565b34801561044a575f80fd5b506102df6104593660046119bf565b6109e7565b348015610469575f80fd5b5061047d6104783660046119bf565b610cd1565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102a6565b6102df6104b5366004611888565b610e33565b3480156104c5575f80fd5b506104d96104d43660046119bf565b610e45565b6040516102a69190611a4a565b3480156104f1575f80fd5b5061029a610500366004611888565b638b78c6d8600c9081525f9290925260209091205416151590565b6102df610f2e565b34801561052e575f80fd5b506102be60065481565b6102df610f67565b34801561054b575f80fd5b506102be600281565b34801561055f575f80fd5b506007546008546009546105969260ff908116929190811690610100900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102a69493929190611a9d565b3480156105b1575f80fd5b50638b78c6d819546103fb565b3480156105c9575f80fd5b506102be60025481565b3480156105de575f80fd5b506105e7610f7a565b6040516102a69190611b25565b3480156105ff575f80fd5b5061029a61060e366004611b33565b611014565b34801561061e575f80fd5b506102df61062d366004611915565b611245565b34801561063d575f80fd5b506006546102be565b348015610651575f80fd5b5061029a6106603660046118b2565b60016020525f908152604090205460ff1681565b34801561067f575f80fd5b506102be60055481565b348015610694575f80fd5b5061029a6106a3366004611b33565b6112e3565b3480156106b3575f80fd5b506102df6106c2366004611915565b6112f9565b3480156106d2575f80fd5b506102be60045481565b3480156106e7575f80fd5b506102be600181565b6102df6106fe3660046118b2565b611397565b6102df6107113660046118b2565b6113d1565b348015610721575f80fd5b5061029a6107303660046118b2565b6113f7565b348015610740575f80fd5b506102be61074f3660046118b2565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f52b8e45c0000000000000000000000000000000000000000000000000000000014806107bb57506107bb82611456565b92915050565b6107cb33826114ab565b50565b6107d66114b6565b6107e082826114d0565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161083c816114dc565b815f03610875576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035461089a9073ffffffffffffffffffffffffffffffffffffffff1633308561150d565b8160025f8282546108ab9190611bb1565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026108f8816114dc565b838214610931576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df575f84848381811061094e5761094e611bc4565b90506020020160208101906109639190611bf1565b90508015156001036109a5576109a087878481811061098457610984611bc4565b905060200201602081019061099991906118b2565b60016114d0565b6109d6565b6109d68787848181106109ba576109ba611bc4565b90506020020160208101906109cf91906118b2565b60016114ab565b50600101610933565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610a385760018160011c14303b10610a2f5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610a4683850185611cac565b805160208201516040830151606084015160808501519495509293919290915f839003610a9f576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ac073ffffffffffffffffffffffffffffffffffffffff87163061156f565b905083811015610b295786516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810185905260640160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555f8581556002859055600684905560055581516007805484929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610bba57610bba611a5c565b02179055506020820151600182015560408201516002909101805460609093015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090931660ff90921691909117919091179055610c31336115a2565b610c3c3360016115ea565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610c889493929190611d83565b60405180910390a2505050505050508015610ccc576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610cde816114dc565b5f610ceb85870187611e57565b90505f8160200151806020019051810190610d069190611ed6565b90508060025f828254610d199190611eed565b90915550508151600354610d469173ffffffffffffffffffffffffffffffffffffffff909116908361162b565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610e0491611a4a565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610e3b6114b6565b6107e082826114ab565b60605f80610e5584860186611f00565b9250509150604051806080016040528060016002811115610e7857610e78611a5c565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610ed79151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610f159190602001611f32565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610f6f6114b6565b610f785f61167e565b565b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810190915260078054829060ff166001811115610fc257610fc2611a5c565b6001811115610fd357610fd3611a5c565b81526001820154602082015260029091015460ff81166040830152610100900473ffffffffffffffffffffffffffffffffffffffff16606090910152919050565b5f61101d6114b6565b5f61102a83850185611fa8565b90505f81602001518060200190518101906110459190611ed6565b90505f6110556002546005541090565b61108b576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f545f0361109a5750806110bd565b670de0b6b3a7640000825f546110b09190612025565b6110ba919061203c565b90505b600654158015906110cf575060065481115b156110d957506006545b600254816005546110ea9190611bb1565b1115611122576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546111339190611bb1565b92505081905550600160045f82825461114c9190611bb1565b90915550506003546111759073ffffffffffffffffffffffffffffffffffffffff16888361162b565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261123091611a4a565b60405180910390a25060019695505050505050565b6002611250816114dc565b838214611289576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df576112db8686838181106112a8576112a8611bc4565b90506020020160208101906112bd91906118b2565b8585848181106112cf576112cf611bc4565b905060200201356114d0565b60010161128b565b5f6112f16002546005541090565b949350505050565b6002611304816114dc565b83821461133d576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df5761138f86868381811061135c5761135c611bc4565b905060200201602081019061137191906118b2565b85858481811061138357611383611bc4565b905060200201356114ab565b60010161133f565b61139f6114b6565b63389a75e1600c52805f526020600c2080544211156113c557636f5e88185f526004601cfd5b5f90556107cb8161167e565b6113d96114b6565b8060601b6113ee57637448fbae5f526004601cfd5b6107cb8161167e565b5f8173ffffffffffffffffffffffffffffffffffffffff1661141c638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806107bb5750638b78c6d8600c9081525f839052602090205460031615156107bb565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f903181110000000000000000000000000000000000000000000000000000000014806107bb57506107bb826116c8565b6107e082825f61171d565b638b78c6d819543314610f78576382b429005f526004601cfd5b6107e08282600161171d565b638b78c6d8195433146107cb57638b78c6d8600c52335f52806020600c2054166107cb576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661156157803d873b15171061156157637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661167457803d853b151710611674576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa92167050000000000000000000000000000000000000000000000000000000014806107bb57506107bb82611774565b638b78c6d8600c52825f526020600c2080548381178361173e575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806107bb57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107bb565b5f6020828403121561181a575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611849575f80fd5b9392505050565b5f60208284031215611860575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146107cb575f80fd5b5f8060408385031215611899575f80fd5b82356118a481611867565b946020939093013593505050565b5f602082840312156118c2575f80fd5b813561184981611867565b5f8083601f8401126118dd575f80fd5b50813567ffffffffffffffff8111156118f4575f80fd5b6020830191508360208260051b850101111561190e575f80fd5b9250929050565b5f805f8060408587031215611928575f80fd5b843567ffffffffffffffff81111561193e575f80fd5b61194a878288016118cd565b909550935050602085013567ffffffffffffffff811115611969575f80fd5b611975878288016118cd565b95989497509550505050565b5f8083601f840112611991575f80fd5b50813567ffffffffffffffff8111156119a8575f80fd5b60208301915083602082850101111561190e575f80fd5b5f80602083850312156119d0575f80fd5b823567ffffffffffffffff8111156119e6575f80fd5b6119f285828601611981565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f61184960208301846119fe565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611a9957611a99611a5c565b9052565b60808101611aab8287611a89565b84602083015260ff8416604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b611aea828251611a89565b6020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301525050565b608081016107bb8284611adf565b5f805f60408486031215611b45575f80fd5b8335611b5081611867565b9250602084013567ffffffffffffffff811115611b6b575f80fd5b611b7786828701611981565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156107bb576107bb611b84565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611c01575f80fd5b81358015158114611849575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160a0810167ffffffffffffffff81118282101715611c6057611c60611c10565b60405290565b6040516080810167ffffffffffffffff81118282101715611c6057611c60611c10565b6040805190810167ffffffffffffffff81118282101715611c6057611c60611c10565b5f81830361010081128015611cbf575f80fd5b50611cc8611c3d565b8335611cd381611867565b815260208481013590820152604080850135908201526060808501359082015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083011215611d22575f80fd5b611d2a611c66565b9150608084013560028110611d3d575f80fd5b825260a0840135602083015260c084013560ff81168114611d5c575f80fd5b604083015260e0840135611d6f81611867565b606083015260808101919091529392505050565b848152602081018490526040810183905260e08101611da56060830184611adf565b95945050505050565b5f82601f830112611dbd575f80fd5b813567ffffffffffffffff811115611dd757611dd7611c10565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff81118282101715611e2457611e24611c10565b604052818152838201602001851015611e3b575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215611e67575f80fd5b813567ffffffffffffffff811115611e7d575f80fd5b820160408185031215611e8e575f80fd5b611e96611c89565b8135611ea181611867565b8152602082013567ffffffffffffffff811115611ebc575f80fd5b611ec886828501611dae565b602083015250949350505050565b5f60208284031215611ee6575f80fd5b5051919050565b818103818111156107bb576107bb611b84565b5f805f60608486031215611f12575f80fd5b8335611f1d81611867565b95602085013595506040909401359392505050565b602081525f825160038110611f4957611f49611a5c565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526112f160a08401826119fe565b5f60208284031215611fb8575f80fd5b813567ffffffffffffffff811115611fce575f80fd5b820160408185031215611fdf575f80fd5b611fe7611c89565b813567ffffffffffffffff811115611ffd575f80fd5b61200986828501611dae565b825250602082013567ffffffffffffffff811115611ebc575f80fd5b80820281158282048414176107bb576107bb611b84565b5f8261206f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea264697066735822122002cb02f574ade708d1d5aab7fb7184f2ca850079b21767cde9fb97481599ce8d64736f6c634300081a0033",l={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BOOST_MAINNET_SIGNER_EOA:"0xCBD0C302040bC803B4B2EDaF21Be0e49Deff5480",VITE_BOOST_TESTNET_SIGNER_EOA:"0xd63167e9db11B108940b2E8236581F961f33f396"},p=class p extends w.ERC20VariableIncentive{constructor(){super(...arguments),this.abi=u.c}async getIncentiveCriteria(e){try{return await u.DV(this._config,{...e,address:this.assertValidAddress()})}catch(a){throw new c.IncentiveCriteriaNotFoundError(a)}}async decodeClaimData(e){const a=t.decodeAbiParameters([{type:"tuple",name:"BoostClaimData",components:[{type:"bytes",name:"validatorData"},{type:"bytes",name:"incentiveData"}]}],e),d=t.decodeAbiParameters([{type:"uint256"}],a[0].incentiveData)[0];let b=d;const[f,i]=await Promise.all([this.reward(),this.getMaxReward()]);return f===0n||(b=f*d/t.parseEther("1"),i!==0n&&b>i&&(b=i)),b}async getMaxReward(e){return await u.qV(this._config,{...e,address:this.assertValidAddress()})}async getIncentiveScalar({chainId:e,hash:a,knownSignatures:d},b){var i;const f=await this.getIncentiveCriteria(b);if(f.criteriaType===g.SignatureType.EVENT){const r=await m.getTransactionReceipt(this._config,{chainId:e,hash:a});if(f.fieldIndex===I.CheatCodes.GAS_REBATE_INCENTIVE)return r.gasUsed*r.effectiveGasPrice+(r.blobGasUsed??0n)*(r.blobGasPrice??0n);const s=r.logs;if(s.length===0)throw new c.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);try{const o=d[f.signature],n=t.parseEventLogs({abi:[o],logs:s});if(n==null||n.length===0)throw new c.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);const y=((i=n[0])==null?void 0:i.args)[f.fieldIndex];if(y===void 0)throw new c.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(y)}catch(o){throw new c.DecodedArgsError(`Failed to decode event log for signature ${f.signature}: ${o.message}`)}}else if(f.criteriaType===g.SignatureType.FUNC){const r=await m.getTransaction(this._config,{chainId:e,hash:a});try{const s=d[f.signature],n=t.decodeFunctionData({abi:[s],data:r.input}).args[f.fieldIndex];if(n==null)throw new c.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(n)}catch(s){throw new c.DecodedArgsError(`Failed to decode function data for signature ${f.signature}: ${s.message}`)}}else throw new c.InvalidCriteriaTypeError(`Invalid criteria type ${f.criteriaType}`)}buildParameters(e,a){const[d,b]=this.validateDeploymentConfig(e,a);return{abi:u.c,bytecode:A,args:[C(d)],...this.optionallyAttachAccount(b.account)}}};p.bases={...l!=null&&l.VITE_ERC20_VARIABLE_CRITERIA_INCENTIVE_BASE?{31337:void 0}:{},...h.ERC20VariableCriteriaIncentive};let E=p;function v(){return{criteriaType:g.SignatureType.EVENT,signature:t.zeroHash,fieldIndex:I.CheatCodes.GAS_REBATE_INCENTIVE,targetContract:t.zeroAddress}}function C({asset:T,reward:e,limit:a,maxReward:d=0n,criteria:b}){return t.encodeAbiParameters([{type:"tuple",name:"initPayloadExtended",components:[{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"uint256",name:"maxReward"},{type:"tuple",name:"criteria",components:[{type:"uint8",name:"criteriaType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"}]}]}],[{asset:T,reward:e,limit:a,maxReward:d,criteria:{criteriaType:b.criteriaType,signature:b.signature,fieldIndex:b.fieldIndex,targetContract:b.targetContract}}])}exports.erc20VariableCriteriaIncentiveAbi=u.c;exports.ERC20VariableCriteriaIncentive=E;exports.gasRebateIncentiveCriteria=v;exports.prepareERC20VariableCriteriaIncentivePayload=C;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../generated-BzLYuFx3.cjs"),m=require("@wagmi/core"),t=require("viem"),h=require("../deployments-Dgzcz4Ev.cjs"),g=require("../Actions/EventAction.cjs"),c=require("../errors.cjs"),I=require("../utils.cjs"),w=require("./ERC20VariableIncentive.cjs"),A="0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6120c4806100895f395ff3fe608060405260043610610277575f3560e01c8063715018a61161014b578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b14610708578063fe9fbb801461071b578063fee81cf41461073a575f80fd5b8063ec87621c146106e1578063f04e283e146106f5575f80fd5b8063db09da12116100ac578063db09da121461068e578063dcc21361146106ad578063dcc59b6f146106cc575f80fd5b8063c884ef831461064b578063d54ad2a114610679575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf146105f9578063be4994f814610618578063c213f3f914610637575f80fd5b8063a4d66daf146105c3578063a871ced2146105d8575f80fd5b8063715018a61461053857806375b238fc1461054057806377548687146105545780638da5cb5b146105ab575f80fd5b806330db555f116101f55780634a4ee7b1116101ab578063514e62fc11610191578063514e62fc146104e657806354d1f13d1461051b57806366a78e6c14610523575f80fd5b80634a4ee7b1146104a75780634e7165a2146104ba575f80fd5b80634359d28a116101db5780634359d28a14610420578063439fab911461043f578063474f5a441461045e575f80fd5b806330db555f146103b057806338d52e0f146103cf575f80fd5b80631cd64df41161024a5780632569296211610230578063256929621461033d57806328d6183b146103455780632de948071461037f575f80fd5b80631cd64df4146102f4578063228cb73314610329575f80fd5b806301ffc9a71461027b57806307621eca146102af578063183a4f6e146102cc5780631c10893f146102e1575b5f80fd5b348015610286575f80fd5b5061029a61029536600461181b565b61076b565b60405190151581526020015b60405180910390f35b3480156102ba575f80fd5b505f545b6040519081526020016102a6565b6102df6102da366004611861565b6107c6565b005b6102df6102ef366004611899565b6107d3565b3480156102ff575f80fd5b5061029a61030e366004611899565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610334575f80fd5b506102be5f5481565b6102df6107e9565b348015610350575f80fd5b506040517f52b8e45c0000000000000000000000000000000000000000000000000000000081526020016102a6565b34801561038a575f80fd5b506102be6103993660046118c3565b638b78c6d8600c9081525f91909152602090205490565b3480156103bb575f80fd5b506102df6103ca366004611861565b610836565b3480156103da575f80fd5b506003546103fb9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102a6565b34801561042b575f80fd5b506102df61043a366004611926565b6108f2565b34801561044a575f80fd5b506102df6104593660046119d0565b6109ec565b348015610469575f80fd5b5061047d6104783660046119d0565b610cdc565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102a6565b6102df6104b5366004611899565b610e3e565b3480156104c5575f80fd5b506104d96104d43660046119d0565b610e50565b6040516102a69190611a5b565b3480156104f1575f80fd5b5061029a610500366004611899565b638b78c6d8600c9081525f9290925260209091205416151590565b6102df610f39565b34801561052e575f80fd5b506102be60065481565b6102df610f72565b34801561054b575f80fd5b506102be600281565b34801561055f575f80fd5b5060075460085460095461059b9260ff16919063ffffffff811690640100000000900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102a69493929190611aae565b3480156105b6575f80fd5b50638b78c6d819546103fb565b3480156105ce575f80fd5b506102be60025481565b3480156105e3575f80fd5b506105ec610f85565b6040516102a69190611b3c565b348015610604575f80fd5b5061029a610613366004611b4a565b611025565b348015610623575f80fd5b506102df610632366004611926565b611256565b348015610642575f80fd5b506006546102be565b348015610656575f80fd5b5061029a6106653660046118c3565b60016020525f908152604090205460ff1681565b348015610684575f80fd5b506102be60055481565b348015610699575f80fd5b5061029a6106a8366004611b4a565b6112f4565b3480156106b8575f80fd5b506102df6106c7366004611926565b61130a565b3480156106d7575f80fd5b506102be60045481565b3480156106ec575f80fd5b506102be600181565b6102df6107033660046118c3565b6113a8565b6102df6107163660046118c3565b6113e2565b348015610726575f80fd5b5061029a6107353660046118c3565b611408565b348015610745575f80fd5b506102be6107543660046118c3565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f52b8e45c0000000000000000000000000000000000000000000000000000000014806107c057506107c082611467565b92915050565b6107d033826114bc565b50565b6107db6114c7565b6107e582826114e1565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b6001610841816114ed565b815f0361087a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035461089f9073ffffffffffffffffffffffffffffffffffffffff1633308561151e565b8160025f8282546108b09190611bc8565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026108fd816114ed565b838214610936576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109e4575f84848381811061095357610953611bdb565b90506020020160208101906109689190611c08565b90508015156001036109aa576109a587878481811061098957610989611bdb565b905060200201602081019061099e91906118c3565b60016114e1565b6109db565b6109db8787848181106109bf576109bf611bdb565b90506020020160208101906109d491906118c3565b60016114bc565b50600101610938565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610a3d5760018160011c14303b10610a345763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610a4b83850185611cc3565b805160208201516040830151606084015160808501519495509293919290915f839003610aa4576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ac573ffffffffffffffffffffffffffffffffffffffff871630611580565b905083811015610b2e5786516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810185905260640160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555f8581556002859055600684905560055581516007805484929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610bbf57610bbf611a6d565b02179055506020820151600182015560408201516002909101805460609093015173ffffffffffffffffffffffffffffffffffffffff16640100000000027fffffffffffffffff00000000000000000000000000000000000000000000000090931663ffffffff90921691909117919091179055610c3c336115b3565b610c473360016115fb565b8573ffffffffffffffffffffffffffffffffffffffff167fcb128760e2036ec5ada1eb74cefc1106b2fa17cb84982a3bd46e75ded6e1355286868686604051610c939493929190611d9d565b60405180910390a2505050505050508015610cd7576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610ce9816114ed565b5f610cf685870187611e71565b90505f8160200151806020019051810190610d119190611ef0565b90508060025f828254610d249190611f07565b90915550508151600354610d519173ffffffffffffffffffffffffffffffffffffffff909116908361163c565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610e0f91611a5b565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610e466114c7565b6107e582826114bc565b60605f80610e6084860186611f1a565b9250509150604051806080016040528060016002811115610e8357610e83611a6d565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610ee29151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610f209190602001611f4c565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610f7a6114c7565b610f835f61168f565b565b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810190915260078054829060ff166001811115610fcd57610fcd611a6d565b6001811115610fde57610fde611a6d565b81526001820154602082015260029091015463ffffffff81166040830152640100000000900473ffffffffffffffffffffffffffffffffffffffff16606090910152919050565b5f61102e6114c7565b5f61103b83850185611fc2565b90505f81602001518060200190518101906110569190611ef0565b90505f6110666002546005541090565b61109c576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f545f036110ab5750806110ce565b670de0b6b3a7640000825f546110c1919061203f565b6110cb9190612056565b90505b600654158015906110e0575060065481115b156110ea57506006545b600254816005546110fb9190611bc8565b1115611133576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546111449190611bc8565b92505081905550600160045f82825461115d9190611bc8565b90915550506003546111869073ffffffffffffffffffffffffffffffffffffffff16888361163c565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261124191611a5b565b60405180910390a25060019695505050505050565b6002611261816114ed565b83821461129a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109e4576112ec8686838181106112b9576112b9611bdb565b90506020020160208101906112ce91906118c3565b8585848181106112e0576112e0611bdb565b905060200201356114e1565b60010161129c565b5f6113026002546005541090565b949350505050565b6002611315816114ed565b83821461134e576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109e4576113a086868381811061136d5761136d611bdb565b905060200201602081019061138291906118c3565b85858481811061139457611394611bdb565b905060200201356114bc565b600101611350565b6113b06114c7565b63389a75e1600c52805f526020600c2080544211156113d657636f5e88185f526004601cfd5b5f90556107d08161168f565b6113ea6114c7565b8060601b6113ff57637448fbae5f526004601cfd5b6107d08161168f565b5f8173ffffffffffffffffffffffffffffffffffffffff1661142d638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806107c05750638b78c6d8600c9081525f839052602090205460031615156107c0565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f903181110000000000000000000000000000000000000000000000000000000014806107c057506107c0826116d9565b6107e582825f61172e565b638b78c6d819543314610f83576382b429005f526004601cfd5b6107e58282600161172e565b638b78c6d8195433146107d057638b78c6d8600c52335f52806020600c2054166107d0576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661157257803d873b15171061157257637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661168557803d853b151710611685576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa92167050000000000000000000000000000000000000000000000000000000014806107c057506107c082611785565b638b78c6d8600c52825f526020600c2080548381178361174f575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806107c057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107c0565b5f6020828403121561182b575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461185a575f80fd5b9392505050565b5f60208284031215611871575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146107d0575f80fd5b5f80604083850312156118aa575f80fd5b82356118b581611878565b946020939093013593505050565b5f602082840312156118d3575f80fd5b813561185a81611878565b5f8083601f8401126118ee575f80fd5b50813567ffffffffffffffff811115611905575f80fd5b6020830191508360208260051b850101111561191f575f80fd5b9250929050565b5f805f8060408587031215611939575f80fd5b843567ffffffffffffffff81111561194f575f80fd5b61195b878288016118de565b909550935050602085013567ffffffffffffffff81111561197a575f80fd5b611986878288016118de565b95989497509550505050565b5f8083601f8401126119a2575f80fd5b50813567ffffffffffffffff8111156119b9575f80fd5b60208301915083602082850101111561191f575f80fd5b5f80602083850312156119e1575f80fd5b823567ffffffffffffffff8111156119f7575f80fd5b611a0385828601611992565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f61185a6020830184611a0f565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611aaa57611aaa611a6d565b9052565b60808101611abc8287611a9a565b84602083015263ffffffff8416604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b611afe828251611a9a565b6020810151602083015263ffffffff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301525050565b608081016107c08284611af3565b5f805f60408486031215611b5c575f80fd5b8335611b6781611878565b9250602084013567ffffffffffffffff811115611b82575f80fd5b611b8e86828701611992565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156107c0576107c0611b9b565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611c18575f80fd5b8135801515811461185a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160a0810167ffffffffffffffff81118282101715611c7757611c77611c27565b60405290565b6040516080810167ffffffffffffffff81118282101715611c7757611c77611c27565b6040805190810167ffffffffffffffff81118282101715611c7757611c77611c27565b5f81830361010081128015611cd6575f80fd5b50611cdf611c54565b8335611cea81611878565b815260208481013590820152604080850135908201526060808501359082015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083011215611d39575f80fd5b611d41611c7d565b9150608084013560028110611d54575f80fd5b825260a0840135602083015260c084013563ffffffff81168114611d76575f80fd5b604083015260e0840135611d8981611878565b606083015260808101919091529392505050565b848152602081018490526040810183905260e08101611dbf6060830184611af3565b95945050505050565b5f82601f830112611dd7575f80fd5b813567ffffffffffffffff811115611df157611df1611c27565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff81118282101715611e3e57611e3e611c27565b604052818152838201602001851015611e55575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215611e81575f80fd5b813567ffffffffffffffff811115611e97575f80fd5b820160408185031215611ea8575f80fd5b611eb0611ca0565b8135611ebb81611878565b8152602082013567ffffffffffffffff811115611ed6575f80fd5b611ee286828501611dc8565b602083015250949350505050565b5f60208284031215611f00575f80fd5b5051919050565b818103818111156107c0576107c0611b9b565b5f805f60608486031215611f2c575f80fd5b8335611f3781611878565b95602085013595506040909401359392505050565b602081525f825160038110611f6357611f63611a6d565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff6040840151166060830152606083015160808084015261130260a0840182611a0f565b5f60208284031215611fd2575f80fd5b813567ffffffffffffffff811115611fe8575f80fd5b820160408185031215611ff9575f80fd5b612001611ca0565b813567ffffffffffffffff811115612017575f80fd5b61202386828501611dc8565b825250602082013567ffffffffffffffff811115611ed6575f80fd5b80820281158282048414176107c0576107c0611b9b565b5f82612089577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220e2475c7ee1e007c43bb4210f84615ae1e938101c349f03686cade8733d8f7b7d64736f6c634300081a0033",l={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BOOST_MAINNET_SIGNER_EOA:"0xCBD0C302040bC803B4B2EDaF21Be0e49Deff5480",VITE_BOOST_TESTNET_SIGNER_EOA:"0xd63167e9db11B108940b2E8236581F961f33f396"},p=class p extends w.ERC20VariableIncentive{constructor(){super(...arguments),this.abi=u.m}async getIncentiveCriteria(e){try{return await u.XV(this._config,{...e,address:this.assertValidAddress()})}catch(a){throw new c.IncentiveCriteriaNotFoundError(a)}}async decodeClaimData(e){const a=t.decodeAbiParameters([{type:"tuple",name:"BoostClaimData",components:[{type:"bytes",name:"validatorData"},{type:"bytes",name:"incentiveData"}]}],e),d=t.decodeAbiParameters([{type:"uint256"}],a[0].incentiveData)[0];let b=d;const[f,i]=await Promise.all([this.reward(),this.getMaxReward()]);return f===0n||(b=f*d/t.parseEther("1"),i!==0n&&b>i&&(b=i)),b}async getMaxReward(e){return await u.YV(this._config,{...e,address:this.assertValidAddress()})}async getIncentiveScalar({chainId:e,hash:a,knownSignatures:d},b){var i;const f=await this.getIncentiveCriteria(b);if(f.criteriaType===g.SignatureType.EVENT){const r=await m.getTransactionReceipt(this._config,{chainId:e,hash:a});if(f.fieldIndex===I.CheatCodes.GAS_REBATE_INCENTIVE)return r.gasUsed*r.effectiveGasPrice+(r.blobGasUsed??0n)*(r.blobGasPrice??0n);const s=r.logs;if(s.length===0)throw new c.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);try{const o=d[f.signature],n=t.parseEventLogs({abi:[o],logs:s});if(n==null||n.length===0)throw new c.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);const y=((i=n[0])==null?void 0:i.args)[f.fieldIndex];if(y===void 0)throw new c.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(y)}catch(o){throw new c.DecodedArgsError(`Failed to decode event log for signature ${f.signature}: ${o.message}`)}}else if(f.criteriaType===g.SignatureType.FUNC){const r=await m.getTransaction(this._config,{chainId:e,hash:a});try{const s=d[f.signature],n=t.decodeFunctionData({abi:[s],data:r.input}).args[f.fieldIndex];if(n==null)throw new c.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(n)}catch(s){throw new c.DecodedArgsError(`Failed to decode function data for signature ${f.signature}: ${s.message}`)}}else throw new c.InvalidCriteriaTypeError(`Invalid criteria type ${f.criteriaType}`)}buildParameters(e,a){const[d,b]=this.validateDeploymentConfig(e,a);return{abi:u.m,bytecode:A,args:[C(d)],...this.optionallyAttachAccount(b.account)}}};p.bases={...l!=null&&l.VITE_ERC20_VARIABLE_CRITERIA_INCENTIVE_BASE?{31337:void 0}:{},...h.ERC20VariableCriteriaIncentive};let E=p;function v(){return{criteriaType:g.SignatureType.EVENT,signature:t.zeroHash,fieldIndex:I.CheatCodes.GAS_REBATE_INCENTIVE,targetContract:t.zeroAddress}}function C({asset:T,reward:e,limit:a,maxReward:d=0n,criteria:b}){return t.encodeAbiParameters([{type:"tuple",name:"initPayloadExtended",components:[{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"uint256",name:"maxReward"},{type:"tuple",name:"criteria",components:[{type:"uint8",name:"criteriaType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"}]}]}],[{asset:T,reward:e,limit:a,maxReward:d,criteria:{criteriaType:b.criteriaType,signature:b.signature,fieldIndex:b.fieldIndex,targetContract:b.targetContract}}])}exports.erc20VariableCriteriaIncentiveAbi=u.m;exports.ERC20VariableCriteriaIncentive=E;exports.gasRebateIncentiveCriteria=v;exports.prepareERC20VariableCriteriaIncentivePayload=C;
|
|
2
2
|
//# sourceMappingURL=ERC20VariableCriteriaIncentive.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20VariableCriteriaIncentive.cjs","sources":["../../src/Incentives/ERC20VariableCriteriaIncentive.ts"],"sourcesContent":["import {\n erc20VariableCriteriaIncentiveAbi,\n readErc20VariableCriteriaIncentiveGetIncentiveCriteria,\n readErc20VariableCriteriaIncentiveGetMaxReward,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableCriteriaIncentive.sol/ERC20VariableCriteriaIncentive.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport {\n type AbiEvent,\n type AbiFunction,\n type Address,\n type Hex,\n decodeAbiParameters,\n decodeFunctionData,\n encodeAbiParameters,\n parseEther,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20VariableCriteriaIncentive as ERC20VariableCriteriaIncentiveBases } from '../../dist/deployments.json';\nimport { SignatureType } from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport { CheatCodes, type ReadParams } from '../utils';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n\nexport { erc20VariableCriteriaIncentiveAbi };\n\nexport interface ERC20VariableCriteriaIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The amount of the asset to distribute as reward.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The total amount claimable in a single claim or maximum per-action reward.\n *\n * @type {bigint}\n * @optional\n */\n maxReward?: bigint;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteria;\n}\n\nexport interface IncentiveCriteria {\n /**\n * The type of criteria used, either function signature or event signature.\n *\n * @type {SignatureType}\n */\n criteriaType: SignatureType;\n /**\n * The function or event signature used for criteria matching.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index of the field from where the scalar value is extracted.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the contract where the event/function is called/emitted.\n *\n * @type {Address}\n */\n targetContract: Address;\n}\n\nexport interface ReadIncentiveCriteriaParams extends ReadParams {}\n\nexport interface GetIncentiveScalarParams {\n chainId: number;\n hash: Hex;\n knownSignatures: Record<Hex, AbiFunction | AbiEvent>;\n}\n\n/**\n * Extended ERC20 Variable Criteria Incentive class that fetches incentive criteria and scalar\n *\n * @export\n * @deprecated Please use only v2 implementations\n * @class ERC20VariableCriteriaIncentive\n * @typedef {ERC20VariableCriteriaIncentive}\n * @extends {ERC20VariableIncentive<ERC20VariableCriteriaIncentivePayload, typeof erc20VariableCriteriaIncentiveAbi>}\n */\nexport class ERC20VariableCriteriaIncentive extends ERC20VariableIncentive<\n ERC20VariableCriteriaIncentivePayload,\n typeof erc20VariableCriteriaIncentiveAbi,\n Promise<bigint>\n> {\n //@ts-expect-error instantiated correctly\n public override readonly abi = erc20VariableCriteriaIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(import.meta.env?.VITE_ERC20_VARIABLE_CRITERIA_INCENTIVE_BASE\n ? { 31337: import.meta.env.VITE_ERC20_VARIABLE_CRITERIA_INCENTIVE_BASE }\n : {}),\n ...(ERC20VariableCriteriaIncentiveBases as Record<number, Address>),\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 readErc20VariableCriteriaIncentiveGetIncentiveCriteria(\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 * Decodes claim data for the ERC20VariableCriteriaIncentive, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {Promise<bigint>} Returns the reward amount from a claim data payload\n */\n public override 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 * 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 getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward = await readErc20VariableCriteriaIncentiveGetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\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 * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableCriteriaIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20VariableCriteriaIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableCriteriaIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20VariableCriteriaIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Creates an IncentiveCriteria object representing a gas rebate incentive.\n * This object defines a variable incentive criteria where the criteria will be the gas spent.\n *\n * The criteria uses a signatureType of EVENT, with a special `fieldIndex` of 255 (using CheatCodes enum), which indicates\n * that the entire gas cost of the transaction will be used as the scalar value. If you don't want to\n * rebate the entire gas cost, you can use a reward value on the incentive..\n *\n * - `criteriaType`: EVENT, indicating it's based on event logs.\n * - `signature`: A zeroed signature (0x0000...0000), matching any event.\n * - `fieldIndex`: 255, indicating the use of transaction gas cost using CheatCodes enum.\n * - `targetContract`: A zeroed address (0x0000...0000), applicable to any contract.\n *\n * @returns {IncentiveCriteria} Returns an IncentiveCriteria object for a gas rebate.\n *\n * @example\n * const incentive = gasRebateIncentiveCriteria();\n * const actionPayload = {\n * criteria: incentive,\n * asset: \"0xAssetAddress\",\n * reward: 0, // Set to zero to rebate the entire gas cost\n * limit: BigInt(1000) // This is the total spend limit for the incentive\n * };\n * deployIncentive(actionPayload);\n */\nexport function gasRebateIncentiveCriteria(): IncentiveCriteria {\n return {\n criteriaType: SignatureType.EVENT,\n signature: zeroHash,\n fieldIndex: CheatCodes.GAS_REBATE_INCENTIVE,\n targetContract: zeroAddress,\n };\n}\n\n/**\n *\n *\n * @param {InitPayloadExtended} param0\n * @param {Address} param0.asset - The address of the ERC20 asset to incentivize.\n * @param {bigint} param0.reward - The reward amount to distribute per action.\n * @param {bigint} param0.limit - The total limit of the asset distribution.\n * @param {bigint} param0.maxReward - The maximum value claimable from a single completion.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20VariableCriteriaIncentivePayload({\n asset,\n reward,\n limit,\n maxReward = 0n,\n criteria,\n}: ERC20VariableCriteriaIncentivePayload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\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: asset,\n reward: reward,\n limit: limit,\n maxReward: 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"],"names":["_ERC20VariableCriteriaIncentive","ERC20VariableIncentive","erc20VariableCriteriaIncentiveAbi","params","readErc20VariableCriteriaIncentiveGetIncentiveCriteria","e","IncentiveCriteriaNotFoundError","claimData","boostClaimData","decodeAbiParameters","signedAmount","claimAmount","reward","maxReward","parseEther","readErc20VariableCriteriaIncentiveGetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","scalarValue","_a","DecodedArgsError","transaction","getTransaction","func","decodeFunctionData","InvalidCriteriaTypeError","_payload","_options","payload","options","bytecode","prepareERC20VariableCriteriaIncentivePayload","__vite_import_meta_env__","ERC20VariableCriteriaIncentiveBases","ERC20VariableCriteriaIncentive","gasRebateIncentiveCriteria","zeroHash","zeroAddress","asset","limit","encodeAbiParameters"],"mappings":"opiBAmHaA,EAAN,MAAMA,UAAuCC,EAAAA,sBAIlD,CAJK,aAAA,CAAA,MAAA,GAAA,SAAA,EAML,KAAyB,IAAMC,GAAA,CA0B/B,MAAa,qBACXC,EAC4B,CACxB,GAAA,CAUK,OARL,MAAMC,EAAA,GACJ,KAAK,QACL,CACE,GAAGD,EACH,QAAS,KAAK,mBAAmB,CACnC,CAAA,QAIGE,EAAG,CACJ,MAAA,IAAIC,EAAAA,+BAA+BD,CAAU,CACrD,CACF,CAUA,MAAsB,gBAAgBE,EAAgB,CACpD,MAAMC,EAAiBC,EAAA,oBACrB,CACE,CACE,KAAM,QACN,KAAM,iBACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,eAAgB,EACvC,CAAE,KAAM,QAAS,KAAM,eAAgB,CACzC,CACF,CACF,EACAF,CAAA,EAEIG,EAAeD,EAAA,oBACnB,CAAC,CAAE,KAAM,UAAW,EACpBD,EAAe,CAAC,EAAE,eAClB,CAAC,EACH,IAAIG,EAAcD,EAClB,KAAM,CAACE,EAAQC,CAAS,EAAI,MAAM,QAAQ,IAAI,CAC5C,KAAK,OAAO,EACZ,KAAK,aAAa,CAAA,CACnB,EAED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oBACL,CACE,CACE,KAAM,QACN,KAAM,sBACN,WAAY,CACV,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CACE,KAAM,QACN,KAAM,WACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,cAAe,EACtC,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,UAAW,KAAM,gBAAiB,CAC5C,CACF,CACF,CACF,CACF,EACA,CACE,CACE,MAAAF,EACA,OAAArC,EACA,MAAAsC,EACA,UAAArC,EACA,SAAU,CACR,aAAcM,EAAS,aACvB,UAAWA,EAAS,UACpB,WAAYA,EAAS,WACrB,eAAgBA,EAAS,cAC3B,CACF,CACF,CAAA,CAEJ"}
|
|
1
|
+
{"version":3,"file":"ERC20VariableCriteriaIncentive.cjs","sources":["../../src/Incentives/ERC20VariableCriteriaIncentive.ts"],"sourcesContent":["import {\n erc20VariableCriteriaIncentiveAbi,\n readErc20VariableCriteriaIncentiveGetIncentiveCriteria,\n readErc20VariableCriteriaIncentiveGetMaxReward,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableCriteriaIncentive.sol/ERC20VariableCriteriaIncentive.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport {\n type AbiEvent,\n type AbiFunction,\n type Address,\n type Hex,\n decodeAbiParameters,\n decodeFunctionData,\n encodeAbiParameters,\n parseEther,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20VariableCriteriaIncentive as ERC20VariableCriteriaIncentiveBases } from '../../dist/deployments.json';\nimport { SignatureType } from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport { CheatCodes, type ReadParams } from '../utils';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n\nexport { erc20VariableCriteriaIncentiveAbi };\n\nexport interface ERC20VariableCriteriaIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The amount of the asset to distribute as reward.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The total amount claimable in a single claim or maximum per-action reward.\n *\n * @type {bigint}\n * @optional\n */\n maxReward?: bigint;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteria;\n}\n\nexport interface IncentiveCriteria {\n /**\n * The type of criteria used, either function signature or event signature.\n *\n * @type {SignatureType}\n */\n criteriaType: SignatureType;\n /**\n * The function or event signature used for criteria matching.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index of the field from where the scalar value is extracted.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the contract where the event/function is called/emitted.\n *\n * @type {Address}\n */\n targetContract: Address;\n}\n\nexport interface ReadIncentiveCriteriaParams extends ReadParams {}\n\nexport interface GetIncentiveScalarParams {\n chainId: number;\n hash: Hex;\n knownSignatures: Record<Hex, AbiFunction | AbiEvent>;\n}\n\n/**\n * Extended ERC20 Variable Criteria Incentive class that fetches incentive criteria and scalar\n *\n * @export\n * @deprecated Please use only v2 implementations\n * @class ERC20VariableCriteriaIncentive\n * @typedef {ERC20VariableCriteriaIncentive}\n * @extends {ERC20VariableIncentive<ERC20VariableCriteriaIncentivePayload, typeof erc20VariableCriteriaIncentiveAbi>}\n */\nexport class ERC20VariableCriteriaIncentive extends ERC20VariableIncentive<\n ERC20VariableCriteriaIncentivePayload,\n typeof erc20VariableCriteriaIncentiveAbi,\n Promise<bigint>\n> {\n //@ts-expect-error instantiated correctly\n public override readonly abi = erc20VariableCriteriaIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(import.meta.env?.VITE_ERC20_VARIABLE_CRITERIA_INCENTIVE_BASE\n ? { 31337: import.meta.env.VITE_ERC20_VARIABLE_CRITERIA_INCENTIVE_BASE }\n : {}),\n ...(ERC20VariableCriteriaIncentiveBases as Record<number, Address>),\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 readErc20VariableCriteriaIncentiveGetIncentiveCriteria(\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 * Decodes claim data for the ERC20VariableCriteriaIncentive, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {Promise<bigint>} Returns the reward amount from a claim data payload\n */\n public override 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 * 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 getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward = await readErc20VariableCriteriaIncentiveGetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\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 * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableCriteriaIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20VariableCriteriaIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableCriteriaIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20VariableCriteriaIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Creates an IncentiveCriteria object representing a gas rebate incentive.\n * This object defines a variable incentive criteria where the criteria will be the gas spent.\n *\n * The criteria uses a signatureType of EVENT, with a special `fieldIndex` of 255 (using CheatCodes enum), which indicates\n * that the entire gas cost of the transaction will be used as the scalar value. If you don't want to\n * rebate the entire gas cost, you can use a reward value on the incentive..\n *\n * - `criteriaType`: EVENT, indicating it's based on event logs.\n * - `signature`: A zeroed signature (0x0000...0000), matching any event.\n * - `fieldIndex`: 255, indicating the use of transaction gas cost using CheatCodes enum.\n * - `targetContract`: A zeroed address (0x0000...0000), applicable to any contract.\n *\n * @returns {IncentiveCriteria} Returns an IncentiveCriteria object for a gas rebate.\n *\n * @example\n * const incentive = gasRebateIncentiveCriteria();\n * const actionPayload = {\n * criteria: incentive,\n * asset: \"0xAssetAddress\",\n * reward: 0, // Set to zero to rebate the entire gas cost\n * limit: BigInt(1000) // This is the total spend limit for the incentive\n * };\n * deployIncentive(actionPayload);\n */\nexport function gasRebateIncentiveCriteria(): IncentiveCriteria {\n return {\n criteriaType: SignatureType.EVENT,\n signature: zeroHash,\n fieldIndex: CheatCodes.GAS_REBATE_INCENTIVE,\n targetContract: zeroAddress,\n };\n}\n\n/**\n *\n *\n * @param {InitPayloadExtended} param0\n * @param {Address} param0.asset - The address of the ERC20 asset to incentivize.\n * @param {bigint} param0.reward - The reward amount to distribute per action.\n * @param {bigint} param0.limit - The total limit of the asset distribution.\n * @param {bigint} param0.maxReward - The maximum value claimable from a single completion.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20VariableCriteriaIncentivePayload({\n asset,\n reward,\n limit,\n maxReward = 0n,\n criteria,\n}: ERC20VariableCriteriaIncentivePayload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\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: asset,\n reward: reward,\n limit: limit,\n maxReward: 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"],"names":["_ERC20VariableCriteriaIncentive","ERC20VariableIncentive","erc20VariableCriteriaIncentiveAbi","params","readErc20VariableCriteriaIncentiveGetIncentiveCriteria","e","IncentiveCriteriaNotFoundError","claimData","boostClaimData","decodeAbiParameters","signedAmount","claimAmount","reward","maxReward","parseEther","readErc20VariableCriteriaIncentiveGetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","scalarValue","_a","DecodedArgsError","transaction","getTransaction","func","decodeFunctionData","InvalidCriteriaTypeError","_payload","_options","payload","options","bytecode","prepareERC20VariableCriteriaIncentivePayload","__vite_import_meta_env__","ERC20VariableCriteriaIncentiveBases","ERC20VariableCriteriaIncentive","gasRebateIncentiveCriteria","zeroHash","zeroAddress","asset","limit","encodeAbiParameters"],"mappings":"wsiBAmHaA,EAAN,MAAMA,UAAuCC,EAAAA,sBAIlD,CAJK,aAAA,CAAA,MAAA,GAAA,SAAA,EAML,KAAyB,IAAMC,GAAA,CA0B/B,MAAa,qBACXC,EAC4B,CACxB,GAAA,CAUK,OARL,MAAMC,EAAA,GACJ,KAAK,QACL,CACE,GAAGD,EACH,QAAS,KAAK,mBAAmB,CACnC,CAAA,QAIGE,EAAG,CACJ,MAAA,IAAIC,EAAAA,+BAA+BD,CAAU,CACrD,CACF,CAUA,MAAsB,gBAAgBE,EAAgB,CACpD,MAAMC,EAAiBC,EAAA,oBACrB,CACE,CACE,KAAM,QACN,KAAM,iBACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,eAAgB,EACvC,CAAE,KAAM,QAAS,KAAM,eAAgB,CACzC,CACF,CACF,EACAF,CAAA,EAEIG,EAAeD,EAAA,oBACnB,CAAC,CAAE,KAAM,UAAW,EACpBD,EAAe,CAAC,EAAE,eAClB,CAAC,EACH,IAAIG,EA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ASN,EAA6C,CAC3D,MAAAO,EACA,OAAArC,EACA,MAAAsC,EACA,UAAArC,EAAY,GACZ,SAAAM,CACF,EAA0C,CACjC,OAAAgC,EAAA,oBACL,CACE,CACE,KAAM,QACN,KAAM,sBACN,WAAY,CACV,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CACE,KAAM,QACN,KAAM,WACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,cAAe,EACtC,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,UAAW,KAAM,gBAAiB,CAC5C,CACF,CACF,CACF,CACF,EACA,CACE,CACE,MAAAF,EACA,OAAArC,EACA,MAAAsC,EACA,UAAArC,EACA,SAAU,CACR,aAAcM,EAAS,aACvB,UAAWA,EAAS,UACpB,WAAYA,EAAS,WACrB,eAAgBA,EAAS,cAC3B,CACF,CACF,CAAA,CAEJ"}
|
|
@@ -201,8 +201,8 @@ export declare class ERC20VariableCriteriaIncentive extends ERC20VariableIncenti
|
|
|
201
201
|
readonly type: "bytes32";
|
|
202
202
|
}, {
|
|
203
203
|
readonly name: "fieldIndex";
|
|
204
|
-
readonly internalType: "
|
|
205
|
-
readonly type: "
|
|
204
|
+
readonly internalType: "uint32";
|
|
205
|
+
readonly type: "uint32";
|
|
206
206
|
}, {
|
|
207
207
|
readonly name: "targetContract";
|
|
208
208
|
readonly internalType: "address";
|
|
@@ -450,8 +450,8 @@ export declare class ERC20VariableCriteriaIncentive extends ERC20VariableIncenti
|
|
|
450
450
|
readonly type: "bytes32";
|
|
451
451
|
}, {
|
|
452
452
|
readonly name: "fieldIndex";
|
|
453
|
-
readonly internalType: "
|
|
454
|
-
readonly type: "
|
|
453
|
+
readonly internalType: "uint32";
|
|
454
|
+
readonly type: "uint32";
|
|
455
455
|
}, {
|
|
456
456
|
readonly name: "targetContract";
|
|
457
457
|
readonly internalType: "address";
|
|
@@ -547,8 +547,8 @@ export declare class ERC20VariableCriteriaIncentive extends ERC20VariableIncenti
|
|
|
547
547
|
readonly type: "bytes32";
|
|
548
548
|
}, {
|
|
549
549
|
readonly name: "fieldIndex";
|
|
550
|
-
readonly internalType: "
|
|
551
|
-
readonly type: "
|
|
550
|
+
readonly internalType: "uint32";
|
|
551
|
+
readonly type: "uint32";
|
|
552
552
|
}, {
|
|
553
553
|
readonly name: "targetContract";
|
|
554
554
|
readonly internalType: "address";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m, b4 as h, b5 as C } from "../generated-D6oDILUw.js";
|
|
2
2
|
import { getTransactionReceipt as T, getTransaction as A } from "@wagmi/core";
|
|
3
|
-
import { decodeAbiParameters as p, parseEther as x, parseEventLogs as v, decodeFunctionData as R, encodeAbiParameters as
|
|
4
|
-
import { b as B } from "../deployments-
|
|
3
|
+
import { decodeAbiParameters as p, parseEther as x, parseEventLogs as v, decodeFunctionData as R, encodeAbiParameters as N, zeroHash as V, zeroAddress as D } from "viem";
|
|
4
|
+
import { b as B } from "../deployments-Coa8CGi2.js";
|
|
5
5
|
import { SignatureType as u } from "../Actions/EventAction.js";
|
|
6
6
|
import { IncentiveCriteriaNotFoundError as _, NoMatchingLogsError as E, DecodedArgsError as o, InvalidCriteriaTypeError as S } from "../errors.js";
|
|
7
7
|
import { CheatCodes as I } from "../utils.js";
|
|
8
8
|
import { ERC20VariableIncentive as $ } from "./ERC20VariableIncentive.js";
|
|
9
|
-
const F = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6120aa806100895f395ff3fe608060405260043610610277575f3560e01c8063715018a61161014b578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b14610703578063fe9fbb8014610716578063fee81cf414610735575f80fd5b8063ec87621c146106dc578063f04e283e146106f0575f80fd5b8063db09da12116100ac578063db09da1214610689578063dcc21361146106a8578063dcc59b6f146106c7575f80fd5b8063c884ef8314610646578063d54ad2a114610674575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf146105f4578063be4994f814610613578063c213f3f914610632575f80fd5b8063a4d66daf146105be578063a871ced2146105d3575f80fd5b8063715018a61461053857806375b238fc1461054057806377548687146105545780638da5cb5b146105a6575f80fd5b806330db555f116101f55780634a4ee7b1116101ab578063514e62fc11610191578063514e62fc146104e657806354d1f13d1461051b57806366a78e6c14610523575f80fd5b80634a4ee7b1146104a75780634e7165a2146104ba575f80fd5b80634359d28a116101db5780634359d28a14610420578063439fab911461043f578063474f5a441461045e575f80fd5b806330db555f146103b057806338d52e0f146103cf575f80fd5b80631cd64df41161024a5780632569296211610230578063256929621461033d57806328d6183b146103455780632de948071461037f575f80fd5b80631cd64df4146102f4578063228cb73314610329575f80fd5b806301ffc9a71461027b57806307621eca146102af578063183a4f6e146102cc5780631c10893f146102e1575b5f80fd5b348015610286575f80fd5b5061029a61029536600461180a565b610766565b60405190151581526020015b60405180910390f35b3480156102ba575f80fd5b505f545b6040519081526020016102a6565b6102df6102da366004611850565b6107c1565b005b6102df6102ef366004611888565b6107ce565b3480156102ff575f80fd5b5061029a61030e366004611888565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610334575f80fd5b506102be5f5481565b6102df6107e4565b348015610350575f80fd5b506040517f52b8e45c0000000000000000000000000000000000000000000000000000000081526020016102a6565b34801561038a575f80fd5b506102be6103993660046118b2565b638b78c6d8600c9081525f91909152602090205490565b3480156103bb575f80fd5b506102df6103ca366004611850565b610831565b3480156103da575f80fd5b506003546103fb9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102a6565b34801561042b575f80fd5b506102df61043a366004611915565b6108ed565b34801561044a575f80fd5b506102df6104593660046119bf565b6109e7565b348015610469575f80fd5b5061047d6104783660046119bf565b610cd1565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102a6565b6102df6104b5366004611888565b610e33565b3480156104c5575f80fd5b506104d96104d43660046119bf565b610e45565b6040516102a69190611a4a565b3480156104f1575f80fd5b5061029a610500366004611888565b638b78c6d8600c9081525f9290925260209091205416151590565b6102df610f2e565b34801561052e575f80fd5b506102be60065481565b6102df610f67565b34801561054b575f80fd5b506102be600281565b34801561055f575f80fd5b506007546008546009546105969260ff908116929190811690610100900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102a69493929190611a9d565b3480156105b1575f80fd5b50638b78c6d819546103fb565b3480156105c9575f80fd5b506102be60025481565b3480156105de575f80fd5b506105e7610f7a565b6040516102a69190611b25565b3480156105ff575f80fd5b5061029a61060e366004611b33565b611014565b34801561061e575f80fd5b506102df61062d366004611915565b611245565b34801561063d575f80fd5b506006546102be565b348015610651575f80fd5b5061029a6106603660046118b2565b60016020525f908152604090205460ff1681565b34801561067f575f80fd5b506102be60055481565b348015610694575f80fd5b5061029a6106a3366004611b33565b6112e3565b3480156106b3575f80fd5b506102df6106c2366004611915565b6112f9565b3480156106d2575f80fd5b506102be60045481565b3480156106e7575f80fd5b506102be600181565b6102df6106fe3660046118b2565b611397565b6102df6107113660046118b2565b6113d1565b348015610721575f80fd5b5061029a6107303660046118b2565b6113f7565b348015610740575f80fd5b506102be61074f3660046118b2565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f52b8e45c0000000000000000000000000000000000000000000000000000000014806107bb57506107bb82611456565b92915050565b6107cb33826114ab565b50565b6107d66114b6565b6107e082826114d0565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161083c816114dc565b815f03610875576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035461089a9073ffffffffffffffffffffffffffffffffffffffff1633308561150d565b8160025f8282546108ab9190611bb1565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026108f8816114dc565b838214610931576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df575f84848381811061094e5761094e611bc4565b90506020020160208101906109639190611bf1565b90508015156001036109a5576109a087878481811061098457610984611bc4565b905060200201602081019061099991906118b2565b60016114d0565b6109d6565b6109d68787848181106109ba576109ba611bc4565b90506020020160208101906109cf91906118b2565b60016114ab565b50600101610933565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610a385760018160011c14303b10610a2f5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610a4683850185611cac565b805160208201516040830151606084015160808501519495509293919290915f839003610a9f576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ac073ffffffffffffffffffffffffffffffffffffffff87163061156f565b905083811015610b295786516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810185905260640160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555f8581556002859055600684905560055581516007805484929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610bba57610bba611a5c565b02179055506020820151600182015560408201516002909101805460609093015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090931660ff90921691909117919091179055610c31336115a2565b610c3c3360016115ea565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610c889493929190611d83565b60405180910390a2505050505050508015610ccc576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610cde816114dc565b5f610ceb85870187611e57565b90505f8160200151806020019051810190610d069190611ed6565b90508060025f828254610d199190611eed565b90915550508151600354610d469173ffffffffffffffffffffffffffffffffffffffff909116908361162b565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610e0491611a4a565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610e3b6114b6565b6107e082826114ab565b60605f80610e5584860186611f00565b9250509150604051806080016040528060016002811115610e7857610e78611a5c565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610ed79151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610f159190602001611f32565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610f6f6114b6565b610f785f61167e565b565b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810190915260078054829060ff166001811115610fc257610fc2611a5c565b6001811115610fd357610fd3611a5c565b81526001820154602082015260029091015460ff81166040830152610100900473ffffffffffffffffffffffffffffffffffffffff16606090910152919050565b5f61101d6114b6565b5f61102a83850185611fa8565b90505f81602001518060200190518101906110459190611ed6565b90505f6110556002546005541090565b61108b576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f545f0361109a5750806110bd565b670de0b6b3a7640000825f546110b09190612025565b6110ba919061203c565b90505b600654158015906110cf575060065481115b156110d957506006545b600254816005546110ea9190611bb1565b1115611122576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546111339190611bb1565b92505081905550600160045f82825461114c9190611bb1565b90915550506003546111759073ffffffffffffffffffffffffffffffffffffffff16888361162b565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261123091611a4a565b60405180910390a25060019695505050505050565b6002611250816114dc565b838214611289576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df576112db8686838181106112a8576112a8611bc4565b90506020020160208101906112bd91906118b2565b8585848181106112cf576112cf611bc4565b905060200201356114d0565b60010161128b565b5f6112f16002546005541090565b949350505050565b6002611304816114dc565b83821461133d576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df5761138f86868381811061135c5761135c611bc4565b905060200201602081019061137191906118b2565b85858481811061138357611383611bc4565b905060200201356114ab565b60010161133f565b61139f6114b6565b63389a75e1600c52805f526020600c2080544211156113c557636f5e88185f526004601cfd5b5f90556107cb8161167e565b6113d96114b6565b8060601b6113ee57637448fbae5f526004601cfd5b6107cb8161167e565b5f8173ffffffffffffffffffffffffffffffffffffffff1661141c638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806107bb5750638b78c6d8600c9081525f839052602090205460031615156107bb565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f903181110000000000000000000000000000000000000000000000000000000014806107bb57506107bb826116c8565b6107e082825f61171d565b638b78c6d819543314610f78576382b429005f526004601cfd5b6107e08282600161171d565b638b78c6d8195433146107cb57638b78c6d8600c52335f52806020600c2054166107cb576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661156157803d873b15171061156157637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661167457803d853b151710611674576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa92167050000000000000000000000000000000000000000000000000000000014806107bb57506107bb82611774565b638b78c6d8600c52825f526020600c2080548381178361173e575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806107bb57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107bb565b5f6020828403121561181a575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611849575f80fd5b9392505050565b5f60208284031215611860575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146107cb575f80fd5b5f8060408385031215611899575f80fd5b82356118a481611867565b946020939093013593505050565b5f602082840312156118c2575f80fd5b813561184981611867565b5f8083601f8401126118dd575f80fd5b50813567ffffffffffffffff8111156118f4575f80fd5b6020830191508360208260051b850101111561190e575f80fd5b9250929050565b5f805f8060408587031215611928575f80fd5b843567ffffffffffffffff81111561193e575f80fd5b61194a878288016118cd565b909550935050602085013567ffffffffffffffff811115611969575f80fd5b611975878288016118cd565b95989497509550505050565b5f8083601f840112611991575f80fd5b50813567ffffffffffffffff8111156119a8575f80fd5b60208301915083602082850101111561190e575f80fd5b5f80602083850312156119d0575f80fd5b823567ffffffffffffffff8111156119e6575f80fd5b6119f285828601611981565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f61184960208301846119fe565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611a9957611a99611a5c565b9052565b60808101611aab8287611a89565b84602083015260ff8416604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b611aea828251611a89565b6020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301525050565b608081016107bb8284611adf565b5f805f60408486031215611b45575f80fd5b8335611b5081611867565b9250602084013567ffffffffffffffff811115611b6b575f80fd5b611b7786828701611981565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156107bb576107bb611b84565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611c01575f80fd5b81358015158114611849575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160a0810167ffffffffffffffff81118282101715611c6057611c60611c10565b60405290565b6040516080810167ffffffffffffffff81118282101715611c6057611c60611c10565b6040805190810167ffffffffffffffff81118282101715611c6057611c60611c10565b5f81830361010081128015611cbf575f80fd5b50611cc8611c3d565b8335611cd381611867565b815260208481013590820152604080850135908201526060808501359082015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083011215611d22575f80fd5b611d2a611c66565b9150608084013560028110611d3d575f80fd5b825260a0840135602083015260c084013560ff81168114611d5c575f80fd5b604083015260e0840135611d6f81611867565b606083015260808101919091529392505050565b848152602081018490526040810183905260e08101611da56060830184611adf565b95945050505050565b5f82601f830112611dbd575f80fd5b813567ffffffffffffffff811115611dd757611dd7611c10565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff81118282101715611e2457611e24611c10565b604052818152838201602001851015611e3b575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215611e67575f80fd5b813567ffffffffffffffff811115611e7d575f80fd5b820160408185031215611e8e575f80fd5b611e96611c89565b8135611ea181611867565b8152602082013567ffffffffffffffff811115611ebc575f80fd5b611ec886828501611dae565b602083015250949350505050565b5f60208284031215611ee6575f80fd5b5051919050565b818103818111156107bb576107bb611b84565b5f805f60608486031215611f12575f80fd5b8335611f1d81611867565b95602085013595506040909401359392505050565b602081525f825160038110611f4957611f49611a5c565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526112f160a08401826119fe565b5f60208284031215611fb8575f80fd5b813567ffffffffffffffff811115611fce575f80fd5b820160408185031215611fdf575f80fd5b611fe7611c89565b813567ffffffffffffffff811115611ffd575f80fd5b61200986828501611dae565b825250602082013567ffffffffffffffff811115611ebc575f80fd5b80820281158282048414176107bb576107bb611b84565b5f8261206f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea264697066735822122002cb02f574ade708d1d5aab7fb7184f2ca850079b21767cde9fb97481599ce8d64736f6c634300081a0033", s = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_BOOST_MAINNET_SIGNER_EOA: "0xCBD0C302040bC803B4B2EDaF21Be0e49Deff5480", VITE_BOOST_TESTNET_SIGNER_EOA: "0xd63167e9db11B108940b2E8236581F961f33f396" }, l = class l extends $ {
|
|
9
|
+
const F = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6120c4806100895f395ff3fe608060405260043610610277575f3560e01c8063715018a61161014b578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b14610708578063fe9fbb801461071b578063fee81cf41461073a575f80fd5b8063ec87621c146106e1578063f04e283e146106f5575f80fd5b8063db09da12116100ac578063db09da121461068e578063dcc21361146106ad578063dcc59b6f146106cc575f80fd5b8063c884ef831461064b578063d54ad2a114610679575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf146105f9578063be4994f814610618578063c213f3f914610637575f80fd5b8063a4d66daf146105c3578063a871ced2146105d8575f80fd5b8063715018a61461053857806375b238fc1461054057806377548687146105545780638da5cb5b146105ab575f80fd5b806330db555f116101f55780634a4ee7b1116101ab578063514e62fc11610191578063514e62fc146104e657806354d1f13d1461051b57806366a78e6c14610523575f80fd5b80634a4ee7b1146104a75780634e7165a2146104ba575f80fd5b80634359d28a116101db5780634359d28a14610420578063439fab911461043f578063474f5a441461045e575f80fd5b806330db555f146103b057806338d52e0f146103cf575f80fd5b80631cd64df41161024a5780632569296211610230578063256929621461033d57806328d6183b146103455780632de948071461037f575f80fd5b80631cd64df4146102f4578063228cb73314610329575f80fd5b806301ffc9a71461027b57806307621eca146102af578063183a4f6e146102cc5780631c10893f146102e1575b5f80fd5b348015610286575f80fd5b5061029a61029536600461181b565b61076b565b60405190151581526020015b60405180910390f35b3480156102ba575f80fd5b505f545b6040519081526020016102a6565b6102df6102da366004611861565b6107c6565b005b6102df6102ef366004611899565b6107d3565b3480156102ff575f80fd5b5061029a61030e366004611899565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610334575f80fd5b506102be5f5481565b6102df6107e9565b348015610350575f80fd5b506040517f52b8e45c0000000000000000000000000000000000000000000000000000000081526020016102a6565b34801561038a575f80fd5b506102be6103993660046118c3565b638b78c6d8600c9081525f91909152602090205490565b3480156103bb575f80fd5b506102df6103ca366004611861565b610836565b3480156103da575f80fd5b506003546103fb9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102a6565b34801561042b575f80fd5b506102df61043a366004611926565b6108f2565b34801561044a575f80fd5b506102df6104593660046119d0565b6109ec565b348015610469575f80fd5b5061047d6104783660046119d0565b610cdc565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102a6565b6102df6104b5366004611899565b610e3e565b3480156104c5575f80fd5b506104d96104d43660046119d0565b610e50565b6040516102a69190611a5b565b3480156104f1575f80fd5b5061029a610500366004611899565b638b78c6d8600c9081525f9290925260209091205416151590565b6102df610f39565b34801561052e575f80fd5b506102be60065481565b6102df610f72565b34801561054b575f80fd5b506102be600281565b34801561055f575f80fd5b5060075460085460095461059b9260ff16919063ffffffff811690640100000000900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102a69493929190611aae565b3480156105b6575f80fd5b50638b78c6d819546103fb565b3480156105ce575f80fd5b506102be60025481565b3480156105e3575f80fd5b506105ec610f85565b6040516102a69190611b3c565b348015610604575f80fd5b5061029a610613366004611b4a565b611025565b348015610623575f80fd5b506102df610632366004611926565b611256565b348015610642575f80fd5b506006546102be565b348015610656575f80fd5b5061029a6106653660046118c3565b60016020525f908152604090205460ff1681565b348015610684575f80fd5b506102be60055481565b348015610699575f80fd5b5061029a6106a8366004611b4a565b6112f4565b3480156106b8575f80fd5b506102df6106c7366004611926565b61130a565b3480156106d7575f80fd5b506102be60045481565b3480156106ec575f80fd5b506102be600181565b6102df6107033660046118c3565b6113a8565b6102df6107163660046118c3565b6113e2565b348015610726575f80fd5b5061029a6107353660046118c3565b611408565b348015610745575f80fd5b506102be6107543660046118c3565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f52b8e45c0000000000000000000000000000000000000000000000000000000014806107c057506107c082611467565b92915050565b6107d033826114bc565b50565b6107db6114c7565b6107e582826114e1565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b6001610841816114ed565b815f0361087a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035461089f9073ffffffffffffffffffffffffffffffffffffffff1633308561151e565b8160025f8282546108b09190611bc8565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026108fd816114ed565b838214610936576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109e4575f84848381811061095357610953611bdb565b90506020020160208101906109689190611c08565b90508015156001036109aa576109a587878481811061098957610989611bdb565b905060200201602081019061099e91906118c3565b60016114e1565b6109db565b6109db8787848181106109bf576109bf611bdb565b90506020020160208101906109d491906118c3565b60016114bc565b50600101610938565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610a3d5760018160011c14303b10610a345763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610a4b83850185611cc3565b805160208201516040830151606084015160808501519495509293919290915f839003610aa4576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ac573ffffffffffffffffffffffffffffffffffffffff871630611580565b905083811015610b2e5786516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810185905260640160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555f8581556002859055600684905560055581516007805484929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610bbf57610bbf611a6d565b02179055506020820151600182015560408201516002909101805460609093015173ffffffffffffffffffffffffffffffffffffffff16640100000000027fffffffffffffffff00000000000000000000000000000000000000000000000090931663ffffffff90921691909117919091179055610c3c336115b3565b610c473360016115fb565b8573ffffffffffffffffffffffffffffffffffffffff167fcb128760e2036ec5ada1eb74cefc1106b2fa17cb84982a3bd46e75ded6e1355286868686604051610c939493929190611d9d565b60405180910390a2505050505050508015610cd7576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610ce9816114ed565b5f610cf685870187611e71565b90505f8160200151806020019051810190610d119190611ef0565b90508060025f828254610d249190611f07565b90915550508151600354610d519173ffffffffffffffffffffffffffffffffffffffff909116908361163c565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610e0f91611a5b565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610e466114c7565b6107e582826114bc565b60605f80610e6084860186611f1a565b9250509150604051806080016040528060016002811115610e8357610e83611a6d565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610ee29151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610f209190602001611f4c565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610f7a6114c7565b610f835f61168f565b565b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810190915260078054829060ff166001811115610fcd57610fcd611a6d565b6001811115610fde57610fde611a6d565b81526001820154602082015260029091015463ffffffff81166040830152640100000000900473ffffffffffffffffffffffffffffffffffffffff16606090910152919050565b5f61102e6114c7565b5f61103b83850185611fc2565b90505f81602001518060200190518101906110569190611ef0565b90505f6110666002546005541090565b61109c576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f545f036110ab5750806110ce565b670de0b6b3a7640000825f546110c1919061203f565b6110cb9190612056565b90505b600654158015906110e0575060065481115b156110ea57506006545b600254816005546110fb9190611bc8565b1115611133576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546111449190611bc8565b92505081905550600160045f82825461115d9190611bc8565b90915550506003546111869073ffffffffffffffffffffffffffffffffffffffff16888361163c565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261124191611a5b565b60405180910390a25060019695505050505050565b6002611261816114ed565b83821461129a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109e4576112ec8686838181106112b9576112b9611bdb565b90506020020160208101906112ce91906118c3565b8585848181106112e0576112e0611bdb565b905060200201356114e1565b60010161129c565b5f6113026002546005541090565b949350505050565b6002611315816114ed565b83821461134e576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109e4576113a086868381811061136d5761136d611bdb565b905060200201602081019061138291906118c3565b85858481811061139457611394611bdb565b905060200201356114bc565b600101611350565b6113b06114c7565b63389a75e1600c52805f526020600c2080544211156113d657636f5e88185f526004601cfd5b5f90556107d08161168f565b6113ea6114c7565b8060601b6113ff57637448fbae5f526004601cfd5b6107d08161168f565b5f8173ffffffffffffffffffffffffffffffffffffffff1661142d638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806107c05750638b78c6d8600c9081525f839052602090205460031615156107c0565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f903181110000000000000000000000000000000000000000000000000000000014806107c057506107c0826116d9565b6107e582825f61172e565b638b78c6d819543314610f83576382b429005f526004601cfd5b6107e58282600161172e565b638b78c6d8195433146107d057638b78c6d8600c52335f52806020600c2054166107d0576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661157257803d873b15171061157257637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661168557803d853b151710611685576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa92167050000000000000000000000000000000000000000000000000000000014806107c057506107c082611785565b638b78c6d8600c52825f526020600c2080548381178361174f575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806107c057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107c0565b5f6020828403121561182b575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461185a575f80fd5b9392505050565b5f60208284031215611871575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146107d0575f80fd5b5f80604083850312156118aa575f80fd5b82356118b581611878565b946020939093013593505050565b5f602082840312156118d3575f80fd5b813561185a81611878565b5f8083601f8401126118ee575f80fd5b50813567ffffffffffffffff811115611905575f80fd5b6020830191508360208260051b850101111561191f575f80fd5b9250929050565b5f805f8060408587031215611939575f80fd5b843567ffffffffffffffff81111561194f575f80fd5b61195b878288016118de565b909550935050602085013567ffffffffffffffff81111561197a575f80fd5b611986878288016118de565b95989497509550505050565b5f8083601f8401126119a2575f80fd5b50813567ffffffffffffffff8111156119b9575f80fd5b60208301915083602082850101111561191f575f80fd5b5f80602083850312156119e1575f80fd5b823567ffffffffffffffff8111156119f7575f80fd5b611a0385828601611992565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f61185a6020830184611a0f565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611aaa57611aaa611a6d565b9052565b60808101611abc8287611a9a565b84602083015263ffffffff8416604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b611afe828251611a9a565b6020810151602083015263ffffffff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301525050565b608081016107c08284611af3565b5f805f60408486031215611b5c575f80fd5b8335611b6781611878565b9250602084013567ffffffffffffffff811115611b82575f80fd5b611b8e86828701611992565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156107c0576107c0611b9b565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611c18575f80fd5b8135801515811461185a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160a0810167ffffffffffffffff81118282101715611c7757611c77611c27565b60405290565b6040516080810167ffffffffffffffff81118282101715611c7757611c77611c27565b6040805190810167ffffffffffffffff81118282101715611c7757611c77611c27565b5f81830361010081128015611cd6575f80fd5b50611cdf611c54565b8335611cea81611878565b815260208481013590820152604080850135908201526060808501359082015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083011215611d39575f80fd5b611d41611c7d565b9150608084013560028110611d54575f80fd5b825260a0840135602083015260c084013563ffffffff81168114611d76575f80fd5b604083015260e0840135611d8981611878565b606083015260808101919091529392505050565b848152602081018490526040810183905260e08101611dbf6060830184611af3565b95945050505050565b5f82601f830112611dd7575f80fd5b813567ffffffffffffffff811115611df157611df1611c27565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff81118282101715611e3e57611e3e611c27565b604052818152838201602001851015611e55575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215611e81575f80fd5b813567ffffffffffffffff811115611e97575f80fd5b820160408185031215611ea8575f80fd5b611eb0611ca0565b8135611ebb81611878565b8152602082013567ffffffffffffffff811115611ed6575f80fd5b611ee286828501611dc8565b602083015250949350505050565b5f60208284031215611f00575f80fd5b5051919050565b818103818111156107c0576107c0611b9b565b5f805f60608486031215611f2c575f80fd5b8335611f3781611878565b95602085013595506040909401359392505050565b602081525f825160038110611f6357611f63611a6d565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff6040840151166060830152606083015160808084015261130260a0840182611a0f565b5f60208284031215611fd2575f80fd5b813567ffffffffffffffff811115611fe8575f80fd5b820160408185031215611ff9575f80fd5b612001611ca0565b813567ffffffffffffffff811115612017575f80fd5b61202386828501611dc8565b825250602082013567ffffffffffffffff811115611ed6575f80fd5b80820281158282048414176107c0576107c0611b9b565b5f82612089577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220e2475c7ee1e007c43bb4210f84615ae1e938101c349f03686cade8733d8f7b7d64736f6c634300081a0033", s = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_BOOST_MAINNET_SIGNER_EOA: "0xCBD0C302040bC803B4B2EDaF21Be0e49Deff5480", VITE_BOOST_TESTNET_SIGNER_EOA: "0xd63167e9db11B108940b2E8236581F961f33f396" }, l = class l extends $ {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments), this.abi = m;
|
|
12
12
|
}
|
|
@@ -176,12 +176,12 @@ l.bases = {
|
|
|
176
176
|
...B
|
|
177
177
|
};
|
|
178
178
|
let y = l;
|
|
179
|
-
function
|
|
179
|
+
function Y() {
|
|
180
180
|
return {
|
|
181
181
|
criteriaType: u.EVENT,
|
|
182
|
-
signature:
|
|
182
|
+
signature: V,
|
|
183
183
|
fieldIndex: I.GAS_REBATE_INCENTIVE,
|
|
184
|
-
targetContract:
|
|
184
|
+
targetContract: D
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
function P({
|
|
@@ -191,7 +191,7 @@ function P({
|
|
|
191
191
|
maxReward: d = 0n,
|
|
192
192
|
criteria: b
|
|
193
193
|
}) {
|
|
194
|
-
return
|
|
194
|
+
return N(
|
|
195
195
|
[
|
|
196
196
|
{
|
|
197
197
|
type: "tuple",
|
|
@@ -233,7 +233,7 @@ function P({
|
|
|
233
233
|
export {
|
|
234
234
|
y as ERC20VariableCriteriaIncentive,
|
|
235
235
|
m as erc20VariableCriteriaIncentiveAbi,
|
|
236
|
-
|
|
236
|
+
Y as gasRebateIncentiveCriteria,
|
|
237
237
|
P as prepareERC20VariableCriteriaIncentivePayload
|
|
238
238
|
};
|
|
239
239
|
//# sourceMappingURL=ERC20VariableCriteriaIncentive.js.map
|