@boostxyz/sdk 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.js +2 -2
  3. package/dist/Actions/EventAction.cjs +1 -1
  4. package/dist/Actions/EventAction.cjs.map +1 -1
  5. package/dist/Actions/EventAction.d.ts +219 -0
  6. package/dist/Actions/EventAction.d.ts.map +1 -1
  7. package/dist/Actions/EventAction.js +40 -40
  8. package/dist/Actions/EventAction.js.map +1 -1
  9. package/dist/AllowLists/AllowList.cjs +1 -1
  10. package/dist/AllowLists/AllowList.js +12 -12
  11. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  12. package/dist/AllowLists/SimpleAllowList.js +10 -10
  13. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  14. package/dist/AllowLists/SimpleDenyList.js +2 -2
  15. package/dist/Auth/PassthroughAuth.cjs +1 -1
  16. package/dist/Auth/PassthroughAuth.js +1 -1
  17. package/dist/BoostCore.cjs +2 -2
  18. package/dist/BoostCore.cjs.map +1 -1
  19. package/dist/BoostCore.d.ts +33 -0
  20. package/dist/BoostCore.d.ts.map +1 -1
  21. package/dist/BoostCore.js +103 -86
  22. package/dist/BoostCore.js.map +1 -1
  23. package/dist/BoostRegistry.cjs +1 -1
  24. package/dist/BoostRegistry.js +10 -10
  25. package/dist/{Budget-B0q1S08L.js → Budget-2Zb3Mb-8.js} +32 -32
  26. package/dist/{Budget-B0q1S08L.js.map → Budget-2Zb3Mb-8.js.map} +1 -1
  27. package/dist/{Budget-BA_1sa1e.cjs → Budget-2xKEvkbL.cjs} +2 -2
  28. package/dist/{Budget-BA_1sa1e.cjs.map → Budget-2xKEvkbL.cjs.map} +1 -1
  29. package/dist/Budgets/Budget.cjs +1 -1
  30. package/dist/Budgets/Budget.js +3 -3
  31. package/dist/Budgets/ManagedBudget.cjs +1 -1
  32. package/dist/Budgets/ManagedBudget.js +28 -28
  33. package/dist/Deployable/DeployableTarget.cjs +1 -1
  34. package/dist/Deployable/DeployableTarget.js +1 -1
  35. package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
  36. package/dist/Deployable/DeployableTargetWithRBAC.js +16 -16
  37. package/dist/Incentive-CfIjdL4T.cjs +2 -0
  38. package/dist/Incentive-CfIjdL4T.cjs.map +1 -0
  39. package/dist/Incentive-DNwTyG5Z.js +393 -0
  40. package/dist/Incentive-DNwTyG5Z.js.map +1 -0
  41. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  42. package/dist/Incentives/AllowListIncentive.js +8 -8
  43. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  44. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  45. package/dist/Incentives/CGDAIncentive.d.ts +30 -0
  46. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  47. package/dist/Incentives/CGDAIncentive.js +23 -23
  48. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  49. package/dist/Incentives/ERC1155Incentive.d.ts +25 -0
  50. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  51. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  52. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  53. package/dist/Incentives/ERC20Incentive.d.ts +30 -0
  54. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  55. package/dist/Incentives/ERC20Incentive.js +23 -23
  56. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  57. package/dist/Incentives/ERC20PeggedIncentive.d.ts +905 -0
  58. package/dist/Incentives/ERC20PeggedIncentive.d.ts.map +1 -0
  59. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
  60. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
  61. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +67 -0
  62. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
  63. package/dist/Incentives/ERC20VariableCriteriaIncentive.js +22 -22
  64. package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
  65. package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
  66. package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
  67. package/dist/Incentives/ERC20VariableIncentive.d.ts +20 -0
  68. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  69. package/dist/Incentives/ERC20VariableIncentive.js +13 -13
  70. package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
  71. package/dist/Incentives/Incentive.cjs +1 -1
  72. package/dist/Incentives/Incentive.cjs.map +1 -1
  73. package/dist/Incentives/Incentive.d.ts +24 -3
  74. package/dist/Incentives/Incentive.d.ts.map +1 -1
  75. package/dist/Incentives/Incentive.js +18 -39
  76. package/dist/Incentives/Incentive.js.map +1 -1
  77. package/dist/Incentives/PointsIncentive.cjs +1 -1
  78. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  79. package/dist/Incentives/PointsIncentive.d.ts +25 -0
  80. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  81. package/dist/Incentives/PointsIncentive.js +11 -11
  82. package/dist/Incentives/PointsIncentive.js.map +1 -1
  83. package/dist/{SimpleDenyList-DrQrJ14i.cjs → SimpleDenyList-BQ0GqQfC.cjs} +2 -2
  84. package/dist/{SimpleDenyList-DrQrJ14i.cjs.map → SimpleDenyList-BQ0GqQfC.cjs.map} +1 -1
  85. package/dist/{SimpleDenyList-DuCoaOlG.js → SimpleDenyList-D49GF3NX.js} +6 -6
  86. package/dist/{SimpleDenyList-DuCoaOlG.js.map → SimpleDenyList-D49GF3NX.js.map} +1 -1
  87. package/dist/Validators/LimitedSignerValidator.cjs +1 -1
  88. package/dist/Validators/LimitedSignerValidator.d.ts +10 -0
  89. package/dist/Validators/LimitedSignerValidator.d.ts.map +1 -1
  90. package/dist/Validators/LimitedSignerValidator.js +10 -10
  91. package/dist/Validators/SignerValidator.cjs +1 -1
  92. package/dist/Validators/SignerValidator.cjs.map +1 -1
  93. package/dist/Validators/SignerValidator.d.ts +10 -0
  94. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  95. package/dist/Validators/SignerValidator.js +5 -5
  96. package/dist/Validators/SignerValidator.js.map +1 -1
  97. package/dist/Validators/Validator.cjs +1 -1
  98. package/dist/Validators/Validator.js +10 -10
  99. package/dist/{componentInterfaces-dakxtQHf.js → componentInterfaces-C4uAYjSo.js} +12 -12
  100. package/dist/componentInterfaces-C4uAYjSo.js.map +1 -0
  101. package/dist/deployments.json +3 -0
  102. package/dist/{generated-1ZT_mHJx.js → generated-B5pVBNb-.js} +1647 -764
  103. package/dist/generated-B5pVBNb-.js.map +1 -0
  104. package/dist/generated-D50hBWtr.cjs +3 -0
  105. package/dist/generated-D50hBWtr.cjs.map +1 -0
  106. package/dist/index.cjs +1 -1
  107. package/dist/index.d.ts +1 -0
  108. package/dist/index.d.ts.map +1 -1
  109. package/dist/index.js +113 -110
  110. package/package.json +1 -1
  111. package/src/BoostCore.ts +22 -0
  112. package/src/Incentives/ERC20PeggedIncentive.ts +507 -0
  113. package/src/Incentives/Incentive.ts +6 -1
  114. package/src/index.ts +1 -0
  115. package/dist/componentInterfaces-dakxtQHf.js.map +0 -1
  116. package/dist/generated-1ZT_mHJx.js.map +0 -1
  117. package/dist/generated-CgBgbMNe.cjs +0 -3
  118. package/dist/generated-CgBgbMNe.cjs.map +0 -1
@@ -4,21 +4,22 @@ import type { ReadParams } from '../utils';
4
4
  import { AllowListIncentive } from './AllowListIncentive';
5
5
  import { CGDAIncentive } from './CGDAIncentive';
6
6
  import { ERC20Incentive } from './ERC20Incentive';
