@boostxyz/sdk 0.0.0-alpha.2 → 0.0.0-alpha.20
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 +2 -1
- package/dist/Actions/Action.cjs.map +1 -0
- package/dist/Actions/Action.d.ts +1 -1
- package/dist/Actions/Action.d.ts.map +1 -1
- package/dist/Actions/Action.js +14 -12
- package/dist/Actions/Action.js.map +1 -0
- package/dist/Actions/ContractAction.d.ts +57 -14
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +50 -23
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.cjs +2 -1
- package/dist/Actions/EventAction.cjs.map +1 -0
- package/dist/Actions/EventAction.d.ts +405 -36
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +15 -209
- package/dist/Actions/EventAction.js.map +1 -0
- package/dist/AllowLists/AllowList.cjs +2 -1
- package/dist/AllowLists/AllowList.cjs.map +1 -0
- package/dist/AllowLists/AllowList.d.ts +6 -5
- package/dist/AllowLists/AllowList.d.ts.map +1 -1
- package/dist/AllowLists/AllowList.js +46 -22
- package/dist/AllowLists/AllowList.js.map +1 -0
- package/dist/AllowLists/OpenAllowList.d.ts +423 -0
- package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.cjs +2 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
- package/dist/AllowLists/SimpleAllowList.d.ts +124 -40
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +77 -77
- package/dist/AllowLists/SimpleAllowList.js.map +1 -0
- package/dist/AllowLists/SimpleDenyList.cjs +2 -1
- package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
- package/dist/AllowLists/SimpleDenyList.d.ts +234 -13
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +12 -200
- package/dist/AllowLists/SimpleDenyList.js.map +1 -0
- package/dist/Auth/Auth.cjs +1 -0
- package/dist/Auth/Auth.cjs.map +1 -0
- package/dist/Auth/Auth.js +1 -0
- package/dist/Auth/Auth.js.map +1 -0
- package/dist/Auth/PassthroughAuth.cjs +2 -1
- package/dist/Auth/PassthroughAuth.cjs.map +1 -0
- package/dist/Auth/PassthroughAuth.js +5 -4
- package/dist/Auth/PassthroughAuth.js.map +1 -0
- package/dist/Boost.cjs +2 -1
- package/dist/Boost.cjs.map +1 -0
- package/dist/Boost.d.ts +111 -1
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +140 -5
- package/dist/Boost.js.map +1 -0
- package/dist/BoostCore-3-U1xTQN.cjs +3 -0
- package/dist/BoostCore-3-U1xTQN.cjs.map +1 -0
- package/dist/BoostCore-DVGBUr2y.js +1477 -0
- package/dist/BoostCore-DVGBUr2y.js.map +1 -0
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -0
- package/dist/BoostCore.d.ts +166 -43
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +30 -1103
- package/dist/BoostCore.js.map +1 -0
- package/dist/BoostRegistry.cjs +2 -1
- package/dist/BoostRegistry.cjs.map +1 -0
- package/dist/BoostRegistry.d.ts +64 -23
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +162 -88
- package/dist/BoostRegistry.js.map +1 -0
- package/dist/Budgets/Budget.cjs +2 -1
- package/dist/Budgets/Budget.cjs.map +1 -0
- package/dist/Budgets/Budget.d.ts +1 -1
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +15 -13
- package/dist/Budgets/Budget.js.map +1 -0
- package/dist/Budgets/ManagedBudget.cjs +2 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -0
- package/dist/Budgets/ManagedBudget.d.ts +78 -188
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +86 -286
- package/dist/Budgets/ManagedBudget.js.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +243 -87
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Contract.cjs +2 -1
- package/dist/Deployable/Contract.cjs.map +1 -0
- package/dist/Deployable/Contract.d.ts +4 -5
- package/dist/Deployable/Contract.d.ts.map +1 -1
- package/dist/Deployable/Contract.js +7 -8
- package/dist/Deployable/Contract.js.map +1 -0
- package/dist/Deployable/Deployable.cjs +1 -0
- package/dist/Deployable/Deployable.cjs.map +1 -0
- package/dist/Deployable/Deployable.d.ts +9 -3
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +10 -5
- package/dist/Deployable/Deployable.js.map +1 -0
- package/dist/Deployable/DeployableTarget.cjs +2 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -0
- package/dist/Deployable/DeployableTarget.d.ts +16 -15
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +49 -42
- package/dist/Deployable/DeployableTarget.js.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
- package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
- package/dist/EventAction-CIPqmAoP.js +1450 -0
- package/dist/EventAction-CIPqmAoP.js.map +1 -0
- package/dist/EventAction-d-oeqZQs.cjs +2 -0
- package/dist/EventAction-d-oeqZQs.cjs.map +1 -0
- package/dist/Incentive-Bp8Sez7M.js +298 -0
- package/dist/Incentive-Bp8Sez7M.js.map +1 -0
- package/dist/Incentive-Djnzseoj.cjs +2 -0
- package/dist/Incentive-Djnzseoj.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +2 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.d.ts +49 -19
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +50 -34
- package/dist/Incentives/AllowListIncentive.js.map +1 -0
- package/dist/Incentives/CGDAIncentive.cjs +2 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
- package/dist/Incentives/CGDAIncentive.d.ts +118 -22
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +67 -42
- package/dist/Incentives/CGDAIncentive.js.map +1 -0
- package/dist/Incentives/ERC1155Incentive.d.ts +99 -38
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +2 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
- package/dist/Incentives/ERC20Incentive.d.ts +73 -29
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +71 -48
- package/dist/Incentives/ERC20Incentive.js.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +523 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +65 -28
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.cjs +2 -1
- package/dist/Incentives/Incentive.cjs.map +1 -0
- package/dist/Incentives/Incentive.d.ts +4 -7
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +17 -278
- package/dist/Incentives/Incentive.js.map +1 -0
- package/dist/Incentives/PointsIncentive.cjs +2 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -0
- package/dist/Incentives/PointsIncentive.d.ts +65 -21
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +57 -36
- package/dist/Incentives/PointsIncentive.js.map +1 -0
- package/dist/SimpleDenyList-BwfNjRsg.cjs +2 -0
- package/dist/SimpleDenyList-BwfNjRsg.cjs.map +1 -0
- package/dist/SimpleDenyList-Cn5WpNn0.js +132 -0
- package/dist/SimpleDenyList-Cn5WpNn0.js.map +1 -0
- package/dist/Validators/SignerValidator.cjs +2 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -0
- package/dist/Validators/SignerValidator.d.ts +310 -17
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +165 -36
- package/dist/Validators/SignerValidator.js.map +1 -0
- package/dist/Validators/Validator.cjs +2 -1
- package/dist/Validators/Validator.cjs.map +1 -0
- package/dist/Validators/Validator.d.ts +2 -2
- package/dist/Validators/Validator.d.ts.map +1 -1
- package/dist/Validators/Validator.js +12 -10
- package/dist/Validators/Validator.js.map +1 -0
- package/dist/claiming.cjs +2 -0
- package/dist/claiming.cjs.map +1 -0
- package/dist/claiming.d.ts +43 -0
- package/dist/claiming.d.ts.map +1 -0
- package/dist/claiming.js +17 -0
- package/dist/claiming.js.map +1 -0
- package/dist/componentInterfaces-D09mhzxO.cjs +2 -0
- package/dist/componentInterfaces-D09mhzxO.cjs.map +1 -0
- package/dist/componentInterfaces-RXBMI5yH.js +14 -0
- package/dist/componentInterfaces-RXBMI5yH.js.map +1 -0
- package/dist/deployments-BM42vImE.js +43 -0
- package/dist/deployments-BM42vImE.js.map +1 -0
- package/dist/deployments-CMdF5uEC.cjs +2 -0
- package/dist/deployments-CMdF5uEC.cjs.map +1 -0
- package/dist/deployments.json +41 -0
- package/dist/errors.cjs +2 -1
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.ts +403 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +285 -39
- package/dist/errors.js.map +1 -0
- package/dist/generated-B0tk-c9b.cjs +3 -0
- package/dist/generated-B0tk-c9b.cjs.map +1 -0
- package/dist/{generated-x_abr3Yv.js → generated-B7VaSah4.js} +2058 -2541
- package/dist/generated-B7VaSah4.js.map +1 -0
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +10 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +143 -1353
- package/dist/index.js.map +1 -0
- package/dist/transfers.cjs +2 -0
- package/dist/transfers.cjs.map +1 -0
- package/dist/transfers.d.ts +198 -0
- package/dist/transfers.d.ts.map +1 -0
- package/dist/transfers.js +84 -0
- package/dist/transfers.js.map +1 -0
- package/dist/utils.cjs +2 -1
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +26 -1350
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +38 -636
- package/dist/utils.js.map +1 -0
- package/package.json +37 -11
- package/src/Actions/Action.test.ts +79 -0
- package/src/Actions/Action.ts +61 -0
- package/src/Actions/ContractAction.test.ts +197 -0
- package/src/Actions/ContractAction.ts +300 -0
- package/src/Actions/ERC721MintAction.test.ts +112 -0
- package/src/Actions/ERC721MintAction.ts +291 -0
- package/src/Actions/EventAction.test.ts +787 -0
- package/src/Actions/EventAction.ts +1214 -0
- package/src/AllowLists/AllowList.test.ts +64 -0
- package/src/AllowLists/AllowList.ts +62 -0
- package/src/AllowLists/OpenAllowList.test.ts +40 -0
- package/src/AllowLists/OpenAllowList.ts +45 -0
- package/src/AllowLists/SimpleAllowList.test.ts +52 -0
- package/src/AllowLists/SimpleAllowList.ts +262 -0
- package/src/AllowLists/SimpleDenyList.test.ts +52 -0
- package/src/AllowLists/SimpleDenyList.ts +250 -0
- package/src/Auth/Auth.ts +11 -0
- package/src/Auth/PassthroughAuth.test.ts +12 -0
- package/src/Auth/PassthroughAuth.ts +80 -0
- package/src/Boost.ts +309 -0
- package/src/BoostCore.test.ts +827 -0
- package/src/BoostCore.ts +1447 -0
- package/src/BoostRegistry.ts +543 -0
- package/src/Budgets/Budget.test.ts +27 -0
- package/src/Budgets/Budget.ts +60 -0
- package/src/Budgets/ManagedBudget.test.ts +217 -0
- package/src/Budgets/ManagedBudget.ts +534 -0
- package/src/Budgets/VestingBudget.test.ts +123 -0
- package/src/Budgets/VestingBudget.ts +530 -0
- package/src/Deployable/Contract.ts +228 -0
- package/src/Deployable/Deployable.ts +250 -0
- package/src/Deployable/DeployableTarget.ts +234 -0
- package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
- package/src/Incentives/AllowListIncentive.test.ts +143 -0
- package/src/Incentives/AllowListIncentive.ts +336 -0
- package/src/Incentives/CGDAIncentive.test.ts +132 -0
- package/src/Incentives/CGDAIncentive.ts +470 -0
- package/src/Incentives/ERC1155Incentive.test.ts +87 -0
- package/src/Incentives/ERC1155Incentive.ts +465 -0
- package/src/Incentives/ERC20Incentive.test.ts +130 -0
- package/src/Incentives/ERC20Incentive.ts +484 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +309 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +136 -0
- package/src/Incentives/ERC20VariableIncentive.ts +422 -0
- package/src/Incentives/Incentive.test.ts +92 -0
- package/src/Incentives/Incentive.ts +86 -0
- package/src/Incentives/PointsIncentive.test.ts +139 -0
- package/src/Incentives/PointsIncentive.ts +367 -0
- package/src/Validators/SignerValidator.test.ts +159 -0
- package/src/Validators/SignerValidator.ts +683 -0
- package/src/Validators/Validator.test.ts +21 -0
- package/src/Validators/Validator.ts +55 -0
- package/src/claiming.ts +56 -0
- package/src/errors.ts +844 -0
- package/src/index.test.ts +122 -0
- package/src/index.ts +58 -0
- package/src/transfers.ts +284 -0
- package/src/utils.test.ts +44 -0
- package/src/utils.ts +247 -0
- package/dist/Budgets/SimpleBudget.d.ts +0 -793
- package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
- package/dist/generated-BaaleHW-.cjs +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CGDAIncentive.js","sources":["../../src/Incentives/CGDAIncentive.ts"],"sourcesContent":["import {\n cgdaIncentiveAbi,\n readCgdaIncentiveAsset,\n readCgdaIncentiveCgdaParams,\n readCgdaIncentiveClaimed,\n readCgdaIncentiveClaims,\n readCgdaIncentiveCurrentReward,\n readCgdaIncentiveIsClaimable,\n readCgdaIncentiveOwner,\n readCgdaIncentiveReward,\n readCgdaIncentiveTotalBudget,\n simulateCgdaIncentiveClaim,\n simulateCgdaIncentiveClawback,\n writeCgdaIncentiveClaim,\n writeCgdaIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/CGDAIncentive.sol/CGDAIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n} from 'viem';\nimport { CGDAIncentive as CGDAIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { cgdaIncentiveAbi };\n\n/**\n * The object representation of a `CGDAIncentive.InitPayload`\n *\n * @export\n * @interface CGDAIncentivePayload\n * @typedef {CGDAIncentivePayload}\n */\nexport interface CGDAIncentivePayload {\n /**\n * The address of the ERC20-like token\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The initial reward amount\n *\n * @type {bigint}\n */\n initialReward: bigint;\n /**\n * The amount to subtract from the current reward after each claim\n *\n * @type {bigint}\n */\n rewardDecay: bigint;\n /**\n * The amount by which the reward increases for each hour without a claim (continuous linear increase)\n *\n * @type {bigint}\n */\n rewardBoost: bigint;\n /**\n * The total budget for the incentive\n *\n * @type {bigint}\n */\n totalBudget: bigint;\n}\n\n/**\n * The configuration parameters for the CGDAIncentive\n *\n * @export\n * @interface CGDAParameters\n * @typedef {CGDAParameters}\n */\nexport interface CGDAParameters {\n /**\n * The amount to subtract from the current reward after each claim\n *\n * @type {bigint}\n */\n rewardDecay: bigint;\n /**\n * The amount by which the reward increases for each hour without a claim (continuous linear increase)\n *\n * @type {bigint}\n */\n rewardBoost: bigint;\n /**\n * The timestamp of the last claim\n *\n * @type {bigint}\n */\n lastClaimTime: bigint;\n /**\n * The current reward amount\n *\n * @type {bigint}\n */\n currentReward: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `CGDAIncentive` event types.\n *\n * @export\n * @typedef {CGDAIncentiveLog}\n * @template {ContractEventName<typeof cgdaIncentiveAbi>} [event=ContractEventName<\n * typeof cgdaIncentiveAbi\n * >]\n */\nexport type CGDAIncentiveLog<\n event extends ContractEventName<typeof cgdaIncentiveAbi> = ContractEventName<\n typeof cgdaIncentiveAbi\n >,\n> = GenericLog<typeof cgdaIncentiveAbi, event>;\n\n/**\n * Continuous Gradual Dutch Auction Incentive.\n * An CGDA incentive implementation with reward amounts adjusting dynamically based on claim volume.\n *\n * @export\n * @class CGDAIncentive\n * @typedef {CGDAIncentive}\n * @extends {DeployableTarget<CGDAIncentivePayload>}\n */\nexport class CGDAIncentive extends DeployableTarget<\n CGDAIncentivePayload,\n typeof cgdaIncentiveAbi\n> {\n public override readonly abi = cgdaIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(CGDAIncentiveBases 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 incentive's owner.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams<typeof cgdaIncentiveAbi, 'owner'>) {\n return await readCgdaIncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams<typeof cgdaIncentiveAbi, 'claims'>) {\n return await readCgdaIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The 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<typeof cgdaIncentiveAbi, 'reward'>) {\n return await readCgdaIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the claim status for a user\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(\n address: Address,\n params?: ReadParams<typeof cgdaIncentiveAbi, 'claimed'>,\n ) {\n return await readCgdaIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The CGDA-like token used for the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams<typeof cgdaIncentiveAbi, 'asset'>) {\n return await readCgdaIncentiveAsset(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 configuration parameters for the CGDAIncentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<CGDAParameters>}\n */\n public async cgdaParams(\n params?: ReadParams<typeof cgdaIncentiveAbi, 'cgdaParams'>,\n ): Promise<CGDAParameters> {\n const [rewardDecay, rewardBoost, lastClaimTime, currentReward] =\n await readCgdaIncentiveCgdaParams(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 return {\n rewardDecay,\n rewardBoost,\n lastClaimTime,\n currentReward,\n };\n }\n\n /**\n * The total budget of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalBudget(\n params?: ReadParams<typeof cgdaIncentiveAbi, 'totalBudget'>,\n ) {\n return await readCgdaIncentiveTotalBudget(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(\n payload: ClaimPayload,\n params?: WriteParams<typeof cgdaIncentiveAbi, 'claim'>,\n ) {\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<boolean>} - Returns true if successfully claimed\n */\n protected async claimRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof cgdaIncentiveAbi, 'claim'>,\n ) {\n const { request, result } = await simulateCgdaIncentiveClaim(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 writeCgdaIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(\n payload: ClaimPayload,\n params?: WriteParams<typeof cgdaIncentiveAbi, 'clawback'>,\n ) {\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<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof cgdaIncentiveAbi, 'clawback'>,\n ) {\n const { request, result } = await simulateCgdaIncentiveClawback(\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 writeCgdaIncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload\n */\n public async isClaimable(\n payload: ClaimPayload,\n params?: ReadParams<typeof cgdaIncentiveAbi, 'isClaimable'>,\n ) {\n return await readCgdaIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\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.\n * 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.\n * 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(\n params?: ReadParams<typeof cgdaIncentiveAbi, 'currentReward'>,\n ) {\n return await readCgdaIncentiveCurrentReward(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 * @inheritdoc\n *\n * @public\n * @param {?CGDAIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: CGDAIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: cgdaIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareCGDAIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link CGDAIncentivePayload}, properly encode a `CGDAIncentive.InitPayload` for use with {@link CGDAIncentive} initialization.\n *\n * @param {CGDAIncentivePayload} param0\n * @param {Address} param0.asset - The address of the ERC20-like token\n * @param {bigint} param0.initialReward - The initial reward amount\n * @param {bigint} param0.rewardDecay - The amount to subtract from the current reward after each claim\n * @param {bigint} param0.rewardBoost - The amount by which the reward increases for each hour without a claim (continuous linear increase)\n * @param {bigint} param0.totalBudget - The total budget for the incentive\n * @returns {Hex}\n */\nexport function prepareCGDAIncentivePayload({\n asset,\n initialReward,\n rewardDecay,\n rewardBoost,\n totalBudget,\n}: CGDAIncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'initialReward' },\n { type: 'uint256', name: 'rewardDecay' },\n { type: 'uint256', name: 'rewardBoost' },\n { type: 'uint256', name: 'totalBudget' },\n ],\n [asset, initialReward, rewardDecay, rewardBoost, totalBudget],\n );\n}\n"],"names":["_CGDAIncentive","DeployableTarget","cgdaIncentiveAbi","params","readCgdaIncentiveOwner","readCgdaIncentiveClaims","readCgdaIncentiveReward","address","readCgdaIncentiveClaimed","readCgdaIncentiveAsset","rewardDecay","rewardBoost","lastClaimTime","currentReward","readCgdaIncentiveCgdaParams","readCgdaIncentiveTotalBudget","payload","request","result","simulateCgdaIncentiveClaim","prepareClaimPayload","writeCgdaIncentiveClaim","simulateCgdaIncentiveClawback","writeCgdaIncentiveClawback","readCgdaIncentiveIsClaimable","readCgdaIncentiveCurrentReward","_payload","_options","options","bytecode","prepareCGDAIncentivePayload","CGDAIncentiveBases","RegistryType","CGDAIncentive","asset","initialReward","totalBudget","encodeAbiParameters"],"mappings":";;;;;;gleAyIaA,IAAN,MAAMA,UAAsBC,EAGjC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4B/B,MAAa,MAAMC,GAAuD;AACjE,WAAA,MAAMC,EAAuB,KAAK,SAAS;AAAA,MAChD,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,OAAOA,GAAwD;AACnE,WAAA,MAAME,EAAwB,KAAK,SAAS;AAAA,MACjD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,OAAOA,GAAwD;AACnE,WAAA,MAAMG,EAAwB,KAAK,SAAS;AAAA,MACjD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIH;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AK,SAAS;AAAA,MACxD,SAAS,KAAK,mBAAmB;AAAA;AAAA,MAEjC,GAAItB;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACduB,GACAC,GACyB;AACzB,UAAM,CAACX,GAASY,CAAO,IAAI,KAAK;AAAA,MAC9BF;AAAA,MACAC;AAAA,IAAA;AAEK,WAAA;AAAA,MACL,KAAKzB;AAAAA,MACL,UAAA2B;AAAA,MACA,MAAM,CAACC,EAA4Bd,CAAO,CAAC;AAAA,MAC3C,GAAG,KAAK,wBAAwBY,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;AAlSE5B,EAAuB,QAAiC;AAAA,EACtD,GAAI+B;AAAA,GASN/B,EAAuB,eAA6BgC,EAAa;AAtB5D,IAAMC,IAANjC;AA2TA,SAAS8B,EAA4B;AAAA,EAC1C,OAAAI;AAAA,EACA,eAAAC;AAAA,EACA,aAAAzB;AAAA,EACA,aAAAC;AAAA,EACA,aAAAyB;AACF,GAAyB;AAChB,SAAAC;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,WAAW,MAAM,gBAAgB;AAAA,MACzC,EAAE,MAAM,WAAW,MAAM,cAAc;AAAA,MACvC,EAAE,MAAM,WAAW,MAAM,cAAc;AAAA,MACvC,EAAE,MAAM,WAAW,MAAM,cAAc;AAAA,IACzC;AAAA,IACA,CAACH,GAAOC,GAAezB,GAAaC,GAAayB,CAAW;AAAA,EAAA;AAEhE;"}
|
|
@@ -1,10 +1,59 @@
|
|
|
1
1
|
import { erc1155IncentiveAbi } from '@boostxyz/evm';
|
|
2
|
-
import type
|
|
2
|
+
import { type Address, type ContractEventName, type Hex } from 'viem';
|
|
3
3
|
import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
|
|
4
4
|
import { DeployableTarget } from '../Deployable/DeployableTarget';
|
|
5
|
-
import { type ClaimPayload, type
|
|
6
|
-
|
|
7
|
-
export
|
|
5
|
+
import { type ClaimPayload, type StrategyType } from '../claiming';
|
|
6
|
+
import { type GenericLog, type ReadParams, RegistryType, type WriteParams } from '../utils';
|
|
7
|
+
export { erc1155IncentiveAbi };
|
|
8
|
+
/**
|
|
9
|
+
* Enum representing inventive disbursement strategies for {@link ERC1155Incentive}
|
|
10
|
+
*
|
|
11
|
+
* @export
|
|
12
|
+
* @enum {number}
|
|
13
|
+
*/
|
|
14
|
+
export declare enum ERC1155StrategyType {
|
|
15
|
+
POOL = 0,
|
|
16
|
+
MINT = 1
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The object representation of a `ERC1155Incentive.InitPayload`
|
|
20
|
+
*
|
|
21
|
+
* @export
|
|
22
|
+
* @interface ERC1155IncentivePayload
|
|
23
|
+
* @typedef {ERC1155IncentivePayload}
|
|
24
|
+
*/
|
|
25
|
+
export interface ERC1155IncentivePayload {
|
|
26
|
+
/**
|
|
27
|
+
* The address of the `ERC1155` asset
|
|
28
|
+
*
|
|
29
|
+
* @type {Address}
|
|
30
|
+
*/
|
|
31
|
+
asset: Address;
|
|
32
|
+
/**
|
|
33
|
+
* Should be `Strategy.POOL`
|
|
34
|
+
*
|
|
35
|
+
* @type {ERC1155StrategyType}
|
|
36
|
+
*/
|
|
37
|
+
strategy: ERC1155StrategyType;
|
|
38
|
+
/**
|
|
39
|
+
* The token ID to target
|
|
40
|
+
*
|
|
41
|
+
* @type {bigint}
|
|
42
|
+
*/
|
|
43
|
+
tokenId: bigint;
|
|
44
|
+
/**
|
|
45
|
+
* The maximum number of claims that can be made (one per address)
|
|
46
|
+
*
|
|
47
|
+
* @type {bigint}
|
|
48
|
+
*/
|
|
49
|
+
limit: bigint;
|
|
50
|
+
/**
|
|
51
|
+
* Any extra data to accompany the claim, if applicable.
|
|
52
|
+
*
|
|
53
|
+
* @type {Hex}
|
|
54
|
+
*/
|
|
55
|
+
extraData: Hex;
|
|
56
|
+
}
|
|
8
57
|
/**
|
|
9
58
|
* A generic `viem.Log` event with support for `ERC1155Incentive` event types.
|
|
10
59
|
*
|
|
@@ -207,8 +256,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
207
256
|
readonly type: "function";
|
|
208
257
|
readonly inputs: readonly [{
|
|
209
258
|
readonly name: "";
|
|
210
|
-
readonly internalType: "
|
|
211
|
-
readonly type: "
|
|
259
|
+
readonly internalType: "bytes32";
|
|
260
|
+
readonly type: "bytes32";
|
|
212
261
|
}];
|
|
213
262
|
readonly name: "claimed";
|
|
214
263
|
readonly outputs: readonly [{
|
|
@@ -294,11 +343,11 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
294
343
|
}, {
|
|
295
344
|
readonly type: "function";
|
|
296
345
|
readonly inputs: readonly [{
|
|
297
|
-
readonly name: "
|
|
346
|
+
readonly name: "";
|
|
298
347
|
readonly internalType: "address";
|
|
299
348
|
readonly type: "address";
|
|
300
349
|
}, {
|
|
301
|
-
readonly name: "";
|
|
350
|
+
readonly name: "data_";
|
|
302
351
|
readonly internalType: "bytes";
|
|
303
352
|
readonly type: "bytes";
|
|
304
353
|
}];
|
|
@@ -489,9 +538,9 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
489
538
|
*
|
|
490
539
|
* @public
|
|
491
540
|
* @static
|
|
492
|
-
* @type {Address}
|
|
541
|
+
* @type {Record<number, Address>}
|
|
493
542
|
*/
|
|
494
|
-
static
|
|
543
|
+
static bases: Record<number, Address>;
|
|
495
544
|
/**
|
|
496
545
|
* @inheritdoc
|
|
497
546
|
*
|
|
@@ -505,8 +554,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
505
554
|
*
|
|
506
555
|
* @public
|
|
507
556
|
* @async
|
|
508
|
-
* @param {?ReadParams
|
|
509
|
-
* @returns {
|
|
557
|
+
* @param {?ReadParams} [params]
|
|
558
|
+
* @returns {Promise<bigint>}
|
|
510
559
|
*/
|
|
511
560
|
claims(params?: ReadParams<typeof erc1155IncentiveAbi, 'claims'>): Promise<bigint>;
|
|
512
561
|
/**
|
|
@@ -514,8 +563,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
514
563
|
*
|
|
515
564
|
* @public
|
|
516
565
|
* @async
|
|
517
|
-
* @param {?ReadParams
|
|
518
|
-
* @returns {
|
|
566
|
+
* @param {?ReadParams} [params]
|
|
567
|
+
* @returns {Promise<bigint>}
|
|
519
568
|
*/
|
|
520
569
|
reward(params?: ReadParams<typeof erc1155IncentiveAbi, 'reward'>): Promise<bigint>;
|
|
521
570
|
/**
|
|
@@ -524,8 +573,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
524
573
|
* @public
|
|
525
574
|
* @async
|
|
526
575
|
* @param {Address} address
|
|
527
|
-
* @param {?ReadParams
|
|
528
|
-
* @returns {
|
|
576
|
+
* @param {?ReadParams} [params]
|
|
577
|
+
* @returns {Promise<boolean>}
|
|
529
578
|
*/
|
|
530
579
|
claimed(address: Address, params?: ReadParams<typeof erc1155IncentiveAbi, 'claimed'>): Promise<boolean>;
|
|
531
580
|
/**
|
|
@@ -533,8 +582,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
533
582
|
*
|
|
534
583
|
* @public
|
|
535
584
|
* @async
|
|
536
|
-
* @param {?ReadParams
|
|
537
|
-
* @returns {
|
|
585
|
+
* @param {?ReadParams} [params]
|
|
586
|
+
* @returns {Promise<Address>}
|
|
538
587
|
*/
|
|
539
588
|
asset(params?: ReadParams<typeof erc1155IncentiveAbi, 'asset'>): Promise<`0x${string}`>;
|
|
540
589
|
/**
|
|
@@ -542,7 +591,7 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
542
591
|
*
|
|
543
592
|
* @public
|
|
544
593
|
* @async
|
|
545
|
-
* @param {?ReadParams
|
|
594
|
+
* @param {?ReadParams} [params]
|
|
546
595
|
* @returns {Promise<StrategyType>}
|
|
547
596
|
*/
|
|
548
597
|
strategy(params?: ReadParams<typeof erc1155IncentiveAbi, 'strategy'>): Promise<StrategyType>;
|
|
@@ -551,7 +600,7 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
551
600
|
*
|
|
552
601
|
* @public
|
|
553
602
|
* @async
|
|
554
|
-
* @param {?ReadParams
|
|
603
|
+
* @param {?ReadParams} [params]
|
|
555
604
|
* @returns {unknown}
|
|
556
605
|
*/
|
|
557
606
|
limit(params?: ReadParams<typeof erc1155IncentiveAbi, 'limit'>): Promise<bigint>;
|
|
@@ -560,8 +609,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
560
609
|
*
|
|
561
610
|
* @public
|
|
562
611
|
* @async
|
|
563
|
-
* @param {?ReadParams
|
|
564
|
-
* @returns {
|
|
612
|
+
* @param {?ReadParams} [params]
|
|
613
|
+
* @returns {Promise<bigint>}
|
|
565
614
|
*/
|
|
566
615
|
tokenId(params?: ReadParams<typeof erc1155IncentiveAbi, 'tokenId'>): Promise<bigint>;
|
|
567
616
|
/**
|
|
@@ -569,8 +618,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
569
618
|
*
|
|
570
619
|
* @public
|
|
571
620
|
* @async
|
|
572
|
-
* @param {?ReadParams
|
|
573
|
-
* @returns {
|
|
621
|
+
* @param {?ReadParams} [params]
|
|
622
|
+
* @returns {Promise<Hex>}
|
|
574
623
|
*/
|
|
575
624
|
extraData(params?: ReadParams<typeof erc1155IncentiveAbi, 'extraData'>): Promise<`0x${string}`>;
|
|
576
625
|
/**
|
|
@@ -579,20 +628,20 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
579
628
|
* @public
|
|
580
629
|
* @async
|
|
581
630
|
* @param {ClaimPayload} payload
|
|
582
|
-
* @param {?WriteParams
|
|
583
|
-
* @returns {
|
|
631
|
+
* @param {?WriteParams} [params]
|
|
632
|
+
* @returns {Promise<boolean>}
|
|
584
633
|
*/
|
|
585
|
-
claim(payload: ClaimPayload, params?: WriteParams<typeof erc1155IncentiveAbi, 'claim'>): Promise<boolean>;
|
|
634
|
+
protected claim(payload: ClaimPayload, params?: WriteParams<typeof erc1155IncentiveAbi, 'claim'>): Promise<boolean>;
|
|
586
635
|
/**
|
|
587
636
|
* Description placeholder
|
|
588
637
|
*
|
|
589
638
|
* @public
|
|
590
639
|
* @async
|
|
591
640
|
* @param {ClaimPayload} payload
|
|
592
|
-
* @param {?WriteParams
|
|
593
|
-
* @returns {
|
|
641
|
+
* @param {?WriteParams} [params]
|
|
642
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>}
|
|
594
643
|
*/
|
|
595
|
-
claimRaw(payload: ClaimPayload, params?: WriteParams<typeof erc1155IncentiveAbi, 'claim'>): Promise<{
|
|
644
|
+
protected claimRaw(payload: ClaimPayload, params?: WriteParams<typeof erc1155IncentiveAbi, 'claim'>): Promise<{
|
|
596
645
|
hash: `0x${string}`;
|
|
597
646
|
result: boolean;
|
|
598
647
|
}>;
|
|
@@ -602,8 +651,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
602
651
|
* @public
|
|
603
652
|
* @async
|
|
604
653
|
* @param {ClaimPayload} payload
|
|
605
|
-
* @param {?WriteParams
|
|
606
|
-
* @returns {
|
|
654
|
+
* @param {?WriteParams} [params]
|
|
655
|
+
* @returns {Promise<boolean>}
|
|
607
656
|
*/
|
|
608
657
|
clawback(payload: ClaimPayload, params?: WriteParams<typeof erc1155IncentiveAbi, 'clawback'>): Promise<boolean>;
|
|
609
658
|
/**
|
|
@@ -612,8 +661,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
612
661
|
* @public
|
|
613
662
|
* @async
|
|
614
663
|
* @param {ClaimPayload} payload
|
|
615
|
-
* @param {?WriteParams
|
|
616
|
-
* @returns {
|
|
664
|
+
* @param {?WriteParams} [params]
|
|
665
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>}
|
|
617
666
|
*/
|
|
618
667
|
clawbackRaw(payload: ClaimPayload, params?: WriteParams<typeof erc1155IncentiveAbi, 'clawback'>): Promise<{
|
|
619
668
|
hash: `0x${string}`;
|
|
@@ -625,8 +674,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
625
674
|
* @public
|
|
626
675
|
* @async
|
|
627
676
|
* @param {ClaimPayload} payload
|
|
628
|
-
* @param {?ReadParams
|
|
629
|
-
* @returns {
|
|
677
|
+
* @param {?ReadParams} [params]
|
|
678
|
+
* @returns {Promise<boolean>}
|
|
630
679
|
*/
|
|
631
680
|
isClaimable(payload: ClaimPayload, params?: ReadParams<typeof erc1155IncentiveAbi, 'isClaimable'>): Promise<boolean>;
|
|
632
681
|
/**
|
|
@@ -635,8 +684,8 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
635
684
|
* @public
|
|
636
685
|
* @async
|
|
637
686
|
* @param {ERC1155IncentivePayload} data
|
|
638
|
-
* @param {?ReadParams
|
|
639
|
-
* @returns {
|
|
687
|
+
* @param {?ReadParams} [params]
|
|
688
|
+
* @returns {Promise<Hex>}
|
|
640
689
|
*/
|
|
641
690
|
preflight(data: ERC1155IncentivePayload, params?: ReadParams<typeof erc1155IncentiveAbi, 'preflight'>): Promise<`0x${string}`>;
|
|
642
691
|
/**
|
|
@@ -649,4 +698,16 @@ export declare class ERC1155Incentive extends DeployableTarget<ERC1155IncentiveP
|
|
|
649
698
|
*/
|
|
650
699
|
buildParameters(_payload?: ERC1155IncentivePayload, _options?: DeployableOptions): GenericDeployableParams;
|
|
651
700
|
}
|
|
701
|
+
/**
|
|
702
|
+
* Given a {@link ERC1155IncentivePayload}, properly encode a `ERC1155Incentive.InitPayload` for use with {@link ERC1155Incentive} initialization.
|
|
703
|
+
*
|
|
704
|
+
* @param {ERC1155IncentivePayload} param0
|
|
705
|
+
* @param {Address} param0.asset - The address of the `ERC1155` asset
|
|
706
|
+
* @param {ERC1155StrategyType} param0.strategy - Should be `Strategy.POOL`
|
|
707
|
+
* @param {bigint} param0.tokenId - The token ID to target
|
|
708
|
+
* @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)
|
|
709
|
+
* @param {Hex} param0.extraData - Any extra data to accompany the claim, if applicable.
|
|
710
|
+
* @returns {Hex}
|
|
711
|
+
*/
|
|
712
|
+
export declare const prepareERC1155IncentivePayload: ({ asset, strategy, tokenId, limit, extraData, }: ERC1155IncentivePayload) => `0x${string}`;
|
|
652
713
|
//# sourceMappingURL=ERC1155Incentive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC1155Incentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC1155Incentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAepB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ERC1155Incentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC1155Incentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAepB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAGT,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,YAAY,EAElB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,mBAAmB,EAAE,CAAC;A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,OAAO,CAAC;;;;IAgB3D;;;;;;;;OAQG;IACU,QAAQ,CACnB,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,EAAE,UAAU,CAAC;IAK9D;;;;;;;;OAQG;IACU,WAAW,CACtB,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,EAAE,UAAU,CAAC;;;;IAgB9D;;;;;;;;OAQG;IACU,WAAW,CACtB,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,mBAAmB,EAAE,aAAa,CAAC;IAUhE;;;;;;;;OAQG;IACU,SAAS,CACpB,IAAI,EAAE,uBAAuB,EAC7B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,mBAAmB,EAAE,WAAW,CAAC;IAU9D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,uBAAuB,EAClC,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;CAY3B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,8BAA8B,oDAMxC,uBAAuB,kBAQzB,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../generated-BaaleHW-.cjs"),i=require("../Deployable/DeployableTarget.cjs"),c=require("../utils.cjs"),n="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612273806100bd5f395ff3fe60806040526004361061013f575f3560e01c8063715018a6116100b5578063c884ef831161006e578063c884ef83146103f1578063db09da121461042d578063dcc59b6f14610469578063f04e283e14610493578063f2fde38b146104af578063fee81cf4146104cb5761013f565b8063715018a6146102f15780638da5cb5b146102fb578063a4d66daf14610325578063a8c62e761461034f578063b30906d414610379578063bb1757cf146103b55761013f565b806328d6183b1161010757806328d6183b146101f357806338d52e0f1461021d578063439fab9114610247578063474f5a441461026f5780634e7165a2146102ab57806354d1f13d146102e75761013f565b806301ffc9a71461014357806307621eca1461017f5780632275aea9146101a9578063228cb733146101bf57806325692962146101e9575b5f80fd5b34801561014e575f80fd5b50610169600480360381019061016491906116eb565b610507565b6040516101769190611730565b60405180910390f35b34801561018a575f80fd5b50610193610580565b6040516101a09190611761565b60405180910390f35b3480156101b4575f80fd5b506101bd610589565b005b3480156101ca575f80fd5b506101d3610756565b6040516101e09190611761565b60405180910390f35b6101f161075c565b005b3480156101fe575f80fd5b506102076107ad565b6040516102149190611789565b60405180910390f35b348015610228575f80fd5b506102316107d4565b60405161023e91906117e1565b60405180910390f35b348015610252575f80fd5b5061026d6004803603810190610268919061185b565b6107f9565b005b34801561027a575f80fd5b506102956004803603810190610290919061185b565b610a2c565b6040516102a29190611730565b60405180910390f35b3480156102b6575f80fd5b506102d160048036038101906102cc919061185b565b610ca7565b6040516102de9190611916565b60405180910390f35b6102ef610dc5565b005b6102f9610dfe565b005b348015610306575f80fd5b5061030f610e11565b60405161031c91906117e1565b60405180910390f35b348015610330575f80fd5b50610339610e39565b6040516103469190611761565b60405180910390f35b34801561035a575f80fd5b50610363610e3f565b60405161037091906119a9565b60405180910390f35b348015610384575f80fd5b5061039f600480360381019061039a91906119ec565b610e52565b6040516103ac91906117e1565b60405180910390f35b3480156103c0575f80fd5b506103db60048036038101906103d69190611a41565b610e8d565b6040516103e89190611730565b60405180910390f35b3480156103fc575f80fd5b5061041760048036038101906104129190611a9e565b61117f565b6040516104249190611730565b60405180910390f35b348015610438575f80fd5b50610453600480360381019061044e9190611a41565b61119c565b6040516104609190611730565b60405180910390f35b348015610474575f80fd5b5061047d6111af565b60405161048a9190611761565b60405180910390f35b6104ad60048036038101906104a89190611a9e565b6111b4565b005b6104c960048036038101906104c49190611a9e565b6111f2565b005b3480156104d6575f80fd5b506104f160048036038101906104ec9190611a9e565b61121b565b6040516104fe9190611761565b60405180910390f35b5f7f8c901437000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610579575061057882611234565b5b9050919050565b5f600154905090565b6105916112ad565b6001808111156105a4576105a3611936565b5b600360149054906101000a900460ff1660018111156105c6576105c5611936565b5b146105fd576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f604051806020016040528042446106159190611af6565b81525090505f6005808054905061062b846112e4565b6106359190611b56565b8154811061064657610645611b86565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506106be8160015460035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f39092919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360015460405160200161072e93929190611c18565b60405160208183030381529060405260405161074a9190611916565b60405180910390a25050565b60015481565b5f61076561133c565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f8c90143700000000000000000000000000000000000000000000000000000000905090565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f610802611346565b905080546003825580156108345760018160011c14303b1061082b5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f83838101906108459190611d6c565b90505f8160400151148061085c57505f8160600151145b15610893576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6001808111156108a7576108a6611936565b5b826020015160018111156108be576108bd611936565b5b036108cd5781604001516108e2565b816060015182604001516108e19190611d97565b5b90505f61091130845f015173ffffffffffffffffffffffffffffffffffffffff1661136f90919063ffffffff16565b90508181101561095f57825f015181836040517f5c54305e00000000000000000000000000000000000000000000000000000000815260040161095693929190611dd8565b60405180910390fd5b825f015160035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260200151600360146101000a81548160ff021916908360018111156109cb576109ca611936565b5b0217905550826040015160018190555082606001516004819055506109ef336113a2565b5050508015610a27576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f610a356112ad565b5f8383810190610a459190611f26565b90505f8160200151806020019051810190610a609190611f81565b9050600180811115610a7557610a74611936565b5b600360149054906101000a900460ff166001811115610a9757610a96611936565b5b03610b1c5760015481141580610aad57505f8054115b15610b10573382604051602001610ac4919061203d565b6040516020818303038152906040526040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610b0792919061205d565b60405180910390fd5b5f600481905550610bb4565b5f60015482610b2b9190611b56565b14610b8e573382604051602001610b42919061203d565b6040516020818303038152906040526040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610b8592919061205d565b60405180910390fd5b60015481610b9c919061208b565b60045f828254610bac91906120bb565b925050819055505b610c03825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f39092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610c7793929190611c18565b604051602081830303815290604052604051610c939190611916565b60405180910390a260019250505092915050565b60605f8383810190610cb99190611d6c565b90505f600180811115610ccf57610cce611936565b5b82602001516001811115610ce657610ce5611936565b5b03610cf5578160400151610d0a565b81606001518260400151610d099190611d97565b5b9050604051806080016040528060016002811115610d2b57610d2a611936565b5b8152602001835f015173ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610d8a9190612117565b604051602081830303815290604052815250604051602001610dac91906121d6565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610e066112ad565b610e0f5f611478565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045481565b600360149054906101000a900460ff1681565b60058181548110610e61575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f610e966112ad565b610e9f8461153e565b610ed5576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6001811115610ee857610ee7611936565b5b600360149054906101000a900460ff166001811115610f0a57610f09611936565b5b03611065575f80815480929190610f20906121f6565b9190505550600160025f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550610fc88460015460035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f39092919063ffffffff16565b8373ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168660015460405160200161103893929190611c18565b6040516020818303038152906040526040516110549190611916565b60405180910390a260019050611178565b5f80815480929190611076906121f6565b9190505550600160025f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600584908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff167ff0abe0f5c6f02112a9a4332e7b091bf49040ffddeedb73785a9b9a0a3ca7f15360405160405180910390a2600190505b9392505050565b6002602052805f5260405f205f915054906101000a900460ff1681565b5f6111a68461153e565b90509392505050565b5f5481565b6111bc6112ad565b63389a75e1600c52805f526020600c2080544211156111e257636f5e88185f526004601cfd5b5f8155506111ef81611478565b50565b6111fa6112ad565b8060601b61120f57637448fbae5f526004601cfd5b61121881611478565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f5970a689000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112a657506112a58261159f565b5b9050919050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146112e2576382b429005f526004601cfd5b565b5f602082209050808252919050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611333576390b8ec185f526004601cfd5b5f603452505050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6113aa611618565b15611422577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156113e457630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611475565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611480611618565b156114e5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b821781555061153b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60025f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561159857506004545f54105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061161157506116108261161c565b5b9050919050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6116ca81611696565b81146116d4575f80fd5b50565b5f813590506116e5816116c1565b92915050565b5f60208284031215611700576116ff61168e565b5b5f61170d848285016116d7565b91505092915050565b5f8115159050919050565b61172a81611716565b82525050565b5f6020820190506117435f830184611721565b92915050565b5f819050919050565b61175b81611749565b82525050565b5f6020820190506117745f830184611752565b92915050565b61178381611696565b82525050565b5f60208201905061179c5f83018461177a565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6117cb826117a2565b9050919050565b6117db816117c1565b82525050565b5f6020820190506117f45f8301846117d2565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261181b5761181a6117fa565b5b8235905067ffffffffffffffff811115611838576118376117fe565b5b60208301915083600182028301111561185457611853611802565b5b9250929050565b5f80602083850312156118715761187061168e565b5b5f83013567ffffffffffffffff81111561188e5761188d611692565b5b61189a85828601611806565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6118e8826118a6565b6118f281856118b0565b93506119028185602086016118c0565b61190b816118ce565b840191505092915050565b5f6020820190508181035f83015261192e81846118de565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061197457611973611936565b5b50565b5f81905061198482611963565b919050565b5f61199382611977565b9050919050565b6119a381611989565b82525050565b5f6020820190506119bc5f83018461199a565b92915050565b6119cb81611749565b81146119d5575f80fd5b50565b5f813590506119e6816119c2565b92915050565b5f60208284031215611a0157611a0061168e565b5b5f611a0e848285016119d8565b91505092915050565b611a20816117c1565b8114611a2a575f80fd5b50565b5f81359050611a3b81611a17565b92915050565b5f805f60408486031215611a5857611a5761168e565b5b5f611a6586828701611a2d565b935050602084013567ffffffffffffffff811115611a8657611a85611692565b5b611a9286828701611806565b92509250509250925092565b5f60208284031215611ab357611ab261168e565b5b5f611ac084828501611a2d565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611b0082611749565b9150611b0b83611749565b9250828201905080821115611b2357611b22611ac9565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611b6082611749565b9150611b6b83611749565b925082611b7b57611b7a611b29565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8160601b9050919050565b5f611bc982611bb3565b9050919050565b5f611bda82611bbf565b9050919050565b611bf2611bed826117c1565b611bd0565b82525050565b5f819050919050565b611c12611c0d82611749565b611bf8565b82525050565b5f611c238286611be1565b601482019150611c338285611be1565b601482019150611c438284611c01565b602082019150819050949350505050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611c8e826118ce565b810181811067ffffffffffffffff82111715611cad57611cac611c58565b5b80604052505050565b5f611cbf611685565b9050611ccb8282611c85565b919050565b5f80fd5b60028110611ce0575f80fd5b50565b5f81359050611cf181611cd4565b92915050565b5f60808284031215611d0c57611d0b611c54565b5b611d166080611cb6565b90505f611d2584828501611a2d565b5f830152506020611d3884828501611ce3565b6020830152506040611d4c848285016119d8565b6040830152506060611d60848285016119d8565b60608301525092915050565b5f60808284031215611d8157611d8061168e565b5b5f611d8e84828501611cf7565b91505092915050565b5f611da182611749565b9150611dac83611749565b9250828202611dba81611749565b91508282048414831517611dd157611dd0611ac9565b5b5092915050565b5f606082019050611deb5f8301866117d2565b611df86020830185611752565b611e056040830184611752565b949350505050565b5f80fd5b5f67ffffffffffffffff821115611e2b57611e2a611c58565b5b611e34826118ce565b9050602081019050919050565b828183375f83830152505050565b5f611e61611e5c84611e11565b611cb6565b905082815260208101848484011115611e7d57611e7c611e0d565b5b611e88848285611e41565b509392505050565b5f82601f830112611ea457611ea36117fa565b5b8135611eb4848260208601611e4f565b91505092915050565b5f60408284031215611ed257611ed1611c54565b5b611edc6040611cb6565b90505f611eeb84828501611a2d565b5f83015250602082013567ffffffffffffffff811115611f0e57611f0d611cd0565b5b611f1a84828501611e90565b60208301525092915050565b5f60208284031215611f3b57611f3a61168e565b5b5f82013567ffffffffffffffff811115611f5857611f57611692565b5b611f6484828501611ebd565b91505092915050565b5f81519050611f7b816119c2565b92915050565b5f60208284031215611f9657611f9561168e565b5b5f611fa384828501611f6d565b91505092915050565b611fb5816117c1565b82525050565b5f82825260208201905092915050565b5f611fd5826118a6565b611fdf8185611fbb565b9350611fef8185602086016118c0565b611ff8816118ce565b840191505092915050565b5f604083015f8301516120185f860182611fac565b50602083015184820360208601526120308282611fcb565b9150508091505092915050565b5f6020820190508181035f8301526120558184612003565b905092915050565b5f6040820190506120705f8301856117d2565b818103602083015261208281846118de565b90509392505050565b5f61209582611749565b91506120a083611749565b9250826120b0576120af611b29565b5b828204905092915050565b5f6120c582611749565b91506120d083611749565b92508282039050818111156120e8576120e7611ac9565b5b92915050565b6120f781611749565b82525050565b602082015f8201516121115f8501826120ee565b50505050565b5f60208201905061212a5f8301846120fd565b92915050565b6003811061214157612140611936565b5b50565b5f81905061215182612130565b919050565b5f61216082612144565b9050919050565b61217081612156565b82525050565b5f608083015f83015161218b5f860182612167565b50602083015161219e6020860182611fac565b5060408301516121b16040860182611fac565b50606083015184820360608601526121c98282611fcb565b9150508091505092915050565b5f6020820190508181035f8301526121ee8184612176565b905092915050565b5f61220082611749565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361223257612231611ac9565b5b60018201905091905056fea264697066735822122035b61f4ea2c3b5fd5c3fe652b3fb2ea41d8542dbc6f57a84f75789864bfe9fc564736f6c634300081a0033",s=class s extends i.DeployableTarget{constructor(){super(...arguments),this.abi=b.f}async owner(f){return b.wm(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return b.cm(this._config,{address:this.assertValidAddress(),args:[],...f})}async claims(f){return b.dm(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,a){return b.ym(this._config,{address:this.assertValidAddress(),args:[f],...a})}async asset(f){return b.lm(this._config,{address:this.assertValidAddress(),...f})}async strategy(f){return b.Nm(this._config,{address:this.assertValidAddress(),...f})}async reward(f){return b.Am(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return b.vm(this._config,{address:this.assertValidAddress(),...f})}async entries(f,a){return b.mm(this._config,{address:this.assertValidAddress(),args:[f],...a})}async claim(f,a){return this.awaitResult(this.claimRaw(f,a))}async claimRaw(f,a){const{request:e,result:d}=await b._m(this._config,{address:this.assertValidAddress(),args:[c.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...a});return{hash:await b.Om(this._config,e),result:d}}async clawback(f,a){return this.awaitResult(this.clawbackRaw(f,a))}async clawbackRaw(f,a){const{request:e,result:d}=await b.Fm(this._config,{address:this.assertValidAddress(),args:[c.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...a});return{hash:await b.Cm(this._config,e),result:d}}async isClaimable(f,a){return b.fm(this._config,{address:this.assertValidAddress(),args:[c.prepareClaimPayload(f)],...a})}async drawRaffle(f){return this.awaitResult(this.drawRaffleRaw(f))}async drawRaffleRaw(f){const{request:a,result:e}=await b.km(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f});return{hash:await b.Rm(this._config,a),result:e}}buildParameters(f,a){const[e,d]=this.validateDeploymentConfig(f,a);return{abi:b.f,bytecode:n,args:[c.prepareERC20IncentivePayload(e)],...this.optionallyAttachAccount(d.account)}}};s.base="0xDCfbb7767B281Fd2d39fc7c39A9f89dC61E81f0d",s.registryType=c.RegistryType.INCENTIVE;let t=s;exports.erc20IncentiveAbi=b.f;exports.ERC20Incentive=t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-B0tk-c9b.cjs"),o=require("viem"),l=require("../deployments-CMdF5uEC.cjs"),h=require("../Deployable/DeployableTarget.cjs"),s=require("../claiming.cjs"),u=require("../utils.cjs"),y="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612273806100bd5f395ff3fe60806040526004361061013f575f3560e01c8063715018a6116100b5578063c884ef831161006e578063c884ef83146103f1578063db09da121461042d578063dcc59b6f14610469578063f04e283e14610493578063f2fde38b146104af578063fee81cf4146104cb5761013f565b8063715018a6146102f15780638da5cb5b146102fb578063a4d66daf14610325578063a8c62e761461034f578063b30906d414610379578063bb1757cf146103b55761013f565b806328d6183b1161010757806328d6183b146101f357806338d52e0f1461021d578063439fab9114610247578063474f5a441461026f5780634e7165a2146102ab57806354d1f13d146102e75761013f565b806301ffc9a71461014357806307621eca1461017f5780632275aea9146101a9578063228cb733146101bf57806325692962146101e9575b5f80fd5b34801561014e575f80fd5b50610169600480360381019061016491906116eb565b610507565b6040516101769190611730565b60405180910390f35b34801561018a575f80fd5b50610193610580565b6040516101a09190611761565b60405180910390f35b3480156101b4575f80fd5b506101bd610589565b005b3480156101ca575f80fd5b506101d3610756565b6040516101e09190611761565b60405180910390f35b6101f161075c565b005b3480156101fe575f80fd5b506102076107ad565b6040516102149190611789565b60405180910390f35b348015610228575f80fd5b506102316107d4565b60405161023e91906117e1565b60405180910390f35b348015610252575f80fd5b5061026d6004803603810190610268919061185b565b6107f9565b005b34801561027a575f80fd5b506102956004803603810190610290919061185b565b610a2c565b6040516102a29190611730565b60405180910390f35b3480156102b6575f80fd5b506102d160048036038101906102cc919061185b565b610ca7565b6040516102de9190611916565b60405180910390f35b6102ef610dc5565b005b6102f9610dfe565b005b348015610306575f80fd5b5061030f610e11565b60405161031c91906117e1565b60405180910390f35b348015610330575f80fd5b50610339610e39565b6040516103469190611761565b60405180910390f35b34801561035a575f80fd5b50610363610e3f565b60405161037091906119a9565b60405180910390f35b348015610384575f80fd5b5061039f600480360381019061039a91906119ec565b610e52565b6040516103ac91906117e1565b60405180910390f35b3480156103c0575f80fd5b506103db60048036038101906103d69190611a41565b610e8d565b6040516103e89190611730565b60405180910390f35b3480156103fc575f80fd5b5061041760048036038101906104129190611a9e565b61117f565b6040516104249190611730565b60405180910390f35b348015610438575f80fd5b50610453600480360381019061044e9190611a41565b61119c565b6040516104609190611730565b60405180910390f35b348015610474575f80fd5b5061047d6111af565b60405161048a9190611761565b60405180910390f35b6104ad60048036038101906104a89190611a9e565b6111b4565b005b6104c960048036038101906104c49190611a9e565b6111f2565b005b3480156104d6575f80fd5b506104f160048036038101906104ec9190611a9e565b61121b565b6040516104fe9190611761565b60405180910390f35b5f7f4414fbb4000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610579575061057882611234565b5b9050919050565b5f600154905090565b6105916112ad565b6001808111156105a4576105a3611936565b5b600360149054906101000a900460ff1660018111156105c6576105c5611936565b5b146105fd576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f604051806020016040528042446106159190611af6565b81525090505f6005808054905061062b846112e4565b6106359190611b56565b8154811061064657610645611b86565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506106be8160015460035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f39092919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360015460405160200161072e93929190611c18565b60405160208183030381529060405260405161074a9190611916565b60405180910390a25050565b60015481565b5f61076561133c565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f4414fbb400000000000000000000000000000000000000000000000000000000905090565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f610802611346565b905080546003825580156108345760018160011c14303b1061082b5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f83838101906108459190611d6c565b90505f8160400151148061085c57505f8160600151145b15610893576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6001808111156108a7576108a6611936565b5b826020015160018111156108be576108bd611936565b5b036108cd5781604001516108e2565b816060015182604001516108e19190611d97565b5b90505f61091130845f015173ffffffffffffffffffffffffffffffffffffffff1661136f90919063ffffffff16565b90508181101561095f57825f015181836040517f5c54305e00000000000000000000000000000000000000000000000000000000815260040161095693929190611dd8565b60405180910390fd5b825f015160035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260200151600360146101000a81548160ff021916908360018111156109cb576109ca611936565b5b0217905550826040015160018190555082606001516004819055506109ef336113a2565b5050508015610a27576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f610a356112ad565b5f8383810190610a459190611f26565b90505f8160200151806020019051810190610a609190611f81565b9050600180811115610a7557610a74611936565b5b600360149054906101000a900460ff166001811115610a9757610a96611936565b5b03610b1c5760015481141580610aad57505f8054115b15610b10573382604051602001610ac4919061203d565b6040516020818303038152906040526040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610b0792919061205d565b60405180910390fd5b5f600481905550610bb4565b5f60015482610b2b9190611b56565b14610b8e573382604051602001610b42919061203d565b6040516020818303038152906040526040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610b8592919061205d565b60405180910390fd5b60015481610b9c919061208b565b60045f828254610bac91906120bb565b925050819055505b610c03825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f39092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610c7793929190611c18565b604051602081830303815290604052604051610c939190611916565b60405180910390a260019250505092915050565b60605f8383810190610cb99190611d6c565b90505f600180811115610ccf57610cce611936565b5b82602001516001811115610ce657610ce5611936565b5b03610cf5578160400151610d0a565b81606001518260400151610d099190611d97565b5b9050604051806080016040528060016002811115610d2b57610d2a611936565b5b8152602001835f015173ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610d8a9190612117565b604051602081830303815290604052815250604051602001610dac91906121d6565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610e066112ad565b610e0f5f611478565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045481565b600360149054906101000a900460ff1681565b60058181548110610e61575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f610e966112ad565b610e9f8461153e565b610ed5576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6001811115610ee857610ee7611936565b5b600360149054906101000a900460ff166001811115610f0a57610f09611936565b5b03611065575f80815480929190610f20906121f6565b9190505550600160025f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550610fc88460015460035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f39092919063ffffffff16565b8373ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168660015460405160200161103893929190611c18565b6040516020818303038152906040526040516110549190611916565b60405180910390a260019050611178565b5f80815480929190611076906121f6565b9190505550600160025f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600584908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff167ff0abe0f5c6f02112a9a4332e7b091bf49040ffddeedb73785a9b9a0a3ca7f15360405160405180910390a2600190505b9392505050565b6002602052805f5260405f205f915054906101000a900460ff1681565b5f6111a68461153e565b90509392505050565b5f5481565b6111bc6112ad565b63389a75e1600c52805f526020600c2080544211156111e257636f5e88185f526004601cfd5b5f8155506111ef81611478565b50565b6111fa6112ad565b8060601b61120f57637448fbae5f526004601cfd5b61121881611478565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f91f4490a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112a657506112a58261159f565b5b9050919050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146112e2576382b429005f526004601cfd5b565b5f602082209050808252919050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611333576390b8ec185f526004601cfd5b5f603452505050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6113aa611618565b15611422577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156113e457630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611475565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611480611618565b156114e5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b821781555061153b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60025f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561159857506004545f54105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061161157506116108261161c565b5b9050919050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6116ca81611696565b81146116d4575f80fd5b50565b5f813590506116e5816116c1565b92915050565b5f60208284031215611700576116ff61168e565b5b5f61170d848285016116d7565b91505092915050565b5f8115159050919050565b61172a81611716565b82525050565b5f6020820190506117435f830184611721565b92915050565b5f819050919050565b61175b81611749565b82525050565b5f6020820190506117745f830184611752565b92915050565b61178381611696565b82525050565b5f60208201905061179c5f83018461177a565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6117cb826117a2565b9050919050565b6117db816117c1565b82525050565b5f6020820190506117f45f8301846117d2565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261181b5761181a6117fa565b5b8235905067ffffffffffffffff811115611838576118376117fe565b5b60208301915083600182028301111561185457611853611802565b5b9250929050565b5f80602083850312156118715761187061168e565b5b5f83013567ffffffffffffffff81111561188e5761188d611692565b5b61189a85828601611806565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6118e8826118a6565b6118f281856118b0565b93506119028185602086016118c0565b61190b816118ce565b840191505092915050565b5f6020820190508181035f83015261192e81846118de565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061197457611973611936565b5b50565b5f81905061198482611963565b919050565b5f61199382611977565b9050919050565b6119a381611989565b82525050565b5f6020820190506119bc5f83018461199a565b92915050565b6119cb81611749565b81146119d5575f80fd5b50565b5f813590506119e6816119c2565b92915050565b5f60208284031215611a0157611a0061168e565b5b5f611a0e848285016119d8565b91505092915050565b611a20816117c1565b8114611a2a575f80fd5b50565b5f81359050611a3b81611a17565b92915050565b5f805f60408486031215611a5857611a5761168e565b5b5f611a6586828701611a2d565b935050602084013567ffffffffffffffff811115611a8657611a85611692565b5b611a9286828701611806565b92509250509250925092565b5f60208284031215611ab357611ab261168e565b5b5f611ac084828501611a2d565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611b0082611749565b9150611b0b83611749565b9250828201905080821115611b2357611b22611ac9565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611b6082611749565b9150611b6b83611749565b925082611b7b57611b7a611b29565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8160601b9050919050565b5f611bc982611bb3565b9050919050565b5f611bda82611bbf565b9050919050565b611bf2611bed826117c1565b611bd0565b82525050565b5f819050919050565b611c12611c0d82611749565b611bf8565b82525050565b5f611c238286611be1565b601482019150611c338285611be1565b601482019150611c438284611c01565b602082019150819050949350505050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611c8e826118ce565b810181811067ffffffffffffffff82111715611cad57611cac611c58565b5b80604052505050565b5f611cbf611685565b9050611ccb8282611c85565b919050565b5f80fd5b60028110611ce0575f80fd5b50565b5f81359050611cf181611cd4565b92915050565b5f60808284031215611d0c57611d0b611c54565b5b611d166080611cb6565b90505f611d2584828501611a2d565b5f830152506020611d3884828501611ce3565b6020830152506040611d4c848285016119d8565b6040830152506060611d60848285016119d8565b60608301525092915050565b5f60808284031215611d8157611d8061168e565b5b5f611d8e84828501611cf7565b91505092915050565b5f611da182611749565b9150611dac83611749565b9250828202611dba81611749565b91508282048414831517611dd157611dd0611ac9565b5b5092915050565b5f606082019050611deb5f8301866117d2565b611df86020830185611752565b611e056040830184611752565b949350505050565b5f80fd5b5f67ffffffffffffffff821115611e2b57611e2a611c58565b5b611e34826118ce565b9050602081019050919050565b828183375f83830152505050565b5f611e61611e5c84611e11565b611cb6565b905082815260208101848484011115611e7d57611e7c611e0d565b5b611e88848285611e41565b509392505050565b5f82601f830112611ea457611ea36117fa565b5b8135611eb4848260208601611e4f565b91505092915050565b5f60408284031215611ed257611ed1611c54565b5b611edc6040611cb6565b90505f611eeb84828501611a2d565b5f83015250602082013567ffffffffffffffff811115611f0e57611f0d611cd0565b5b611f1a84828501611e90565b60208301525092915050565b5f60208284031215611f3b57611f3a61168e565b5b5f82013567ffffffffffffffff811115611f5857611f57611692565b5b611f6484828501611ebd565b91505092915050565b5f81519050611f7b816119c2565b92915050565b5f60208284031215611f9657611f9561168e565b5b5f611fa384828501611f6d565b91505092915050565b611fb5816117c1565b82525050565b5f82825260208201905092915050565b5f611fd5826118a6565b611fdf8185611fbb565b9350611fef8185602086016118c0565b611ff8816118ce565b840191505092915050565b5f604083015f8301516120185f860182611fac565b50602083015184820360208601526120308282611fcb565b9150508091505092915050565b5f6020820190508181035f8301526120558184612003565b905092915050565b5f6040820190506120705f8301856117d2565b818103602083015261208281846118de565b90509392505050565b5f61209582611749565b91506120a083611749565b9250826120b0576120af611b29565b5b828204905092915050565b5f6120c582611749565b91506120d083611749565b92508282039050818111156120e8576120e7611ac9565b5b92915050565b6120f781611749565b82525050565b602082015f8201516121115f8501826120ee565b50505050565b5f60208201905061212a5f8301846120fd565b92915050565b6003811061214157612140611936565b5b50565b5f81905061215182612130565b919050565b5f61216082612144565b9050919050565b61217081612156565b82525050565b5f608083015f83015161218b5f860182612167565b50602083015161219e6020860182611fac565b5060408301516121b16040860182611fac565b50606083015184820360608601526121c98282611fcb565b9150508091505092915050565b5f6020820190508181035f8301526121ee8184612176565b905092915050565b5f61220082611749565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361223257612231611ac9565b5b60018201905091905056fea2646970667358221220c48d6677200a822d9bc87ba0d4d9530e225ed8a85c402861b83976b87b0d7dd664736f6c634300081a0033",c=class c extends h.DeployableTarget{constructor(){super(...arguments),this.abi=a.T}async owner(f){return await a.If(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.ff(this._config,{address:this.assertValidAddress(),args:[],...f})}async claims(f){return await a.bf(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.mf(this._config,{address:this.assertValidAddress(),args:[f],...b})}async asset(f){return await a.cf(this._config,{address:this.assertValidAddress(),...f})}strategy(f){return a.Of(this._config,{address:this.assertValidAddress(),...f})}async reward(f){return await a.gf(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.Af(this._config,{address:this.assertValidAddress(),...f})}async entries(f,b){return await a.vf(this._config,{address:this.assertValidAddress(),args:[f],...b})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:d}=await a.Df(this._config,{address:this.assertValidAddress(),args:[s.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.Ef(this._config,e),result:d}}async clawback(f,b){return await this.awaitResult(this.clawbackRaw(f,b))}async clawbackRaw(f,b){const{request:e,result:d}=await a.Ff(this._config,{address:this.assertValidAddress(),args:[s.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.zf(this._config,e),result:d}}async isClaimable(f,b){return await a.Tf(this._config,{address:this.assertValidAddress(),args:[s.prepareClaimPayload(f)],...b})}async drawRaffle(f){return await this.awaitResult(this.drawRaffleRaw(f))}async drawRaffleRaw(f){const{request:b,result:e}=await a.qf(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f});return{hash:await a.xf(this._config,b),result:e}}buildParameters(f,b){const[e,d]=this.validateDeploymentConfig(f,b);return{abi:a.T,bytecode:y,args:[r(e)],...this.optionallyAttachAccount(d.account)}}};c.bases={...l.ERC20Incentive},c.registryType=u.RegistryType.INCENTIVE;let t=c;function r({asset:i,strategy:f,reward:b,limit:e}){return o.encodeAbiParameters([{type:"address",name:"asset"},{type:"uint8",name:"strategy"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[i,f,b,e])}exports.erc20IncentiveAbi=a.T;exports.ERC20Incentive=t;exports.prepareERC20IncentivePayload=r;
|
|
2
|
+
//# sourceMappingURL=ERC20Incentive.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ERC20Incentive.cjs","sources":["../../src/Incentives/ERC20Incentive.ts"],"sourcesContent":["import {\n erc20IncentiveAbi,\n readErc20IncentiveAsset,\n readErc20IncentiveClaimed,\n readErc20IncentiveClaims,\n readErc20IncentiveCurrentReward,\n readErc20IncentiveEntries,\n readErc20IncentiveIsClaimable,\n readErc20IncentiveLimit,\n readErc20IncentiveOwner,\n readErc20IncentiveReward,\n readErc20IncentiveStrategy,\n simulateErc20IncentiveClaim,\n simulateErc20IncentiveClawback,\n simulateErc20IncentiveDrawRaffle,\n writeErc20IncentiveClaim,\n writeErc20IncentiveClawback,\n writeErc20IncentiveDrawRaffle,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20Incentive.sol/ERC20Incentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n} from 'viem';\nimport { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type ClaimPayload,\n type StrategyType,\n prepareClaimPayload,\n} from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20IncentiveAbi };\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20Incentive` event types.\n *\n * @export\n * @typedef {ERC20IncentiveLog}\n * @template {ContractEventName<typeof erc20IncentiveAbi>} [event=ContractEventName<\n * typeof erc20IncentiveAbi\n * >]\n */\nexport type ERC20IncentiveLog<\n event extends ContractEventName<typeof erc20IncentiveAbi> = ContractEventName<\n typeof erc20IncentiveAbi\n >,\n> = GenericLog<typeof erc20IncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20Incentive\n * @typedef {ERC20Incentive}\n * @extends {DeployableTarget<ERC20IncentivePayload>}\n */\nexport class ERC20Incentive extends DeployableTarget<\n ERC20IncentivePayload,\n typeof erc20IncentiveAbi\n> {\n public override readonly abi = erc20IncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(ERC20IncentiveBases 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<typeof erc20IncentiveAbi, 'owner'>) {\n return await readErc20IncentiveOwner(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(\n params?: ReadParams<typeof erc20IncentiveAbi, 'currentReward'>,\n ) {\n return await readErc20IncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams<typeof erc20IncentiveAbi, 'claims'>) {\n return await readErc20IncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(\n address: Address,\n params?: ReadParams<typeof erc20IncentiveAbi, 'claimed'>,\n ) {\n return await readErc20IncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams<typeof erc20IncentiveAbi, 'asset'>) {\n return await readErc20IncentiveAsset(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 strategy for the incentive (MINT or POOL)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<StrategyType>}\n */\n public strategy(\n params?: ReadParams<typeof erc20IncentiveAbi, 'strategy'>,\n ): Promise<StrategyType> {\n return readErc20IncentiveStrategy(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 }) as Promise<StrategyType>;\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<typeof erc20IncentiveAbi, 'reward'>) {\n return await readErc20IncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams<typeof erc20IncentiveAbi, 'limit'>) {\n return await readErc20IncentiveLimit(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 set of addresses that have claimed a slot in the incentive raffle, accessed by bigint index.\n *\n * @public\n * @async\n * @param {bigint} i - Index of address\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async entries(\n i: bigint,\n params?: ReadParams<typeof erc20IncentiveAbi, 'entries'>,\n ) {\n return await readErc20IncentiveEntries(this._config, {\n address: this.assertValidAddress(),\n args: [i],\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(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\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(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClaim(\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 writeErc20IncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\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(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClawback(\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 writeErc20IncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\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(\n payload: ClaimPayload,\n params?: ReadParams<typeof erc20IncentiveAbi, 'isClaimable'>,\n ) {\n return await readErc20IncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\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 * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async drawRaffle(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n return await this.awaitResult(this.drawRaffleRaw(params));\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async drawRaffleRaw(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n const { request, result } = await simulateErc20IncentiveDrawRaffle(\n this._config,\n {\n address: this.assertValidAddress(),\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 writeErc20IncentiveDrawRaffle(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20IncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20IncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20IncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20IncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\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 * @returns {Hex}\n */\nexport function prepareERC20IncentivePayload({\n asset,\n strategy,\n reward,\n limit,\n}: ERC20IncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [asset, strategy, reward, limit],\n );\n}\n"],"names":["_ERC20Incentive","DeployableTarget","erc20IncentiveAbi","params","readErc20IncentiveOwner","readErc20IncentiveCurrentReward","readErc20IncentiveClaims","address","readErc20IncentiveClaimed","readErc20IncentiveAsset","readErc20IncentiveStrategy","readErc20IncentiveReward","readErc20IncentiveLimit","i","readErc20IncentiveEntries","payload","request","result","simulateErc20IncentiveClaim","prepareClaimPayload","writeErc20IncentiveClaim","simulateErc20IncentiveClawback","writeErc20IncentiveClawback","readErc20IncentiveIsClaimable","simulateErc20IncentiveDrawRaffle","writeErc20IncentiveDrawRaffle","_payload","_options","options","bytecode","prepareERC20IncentivePayload","ERC20IncentiveBases","RegistryType","ERC20Incentive","asset","strategy","reward","limit","encodeAbiParameters"],"mappings":"s4jBAuGaA,EAAN,MAAMA,UAAuBC,EAAAA,gBAGlC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA4B/B,MAAa,MAAMC,EAAwD,CAClE,OAAA,MAAMC,EAAAA,GAAwB,KAAK,QAAS,CACjD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cACXA,EACA,CACO,OAAA,MAAME,EAAAA,GAAgC,KAAK,QAAS,CACzD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAyD,CACpE,OAAA,MAAMG,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QACXI,EACAJ,EACA,CACO,OAAA,MAAMK,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAwD,CAClE,OAAA,MAAMM,EAAAA,GAAwB,KAAK,Q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