@boostxyz/sdk 2.0.0-alpha.35 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +4 -4
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.js +17 -17
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +5 -5
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.js +19 -19
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +14 -0
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +100 -81
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +31 -31
- package/dist/Budget-B0kJsZtZ.cjs +2 -0
- package/dist/Budget-B0kJsZtZ.cjs.map +1 -0
- package/dist/Budget-NtzY9H7G.js +462 -0
- package/dist/Budget-NtzY9H7G.js.map +1 -0
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.cjs.map +1 -1
- package/dist/Budgets/Budget.d.ts +5 -4
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +9 -26
- package/dist/Budgets/Budget.js.map +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.js +34 -34
- package/dist/Budgets/ManagedBudgetWithFees.d.ts +1203 -0
- package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -0
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +23 -23
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +18 -0
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +48 -22
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +18 -0
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +47 -16
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.d.ts +18 -0
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +58 -32
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +29 -29
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +18 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +37 -11
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.js +4 -4
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.d.ts +18 -0
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +49 -23
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/{SimpleDenyList-wDvsNIuY.cjs → SimpleDenyList-B65fnca2.cjs} +2 -2
- package/dist/{SimpleDenyList-wDvsNIuY.cjs.map → SimpleDenyList-B65fnca2.cjs.map} +1 -1
- package/dist/{SimpleDenyList-D-rGBaay.js → SimpleDenyList-UvXQl2vm.js} +20 -20
- package/dist/{SimpleDenyList-D-rGBaay.js.map → SimpleDenyList-UvXQl2vm.js.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.js +9 -9
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +8 -8
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.cjs.map +1 -1
- package/dist/Validators/Validator.js +20 -20
- package/dist/componentInterfaces-Bt-4sNB5.cjs +2 -0
- package/dist/componentInterfaces-Bt-4sNB5.cjs.map +1 -0
- package/dist/componentInterfaces-dakxtQHf.js +16 -0
- package/dist/componentInterfaces-dakxtQHf.js.map +1 -0
- package/dist/deployments-DxkwtCyu.cjs +2 -0
- package/dist/deployments-DxkwtCyu.cjs.map +1 -0
- package/dist/{deployments-BdPDIh-i.js → deployments-ZLVwJGZD.js} +33 -30
- package/dist/deployments-ZLVwJGZD.js.map +1 -0
- package/dist/deployments.json +17 -14
- package/dist/{generated-CDEDSOGZ.js → generated-B0XfMfoq.js} +1037 -470
- package/dist/generated-B0XfMfoq.js.map +1 -0
- package/dist/generated-pNKCp_Ez.cjs +3 -0
- package/dist/generated-pNKCp_Ez.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +148 -144
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +12 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +64 -35
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/BoostCore.ts +30 -0
- package/src/Budgets/Budget.ts +8 -3
- package/src/Budgets/ManagedBudgetWithFees.test.ts +286 -0
- package/src/Budgets/ManagedBudgetWithFees.ts +671 -0
- package/src/Incentives/AllowListIncentive.test.ts +52 -4
- package/src/Incentives/AllowListIncentive.ts +28 -0
- package/src/Incentives/CGDAIncentive.test.ts +48 -3
- package/src/Incentives/CGDAIncentive.ts +34 -0
- package/src/Incentives/ERC20Incentive.test.ts +42 -0
- package/src/Incentives/ERC20Incentive.ts +28 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +41 -1
- package/src/Incentives/ERC20VariableIncentive.ts +28 -0
- package/src/Incentives/PointsIncentive.test.ts +47 -3
- package/src/Incentives/PointsIncentive.ts +28 -0
- package/src/index.ts +1 -0
- package/src/utils.ts +46 -0
- package/dist/componentInterfaces-BQw7DH-m.cjs +0 -2
- package/dist/componentInterfaces-BQw7DH-m.cjs.map +0 -1
- package/dist/componentInterfaces-C0vuWQlh.js +0 -15
- package/dist/componentInterfaces-C0vuWQlh.js.map +0 -1
- package/dist/deployments--f75Pthq.cjs +0 -2
- package/dist/deployments--f75Pthq.cjs.map +0 -1
- package/dist/deployments-BdPDIh-i.js.map +0 -1
- package/dist/generated-CDEDSOGZ.js.map +0 -1
- package/dist/generated-D3DE5TfH.cjs +0 -3
- package/dist/generated-D3DE5TfH.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointsIncentive.cjs","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } 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 { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases 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 number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readPointsIncentiveClaims(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 current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readPointsIncentiveCurrentReward(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>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readPointsIncentiveClaimed(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 points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(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 maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(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 selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(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>} - True if the incentive was successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\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 writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * 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(payload: ClaimPayload, params?: ReadParams) {\n return await readPointsIncentiveIsClaimable(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 * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","_payload","_options","options","bytecode","preparePointsIncentivePayload","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","limit","encodeAbiParameters"],"mappings":"wodAmGaA,EAAN,MAAMA,UAAwBC,EAAAA,gBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,OAAOC,EAAqB,CAChC,OAAA,MAAMC,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cAAcA,EAAqB,CACvC,OAAA,MAAME,EAAAA,GAAiC,KAAK,QAAS,CAC1D,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMG,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QAAQ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AA,CACL,IAAKlB,EAAA,EACL,SAAAoB,EACA,KAAM,CAACC,EAA8BX,CAAO,CAAC,EAC7C,GAAG,KAAK,wBAAwBS,EAAQ,OAAO,CAAA,CAEnD,CASO,gBAAiB,CACf,OAAAG,UACT,CACF,EA7NExB,EAAuB,MAAiC,CACtD,MAAO,OACP,GAAIyB,EAAA,eAAA,EASNzB,EAAuB,aAA6B0B,EAAa,aAAA,UAvB5D,IAAMC,EAAN3B,EAqPA,MAAMuB,EAAgC,CAAC,CAC5C,MAAAK,EACA,SAAAC,EACA,OAAAC,EACA,MAAAC,CACF,IACSC,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,SAAU,KAAM,UAAW,EACnC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,CACnC,EACA,CAACJ,EAAOC,EAAUC,EAAQC,CAAK,CAAA"}
|
|
1
|
+
{"version":3,"file":"PointsIncentive.cjs","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } 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 { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases 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 number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readPointsIncentiveClaims(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 current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readPointsIncentiveCurrentReward(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>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readPointsIncentiveClaimed(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 points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(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 maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(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 selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(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>} - True if the incentive was successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\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 writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * 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(payload: ClaimPayload, params?: ReadParams) {\n return await readPointsIncentiveIsClaimable(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 * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","claims","limit","_payload","_options","options","bytecode","preparePointsIncentivePayload","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","encodeAbiParameters"],"mappings":"s7cAmGaA,EAAN,MAAMA,UAAwBC,EAAAA,gBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,OAAOC,EAAqB,CAChC,OAAA,MAAMC,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cAAcA,EAAqB,CACvC,OAAA,MAAME,EAAAA,GAAiC,KAAK,QAAS,CAC1D,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMG,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QAAQI,EAAkBJ,EAAqB,CACnD,OAAA,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EAAQC,CAAK,EAAI,MAAM,QAAQ,IAAI,CACxC,KAAK,OAAOjB,CAAM,EAClB,KAAK,MAAMA,CAAM,CAAA,CAClB,EACD,OAAOiB,EAAQD,CACjB,CAUgB,gBACdE,EACAC,EACyB,CACzB,KAAM,CAACV,EAASW,CAAO,EAAI,KAAK,yBAC9BF,EACAC,CAAA,EAEK,MAAA,CACL,IAAKpB,EAAA,EACL,SAAAsB,EACA,KAAM,CAACC,EAA8Bb,CAAO,CAAC,EAC7C,GAAG,KAAK,wBAAwBW,EAAQ,OAAO,CAAA,CAEnD,CASO,gBAAiB,CACf,OAAAG,UACT,CACF,EAzPE1B,EAAuB,MAAiC,CACtD,MAAO,OACP,GAAI2B,EAAA,eAAA,EASN3B,EAAuB,aAA6B4B,EAAa,aAAA,UAvB5D,IAAMC,EAAN7B,EAiRA,MAAMyB,EAAgC,CAAC,CAC5C,MAAAK,EACA,SAAAC,EACA,OAAAC,EACA,MAAAZ,CACF,IACSa,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,SAAU,KAAM,UAAW,EACnC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,CACnC,EACA,CAACH,EAAOC,EAAUC,EAAQZ,CAAK,CAAA"}
|
|
@@ -649,6 +649,24 @@ export declare class PointsIncentive extends DeployableTarget<PointsIncentivePay
|
|
|
649
649
|
* @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload
|
|
650
650
|
*/
|
|
651
651
|
isClaimable(payload: ClaimPayload, params?: ReadParams): Promise<boolean>;
|
|
652
|
+
/**
|
|
653
|
+
* Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
654
|
+
*
|
|
655
|
+
* @public
|
|
656
|
+
* @async
|
|
657
|
+
* @param {?ReadParams} [params]
|
|
658
|
+
* @returns {Promise<boolean>} - True if total claims is less than limit
|
|
659
|
+
*/
|
|
660
|
+
canBeClaimed(params?: ReadParams): Promise<boolean>;
|
|
661
|
+
/**
|
|
662
|
+
* Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
663
|
+
*
|
|
664
|
+
* @public
|
|
665
|
+
* @async
|
|
666
|
+
* @param {?ReadParams} [params]
|
|
667
|
+
* @returns {Promise<bigint>} - True if total claims is less than limit
|
|
668
|
+
*/
|
|
669
|
+
getRemainingClaimPotential(params?: ReadParams): Promise<bigint>;
|
|
652
670
|
/**
|
|
653
671
|
* @inheritdoc
|
|
654
672
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointsIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/PointsIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAWnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAGT,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,QAAQ,EAAE,GAAG,CAAC;IACd;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,CAC5B,KAAK,SAAS,iBAAiB,CAC7B,O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ated-B0XfMfoq.js";
|
|
2
2
|
import { zeroHash as w, encodeAbiParameters as A } from "viem";
|
|
3
|
-
import { P as
|
|
4
|
-
import { DeployableTarget as
|
|
3
|
+
import { P as z } from "../deployments-ZLVwJGZD.js";
|
|
4
|
+
import { DeployableTarget as V } from "../Deployable/DeployableTarget.js";
|
|
5
5
|
import { prepareClaimPayload as s } from "../claiming.js";
|
|
6
|
-
import { RegistryType as
|
|
7
|
-
const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b99806101185f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db9190611407565b61065f565b6040516101ed919061144c565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061147d565b60405180910390f35b61023a600480360381019061023591906114c0565b6106e1565b005b61025660048036038101906102519190611545565b6106ee565b005b348015610263575f80fd5b5061027e60048036038101906102799190611545565b610704565b60405161028b919061144c565b60405180910390f35b34801561029f575f80fd5b506102a861071a565b6040516102b5919061147d565b60405180910390f35b6102c6610720565b005b3480156102d3575f80fd5b506102dc610771565b6040516102e99190611592565b60405180910390f35b3480156102fd575f80fd5b50610318600480360381019061031391906115ab565b610798565b604051610325919061147d565b60405180910390f35b348015610339575f80fd5b506103426107b1565b60405161034f91906115e5565b60405180910390f35b348015610363575f80fd5b5061037e6004803603810190610379919061165f565b6107d4565b005b34801561038b575f80fd5b506103a660048036038101906103a1919061165f565b61092c565b6040516103b49291906116aa565b60405180910390f35b6103d760048036038101906103d29190611545565b610960565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa919061165f565b610976565b60405161040c9190611741565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611545565b6109cd565b604051610448919061144c565b60405180910390f35b6104596109e4565b005b610463610a1d565b005b348015610470575f80fd5b50610479610a30565b60405161048691906115e5565b60405180910390f35b34801561049a575f80fd5b506104a3610a58565b6040516104b091906115e5565b60405180910390f35b3480156104c4575f80fd5b506104cd610a7d565b6040516104da919061147d565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611761565b610a83565b604051610516919061144c565b60405180910390f35b34801561052a575f80fd5b50610545600480360381019061054091906115ab565b610e9b565b604051610552919061144c565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611761565b610eb8565b60405161058e919061144c565b60405180910390f35b3480156105a2575f80fd5b506105ab610ecb565b6040516105b8919061147d565b60405180910390f35b3480156105cc575f80fd5b506105d5610ed1565b6040516105e29190611592565b60405180910390f35b610605600480360381019061060091906115ab565b610ee3565b005b610621600480360381019061061c91906115ab565b610f21565b005b34801561062e575f80fd5b50610649600480360381019061064491906115ab565b610f4a565b604051610656919061147d565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f63565b5b9050919050565b5f600254905090565b6106eb3382610fdc565b50565b6106f6610feb565b6107008282611022565b5050565b5f818261071085610798565b1614905092915050565b60025481565b5f610729611032565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f6107dd61103c565b9050805460038255801561080f5760018160011c14303b106108065763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061082091906118af565b90505f8160400151148061083757505f8160600151145b1561086e576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160065f6101000a81548163ffffffff021916908360e01c0217905550806040015160028190555080606001516005819055506108f133611065565b508015610927576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610968610feb565b6109728282610fdc565b5050565b60605f67ffffffffffffffff811115610992576109916117c2565b5b6040519080825280601f01601f1916602001820160405280156109c45781602001600182028036833780820191505090505b50905092915050565b5f80826109d985610798565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a25610feb565b610a2e5f61113b565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b5f610a8c610feb565b5f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b3591906118ee565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bd85750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b9492919061195b565b602060405180830381865afa158015610baf573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bd391906119ac565b151514155b15610c0f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c1885611201565b610c4e576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015f815480929190610c6090611a04565b9190505550600160035f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900460e01b87600254604051602401610d17929190611a4b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d819190611aac565b5f604051808303815f865af19150503d805f8114610dba576040519150601f19603f3d011682016040523d82523d5f602084013e610dbf565b606091505b5050905080610dfa576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600254604051602001610e6a93929190611b27565b604051602081830303815290604052604051610e869190611741565b60405180910390a26001925050509392505050565b6003602052805f5260405f205f915054906101000a900460ff1681565b5f610ec284611201565b90509392505050565b60015481565b60065f9054906101000a900460e01b81565b610eeb610feb565b63389a75e1600c52805f526020600c208054421115610f1157636f5e88185f526004601cfd5b5f815550610f1e8161113b565b50565b610f29610feb565b8060601b610f3e57637448fbae5f526004601cfd5b610f478161113b565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fd55750610fd482611263565b5b9050919050565b610fe782825f6112dc565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611020576382b429005f526004601cfd5b565b61102e828260016112dc565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61106d611334565b156110e5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156110a757630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611138565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611143611334565b156111a8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111fe565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561125c5750600554600154105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112d557506112d482611338565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112fe57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113e6816113b2565b81146113f0575f80fd5b50565b5f81359050611401816113dd565b92915050565b5f6020828403121561141c5761141b6113aa565b5b5f611429848285016113f3565b91505092915050565b5f8115159050919050565b61144681611432565b82525050565b5f60208201905061145f5f83018461143d565b92915050565b5f819050919050565b61147781611465565b82525050565b5f6020820190506114905f83018461146e565b92915050565b61149f81611465565b81146114a9575f80fd5b50565b5f813590506114ba81611496565b92915050565b5f602082840312156114d5576114d46113aa565b5b5f6114e2848285016114ac565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611514826114eb565b9050919050565b6115248161150a565b811461152e575f80fd5b50565b5f8135905061153f8161151b565b92915050565b5f806040838503121561155b5761155a6113aa565b5b5f61156885828601611531565b9250506020611579858286016114ac565b9150509250929050565b61158c816113b2565b82525050565b5f6020820190506115a55f830184611583565b92915050565b5f602082840312156115c0576115bf6113aa565b5b5f6115cd84828501611531565b91505092915050565b6115df8161150a565b82525050565b5f6020820190506115f85f8301846115d6565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261161f5761161e6115fe565b5b8235905067ffffffffffffffff81111561163c5761163b611602565b5b60208301915083600182028301111561165857611657611606565b5b9250929050565b5f8060208385031215611675576116746113aa565b5b5f83013567ffffffffffffffff811115611692576116916113ae565b5b61169e8582860161160a565b92509250509250929050565b5f6040820190506116bd5f83018561146e565b6116ca60208301846115d6565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611713826116d1565b61171d81856116db565b935061172d8185602086016116eb565b611736816116f9565b840191505092915050565b5f6020820190508181035f8301526117598184611709565b905092915050565b5f805f60408486031215611778576117776113aa565b5b5f61178586828701611531565b935050602084013567ffffffffffffffff8111156117a6576117a56113ae565b5b6117b28682870161160a565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117f8826116f9565b810181811067ffffffffffffffff82111715611817576118166117c2565b5b80604052505050565b5f6118296113a1565b905061183582826117ef565b919050565b5f6080828403121561184f5761184e6117be565b5b6118596080611820565b90505f61186884828501611531565b5f83015250602061187b848285016113f3565b602083015250604061188f848285016114ac565b60408301525060606118a3848285016114ac565b60608301525092915050565b5f608082840312156118c4576118c36113aa565b5b5f6118d18482850161183a565b91505092915050565b5f815190506118e88161151b565b92915050565b5f60208284031215611903576119026113aa565b5b5f611910848285016118da565b91505092915050565b5f819050919050565b5f819050919050565b5f61194561194061193b84611919565b611922565b611465565b9050919050565b6119558161192b565b82525050565b5f60408201905061196e5f8301856115d6565b61197b602083018461194c565b9392505050565b61198b81611432565b8114611995575f80fd5b50565b5f815190506119a681611982565b92915050565b5f602082840312156119c1576119c06113aa565b5b5f6119ce84828501611998565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0e82611465565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a4057611a3f6119d7565b5b600182019050919050565b5f604082019050611a5e5f8301856115d6565b611a6b602083018461146e565b9392505050565b5f81905092915050565b5f611a86826116d1565b611a908185611a72565b9350611aa08185602086016116eb565b80840191505092915050565b5f611ab78284611a7c565b915081905092915050565b5f8160601b9050919050565b5f611ad882611ac2565b9050919050565b5f611ae982611ace565b9050919050565b611b01611afc8261150a565b611adf565b82525050565b5f819050919050565b611b21611b1c82611465565b611b07565b82525050565b5f611b328286611af0565b601482019150611b428285611af0565b601482019150611b528284611b10565b60208201915081905094935050505056fea2646970667358221220e1ce7f1c57a6d62d7c8e566241c04213bed868c0967ce7c24b4cc5c5f5d63e4364736f6c634300081a0033", e = class e extends O {
|
|
6
|
+
import { RegistryType as C } from "../utils.js";
|
|
7
|
+
const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b8b806100bd5f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db91906113f9565b61065f565b6040516101ed919061143e565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061146f565b60405180910390f35b61023a600480360381019061023591906114b2565b6106e0565b005b61025660048036038101906102519190611537565b6106ed565b005b348015610263575f80fd5b5061027e60048036038101906102799190611537565b610703565b60405161028b919061143e565b60405180910390f35b34801561029f575f80fd5b506102a8610719565b6040516102b5919061146f565b60405180910390f35b6102c661071e565b005b3480156102d3575f80fd5b506102dc61076f565b6040516102e99190611584565b60405180910390f35b3480156102fd575f80fd5b506103186004803603810190610313919061159d565b610796565b604051610325919061146f565b60405180910390f35b348015610339575f80fd5b506103426107af565b60405161034f91906115d7565b60405180910390f35b348015610363575f80fd5b5061037e60048036038101906103799190611651565b6107ca565b005b34801561038b575f80fd5b506103a660048036038101906103a19190611651565b610921565b6040516103b492919061169c565b60405180910390f35b6103d760048036038101906103d29190611537565b610955565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa9190611651565b61096b565b60405161040c9190611733565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611537565b6109c2565b604051610448919061143e565b60405180910390f35b6104596109d9565b005b610463610a12565b005b348015610470575f80fd5b50610479610a25565b60405161048691906115d7565b60405180910390f35b34801561049a575f80fd5b506104a3610a4d565b6040516104b091906115d7565b60405180910390f35b3480156104c4575f80fd5b506104cd610a72565b6040516104da919061146f565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611753565b610a78565b604051610516919061143e565b60405180910390f35b34801561052a575f80fd5b506105456004803603810190610540919061159d565b610e8d565b604051610552919061143e565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611753565b610eaa565b60405161058e919061143e565b60405180910390f35b3480156105a2575f80fd5b506105ab610ebd565b6040516105b8919061146f565b60405180910390f35b3480156105cc575f80fd5b506105d5610ec3565b6040516105e29190611584565b60405180910390f35b6106056004803603810190610600919061159d565b610ed5565b005b610621600480360381019061061c919061159d565b610f13565b005b34801561062e575f80fd5b506106496004803603810190610644919061159d565b610f3c565b604051610656919061146f565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f55565b5b9050919050565b5f8054905090565b6106ea3382610fce565b50565b6106f5610fdd565b6106ff8282611014565b5050565b5f818261070f85610796565b1614905092915050565b5f5481565b5f610727611024565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f73deaddeaddeaddeaddeaddeaddeaddeaddeaddead905090565b5f6107d361102e565b905080546003825580156108055760018160011c14303b106107fc5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061081691906118a1565b90505f8160400151148061082d57505f8160600151145b15610864576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160045f6101000a81548163ffffffff021916908360e01c021790555080604001515f8190555080606001516003819055506108e633611057565b50801561091c576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61095d610fdd565b6109678282610fce565b5050565b60605f67ffffffffffffffff811115610987576109866117b4565b5b6040519080825280601f01601f1916602001820160405280156109b95781602001600182028036833780820191505090505b50905092915050565b5f80826109ce85610796565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a1a610fdd565b610a235f61112d565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b5f610a81610fdd565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b06573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b2a91906118e0565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bcd5750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b8992919061194d565b602060405180830381865afa158015610ba4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bc8919061199e565b151514155b15610c04576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c0d856111f3565b610c43576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f815480929190610c55906119f6565b91905055506001805f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900460e01b875f54604051602401610d0a929190611a3d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d749190611a9e565b5f604051808303815f865af19150503d805f8114610dad576040519150601f19603f3d011682016040523d82523d5f602084013e610db2565b606091505b5050905080610ded576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16885f54604051602001610e5c93929190611b19565b604051602081830303815290604052604051610e789190611733565b60405180910390a26001925050509392505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b5f610eb4846111f3565b90509392505050565b60055481565b60045f9054906101000a900460e01b81565b610edd610fdd565b63389a75e1600c52805f526020600c208054421115610f0357636f5e88185f526004601cfd5b5f815550610f108161112d565b50565b610f1b610fdd565b8060601b610f3057637448fbae5f526004601cfd5b610f398161112d565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fc75750610fc682611255565b5b9050919050565b610fd982825f6112ce565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611012576382b429005f526004601cfd5b565b611020828260016112ce565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61105f611326565b156110d7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561109957630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061112a565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611135611326565b1561119a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111f0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561124e5750600354600554105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112c757506112c68261132a565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112f057848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113d8816113a4565b81146113e2575f80fd5b50565b5f813590506113f3816113cf565b92915050565b5f6020828403121561140e5761140d61139c565b5b5f61141b848285016113e5565b91505092915050565b5f8115159050919050565b61143881611424565b82525050565b5f6020820190506114515f83018461142f565b92915050565b5f819050919050565b61146981611457565b82525050565b5f6020820190506114825f830184611460565b92915050565b61149181611457565b811461149b575f80fd5b50565b5f813590506114ac81611488565b92915050565b5f602082840312156114c7576114c661139c565b5b5f6114d48482850161149e565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611506826114dd565b9050919050565b611516816114fc565b8114611520575f80fd5b50565b5f813590506115318161150d565b92915050565b5f806040838503121561154d5761154c61139c565b5b5f61155a85828601611523565b925050602061156b8582860161149e565b9150509250929050565b61157e816113a4565b82525050565b5f6020820190506115975f830184611575565b92915050565b5f602082840312156115b2576115b161139c565b5b5f6115bf84828501611523565b91505092915050565b6115d1816114fc565b82525050565b5f6020820190506115ea5f8301846115c8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611611576116106115f0565b5b8235905067ffffffffffffffff81111561162e5761162d6115f4565b5b60208301915083600182028301111561164a576116496115f8565b5b9250929050565b5f80602083850312156116675761166661139c565b5b5f83013567ffffffffffffffff811115611684576116836113a0565b5b611690858286016115fc565b92509250509250929050565b5f6040820190506116af5f830185611460565b6116bc60208301846115c8565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611705826116c3565b61170f81856116cd565b935061171f8185602086016116dd565b611728816116eb565b840191505092915050565b5f6020820190508181035f83015261174b81846116fb565b905092915050565b5f805f6040848603121561176a5761176961139c565b5b5f61177786828701611523565b935050602084013567ffffffffffffffff811115611798576117976113a0565b5b6117a4868287016115fc565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117ea826116eb565b810181811067ffffffffffffffff82111715611809576118086117b4565b5b80604052505050565b5f61181b611393565b905061182782826117e1565b919050565b5f60808284031215611841576118406117b0565b5b61184b6080611812565b90505f61185a84828501611523565b5f83015250602061186d848285016113e5565b60208301525060406118818482850161149e565b60408301525060606118958482850161149e565b60608301525092915050565b5f608082840312156118b6576118b561139c565b5b5f6118c38482850161182c565b91505092915050565b5f815190506118da8161150d565b92915050565b5f602082840312156118f5576118f461139c565b5b5f611902848285016118cc565b91505092915050565b5f819050919050565b5f819050919050565b5f61193761193261192d8461190b565b611914565b611457565b9050919050565b6119478161191d565b82525050565b5f6040820190506119605f8301856115c8565b61196d602083018461193e565b9392505050565b61197d81611424565b8114611987575f80fd5b50565b5f8151905061199881611974565b92915050565b5f602082840312156119b3576119b261139c565b5b5f6119c08482850161198a565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0082611457565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a3257611a316119c9565b5b600182019050919050565b5f604082019050611a505f8301856115c8565b611a5d6020830184611460565b9392505050565b5f81905092915050565b5f611a78826116c3565b611a828185611a64565b9350611a928185602086016116dd565b80840191505092915050565b5f611aa98284611a6e565b915081905092915050565b5f8160601b9050919050565b5f611aca82611ab4565b9050919050565b5f611adb82611ac0565b9050919050565b611af3611aee826114fc565b611ad1565b82525050565b5f819050919050565b611b13611b0e82611457565b611af9565b82525050565b5f611b248286611ae2565b601482019150611b348285611ae2565b601482019150611b448284611b02565b60208201915081905094935050505056fea2646970667358221220d6b660c45cfb14561fecfab54209da8ea926d96b371bbdb9b93f5ad944e89aad64736f6c634300081a0033", d = class d extends V {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments), this.abi = c;
|
|
10
10
|
}
|
|
@@ -17,7 +17,7 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
|
|
|
17
17
|
* @returns {Promise<bigint>}
|
|
18
18
|
*/
|
|
19
19
|
async claims(f) {
|
|
20
|
-
return await
|
|
20
|
+
return await r(this._config, {
|
|
21
21
|
address: this.assertValidAddress(),
|
|
22
22
|
args: [],
|
|
23
23
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -82,7 +82,7 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
|
|
|
82
82
|
* @returns {Promise<Address>}
|
|
83
83
|
*/
|
|
84
84
|
async venue(f) {
|
|
85
|
-
return await
|
|
85
|
+
return await m(this._config, {
|
|
86
86
|
address: this.assertValidAddress(),
|
|
87
87
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
88
88
|
...f
|
|
@@ -97,7 +97,7 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
|
|
|
97
97
|
* @returns {Promise<bigint>}
|
|
98
98
|
*/
|
|
99
99
|
async limit(f) {
|
|
100
|
-
return await
|
|
100
|
+
return await h(this._config, {
|
|
101
101
|
address: this.assertValidAddress(),
|
|
102
102
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
103
103
|
...f
|
|
@@ -140,7 +140,7 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
|
|
|
140
140
|
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed
|
|
141
141
|
*/
|
|
142
142
|
async claimRaw(f, b) {
|
|
143
|
-
const { request: a, result:
|
|
143
|
+
const { request: a, result: e } = await y(
|
|
144
144
|
this._config,
|
|
145
145
|
{
|
|
146
146
|
address: this.assertValidAddress(),
|
|
@@ -150,7 +150,7 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
|
|
|
150
150
|
...b
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
return { hash: await
|
|
153
|
+
return { hash: await g(this._config, a), result: e };
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* Check if an incentive is claimable.
|
|
@@ -164,13 +164,39 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
|
|
|
164
164
|
* @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload
|
|
165
165
|
*/
|
|
166
166
|
async isClaimable(f, b) {
|
|
167
|
-
return await
|
|
167
|
+
return await p(this._config, {
|
|
168
168
|
address: this.assertValidAddress(),
|
|
169
169
|
args: [s(f)],
|
|
170
170
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
171
171
|
...b
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
176
|
+
*
|
|
177
|
+
* @public
|
|
178
|
+
* @async
|
|
179
|
+
* @param {?ReadParams} [params]
|
|
180
|
+
* @returns {Promise<boolean>} - True if total claims is less than limit
|
|
181
|
+
*/
|
|
182
|
+
async canBeClaimed(f) {
|
|
183
|
+
return await this.getRemainingClaimPotential(f) > 0n;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
187
|
+
*
|
|
188
|
+
* @public
|
|
189
|
+
* @async
|
|
190
|
+
* @param {?ReadParams} [params]
|
|
191
|
+
* @returns {Promise<bigint>} - True if total claims is less than limit
|
|
192
|
+
*/
|
|
193
|
+
async getRemainingClaimPotential(f) {
|
|
194
|
+
const [b, a] = await Promise.all([
|
|
195
|
+
this.claims(f),
|
|
196
|
+
this.limit(f)
|
|
197
|
+
]);
|
|
198
|
+
return a - b;
|
|
199
|
+
}
|
|
174
200
|
/**
|
|
175
201
|
* @inheritdoc
|
|
176
202
|
*
|
|
@@ -180,15 +206,15 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
|
|
|
180
206
|
* @returns {GenericDeployableParams}
|
|
181
207
|
*/
|
|
182
208
|
buildParameters(f, b) {
|
|
183
|
-
const [a,
|
|
209
|
+
const [a, e] = this.validateDeploymentConfig(
|
|
184
210
|
f,
|
|
185
211
|
b
|
|
186
212
|
);
|
|
187
213
|
return {
|
|
188
214
|
abi: c,
|
|
189
|
-
bytecode:
|
|
190
|
-
args: [
|
|
191
|
-
...this.optionallyAttachAccount(
|
|
215
|
+
bytecode: _,
|
|
216
|
+
args: [P(a)],
|
|
217
|
+
...this.optionallyAttachAccount(e.account)
|
|
192
218
|
};
|
|
193
219
|
}
|
|
194
220
|
/**
|
|
@@ -202,13 +228,13 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
|
|
|
202
228
|
return w;
|
|
203
229
|
}
|
|
204
230
|
};
|
|
205
|
-
|
|
231
|
+
d.bases = {
|
|
206
232
|
31337: void 0,
|
|
207
|
-
...
|
|
208
|
-
},
|
|
209
|
-
let t =
|
|
210
|
-
const
|
|
211
|
-
venue:
|
|
233
|
+
...z
|
|
234
|
+
}, d.registryType = C.INCENTIVE;
|
|
235
|
+
let t = d;
|
|
236
|
+
const P = ({
|
|
237
|
+
venue: i,
|
|
212
238
|
selector: f,
|
|
213
239
|
reward: b,
|
|
214
240
|
limit: a
|
|
@@ -219,11 +245,11 @@ const T = ({
|
|
|
219
245
|
{ type: "uint256", name: "reward" },
|
|
220
246
|
{ type: "uint256", name: "limit" }
|
|
221
247
|
],
|
|
222
|
-
[
|
|
248
|
+
[i, f, b, a]
|
|
223
249
|
);
|
|
224
250
|
export {
|
|
225
251
|
t as PointsIncentive,
|
|
226
252
|
c as pointsIncentiveAbi,
|
|
227
|
-
|
|
253
|
+
P as preparePointsIncentivePayload
|
|
228
254
|
};
|
|
229
255
|
//# sourceMappingURL=PointsIncentive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointsIncentive.js","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } 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 { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases 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 number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readPointsIncentiveClaims(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 current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readPointsIncentiveCurrentReward(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>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readPointsIncentiveClaimed(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 points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(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 maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(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 selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(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>} - True if the incentive was successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\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 writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * 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(payload: ClaimPayload, params?: ReadParams) {\n return await readPointsIncentiveIsClaimable(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 * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","_payload","_options","options","bytecode","preparePointsIncentivePayload","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","limit","encodeAbiParameters"],"mappings":";;;;;;k3cAmGaA,IAAN,MAAMA,UAAwBC,EAGnC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,OAAOC,GAAqB;AAChC,WAAA,MAAMC,EAA0B,KAAK,SAAS;AAAA,MACnD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA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AwBS,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,iBAAiB;AACf,WAAAG;AAAA,EACT;AACF;AA7NExB,EAAuB,QAAiC;AAAA,EACtD,OAAO;AAAA,EACP,GAAIyB;AAAA,GASNzB,EAAuB,eAA6B0B,EAAa;AAvB5D,IAAMC,IAAN3B;AAqPA,MAAMuB,IAAgC,CAAC;AAAA,EAC5C,OAAAK;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AACF,MACSC;AAAA,EACL;AAAA,IACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,IACjC,EAAE,MAAM,UAAU,MAAM,WAAW;AAAA,IACnC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,IAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,EACnC;AAAA,EACA,CAACJ,GAAOC,GAAUC,GAAQC,CAAK;AAAA;"}
|
|
1
|
+
{"version":3,"file":"PointsIncentive.js","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } 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 { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases 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 number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readPointsIncentiveClaims(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 current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readPointsIncentiveCurrentReward(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>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readPointsIncentiveClaimed(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 points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(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 maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(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 selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(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>} - True if the incentive was successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\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 writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * 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(payload: ClaimPayload, params?: ReadParams) {\n return await readPointsIncentiveIsClaimable(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 * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","claims","limit","_payload","_options","options","bytecode","preparePointsIncentivePayload","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","encodeAbiParameters"],"mappings":";;;;;;gqcAmGaA,IAAN,MAAMA,UAAwBC,EAGnC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,OAAOC,GAAqB;AAChC,WAAA,MAAMC,EAA0B,KAAK,SAAS;AAAA,MACnD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cAAcA,GAAqB;AACvC,WAAA,MAAME,EAAiC,KAAK,SAAS;AAAA,MAC1D,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;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AM,CAACV,GAASW,CAAO,IAAI,KAAK;AAAA,MAC9BF;AAAA,MACAC;AAAA,IAAA;AAEK,WAAA;AAAA,MACL,KAAKpB;AAAAA,MACL,UAAAsB;AAAA,MACA,MAAM,CAACC,EAA8Bb,CAAO,CAAC;AAAA,MAC7C,GAAG,KAAK,wBAAwBW,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,iBAAiB;AACf,WAAAG;AAAA,EACT;AACF;AAzPE1B,EAAuB,QAAiC;AAAA,EACtD,OAAO;AAAA,EACP,GAAI2B;AAAA,GASN3B,EAAuB,eAA6B4B,EAAa;AAvB5D,IAAMC,IAAN7B;AAiRA,MAAMyB,IAAgC,CAAC;AAAA,EAC5C,OAAAK;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAZ;AACF,MACSa;AAAA,EACL;AAAA,IACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,IACjC,EAAE,MAAM,UAAU,MAAM,WAAW;AAAA,IACnC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,IAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,EACnC;AAAA,EACA,CAACH,GAAOC,GAAUC,GAAQZ,CAAK;AAAA;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const d=require("./generated-D3DE5TfH.cjs"),h=require("@wagmi/core"),r=require("viem"),y=require("./deployments--f75Pthq.cjs"),p=require("./Deployable/DeployableTargetWithRBAC.cjs"),w=require("./errors.cjs"),g=require("./utils.cjs"),o="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6118ff806100bd5f395ff3fe60806040526004361061014a575f3560e01c806354d1f13d116100b5578063e3f756de1161006e578063e3f756de146103f6578063ec87621c14610432578063f04e283e1461045c578063f2fde38b14610478578063fe9fbb8014610494578063fee81cf4146104d05761014a565b806354d1f13d1461033e578063715018a61461034857806375b238fc146103525780638da5cb5b1461037c578063be4994f8146103a6578063dcc21361146103ce5761014a565b806328d6183b1161010757806328d6183b146102305780632de948071461025a5780634359d28a14610296578063439fab91146102be5780634a4ee7b1146102e6578063514e62fc146103025761014a565b806301ffc9a71461014e578063141973b01461018a578063183a4f6e146101b25780631c10893f146101ce5780631cd64df4146101ea5780632569296214610226575b5f80fd5b348015610159575f80fd5b50610174600480360381019061016f919061116f565b61050c565b60405161018191906111b4565b60405180910390f35b348015610195575f80fd5b506101b060048036038101906101ab9190611283565b610585565b005b6101cc60048036038101906101c79190611334565b6106c5565b005b6101e860048036038101906101e391906113b9565b6106d2565b005b3480156101f5575f80fd5b50610210600480360381019061020b91906113b9565b6106e8565b60405161021d91906111b4565b60405180910390f35b61022e6106fe565b005b34801561023b575f80fd5b5061024461074f565b6040516102519190611406565b60405180910390f35b348015610265575f80fd5b50610280600480360381019061027b919061141f565b610776565b60405161028d9190611459565b60405180910390f35b3480156102a1575f80fd5b506102bc60048036038101906102b79190611283565b61078f565b005b3480156102c9575f80fd5b506102e460048036038101906102df91906114c7565b61089d565b005b61030060048036038101906102fb91906113b9565b6109ba565b005b34801561030d575f80fd5b50610328600480360381019061032391906113b9565b6109d0565b60405161033591906111b4565b60405180910390f35b6103466109e7565b005b610350610a20565b005b34801561035d575f80fd5b50610366610a33565b6040516103739190611459565b60405180910390f35b348015610387575f80fd5b50610390610a38565b60405161039d9190611521565b60405180910390f35b3480156103b1575f80fd5b506103cc60048036038101906103c7919061158f565b610a60565b005b3480156103d9575f80fd5b506103f460048036038101906103ef919061158f565b610b16565b005b348015610401575f80fd5b5061041c6004803603810190610417919061160d565b610bcc565b60405161042991906111b4565b60405180910390f35b34801561043d575f80fd5b50610446610c20565b6040516104539190611459565b60405180910390f35b6104766004803603810190610471919061141f565b610c25565b005b610492600480360381019061048d919061141f565b610c63565b005b34801561049f575f80fd5b506104ba60048036038101906104b5919061141f565b610c8c565b6040516104c791906111b4565b60405180910390f35b3480156104db575f80fd5b506104f660048036038101906104f1919061141f565b610cdf565b6040516105039190611459565b60405180910390f35b5f7f3d30a22c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061057e575061057d82610cf8565b5b9050919050565b61058e33610c8c565b6105c4576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818190508484905014610603576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848490508110156106be578282828181106106235761062261166a565b5b905060200201602081019061063891906116c1565b5f8087878581811061064d5761064c61166a565b5b9050602002016020810190610662919061141f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610605565b5050505050565b6106cf3382610d71565b50565b6106da610d80565b6106e48282610db7565b5050565b5f81826106f485610776565b1614905092915050565b5f610707610dc7565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f3d30a22c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b600261079a81610dd1565b8282905085859050146107d9576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610895575f8484838181106107fa576107f961166a565b5b905060200201602081019061080f91906116c1565b905060011515811515036108545761084f8787848181106108335761083261166a565b5b9050602002016020810190610848919061141f565b6001610db7565b610887565b61088687878481811061086a5761086961166a565b5b905060200201602081019061087f919061141f565b6001610d71565b5b5080806001019150506107db565b505050505050565b5f6108a6610e06565b905080546003825580156108d85760018160011c14303b106108cf5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8084848101906108ea919061186f565b915091506108f782610e2f565b5f5b815181101561097d5760015f808484815181106109195761091861166a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506108f9565b50505080156109b5576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6109c2610d80565b6109cc8282610d71565b5050565b5f80826109dc85610776565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a28610d80565b610a315f610f05565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6002610a6b81610dd1565b828290508585905014610aaa576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610b0e57610b01868683818110610acd57610acc61166a565b5b9050602002016020810190610ae2919061141f565b858584818110610af557610af461166a565b5b90506020020135610db7565b8080600101915050610aac565b505050505050565b6002610b2181610dd1565b828290508585905014610b60576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610bc457610bb7868683818110610b8357610b8261166a565b5b9050602002016020810190610b98919061141f565b858584818110610bab57610baa61166a565b5b90506020020135610d71565b8080600101915050610b62565b505050505050565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161590509392505050565b600181565b610c2d610d80565b63389a75e1600c52805f526020600c208054421115610c5357636f5e88185f526004601cfd5b5f815550610c6081610f05565b50565b610c6b610d80565b8060601b610c8057637448fbae5f526004601cfd5b610c8981610f05565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff16610cac610a38565b73ffffffffffffffffffffffffffffffffffffffff161480610cd85750610cd78260026001176109d0565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610d6a5750610d6982610fcb565b5b9050919050565b610d7c82825f611044565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610db5576382b429005f526004601cfd5b565b610dc382826001611044565b5050565b5f6202a300905090565b638b78c6d819543314610e0357638b78c6d8600c52335f52806020600c205416610e02576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610e3761109c565b15610eaf577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610e7157630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610f02565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b610f0d61109c565b15610f72577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610fc8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061103d575061103c826110a0565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361106657848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61114e8161111a565b8114611158575f80fd5b50565b5f8135905061116981611145565b92915050565b5f6020828403121561118457611183611112565b5b5f6111918482850161115b565b91505092915050565b5f8115159050919050565b6111ae8161119a565b82525050565b5f6020820190506111c75f8301846111a5565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126111ee576111ed6111cd565b5b8235905067ffffffffffffffff81111561120b5761120a6111d1565b5b602083019150836020820283011115611227576112266111d5565b5b9250929050565b5f8083601f840112611243576112426111cd565b5b8235905067ffffffffffffffff8111156112605761125f6111d1565b5b60208301915083602082028301111561127c5761127b6111d5565b5b9250929050565b5f805f806040858703121561129b5761129a611112565b5b5f85013567ffffffffffffffff8111156112b8576112b7611116565b5b6112c4878288016111d9565b9450945050602085013567ffffffffffffffff8111156112e7576112e6611116565b5b6112f38782880161122e565b925092505092959194509250565b5f819050919050565b61131381611301565b811461131d575f80fd5b50565b5f8135905061132e8161130a565b92915050565b5f6020828403121561134957611348611112565b5b5f61135684828501611320565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6113888261135f565b9050919050565b6113988161137e565b81146113a2575f80fd5b50565b5f813590506113b38161138f565b92915050565b5f80604083850312156113cf576113ce611112565b5b5f6113dc858286016113a5565b92505060206113ed85828601611320565b9150509250929050565b6114008161111a565b82525050565b5f6020820190506114195f8301846113f7565b92915050565b5f6020828403121561143457611433611112565b5b5f611441848285016113a5565b91505092915050565b61145381611301565b82525050565b5f60208201905061146c5f83018461144a565b92915050565b5f8083601f840112611487576114866111cd565b5b8235905067ffffffffffffffff8111156114a4576114a36111d1565b5b6020830191508360018202830111156114c0576114bf6111d5565b5b9250929050565b5f80602083850312156114dd576114dc611112565b5b5f83013567ffffffffffffffff8111156114fa576114f9611116565b5b61150685828601611472565b92509250509250929050565b61151b8161137e565b82525050565b5f6020820190506115345f830184611512565b92915050565b5f8083601f84011261154f5761154e6111cd565b5b8235905067ffffffffffffffff81111561156c5761156b6111d1565b5b602083019150836020820283011115611588576115876111d5565b5b9250929050565b5f805f80604085870312156115a7576115a6611112565b5b5f85013567ffffffffffffffff8111156115c4576115c3611116565b5b6115d0878288016111d9565b9450945050602085013567ffffffffffffffff8111156115f3576115f2611116565b5b6115ff8782880161153a565b925092505092959194509250565b5f805f6040848603121561162457611623611112565b5b5f611631868287016113a5565b935050602084013567ffffffffffffffff81111561165257611651611116565b5b61165e86828701611472565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6116a08161119a565b81146116aa575f80fd5b50565b5f813590506116bb81611697565b92915050565b5f602082840312156116d6576116d5611112565b5b5f6116e3848285016116ad565b91505092915050565b5f6116f68261135f565b9050919050565b611706816116ec565b8114611710575f80fd5b50565b5f81359050611721816116fd565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61176d82611727565b810181811067ffffffffffffffff8211171561178c5761178b611737565b5b80604052505050565b5f61179e611109565b90506117aa8282611764565b919050565b5f67ffffffffffffffff8211156117c9576117c8611737565b5b602082029050602081019050919050565b5f6117ec6117e7846117af565b611795565b9050808382526020820190506020840283018581111561180f5761180e6111d5565b5b835b81811015611838578061182488826113a5565b845260208401935050602081019050611811565b5050509392505050565b5f82601f830112611856576118556111cd565b5b81356118668482602086016117da565b91505092915050565b5f806040838503121561188557611884611112565b5b5f61189285828601611713565b925050602083013567ffffffffffffffff8111156118b3576118b2611116565b5b6118bf85828601611842565b915050925092905056fea2646970667358221220116cbe1ffbc474fcaeb37297cb70b6ef5e5edc8a954bd32ea381049b2cd20ad664736f6c634300081a0033",t=class t extends p.DeployableTargetWithRBAC{constructor(){super(...arguments),this.abi=d.M}async owner(f){return await d.BE(this._config,{...this.optionallyAttachAccount(),...f,address:this.assertValidAddress(),args:[]})}async isAllowed(f,b){return await d.hz(this._config,{address:this.assertValidAddress(),args:[f,r.zeroHash],...this.optionallyAttachAccount(),...b})}async setDenied(f,b,c){return await this.awaitResult(this.setDeniedRaw(f,b,c))}async setDeniedRaw(f,b,c){const{request:e,result:a}=await d.tH(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...c});return{hash:await d.qz(this._config,e),result:a}}buildParameters(f,b){var s;const[c,e]=this.validateDeploymentConfig(f,b),a=c;if(!a.owner||a.owner===r.zeroAddress){const i=e.account?e.account.address:e.config?h.getAccount(e.config).address:(s=this._account)==null?void 0:s.address;if(i)a.owner=i;else throw new w.DeployableUnknownOwnerProvidedError}return{abi:d.M,bytecode:o,args:[u(a)],...this.optionallyAttachAccount(e.account)}}};t.bases={31337:void 0,...y.SimpleDenyList},t.registryType=g.RegistryType.ALLOW_LIST;let n=t;function u({owner:l,denied:f}){return r.encodeAbiParameters([{type:"address",name:"owner"},{type:"address[]",name:"denied"}],[l,f])}exports.SimpleDenyList=n;exports.bytecode=o;exports.prepareSimpleDenyListPayload=u;
|
|
2
|
-
//# sourceMappingURL=SimpleDenyList-
|
|
1
|
+
"use strict";const d=require("./generated-pNKCp_Ez.cjs"),h=require("@wagmi/core"),r=require("viem"),y=require("./deployments-DxkwtCyu.cjs"),p=require("./Deployable/DeployableTargetWithRBAC.cjs"),w=require("./errors.cjs"),g=require("./utils.cjs"),o="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6118ff806100bd5f395ff3fe60806040526004361061014a575f3560e01c806354d1f13d116100b5578063e3f756de1161006e578063e3f756de146103f6578063ec87621c14610432578063f04e283e1461045c578063f2fde38b14610478578063fe9fbb8014610494578063fee81cf4146104d05761014a565b806354d1f13d1461033e578063715018a61461034857806375b238fc146103525780638da5cb5b1461037c578063be4994f8146103a6578063dcc21361146103ce5761014a565b806328d6183b1161010757806328d6183b146102305780632de948071461025a5780634359d28a14610296578063439fab91146102be5780634a4ee7b1146102e6578063514e62fc146103025761014a565b806301ffc9a71461014e578063141973b01461018a578063183a4f6e146101b25780631c10893f146101ce5780631cd64df4146101ea5780632569296214610226575b5f80fd5b348015610159575f80fd5b50610174600480360381019061016f919061116f565b61050c565b60405161018191906111b4565b60405180910390f35b348015610195575f80fd5b506101b060048036038101906101ab9190611283565b610585565b005b6101cc60048036038101906101c79190611334565b6106c5565b005b6101e860048036038101906101e391906113b9565b6106d2565b005b3480156101f5575f80fd5b50610210600480360381019061020b91906113b9565b6106e8565b60405161021d91906111b4565b60405180910390f35b61022e6106fe565b005b34801561023b575f80fd5b5061024461074f565b6040516102519190611406565b60405180910390f35b348015610265575f80fd5b50610280600480360381019061027b919061141f565b610776565b60405161028d9190611459565b60405180910390f35b3480156102a1575f80fd5b506102bc60048036038101906102b79190611283565b61078f565b005b3480156102c9575f80fd5b506102e460048036038101906102df91906114c7565b61089d565b005b61030060048036038101906102fb91906113b9565b6109ba565b005b34801561030d575f80fd5b50610328600480360381019061032391906113b9565b6109d0565b60405161033591906111b4565b60405180910390f35b6103466109e7565b005b610350610a20565b005b34801561035d575f80fd5b50610366610a33565b6040516103739190611459565b60405180910390f35b348015610387575f80fd5b50610390610a38565b60405161039d9190611521565b60405180910390f35b3480156103b1575f80fd5b506103cc60048036038101906103c7919061158f565b610a60565b005b3480156103d9575f80fd5b506103f460048036038101906103ef919061158f565b610b16565b005b348015610401575f80fd5b5061041c6004803603810190610417919061160d565b610bcc565b60405161042991906111b4565b60405180910390f35b34801561043d575f80fd5b50610446610c20565b6040516104539190611459565b60405180910390f35b6104766004803603810190610471919061141f565b610c25565b005b610492600480360381019061048d919061141f565b610c63565b005b34801561049f575f80fd5b506104ba60048036038101906104b5919061141f565b610c8c565b6040516104c791906111b4565b60405180910390f35b3480156104db575f80fd5b506104f660048036038101906104f1919061141f565b610cdf565b6040516105039190611459565b60405180910390f35b5f7f3d30a22c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061057e575061057d82610cf8565b5b9050919050565b61058e33610c8c565b6105c4576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818190508484905014610603576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848490508110156106be578282828181106106235761062261166a565b5b905060200201602081019061063891906116c1565b5f8087878581811061064d5761064c61166a565b5b9050602002016020810190610662919061141f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610605565b5050505050565b6106cf3382610d71565b50565b6106da610d80565b6106e48282610db7565b5050565b5f81826106f485610776565b1614905092915050565b5f610707610dc7565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f3d30a22c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b600261079a81610dd1565b8282905085859050146107d9576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610895575f8484838181106107fa576107f961166a565b5b905060200201602081019061080f91906116c1565b905060011515811515036108545761084f8787848181106108335761083261166a565b5b9050602002016020810190610848919061141f565b6001610db7565b610887565b61088687878481811061086a5761086961166a565b5b905060200201602081019061087f919061141f565b6001610d71565b5b5080806001019150506107db565b505050505050565b5f6108a6610e06565b905080546003825580156108d85760018160011c14303b106108cf5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8084848101906108ea919061186f565b915091506108f782610e2f565b5f5b815181101561097d5760015f808484815181106109195761091861166a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506108f9565b50505080156109b5576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6109c2610d80565b6109cc8282610d71565b5050565b5f80826109dc85610776565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a28610d80565b610a315f610f05565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6002610a6b81610dd1565b828290508585905014610aaa576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610b0e57610b01868683818110610acd57610acc61166a565b5b9050602002016020810190610ae2919061141f565b858584818110610af557610af461166a565b5b90506020020135610db7565b8080600101915050610aac565b505050505050565b6002610b2181610dd1565b828290508585905014610b60576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610bc457610bb7868683818110610b8357610b8261166a565b5b9050602002016020810190610b98919061141f565b858584818110610bab57610baa61166a565b5b90506020020135610d71565b8080600101915050610b62565b505050505050565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161590509392505050565b600181565b610c2d610d80565b63389a75e1600c52805f526020600c208054421115610c5357636f5e88185f526004601cfd5b5f815550610c6081610f05565b50565b610c6b610d80565b8060601b610c8057637448fbae5f526004601cfd5b610c8981610f05565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff16610cac610a38565b73ffffffffffffffffffffffffffffffffffffffff161480610cd85750610cd78260026001176109d0565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610d6a5750610d6982610fcb565b5b9050919050565b610d7c82825f611044565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610db5576382b429005f526004601cfd5b565b610dc382826001611044565b5050565b5f6202a300905090565b638b78c6d819543314610e0357638b78c6d8600c52335f52806020600c205416610e02576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610e3761109c565b15610eaf577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610e7157630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610f02565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b610f0d61109c565b15610f72577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610fc8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061103d575061103c826110a0565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361106657848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61114e8161111a565b8114611158575f80fd5b50565b5f8135905061116981611145565b92915050565b5f6020828403121561118457611183611112565b5b5f6111918482850161115b565b91505092915050565b5f8115159050919050565b6111ae8161119a565b82525050565b5f6020820190506111c75f8301846111a5565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126111ee576111ed6111cd565b5b8235905067ffffffffffffffff81111561120b5761120a6111d1565b5b602083019150836020820283011115611227576112266111d5565b5b9250929050565b5f8083601f840112611243576112426111cd565b5b8235905067ffffffffffffffff8111156112605761125f6111d1565b5b60208301915083602082028301111561127c5761127b6111d5565b5b9250929050565b5f805f806040858703121561129b5761129a611112565b5b5f85013567ffffffffffffffff8111156112b8576112b7611116565b5b6112c4878288016111d9565b9450945050602085013567ffffffffffffffff8111156112e7576112e6611116565b5b6112f38782880161122e565b925092505092959194509250565b5f819050919050565b61131381611301565b811461131d575f80fd5b50565b5f8135905061132e8161130a565b92915050565b5f6020828403121561134957611348611112565b5b5f61135684828501611320565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6113888261135f565b9050919050565b6113988161137e565b81146113a2575f80fd5b50565b5f813590506113b38161138f565b92915050565b5f80604083850312156113cf576113ce611112565b5b5f6113dc858286016113a5565b92505060206113ed85828601611320565b9150509250929050565b6114008161111a565b82525050565b5f6020820190506114195f8301846113f7565b92915050565b5f6020828403121561143457611433611112565b5b5f611441848285016113a5565b91505092915050565b61145381611301565b82525050565b5f60208201905061146c5f83018461144a565b92915050565b5f8083601f840112611487576114866111cd565b5b8235905067ffffffffffffffff8111156114a4576114a36111d1565b5b6020830191508360018202830111156114c0576114bf6111d5565b5b9250929050565b5f80602083850312156114dd576114dc611112565b5b5f83013567ffffffffffffffff8111156114fa576114f9611116565b5b61150685828601611472565b92509250509250929050565b61151b8161137e565b82525050565b5f6020820190506115345f830184611512565b92915050565b5f8083601f84011261154f5761154e6111cd565b5b8235905067ffffffffffffffff81111561156c5761156b6111d1565b5b602083019150836020820283011115611588576115876111d5565b5b9250929050565b5f805f80604085870312156115a7576115a6611112565b5b5f85013567ffffffffffffffff8111156115c4576115c3611116565b5b6115d0878288016111d9565b9450945050602085013567ffffffffffffffff8111156115f3576115f2611116565b5b6115ff8782880161153a565b925092505092959194509250565b5f805f6040848603121561162457611623611112565b5b5f611631868287016113a5565b935050602084013567ffffffffffffffff81111561165257611651611116565b5b61165e86828701611472565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6116a08161119a565b81146116aa575f80fd5b50565b5f813590506116bb81611697565b92915050565b5f602082840312156116d6576116d5611112565b5b5f6116e3848285016116ad565b91505092915050565b5f6116f68261135f565b9050919050565b611706816116ec565b8114611710575f80fd5b50565b5f81359050611721816116fd565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61176d82611727565b810181811067ffffffffffffffff8211171561178c5761178b611737565b5b80604052505050565b5f61179e611109565b90506117aa8282611764565b919050565b5f67ffffffffffffffff8211156117c9576117c8611737565b5b602082029050602081019050919050565b5f6117ec6117e7846117af565b611795565b9050808382526020820190506020840283018581111561180f5761180e6111d5565b5b835b81811015611838578061182488826113a5565b845260208401935050602081019050611811565b5050509392505050565b5f82601f830112611856576118556111cd565b5b81356118668482602086016117da565b91505092915050565b5f806040838503121561188557611884611112565b5b5f61189285828601611713565b925050602083013567ffffffffffffffff8111156118b3576118b2611116565b5b6118bf85828601611842565b915050925092905056fea264697066735822122029eec1d270425718605fbc01b81abc5d40218a340b220c3d7418c05996387e6a64736f6c634300081a0033",t=class t extends p.DeployableTargetWithRBAC{constructor(){super(...arguments),this.abi=d.O}async owner(f){return await d.CH(this._config,{...this.optionallyAttachAccount(),...f,address:this.assertValidAddress(),args:[]})}async isAllowed(f,b){return await d.w1(this._config,{address:this.assertValidAddress(),args:[f,r.zeroHash],...this.optionallyAttachAccount(),...b})}async setDenied(f,b,c){return await this.awaitResult(this.setDeniedRaw(f,b,c))}async setDeniedRaw(f,b,c){const{request:e,result:a}=await d.J1(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...c});return{hash:await d.F1(this._config,e),result:a}}buildParameters(f,b){var s;const[c,e]=this.validateDeploymentConfig(f,b),a=c;if(!a.owner||a.owner===r.zeroAddress){const i=e.account?e.account.address:e.config?h.getAccount(e.config).address:(s=this._account)==null?void 0:s.address;if(i)a.owner=i;else throw new w.DeployableUnknownOwnerProvidedError}return{abi:d.O,bytecode:o,args:[u(a)],...this.optionallyAttachAccount(e.account)}}};t.bases={31337:void 0,...y.SimpleDenyList},t.registryType=g.RegistryType.ALLOW_LIST;let n=t;function u({owner:l,denied:f}){return r.encodeAbiParameters([{type:"address",name:"owner"},{type:"address[]",name:"denied"}],[l,f])}exports.SimpleDenyList=n;exports.bytecode=o;exports.prepareSimpleDenyListPayload=u;
|
|
2
|
+
//# sourceMappingURL=SimpleDenyList-B65fnca2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleDenyList-
|
|
1
|
+
{"version":3,"file":"SimpleDenyList-B65fnca2.cjs","sources":["../src/AllowLists/SimpleDenyList.ts"],"sourcesContent":["import {\n readSimpleAllowListOwner,\n readSimpleDenyListIsAllowed,\n simpleDenyListAbi,\n simulateSimpleDenyListSetDenied,\n writeSimpleDenyListSetDenied,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleDenyList.sol/SimpleDenyList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { SimpleDenyList as SimpleDenyListBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleDenyListAbi };\n\n/**\n * Object representation of a {@link SimpleDenyList} initialization payload.\n *\n * @export\n * @interface SimpleDenyListPayload\n * @typedef {SimpleDenyListPayload}\n */\nexport interface SimpleDenyListPayload {\n /**\n * The allow list's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of denied addresses.\n *\n * @type {Address[]}\n */\n denied: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleDenyList` event types.\n *\n * @export\n * @typedef {SimpleDenyListLog}\n * @template {ContractEventName<typeof simpleDenyListAbi>} [event=ContractEventName<\n * typeof simpleDenyListAbi\n * >]\n */\nexport type SimpleDenyListLog<\n event extends ContractEventName<typeof simpleDenyListAbi> = ContractEventName<\n typeof simpleDenyListAbi\n >,\n> = GenericLog<typeof simpleDenyListAbi, event>;\n\n/**\n * A simple implementation of an AllowList that implicitly allows all addresses except those explicitly added to the deny list\n *\n * @export\n * @class SimpleDenyList\n * @typedef {SimpleDenyList}\n * @extends {DeployableTargetWithRBAC<SimpleDenyListPayload>}\n */\nexport class SimpleDenyList<\n Payload = SimpleDenyListPayload,\n> extends DeployableTargetWithRBAC<\n Payload | undefined,\n typeof simpleDenyListAbi\n> {\n public override readonly abi = simpleDenyListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_SIMPLE_DENYLIST_BASE,\n ...(SimpleDenyListBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Retrieves the owner\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} - The address of the owner\n */\n public async owner(params?: ReadParams): Promise<Address> {\n return await readSimpleAllowListOwner(this._config, {\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 address: this.assertValidAddress(),\n args: [],\n });\n }\n\n /**\n * Check if a user is authorized (i.e. not denied)\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams,\n ): Promise<boolean> {\n return await readSimpleDenyListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\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\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setDenied(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setDeniedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setDeniedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n const { request, result } = await simulateSimpleDenyListSetDenied(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\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 writeSimpleDenyListSetDenied(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleDenyListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [p, options] = this.validateDeploymentConfig(_payload, _options);\n const payload = p as SimpleDenyListPayload;\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleDenyListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleDenyListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleDenyListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleDenyListPayload} param0\n * @param {Address} param0.owner - The allow list's owner\n * @param {Address[]} param0.denied - List of denied addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleDenyListPayload({\n owner,\n denied,\n}: SimpleDenyListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'denied' },\n ],\n [owner, denied],\n );\n}\n"],"names":["_SimpleDenyList","DeployableTargetWithRBAC","simpleDenyListAbi","params","readSimpleAllowListOwner","address","readSimpleDenyListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleDenyListSetDenied","writeSimpleDenyListSetDenied","_payload","_options","p","options","payload","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleDenyListPayload","SimpleDenyListBases","RegistryType","SimpleDenyList","denied","encodeAbiParameters"],"mappings":"qnaA8EaA,EAAN,MAAMA,UAEHC,EAAAA,wBAGR,CALK,aAAA,CAAA,MAAA,GAAA,SAAA,EAML,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,MAAMC,EAAuC,CACjD,OAAA,MAAMC,EAAAA,GAAyB,KAAK,QA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