7
+ import { ERC20PeggedIncentive } from './ERC20PeggedIncentive';
7
8
  import { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';
8
9
  import { ERC20VariableIncentive } from './ERC20VariableIncentive';
9
10
  import { PointsIncentive } from './PointsIncentive';
10
- export { AllowListIncentive, CGDAIncentive, ERC20Incentive, PointsIncentive, ERC20VariableIncentive, ERC20VariableCriteriaIncentive, };
11
+ export { AllowListIncentive, CGDAIncentive, ERC20Incentive, ERC20PeggedIncentive, PointsIncentive, ERC20VariableIncentive, ERC20VariableCriteriaIncentive, };
11
12
  /**
12
13
  * A union type representing all valid protocol Incentive implementations
13
14
  *
14
15
  * @export
15
16
  * @typedef {Incentive}
16
17
  */
17
- export type Incentive = AllowListIncentive | CGDAIncentive | ERC20Incentive | PointsIncentive | ERC20VariableIncentive | ERC20VariableCriteriaIncentive;
18
+ export type Incentive = AllowListIncentive | CGDAIncentive | ERC20Incentive | ERC20PeggedIncentive | PointsIncentive | ERC20VariableIncentive | ERC20VariableCriteriaIncentive;
18
19
  /**
19
20
  * A map of Incentive component interfaces to their constructors.
20
21
  *
21
- * @type {{ "0xc5b24b8e": typeof PointsIncentive; "0x8c901437": typeof ERC20Incentive; "0x4414fbb4": typeof AllowListIncentive; "0xa39e44d9": typeof CGDAIncentive; "0xa8e4af1e": typeof ERC20VariableIncentive; "0x90318111": typeof ERC20VariableCriteriaIncentive }}
22
+ * @type {{ "0xc5b24b8e": typeof PointsIncentive; "0x8c901437": typeof ERC20Incentive; "0x4414fbb4": typeof ERC20PeggedIncentive; "0x56586338" typeof AllowListIncentive; "0xa39e44d9": typeof CGDAIncentive; "0xa8e4af1e": typeof ERC20VariableIncentive; "0x90318111": typeof ERC20VariableCriteriaIncentive }}
22
23
  */
23
24
  export declare const IncentiveByComponentInterface: {
24
25
  [x: string]: typeof AllowListIncentive | typeof CGDAIncentive | typeof ERC20Incentive | typeof ERC20VariableIncentive | typeof ERC20VariableCriteriaIncentive | typeof PointsIncentive;
@@ -120,6 +121,26 @@ export declare function incentiveFromAddress(options: DeployableOptions, address
120
121
  readonly indexed: false;
121
122
  }];
122
123
  readonly name: "Claimed";
124
+ }, {
125
+ readonly type: "event";
126
+ readonly anonymous: false;
127
+ readonly inputs: readonly [{
128
+ readonly name: "asset";
129
+ readonly internalType: "address";
130
+ readonly type: "address";
131
+ readonly indexed: true;
132
+ }, {
133
+ readonly name: "reward";
134
+ readonly internalType: "uint256";
135
+ readonly type: "uint256";
136
+ readonly indexed: false;
137
+ }, {
138
+ readonly name: "limit";
139
+ readonly internalType: "uint256";
140
+ readonly type: "uint256";
141
+ readonly indexed: false;
142
+ }];
143
+ readonly name: "ERC20VariableIncentiveInitialized";
123
144
  }, {
124
145
  readonly type: "event";
125
146
  readonly anonymous: false;
@@ -1 +1 @@
1
- {"version":3,"file":"Incentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/Incentive.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACL,kBAAkB,EAClB,aAAa,EAEb,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,8BAA8B,GAC/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GACjB,kBAAkB,GAClB,aAAa,GACb,cAAc,GAEd,eAAe,GACf,sBAAsB,GACtB,8BAA8B,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;CAQzC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,OAAO,EAChB,MAAM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../generated-1ZT_mHJx.js";
2
- import { a as c, b as m, c as f, d as I, e as v, f as C } from "../componentInterfaces-dakxtQHf.js";
3
- import { readContract as s } from "@wagmi/core";
4
- import { InvalidComponentInterfaceError as p } from "../errors.js";
5
- import { AllowListIncentive as A } from "./AllowListIncentive.js";
6
- import { CGDAIncentive as l } from "./CGDAIncentive.js";
7
- import { ERC20Incentive as b } from "./ERC20Incentive.js";
1
+ import "../generated-B5pVBNb-.js";
2
+ import "../componentInterfaces-C4uAYjSo.js";
3
+ import "@wagmi/core";
4
+ import "../errors.js";
5
+ import { AllowListIncentive as m } from "./AllowListIncentive.js";
6
+ import { CGDAIncentive as c } from "./CGDAIncentive.js";
7
+ import { ERC20Incentive as a } from "./ERC20Incentive.js";
8
+ import { E as f, I as s, i as x } from "../Incentive-DNwTyG5Z.js";
8
9
  import { ERC20VariableCriteriaIncentive as E } from "./ERC20VariableCriteriaIncentive.js";
9
- import { ERC20VariableIncentive as w } from "./ERC20VariableIncentive.js";
10
- import { PointsIncentive as R } from "./PointsIncentive.js";
11
- const r = {
12
- [c]: R,
13
- [m]: b,
14
- [f]: A,
15
- // [AERC1155Incentive as Hex]: ERC1155Incentive,
16
- [I]: l,
17
- [v]: w,
18
- [C]: E
19
- };
20
- async function j(e, n, o) {
21
- const t = await s(e.config, {
22
- abi: a,
23
- functionName: "getComponentInterface",
24
- address: n,
25
- ...o
26
- }), i = r[t];
27
- if (!i)
28
- throw new p(
29
- Object.keys(r),
30
- t
31
- );
32
- return new i(e, n);
33
- }
10
+ import { ERC20VariableIncentive as R } from "./ERC20VariableIncentive.js";
11
+ import { PointsIncentive as A } from "./PointsIncentive.js";
34
12
  export {
35
- A as AllowListIncentive,
36
- l as CGDAIncentive,
37
- b as ERC20Incentive,
13
+ m as AllowListIncentive,
14
+ c as CGDAIncentive,
15
+ a as ERC20Incentive,
16
+ f as ERC20PeggedIncentive,
38
17
  E as ERC20VariableCriteriaIncentive,
39
- w as ERC20VariableIncentive,
40
- r as IncentiveByComponentInterface,
41
- R as PointsIncentive,
42
- j as incentiveFromAddress
18
+ R as ERC20VariableIncentive,
19
+ s as IncentiveByComponentInterface,
20
+ A as PointsIncentive,
21
+ x as incentiveFromAddress
43
22
  };
44
23
  //# sourceMappingURL=Incentive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Incentive.js","sources":["../../src/Incentives/Incentive.ts"],"sourcesContent":["import { aIncentiveAbi } from '@boostxyz/evm';\nimport {\n AAllowListIncentive,\n ACGDAIncentive,\n AERC20Incentive,\n AERC20VariableCriteriaIncentive,\n AERC20VariableIncentive,\n // AERC20VariableCriteriaIncentive\n APointsIncentive,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport type { ReadParams } from '../utils';\nimport { AllowListIncentive } from './AllowListIncentive';\nimport { CGDAIncentive } from './CGDAIncentive';\nimport { ERC20Incentive } from './ERC20Incentive';\nimport { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n// import { ERC1155Incentive } from './ERC1155Incentive';\nimport { PointsIncentive } from './PointsIncentive';\n\nexport {\n AllowListIncentive,\n CGDAIncentive,\n // ERC1155Incentive,\n ERC20Incentive,\n PointsIncentive,\n ERC20VariableIncentive,\n ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A union type representing all valid protocol Incentive implementations\n *\n * @export\n * @typedef {Incentive}\n */\nexport type Incentive =\n | AllowListIncentive\n | CGDAIncentive\n | ERC20Incentive\n // | ERC1155Incentive\n | PointsIncentive\n | ERC20VariableIncentive\n | ERC20VariableCriteriaIncentive;\n\n/**\n * A map of Incentive component interfaces to their constructors.\n *\n * @type {{ \"0xc5b24b8e\": typeof PointsIncentive; \"0x8c901437\": typeof ERC20Incentive; \"0x4414fbb4\": typeof AllowListIncentive; \"0xa39e44d9\": typeof CGDAIncentive; \"0xa8e4af1e\": typeof ERC20VariableIncentive; \"0x90318111\": typeof ERC20VariableCriteriaIncentive }}\n */\nexport const IncentiveByComponentInterface = {\n [APointsIncentive as Hex]: PointsIncentive,\n [AERC20Incentive as Hex]: ERC20Incentive,\n [AAllowListIncentive]: AllowListIncentive,\n // [AERC1155Incentive as Hex]: ERC1155Incentive,\n [ACGDAIncentive as Hex]: CGDAIncentive,\n [AERC20VariableIncentive as Hex]: ERC20VariableIncentive,\n [AERC20VariableCriteriaIncentive as Hex]: ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Incentive}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function incentiveFromAddress(\n options: DeployableOptions,\n address: Address,\n params?: ReadParams,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aIncentiveAbi,\n functionName: 'getComponentInterface',\n address,\n ...params,\n })) as keyof typeof IncentiveByComponentInterface;\n const Ctor = IncentiveByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(IncentiveByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["IncentiveByComponentInterface","APointsIncentive","PointsIncentive","AERC20Incentive","ERC20Incentive","AAllowListIncentive","AllowListIncentive","ACGDAIncentive","CGDAIncentive","AERC20VariableIncentive","ERC20VariableIncentive","AERC20VariableCriteriaIncentive","ERC20VariableCriteriaIncentive","incentiveFromAddress","options","address","params","interfaceId","readContract","aIncentiveAbi","Ctor","InvalidComponentInterfaceError"],"mappings":";;;;;;;;;;AAqDO,MAAMA,IAAgC;AAAA,EAC3C,CAACC,CAAuB,GAAGC;AAAA,EAC3B,CAACC,CAAsB,GAAGC;AAAA,EAC1B,CAACC,CAAmB,GAAGC;AAAA;AAAA,EAEvB,CAACC,CAAqB,GAAGC;AAAA,EACzB,CAACC,CAA8B,GAAGC;AAAA,EAClC,CAACC,CAAsC,GAAGC;AAC5C;AAYsB,eAAAC,EACpBC,GACAC,GACAC,GACA;AACA,QAAMC,IAAe,MAAMC,EAAaJ,EAAQ,QAAQ;AAAA,IACtD,KAAKK;AAAAA,IACL,cAAc;AAAA,IACd,SAAAJ;AAAA,IACA,GAAGC;AAAA,EAAA,CACJ,GACKI,IAAOpB,EAA8BiB,CAAW;AACtD,MAAI,CAACG;AACH,UAAM,IAAIC;AAAA,MACR,OAAO,KAAKrB,CAA6B;AAAA,MACzCiB;AAAA,IAAA;AAGG,SAAA,IAAIG,EAAKN,GAASC,CAAO;AAClC;"}
1
+ {"version":3,"file":"Incentive.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-CgBgbMNe.cjs"),t=require("viem"),n=require("../deployments-BucJ-gwk.cjs"),l=require("../Deployable/DeployableTarget.cjs"),o=require("../claiming.cjs"),u=require("../utils.cjs"),h="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b8b806100bd5f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db91906113f9565b61065f565b6040516101ed919061143e565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061146f565b60405180910390f35b61023a600480360381019061023591906114b2565b6106e0565b005b61025660048036038101906102519190611537565b6106ed565b005b348015610263575f80fd5b5061027e60048036038101906102799190611537565b610703565b60405161028b919061143e565b60405180910390f35b34801561029f575f80fd5b506102a8610719565b6040516102b5919061146f565b60405180910390f35b6102c661071e565b005b3480156102d3575f80fd5b506102dc61076f565b6040516102e99190611584565b60405180910390f35b3480156102fd575f80fd5b506103186004803603810190610313919061159d565b610796565b604051610325919061146f565b60405180910390f35b348015610339575f80fd5b506103426107af565b60405161034f91906115d7565b60405180910390f35b348015610363575f80fd5b5061037e60048036038101906103799190611651565b6107ca565b005b34801561038b575f80fd5b506103a660048036038101906103a19190611651565b610921565b6040516103b492919061169c565b60405180910390f35b6103d760048036038101906103d29190611537565b610955565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa9190611651565b61096b565b60405161040c9190611733565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611537565b6109c2565b604051610448919061143e565b60405180910390f35b6104596109d9565b005b610463610a12565b005b348015610470575f80fd5b50610479610a25565b60405161048691906115d7565b60405180910390f35b34801561049a575f80fd5b506104a3610a4d565b6040516104b091906115d7565b60405180910390f35b3480156104c4575f80fd5b506104cd610a72565b6040516104da919061146f565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611753565b610a78565b604051610516919061143e565b60405180910390f35b34801561052a575f80fd5b506105456004803603810190610540919061159d565b610e8d565b604051610552919061143e565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611753565b610eaa565b60405161058e919061143e565b60405180910390f35b3480156105a2575f80fd5b506105ab610ebd565b6040516105b8919061146f565b60405180910390f35b3480156105cc575f80fd5b506105d5610ec3565b6040516105e29190611584565b60405180910390f35b6106056004803603810190610600919061159d565b610ed5565b005b610621600480360381019061061c919061159d565b610f13565b005b34801561062e575f80fd5b506106496004803603810190610644919061159d565b610f3c565b604051610656919061146f565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f55565b5b9050919050565b5f8054905090565b6106ea3382610fce565b50565b6106f5610fdd565b6106ff8282611014565b5050565b5f818261070f85610796565b1614905092915050565b5f5481565b5f610727611024565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f73deaddeaddeaddeaddeaddeaddeaddeaddeaddead905090565b5f6107d361102e565b905080546003825580156108055760018160011c14303b106107fc5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061081691906118a1565b90505f8160400151148061082d57505f8160600151145b15610864576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160045f6101000a81548163ffffffff021916908360e01c021790555080604001515f8190555080606001516003819055506108e633611057565b50801561091c576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61095d610fdd565b6109678282610fce565b5050565b60605f67ffffffffffffffff811115610987576109866117b4565b5b6040519080825280601f01601f1916602001820160405280156109b95781602001600182028036833780820191505090505b50905092915050565b5f80826109ce85610796565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a1a610fdd565b610a235f61112d565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b5f610a81610fdd565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b06573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b2a91906118e0565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bcd5750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b8992919061194d565b602060405180830381865afa158015610ba4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bc8919061199e565b151514155b15610c04576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c0d856111f3565b610c43576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f815480929190610c55906119f6565b91905055506001805f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900460e01b875f54604051602401610d0a929190611a3d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d749190611a9e565b5f604051808303815f865af19150503d805f8114610dad576040519150601f19603f3d011682016040523d82523d5f602084013e610db2565b606091505b5050905080610ded576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16885f54604051602001610e5c93929190611b19565b604051602081830303815290604052604051610e789190611733565b60405180910390a26001925050509392505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b5f610eb4846111f3565b90509392505050565b60055481565b60045f9054906101000a900460e01b81565b610edd610fdd565b63389a75e1600c52805f526020600c208054421115610f0357636f5e88185f526004601cfd5b5f815550610f108161112d565b50565b610f1b610fdd565b8060601b610f3057637448fbae5f526004601cfd5b610f398161112d565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fc75750610fc682611255565b5b9050919050565b610fd982825f6112ce565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611012576382b429005f526004601cfd5b565b611020828260016112ce565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61105f611326565b156110d7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561109957630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061112a565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611135611326565b1561119a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111f0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561124e5750600354600554105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112c757506112c68261132a565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112f057848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113d8816113a4565b81146113e2575f80fd5b50565b5f813590506113f3816113cf565b92915050565b5f6020828403121561140e5761140d61139c565b5b5f61141b848285016113e5565b91505092915050565b5f8115159050919050565b61143881611424565b82525050565b5f6020820190506114515f83018461142f565b92915050565b5f819050919050565b61146981611457565b82525050565b5f6020820190506114825f830184611460565b92915050565b61149181611457565b811461149b575f80fd5b50565b5f813590506114ac81611488565b92915050565b5f602082840312156114c7576114c661139c565b5b5f6114d48482850161149e565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611506826114dd565b9050919050565b611516816114fc565b8114611520575f80fd5b50565b5f813590506115318161150d565b92915050565b5f806040838503121561154d5761154c61139c565b5b5f61155a85828601611523565b925050602061156b8582860161149e565b9150509250929050565b61157e816113a4565b82525050565b5f6020820190506115975f830184611575565b92915050565b5f602082840312156115b2576115b161139c565b5b5f6115bf84828501611523565b91505092915050565b6115d1816114fc565b82525050565b5f6020820190506115ea5f8301846115c8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611611576116106115f0565b5b8235905067ffffffffffffffff81111561162e5761162d6115f4565b5b60208301915083600182028301111561164a576116496115f8565b5b9250929050565b5f80602083850312156116675761166661139c565b5b5f83013567ffffffffffffffff811115611684576116836113a0565b5b611690858286016115fc565b92509250509250929050565b5f6040820190506116af5f830185611460565b6116bc60208301846115c8565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611705826116c3565b61170f81856116cd565b935061171f8185602086016116dd565b611728816116eb565b840191505092915050565b5f6020820190508181035f83015261174b81846116fb565b905092915050565b5f805f6040848603121561176a5761176961139c565b5b5f61177786828701611523565b935050602084013567ffffffffffffffff811115611798576117976113a0565b5b6117a4868287016115fc565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117ea826116eb565b810181811067ffffffffffffffff82111715611809576118086117b4565b5b80604052505050565b5f61181b611393565b905061182782826117e1565b919050565b5f60808284031215611841576118406117b0565b5b61184b6080611812565b90505f61185a84828501611523565b5f83015250602061186d848285016113e5565b60208301525060406118818482850161149e565b60408301525060606118958482850161149e565b60608301525092915050565b5f608082840312156118b6576118b561139c565b5b5f6118c38482850161182c565b91505092915050565b5f815190506118da8161150d565b92915050565b5f602082840312156118f5576118f461139c565b5b5f611902848285016118cc565b91505092915050565b5f819050919050565b5f819050919050565b5f61193761193261192d8461190b565b611914565b611457565b9050919050565b6119478161191d565b82525050565b5f6040820190506119605f8301856115c8565b61196d602083018461193e565b9392505050565b61197d81611424565b8114611987575f80fd5b50565b5f8151905061199881611974565b92915050565b5f602082840312156119b3576119b261139c565b5b5f6119c08482850161198a565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0082611457565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a3257611a316119c9565b5b600182019050919050565b5f604082019050611a505f8301856115c8565b611a5d6020830184611460565b9392505050565b5f81905092915050565b5f611a78826116c3565b611a828185611a64565b9350611a928185602086016116dd565b80840191505092915050565b5f611aa98284611a6e565b915081905092915050565b5f8160601b9050919050565b5f611aca82611ab4565b9050919050565b5f611adb82611ac0565b9050919050565b611af3611aee826114fc565b611ad1565b82525050565b5f819050919050565b611b13611b0e82611457565b611af9565b82525050565b5f611b248286611ae2565b601482019150611b348285611ae2565b601482019150611b448284611b02565b60208201915081905094935050505056fea2646970667358221220d6b660c45cfb14561fecfab54209da8ea926d96b371bbdb9b93f5ad944e89aad64736f6c634300081a0033",d=class d extends l.DeployableTarget{constructor(){super(...arguments),this.abi=a.h}async claims(f){return await a.dz(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.mz(this._config,{address:this.assertValidAddress(),args:[],...f})}async reward(f){return await a.Nz(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.yz(this._config,{address:this.assertValidAddress(),args:[f],...b})}async venue(f){return await a.Oz(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.Tz(this._config,{address:this.assertValidAddress(),...f})}async selector(f){return await a.Mz(this._config,{address:this.assertValidAddress(),...f})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:c}=await a.qz(this._config,{address:this.assertValidAddress(),args:[o.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.zz(this._config,e),result:c}}async isClaimable(f,b){return await a.wz(this._config,{address:this.assertValidAddress(),args:[f.target,f.data],...b})}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[b,e]=await Promise.all([this.claims(f),this.limit(f)]);return e-b}buildParameters(f,b){const[e,c]=this.validateDeploymentConfig(f,b);return{abi:a.h,bytecode:h,args:[i(e)],...this.optionallyAttachAccount(c.account)}}buildClaimData(){return t.zeroHash}};d.bases={31337:void 0,...n.PointsIncentive},d.registryType=u.RegistryType.INCENTIVE;let s=d;const i=({venue:r,selector:f,reward:b,limit:e})=>t.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[r,f,b,e]);exports.pointsIncentiveAbi=a.h;exports.PointsIncentive=s;exports.preparePointsIncentivePayload=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-D50hBWtr.cjs"),t=require("viem"),n=require("../deployments-BucJ-gwk.cjs"),l=require("../Deployable/DeployableTarget.cjs"),o=require("../claiming.cjs"),u=require("../utils.cjs"),h="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611c21806100bd5f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db919061145a565b61065f565b6040516101ed919061149f565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b60405161021791906114d0565b60405180910390f35b61023a60048036038101906102359190611513565b6106e0565b005b61025660048036038101906102519190611598565b6106ed565b005b348015610263575f80fd5b5061027e60048036038101906102799190611598565b610703565b60405161028b919061149f565b60405180910390f35b34801561029f575f80fd5b506102a8610719565b6040516102b591906114d0565b60405180910390f35b6102c661071e565b005b3480156102d3575f80fd5b506102dc61076f565b6040516102e991906115e5565b60405180910390f35b3480156102fd575f80fd5b50610318600480360381019061031391906115fe565b610796565b60405161032591906114d0565b60405180910390f35b348015610339575f80fd5b506103426107af565b60405161034f9190611638565b60405180910390f35b348015610363575f80fd5b5061037e600480360381019061037991906116b2565b6107ca565b005b34801561038b575f80fd5b506103a660048036038101906103a191906116b2565b610982565b6040516103b49291906116fd565b60405180910390f35b6103d760048036038101906103d29190611598565b6109b6565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa91906116b2565b6109cc565b60405161040c9190611794565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611598565b610a23565b604051610448919061149f565b60405180910390f35b610459610a3a565b005b610463610a73565b005b348015610470575f80fd5b50610479610a86565b6040516104869190611638565b60405180910390f35b34801561049a575f80fd5b506104a3610aae565b6040516104b09190611638565b60405180910390f35b3480156104c4575f80fd5b506104cd610ad3565b6040516104da91906114d0565b60405180910390f35b3480156104ee575f80fd5b50610509600480360381019061050491906117b4565b610ad9565b604051610516919061149f565b60405180910390f35b34801561052a575f80fd5b50610545600480360381019061054091906115fe565b610eee565b604051610552919061149f565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c91906117b4565b610f0b565b60405161058e919061149f565b60405180910390f35b3480156105a2575f80fd5b506105ab610f1e565b6040516105b891906114d0565b60405180910390f35b3480156105cc575f80fd5b506105d5610f24565b6040516105e291906115e5565b60405180910390f35b610605600480360381019061060091906115fe565b610f36565b005b610621600480360381019061061c91906115fe565b610f74565b005b34801561062e575f80fd5b50610649600480360381019061064491906115fe565b610f9d565b60405161065691906114d0565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610fb6565b5b9050919050565b5f8054905090565b6106ea338261102f565b50565b6106f561103e565b6106ff8282611075565b5050565b5f818261070f85610796565b1614905092915050565b5f5481565b5f610727611085565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f73deaddeaddeaddeaddeaddeaddeaddeaddeaddead905090565b5f6107d361108f565b905080546003825580156108055760018160011c14303b106107fc5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f83838101906108169190611902565b90505f8160400151148061082d57505f8160600151145b15610864576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160045f6101000a81548163ffffffff021916908360e01c021790555080604001515f8190555080606001516003819055506108e6336110b8565b805f015173ffffffffffffffffffffffffffffffffffffffff167fef49c8fd80435c15980f0f55660ffaac9417e5843768f7f21566cfad2d19bfe782602001518360400151846060015160405161093f9392919061192d565b60405180910390a250801561097d576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109be61103e565b6109c8828261102f565b5050565b60605f67ffffffffffffffff8111156109e8576109e7611815565b5b6040519080825280601f01601f191660200182016040528015610a1a5781602001600182028036833780820191505090505b50905092915050565b5f8082610a2f85610796565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a7b61103e565b610a845f61118e565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b5f610ae261103e565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b67573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8b9190611976565b73ffffffffffffffffffffffffffffffffffffffff1614158015610c2e5750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610bea9291906119e3565b602060405180830381865afa158015610c05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c299190611a34565b151514155b15610c65576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c6e85611254565b610ca4576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f815480929190610cb690611a8c565b91905055506001805f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900460e01b875f54604051602401610d6b929190611ad3565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610dd59190611b34565b5f604051808303815f865af19150503d805f8114610e0e576040519150601f19603f3d011682016040523d82523d5f602084013e610e13565b606091505b5050905080610e4e576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16885f54604051602001610ebd93929190611baf565b604051602081830303815290604052604051610ed99190611794565b60405180910390a26001925050509392505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b5f610f1584611254565b90509392505050565b60055481565b60045f9054906101000a900460e01b81565b610f3e61103e565b63389a75e1600c52805f526020600c208054421115610f6457636f5e88185f526004601cfd5b5f815550610f718161118e565b50565b610f7c61103e565b8060601b610f9157637448fbae5f526004601cfd5b610f9a8161118e565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806110285750611027826112b6565b5b9050919050565b61103a82825f61132f565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611073576382b429005f526004601cfd5b565b6110818282600161132f565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6110c0611387565b15611138577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156110fa57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061118b565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611196611387565b156111fb577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611251565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161580156112af5750600354600554105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061132857506113278261138b565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361135157848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61143981611405565b8114611443575f80fd5b50565b5f8135905061145481611430565b92915050565b5f6020828403121561146f5761146e6113fd565b5b5f61147c84828501611446565b91505092915050565b5f8115159050919050565b61149981611485565b82525050565b5f6020820190506114b25f830184611490565b92915050565b5f819050919050565b6114ca816114b8565b82525050565b5f6020820190506114e35f8301846114c1565b92915050565b6114f2816114b8565b81146114fc575f80fd5b50565b5f8135905061150d816114e9565b92915050565b5f60208284031215611528576115276113fd565b5b5f611535848285016114ff565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6115678261153e565b9050919050565b6115778161155d565b8114611581575f80fd5b50565b5f813590506115928161156e565b92915050565b5f80604083850312156115ae576115ad6113fd565b5b5f6115bb85828601611584565b92505060206115cc858286016114ff565b9150509250929050565b6115df81611405565b82525050565b5f6020820190506115f85f8301846115d6565b92915050565b5f60208284031215611613576116126113fd565b5b5f61162084828501611584565b91505092915050565b6116328161155d565b82525050565b5f60208201905061164b5f830184611629565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261167257611671611651565b5b8235905067ffffffffffffffff81111561168f5761168e611655565b5b6020830191508360018202830111156116ab576116aa611659565b5b9250929050565b5f80602083850312156116c8576116c76113fd565b5b5f83013567ffffffffffffffff8111156116e5576116e4611401565b5b6116f18582860161165d565b92509250509250929050565b5f6040820190506117105f8301856114c1565b61171d6020830184611629565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61176682611724565b611770818561172e565b935061178081856020860161173e565b6117898161174c565b840191505092915050565b5f6020820190508181035f8301526117ac818461175c565b905092915050565b5f805f604084860312156117cb576117ca6113fd565b5b5f6117d886828701611584565b935050602084013567ffffffffffffffff8111156117f9576117f8611401565b5b6118058682870161165d565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61184b8261174c565b810181811067ffffffffffffffff8211171561186a57611869611815565b5b80604052505050565b5f61187c6113f4565b90506118888282611842565b919050565b5f608082840312156118a2576118a1611811565b5b6118ac6080611873565b90505f6118bb84828501611584565b5f8301525060206118ce84828501611446565b60208301525060406118e2848285016114ff565b60408301525060606118f6848285016114ff565b60608301525092915050565b5f60808284031215611917576119166113fd565b5b5f6119248482850161188d565b91505092915050565b5f6060820190506119405f8301866115d6565b61194d60208301856114c1565b61195a60408301846114c1565b949350505050565b5f815190506119708161156e565b92915050565b5f6020828403121561198b5761198a6113fd565b5b5f61199884828501611962565b91505092915050565b5f819050919050565b5f819050919050565b5f6119cd6119c86119c3846119a1565b6119aa565b6114b8565b9050919050565b6119dd816119b3565b82525050565b5f6040820190506119f65f830185611629565b611a0360208301846119d4565b9392505050565b611a1381611485565b8114611a1d575f80fd5b50565b5f81519050611a2e81611a0a565b92915050565b5f60208284031215611a4957611a486113fd565b5b5f611a5684828501611a20565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a96826114b8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ac857611ac7611a5f565b5b600182019050919050565b5f604082019050611ae65f830185611629565b611af360208301846114c1565b9392505050565b5f81905092915050565b5f611b0e82611724565b611b188185611afa565b9350611b2881856020860161173e565b80840191505092915050565b5f611b3f8284611b04565b915081905092915050565b5f8160601b9050919050565b5f611b6082611b4a565b9050919050565b5f611b7182611b56565b9050919050565b611b89611b848261155d565b611b67565b82525050565b5f819050919050565b611ba9611ba4826114b8565b611b8f565b82525050565b5f611bba8286611b78565b601482019150611bca8285611b78565b601482019150611bda8284611b98565b60208201915081905094935050505056fea264697066735822122082d6437e7160694ebcc6f5718c4ee30e3efa64dceafb1a566026f6dd8b9107f164736f6c634300081a0033",d=class d extends l.DeployableTarget{constructor(){super(...arguments),this.abi=a.g}async claims(f){return await a.iH(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.rH(this._config,{address:this.assertValidAddress(),args:[],...f})}async reward(f){return await a.bH(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.aH(this._config,{address:this.assertValidAddress(),args:[f],...b})}async venue(f){return await a.TH(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.yH(this._config,{address:this.assertValidAddress(),...f})}async selector(f){return await a.vH(this._config,{address:this.assertValidAddress(),...f})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:c}=await a.xH(this._config,{address:this.assertValidAddress(),args:[o.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.gH(this._config,e),result:c}}async isClaimable(f,b){return await a.lH(this._config,{address:this.assertValidAddress(),args:[f.target,f.data],...b})}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[b,e]=await Promise.all([this.claims(f),this.limit(f)]);return e-b}buildParameters(f,b){const[e,c]=this.validateDeploymentConfig(f,b);return{abi:a.g,bytecode:h,args:[i(e)],...this.optionallyAttachAccount(c.account)}}buildClaimData(){return t.zeroHash}};d.bases={31337:void 0,...n.PointsIncentive},d.registryType=u.RegistryType.INCENTIVE;let s=d;const i=({venue:r,selector:f,reward:b,limit:e})=>t.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[r,f,b,e]);exports.pointsIncentiveAbi=a.g;exports.PointsIncentive=s;exports.preparePointsIncentivePayload=i;
2
2
  //# sourceMappingURL=PointsIncentive.cjs.map
@@ -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: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * 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,MAAMK,EAAAA,GAA2B,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMM,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EAEjC,GAAIN,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMO,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EAEjC,GAAIP,CAAA,CACL,CACH,CAUA,MAAa,SAASA,EAAqB,CAClC,OAAA,MAAMQ,EAAAA,GAA4B,KAAK,QAAS,CACrD,QAAS,KAAK,mBAAmB,EAEjC,GAAIR,CAAA,CACL,C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5D,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"}
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: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * 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":"kudAmGaA,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,MAAMK,EAAAA,GAA2B,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMM,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EAEjC,GAAIN,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B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M,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"}
@@ -182,6 +182,31 @@ export declare class PointsIncentive extends DeployableTarget<PointsIncentivePay
182
182
  readonly indexed: true;
183
183
  }];
184
184
  readonly name: "OwnershipTransferred";
185
+ }, {
186
+ readonly type: "event";
187
+ readonly anonymous: false;
188
+ readonly inputs: readonly [{
189
+ readonly name: "venue";
190
+ readonly internalType: "address";
191
+ readonly type: "address";
192
+ readonly indexed: true;
193
+ }, {
194
+ readonly name: "selector";
195
+ readonly internalType: "bytes4";
196
+ readonly type: "bytes4";
197
+ readonly indexed: false;
198
+ }, {
199
+ readonly name: "reward";
200
+ readonly internalType: "uint256";
201
+ readonly type: "uint256";
202
+ readonly indexed: false;
203
+ }, {
204
+ readonly name: "limit";
205
+ readonly internalType: "uint256";
206
+ readonly type: "uint256";
207
+ readonly indexed: false;
208
+ }];
209
+ readonly name: "PointsIncentiveInitialized";
185
210
  }, {
186
211
  readonly type: "event";
187
212
  readonly anonymous: false;
@@ -1 +1 @@
1
- {"version":3,"file":"PointsIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/PointsIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,E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,CAAC,EAAE,UAAU;IAQtC;;;;;;;OAOG;IACU,KAAK,CAAC,MAAM,CAAC,EAAE,UAAU;IAQtC;;;;;;;OAOG;IACU,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU;IAQzC;;;;;;;;OAQG;cACa,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,WAAW;IAIjE;;;;;;;;OAQG;cACa,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,WAAW;;;;IAepE;;;;;;;;;;OAUG;IACU,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,UAAU;IASnE;;;;;;;OAOG;IACU,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU;IAI7C;;;;;;;OAOG;IACU,0BAA0B,CAAC,MAAM,CAAC,EAAE,UAAU;IAQ3D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,sBAAsB,EACjC,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAa1B;;;;;;OAMG;IACI,cAAc;CAGtB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,wCAKvC,sBAAsB,kBAUxB,CAAC"}
@@ -1,10 +1,10 @@
1
- import { h as c, be as i, bf as r, bg as n, bh as o, bi as l, bj as m, bk as h, bl as u, bm as y, bn as g } from "../generated-1ZT_mHJx.js";
1
+ import { g as c, be as i, bf as r, bg as n, bh as o, bi as l, bj as m, bk as h, bl as u, bm as g, bn as y } from "../generated-B5pVBNb-.js";
2
2
  import { zeroHash as p, encodeAbiParameters as w } from "viem";
3
3
  import { P as A } from "../deployments-CQu0bLhU.js";
4
- import { DeployableTarget as z } from "../Deployable/DeployableTarget.js";
4
+ import { DeployableTarget as H } from "../Deployable/DeployableTarget.js";
5
5
  import { prepareClaimPayload as V } from "../claiming.js";
6
6
  import { RegistryType as C } from "../utils.js";
7
- const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b8b806100bd5f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db91906113f9565b61065f565b6040516101ed919061143e565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061146f565b60405180910390f35b61023a600480360381019061023591906114b2565b6106e0565b005b61025660048036038101906102519190611537565b6106ed565b005b348015610263575f80fd5b5061027e60048036038101906102799190611537565b610703565b60405161028b919061143e565b60405180910390f35b34801561029f575f80fd5b506102a8610719565b6040516102b5919061146f565b60405180910390f35b6102c661071e565b005b3480156102d3575f80fd5b506102dc61076f565b6040516102e99190611584565b60405180910390f35b3480156102fd575f80fd5b506103186004803603810190610313919061159d565b610796565b604051610325919061146f565b60405180910390f35b348015610339575f80fd5b506103426107af565b60405161034f91906115d7565b60405180910390f35b348015610363575f80fd5b5061037e60048036038101906103799190611651565b6107ca565b005b34801561038b575f80fd5b506103a660048036038101906103a19190611651565b610921565b6040516103b492919061169c565b60405180910390f35b6103d760048036038101906103d29190611537565b610955565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa9190611651565b61096b565b60405161040c9190611733565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611537565b6109c2565b604051610448919061143e565b60405180910390f35b6104596109d9565b005b610463610a12565b005b348015610470575f80fd5b50610479610a25565b60405161048691906115d7565b60405180910390f35b34801561049a575f80fd5b506104a3610a4d565b6040516104b091906115d7565b60405180910390f35b3480156104c4575f80fd5b506104cd610a72565b6040516104da919061146f565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611753565b610a78565b604051610516919061143e565b60405180910390f35b34801561052a575f80fd5b506105456004803603810190610540919061159d565b610e8d565b604051610552919061143e565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611753565b610eaa565b60405161058e919061143e565b60405180910390f35b3480156105a2575f80fd5b506105ab610ebd565b6040516105b8919061146f565b60405180910390f35b3480156105cc575f80fd5b506105d5610ec3565b6040516105e29190611584565b60405180910390f35b6106056004803603810190610600919061159d565b610ed5565b005b610621600480360381019061061c919061159d565b610f13565b005b34801561062e575f80fd5b506106496004803603810190610644919061159d565b610f3c565b604051610656919061146f565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f55565b5b9050919050565b5f8054905090565b6106ea3382610fce565b50565b6106f5610fdd565b6106ff8282611014565b5050565b5f818261070f85610796565b1614905092915050565b5f5481565b5f610727611024565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f73deaddeaddeaddeaddeaddeaddeaddeaddeaddead905090565b5f6107d361102e565b905080546003825580156108055760018160011c14303b106107fc5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061081691906118a1565b90505f8160400151148061082d57505f8160600151145b15610864576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160045f6101000a81548163ffffffff021916908360e01c021790555080604001515f8190555080606001516003819055506108e633611057565b50801561091c576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61095d610fdd565b6109678282610fce565b5050565b60605f67ffffffffffffffff811115610987576109866117b4565b5b6040519080825280601f01601f1916602001820160405280156109b95781602001600182028036833780820191505090505b50905092915050565b5f80826109ce85610796565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a1a610fdd565b610a235f61112d565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b5f610a81610fdd565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b06573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b2a91906118e0565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bcd5750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b8992919061194d565b602060405180830381865afa158015610ba4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bc8919061199e565b151514155b15610c04576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c0d856111f3565b610c43576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f815480929190610c55906119f6565b91905055506001805f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900460e01b875f54604051602401610d0a929190611a3d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d749190611a9e565b5f604051808303815f865af19150503d805f8114610dad576040519150601f19603f3d011682016040523d82523d5f602084013e610db2565b606091505b5050905080610ded576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16885f54604051602001610e5c93929190611b19565b604051602081830303815290604052604051610e789190611733565b60405180910390a26001925050509392505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b5f610eb4846111f3565b90509392505050565b60055481565b60045f9054906101000a900460e01b81565b610edd610fdd565b63389a75e1600c52805f526020600c208054421115610f0357636f5e88185f526004601cfd5b5f815550610f108161112d565b50565b610f1b610fdd565b8060601b610f3057637448fbae5f526004601cfd5b610f398161112d565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fc75750610fc682611255565b5b9050919050565b610fd982825f6112ce565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611012576382b429005f526004601cfd5b565b611020828260016112ce565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61105f611326565b156110d7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561109957630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061112a565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611135611326565b1561119a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111f0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561124e5750600354600554105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112c757506112c68261132a565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112f057848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113d8816113a4565b81146113e2575f80fd5b50565b5f813590506113f3816113cf565b92915050565b5f6020828403121561140e5761140d61139c565b5b5f61141b848285016113e5565b91505092915050565b5f8115159050919050565b61143881611424565b82525050565b5f6020820190506114515f83018461142f565b92915050565b5f819050919050565b61146981611457565b82525050565b5f6020820190506114825f830184611460565b92915050565b61149181611457565b811461149b575f80fd5b50565b5f813590506114ac81611488565b92915050565b5f602082840312156114c7576114c661139c565b5b5f6114d48482850161149e565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611506826114dd565b9050919050565b611516816114fc565b8114611520575f80fd5b50565b5f813590506115318161150d565b92915050565b5f806040838503121561154d5761154c61139c565b5b5f61155a85828601611523565b925050602061156b8582860161149e565b9150509250929050565b61157e816113a4565b82525050565b5f6020820190506115975f830184611575565b92915050565b5f602082840312156115b2576115b161139c565b5b5f6115bf84828501611523565b91505092915050565b6115d1816114fc565b82525050565b5f6020820190506115ea5f8301846115c8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611611576116106115f0565b5b8235905067ffffffffffffffff81111561162e5761162d6115f4565b5b60208301915083600182028301111561164a576116496115f8565b5b9250929050565b5f80602083850312156116675761166661139c565b5b5f83013567ffffffffffffffff811115611684576116836113a0565b5b611690858286016115fc565b92509250509250929050565b5f6040820190506116af5f830185611460565b6116bc60208301846115c8565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611705826116c3565b61170f81856116cd565b935061171f8185602086016116dd565b611728816116eb565b840191505092915050565b5f6020820190508181035f83015261174b81846116fb565b905092915050565b5f805f6040848603121561176a5761176961139c565b5b5f61177786828701611523565b935050602084013567ffffffffffffffff811115611798576117976113a0565b5b6117a4868287016115fc565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117ea826116eb565b810181811067ffffffffffffffff82111715611809576118086117b4565b5b80604052505050565b5f61181b611393565b905061182782826117e1565b919050565b5f60808284031215611841576118406117b0565b5b61184b6080611812565b90505f61185a84828501611523565b5f83015250602061186d848285016113e5565b60208301525060406118818482850161149e565b60408301525060606118958482850161149e565b60608301525092915050565b5f608082840312156118b6576118b561139c565b5b5f6118c38482850161182c565b91505092915050565b5f815190506118da8161150d565b92915050565b5f602082840312156118f5576118f461139c565b5b5f611902848285016118cc565b91505092915050565b5f819050919050565b5f819050919050565b5f61193761193261192d8461190b565b611914565b611457565b9050919050565b6119478161191d565b82525050565b5f6040820190506119605f8301856115c8565b61196d602083018461193e565b9392505050565b61197d81611424565b8114611987575f80fd5b50565b5f8151905061199881611974565b92915050565b5f602082840312156119b3576119b261139c565b5b5f6119c08482850161198a565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0082611457565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a3257611a316119c9565b5b600182019050919050565b5f604082019050611a505f8301856115c8565b611a5d6020830184611460565b9392505050565b5f81905092915050565b5f611a78826116c3565b611a828185611a64565b9350611a928185602086016116dd565b80840191505092915050565b5f611aa98284611a6e565b915081905092915050565b5f8160601b9050919050565b5f611aca82611ab4565b9050919050565b5f611adb82611ac0565b9050919050565b611af3611aee826114fc565b611ad1565b82525050565b5f819050919050565b611b13611b0e82611457565b611af9565b82525050565b5f611b248286611ae2565b601482019150611b348285611ae2565b601482019150611b448284611b02565b60208201915081905094935050505056fea2646970667358221220d6b660c45cfb14561fecfab54209da8ea926d96b371bbdb9b93f5ad944e89aad64736f6c634300081a0033", d = class d extends z {
7
+ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611c21806100bd5f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db919061145a565b61065f565b6040516101ed919061149f565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b60405161021791906114d0565b60405180910390f35b61023a60048036038101906102359190611513565b6106e0565b005b61025660048036038101906102519190611598565b6106ed565b005b348015610263575f80fd5b5061027e60048036038101906102799190611598565b610703565b60405161028b919061149f565b60405180910390f35b34801561029f575f80fd5b506102a8610719565b6040516102b591906114d0565b60405180910390f35b6102c661071e565b005b3480156102d3575f80fd5b506102dc61076f565b6040516102e991906115e5565b60405180910390f35b3480156102fd575f80fd5b50610318600480360381019061031391906115fe565b610796565b60405161032591906114d0565b60405180910390f35b348015610339575f80fd5b506103426107af565b60405161034f9190611638565b60405180910390f35b348015610363575f80fd5b5061037e600480360381019061037991906116b2565b6107ca565b005b34801561038b575f80fd5b506103a660048036038101906103a191906116b2565b610982565b6040516103b49291906116fd565b60405180910390f35b6103d760048036038101906103d29190611598565b6109b6565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa91906116b2565b6109cc565b60405161040c9190611794565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611598565b610a23565b604051610448919061149f565b60405180910390f35b610459610a3a565b005b610463610a73565b005b348015610470575f80fd5b50610479610a86565b6040516104869190611638565b60405180910390f35b34801561049a575f80fd5b506104a3610aae565b6040516104b09190611638565b60405180910390f35b3480156104c4575f80fd5b506104cd610ad3565b6040516104da91906114d0565b60405180910390f35b3480156104ee575f80fd5b50610509600480360381019061050491906117b4565b610ad9565b604051610516919061149f565b60405180910390f35b34801561052a575f80fd5b50610545600480360381019061054091906115fe565b610eee565b604051610552919061149f565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c91906117b4565b610f0b565b60405161058e919061149f565b60405180910390f35b3480156105a2575f80fd5b506105ab610f1e565b6040516105b891906114d0565b60405180910390f35b3480156105cc575f80fd5b506105d5610f24565b6040516105e291906115e5565b60405180910390f35b610605600480360381019061060091906115fe565b610f36565b005b610621600480360381019061061c91906115fe565b610f74565b005b34801561062e575f80fd5b50610649600480360381019061064491906115fe565b610f9d565b60405161065691906114d0565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610fb6565b5b9050919050565b5f8054905090565b6106ea338261102f565b50565b6106f561103e565b6106ff8282611075565b5050565b5f818261070f85610796565b1614905092915050565b5f5481565b5f610727611085565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f73deaddeaddeaddeaddeaddeaddeaddeaddeaddead905090565b5f6107d361108f565b905080546003825580156108055760018160011c14303b106107fc5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f83838101906108169190611902565b90505f8160400151148061082d57505f8160600151145b15610864576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160045f6101000a81548163ffffffff021916908360e01c021790555080604001515f8190555080606001516003819055506108e6336110b8565b805f015173ffffffffffffffffffffffffffffffffffffffff167fef49c8fd80435c15980f0f55660ffaac9417e5843768f7f21566cfad2d19bfe782602001518360400151846060015160405161093f9392919061192d565b60405180910390a250801561097d576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109be61103e565b6109c8828261102f565b5050565b60605f67ffffffffffffffff8111156109e8576109e7611815565b5b6040519080825280601f01601f191660200182016040528015610a1a5781602001600182028036833780820191505090505b50905092915050565b5f8082610a2f85610796565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a7b61103e565b610a845f61118e565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b5f610ae261103e565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b67573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8b9190611976565b73ffffffffffffffffffffffffffffffffffffffff1614158015610c2e5750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610bea9291906119e3565b602060405180830381865afa158015610c05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c299190611a34565b151514155b15610c65576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c6e85611254565b610ca4576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f815480929190610cb690611a8c565b91905055506001805f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900460e01b875f54604051602401610d6b929190611ad3565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610dd59190611b34565b5f604051808303815f865af19150503d805f8114610e0e576040519150601f19603f3d011682016040523d82523d5f602084013e610e13565b606091505b5050905080610e4e576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16885f54604051602001610ebd93929190611baf565b604051602081830303815290604052604051610ed99190611794565b60405180910390a26001925050509392505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b5f610f1584611254565b90509392505050565b60055481565b60045f9054906101000a900460e01b81565b610f3e61103e565b63389a75e1600c52805f526020600c208054421115610f6457636f5e88185f526004601cfd5b5f815550610f718161118e565b50565b610f7c61103e565b8060601b610f9157637448fbae5f526004601cfd5b610f9a8161118e565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806110285750611027826112b6565b5b9050919050565b61103a82825f61132f565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611073576382b429005f526004601cfd5b565b6110818282600161132f565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6110c0611387565b15611138577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156110fa57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061118b565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611196611387565b156111fb577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611251565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161580156112af5750600354600554105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061132857506113278261138b565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361135157848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61143981611405565b8114611443575f80fd5b50565b5f8135905061145481611430565b92915050565b5f6020828403121561146f5761146e6113fd565b5b5f61147c84828501611446565b91505092915050565b5f8115159050919050565b61149981611485565b82525050565b5f6020820190506114b25f830184611490565b92915050565b5f819050919050565b6114ca816114b8565b82525050565b5f6020820190506114e35f8301846114c1565b92915050565b6114f2816114b8565b81146114fc575f80fd5b50565b5f8135905061150d816114e9565b92915050565b5f60208284031215611528576115276113fd565b5b5f611535848285016114ff565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6115678261153e565b9050919050565b6115778161155d565b8114611581575f80fd5b50565b5f813590506115928161156e565b92915050565b5f80604083850312156115ae576115ad6113fd565b5b5f6115bb85828601611584565b92505060206115cc858286016114ff565b9150509250929050565b6115df81611405565b82525050565b5f6020820190506115f85f8301846115d6565b92915050565b5f60208284031215611613576116126113fd565b5b5f61162084828501611584565b91505092915050565b6116328161155d565b82525050565b5f60208201905061164b5f830184611629565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261167257611671611651565b5b8235905067ffffffffffffffff81111561168f5761168e611655565b5b6020830191508360018202830111156116ab576116aa611659565b5b9250929050565b5f80602083850312156116c8576116c76113fd565b5b5f83013567ffffffffffffffff8111156116e5576116e4611401565b5b6116f18582860161165d565b92509250509250929050565b5f6040820190506117105f8301856114c1565b61171d6020830184611629565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61176682611724565b611770818561172e565b935061178081856020860161173e565b6117898161174c565b840191505092915050565b5f6020820190508181035f8301526117ac818461175c565b905092915050565b5f805f604084860312156117cb576117ca6113fd565b5b5f6117d886828701611584565b935050602084013567ffffffffffffffff8111156117f9576117f8611401565b5b6118058682870161165d565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61184b8261174c565b810181811067ffffffffffffffff8211171561186a57611869611815565b5b80604052505050565b5f61187c6113f4565b90506118888282611842565b919050565b5f608082840312156118a2576118a1611811565b5b6118ac6080611873565b90505f6118bb84828501611584565b5f8301525060206118ce84828501611446565b60208301525060406118e2848285016114ff565b60408301525060606118f6848285016114ff565b60608301525092915050565b5f60808284031215611917576119166113fd565b5b5f6119248482850161188d565b91505092915050565b5f6060820190506119405f8301866115d6565b61194d60208301856114c1565b61195a60408301846114c1565b949350505050565b5f815190506119708161156e565b92915050565b5f6020828403121561198b5761198a6113fd565b5b5f61199884828501611962565b91505092915050565b5f819050919050565b5f819050919050565b5f6119cd6119c86119c3846119a1565b6119aa565b6114b8565b9050919050565b6119dd816119b3565b82525050565b5f6040820190506119f65f830185611629565b611a0360208301846119d4565b9392505050565b611a1381611485565b8114611a1d575f80fd5b50565b5f81519050611a2e81611a0a565b92915050565b5f60208284031215611a4957611a486113fd565b5b5f611a5684828501611a20565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a96826114b8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ac857611ac7611a5f565b5b600182019050919050565b5f604082019050611ae65f830185611629565b611af360208301846114c1565b9392505050565b5f81905092915050565b5f611b0e82611724565b611b188185611afa565b9350611b2881856020860161173e565b80840191505092915050565b5f611b3f8284611b04565b915081905092915050565b5f8160601b9050919050565b5f611b6082611b4a565b9050919050565b5f611b7182611b56565b9050919050565b611b89611b848261155d565b611b67565b82525050565b5f819050919050565b611ba9611ba4826114b8565b611b8f565b82525050565b5f611bba8286611b78565b601482019150611bca8285611b78565b601482019150611bda8284611b98565b60208201915081905094935050505056fea264697066735822122082d6437e7160694ebcc6f5718c4ee30e3efa64dceafb1a566026f6dd8b9107f164736f6c634300081a0033", e = class e extends H {
8
8
  constructor() {
9
9
  super(...arguments), this.abi = c;
10
10
  }
@@ -140,7 +140,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
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: e } = await u(
143
+ const { request: a, result: d } = await u(
144
144
  this._config,
145
145
  {
146
146
  address: this.assertValidAddress(),
@@ -150,7 +150,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
150
150
  ...b
151
151
  }
152
152
  );
153
- return { hash: await y(this._config, a), result: e };
153
+ return { hash: await g(this._config, a), result: d };
154
154
  }
155
155
  /**
156
156
  * Check if an incentive is claimable.
@@ -164,7 +164,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
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 g(this._config, {
167
+ return await y(this._config, {
168
168
  address: this.assertValidAddress(),
169
169
  args: [f.target, f.data],
170
170
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -206,7 +206,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
206
206
  * @returns {GenericDeployableParams}
207
207
  */
208
208
  buildParameters(f, b) {
209
- const [a, e] = this.validateDeploymentConfig(
209
+ const [a, d] = this.validateDeploymentConfig(
210
210
  f,
211
211
  b
212
212
  );
@@ -214,7 +214,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
214
214
  abi: c,
215
215
  bytecode: _,
216
216
  args: [P(a)],
217
- ...this.optionallyAttachAccount(e.account)
217
+ ...this.optionallyAttachAccount(d.account)
218
218
  };
219
219
  }
220
220
  /**
@@ -228,11 +228,11 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
228
228
  return p;
229
229
  }
230
230
  };
231
- d.bases = {
231
+ e.bases = {
232
232
  31337: void 0,
233
233
  ...A
234
- }, d.registryType = C.INCENTIVE;
235
- let s = d;
234
+ }, e.registryType = C.INCENTIVE;
235
+ let s = e;
236
236
  const P = ({
237
237
  venue: t,
238
238
  selector: f,
@@ -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: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * 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,G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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: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * 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":";;;;;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