@boostxyz/sdk 5.0.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +5 -5
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +18 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +201 -132
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.js +8 -8
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +14 -0
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +130 -111
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +6 -6
- package/dist/{Budget-fHCvlPfB.js → Budget-C0SMvfEl.js} +53 -53
- package/dist/{Budget-fHCvlPfB.js.map → Budget-C0SMvfEl.js.map} +1 -1
- package/dist/{Budget-Cnyh81n5.cjs → Budget-N0YEfSt2.cjs} +2 -2
- package/dist/{Budget-Cnyh81n5.cjs.map → Budget-N0YEfSt2.cjs.map} +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +3 -3
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.js +29 -29
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +15 -15
- package/dist/Incentive-DSsxOFKY.js +901 -0
- package/dist/Incentive-DSsxOFKY.js.map +1 -0
- package/dist/Incentive-lNp-ZudZ.cjs +2 -0
- package/dist/Incentive-lNp-ZudZ.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.js +11 -11
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +24 -22
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +19 -19
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +1035 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +19 -19
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +25 -23
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +6 -5
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +17 -16
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.js +8 -8
- package/dist/{SimpleDenyList-GZlSeh2G.js → SimpleDenyList-B8QeJthf.js} +12 -12
- package/dist/{SimpleDenyList-GZlSeh2G.js.map → SimpleDenyList-B8QeJthf.js.map} +1 -1
- package/dist/{SimpleDenyList-CgQvS1ek.cjs → SimpleDenyList-DIb4xX3j.cjs} +2 -2
- package/dist/{SimpleDenyList-CgQvS1ek.cjs.map → SimpleDenyList-DIb4xX3j.cjs.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.js +18 -18
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +16 -16
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +4 -4
- package/dist/componentInterfaces-D7r9xJmt.cjs +2 -0
- package/dist/componentInterfaces-D7r9xJmt.cjs.map +1 -0
- package/dist/componentInterfaces-PR3ijhgZ.js +18 -0
- package/dist/componentInterfaces-PR3ijhgZ.js.map +1 -0
- package/dist/{deployments-CMdsItcq.cjs → deployments-BGpr4ppG.cjs} +2 -2
- package/dist/deployments-BGpr4ppG.cjs.map +1 -0
- package/dist/{deployments-DzhmI-zL.js → deployments-COxshLqt.js} +42 -32
- package/dist/deployments-COxshLqt.js.map +1 -0
- package/dist/deployments.json +20 -15
- package/dist/generated-CRD9XfOT.cjs +3 -0
- package/dist/generated-CRD9XfOT.cjs.map +1 -0
- package/dist/{generated-Hbd0NIf9.js → generated-ClbO_ULI.js} +1274 -709
- package/dist/generated-ClbO_ULI.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +133 -129
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +7 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1121 -41
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/Actions/EventAction.ts +85 -1
- package/src/BoostCore.ts +27 -0
- package/src/Incentives/CGDAIncentive.ts +3 -1
- package/src/Incentives/ERC20PeggedIncentive.ts +2 -2
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.test.ts +315 -0
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +728 -0
- package/src/Incentives/ERC20VariableIncentive.ts +3 -1
- package/src/Incentives/Incentive.ts +8 -2
- package/src/index.ts +1 -0
- package/src/utils.ts +10 -0
- package/dist/Incentive-M45PaQsT.js +0 -397
- package/dist/Incentive-M45PaQsT.js.map +0 -1
- package/dist/Incentive-axLU7ndr.cjs +0 -2
- package/dist/Incentive-axLU7ndr.cjs.map +0 -1
- package/dist/componentInterfaces-Bt-4sNB5.cjs +0 -2
- package/dist/componentInterfaces-Bt-4sNB5.cjs.map +0 -1
- package/dist/componentInterfaces-C4uAYjSo.js +0 -16
- package/dist/componentInterfaces-C4uAYjSo.js.map +0 -1
- package/dist/deployments-CMdsItcq.cjs.map +0 -1
- package/dist/deployments-DzhmI-zL.js.map +0 -1
- package/dist/generated-CNkDfjzI.cjs +0 -3
- package/dist/generated-CNkDfjzI.cjs.map +0 -1
- package/dist/generated-Hbd0NIf9.js.map +0 -1
|
@@ -475,13 +475,15 @@ export function prepareERC20VariableIncentivePayload({
|
|
|
475
475
|
asset,
|
|
476
476
|
reward,
|
|
477
477
|
limit,
|
|
478
|
+
manager,
|
|
478
479
|
}: ERC20VariableIncentivePayload) {
|
|
479
480
|
return encodeAbiParameters(
|
|
480
481
|
[
|
|
481
482
|
{ type: 'address', name: 'asset' },
|
|
482
483
|
{ type: 'uint256', name: 'reward' },
|
|
483
484
|
{ type: 'uint256', name: 'limit' },
|
|
485
|
+
{ type: 'address', name: 'manager' },
|
|
484
486
|
],
|
|
485
|
-
[asset, reward, limit],
|
|
487
|
+
[asset, reward, limit, manager],
|
|
486
488
|
);
|
|
487
489
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
ACGDAIncentive,
|
|
5
5
|
AERC20Incentive,
|
|
6
6
|
AERC20PeggedIncentive,
|
|
7
|
+
AERC20PeggedVariableCriteriaIncentive,
|
|
7
8
|
AERC20VariableCriteriaIncentive,
|
|
8
9
|
AERC20VariableIncentive,
|
|
9
10
|
// AERC20VariableCriteriaIncentive
|
|
@@ -18,6 +19,7 @@ import { AllowListIncentive } from './AllowListIncentive';
|
|
|
18
19
|
import { CGDAIncentive } from './CGDAIncentive';
|
|
19
20
|
import { ERC20Incentive } from './ERC20Incentive';
|
|
20
21
|
import { ERC20PeggedIncentive } from './ERC20PeggedIncentive';
|
|
22
|
+
import { ERC20PeggedVariableCriteriaIncentive } from './ERC20PeggedVariableCriteriaIncentive';
|
|
21
23
|
import { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';
|
|
22
24
|
import { ERC20VariableIncentive } from './ERC20VariableIncentive';
|
|
23
25
|
// import { ERC1155Incentive } from './ERC1155Incentive';
|
|
@@ -29,6 +31,7 @@ export {
|
|
|
29
31
|
// ERC1155Incentive,
|
|
30
32
|
ERC20Incentive,
|
|
31
33
|
ERC20PeggedIncentive,
|
|
34
|
+
ERC20PeggedVariableCriteriaIncentive,
|
|
32
35
|
PointsIncentive,
|
|
33
36
|
ERC20VariableIncentive,
|
|
34
37
|
ERC20VariableCriteriaIncentive,
|
|
@@ -46,6 +49,7 @@ export type Incentive =
|
|
|
46
49
|
| ERC20Incentive
|
|
47
50
|
// | ERC1155Incentive
|
|
48
51
|
| ERC20PeggedIncentive
|
|
52
|
+
| ERC20PeggedVariableCriteriaIncentive
|
|
49
53
|
| PointsIncentive
|
|
50
54
|
| ERC20VariableIncentive
|
|
51
55
|
| ERC20VariableCriteriaIncentive;
|
|
@@ -53,12 +57,14 @@ export type Incentive =
|
|
|
53
57
|
/**
|
|
54
58
|
* A map of Incentive component interfaces to their constructors.
|
|
55
59
|
*
|
|
56
|
-
* @type {{ "0xc5b24b8e": typeof PointsIncentive; "0x8c901437": typeof ERC20Incentive; "0x4414fbb4": typeof ERC20PeggedIncentive; "
|
|
60
|
+
* @type {{ "0xc5b24b8e": typeof PointsIncentive; "0x8c901437": typeof ERC20Incentive; "0x4414fbb4": typeof ERC20PeggedIncentive; "0xf60c99c9": typeof ERC20PeggedVariableCriteriaIncentive; "0x56586338": typeof AllowListIncentive; "0xa39e44d9": typeof CGDAIncentive; "0xa8e4af1e": typeof ERC20VariableIncentive; "0x90318111": typeof ERC20VariableCriteriaIncentive }}
|
|
57
61
|
*/
|
|
58
62
|
export const IncentiveByComponentInterface = {
|
|
59
63
|
[APointsIncentive as Hex]: PointsIncentive,
|
|
60
64
|
[AERC20Incentive as Hex]: ERC20Incentive,
|
|
61
|
-
[
|
|
65
|
+
[AERC20PeggedVariableCriteriaIncentive as Hex]:
|
|
66
|
+
ERC20PeggedVariableCriteriaIncentive,
|
|
67
|
+
[AERC20PeggedIncentive as Hex]: ERC20PeggedIncentive,
|
|
62
68
|
[AAllowListIncentive]: AllowListIncentive,
|
|
63
69
|
// [AERC1155Incentive as Hex]: ERC1155Incentive,
|
|
64
70
|
[ACGDAIncentive as Hex]: CGDAIncentive,
|
package/src/index.ts
CHANGED
|
@@ -38,6 +38,7 @@ export * from './Incentives/ERC20Incentive';
|
|
|
38
38
|
export * from './Incentives/ERC20PeggedIncentive';
|
|
39
39
|
export * from './Incentives/ERC20VariableIncentive';
|
|
40
40
|
export * from './Incentives/ERC20VariableCriteriaIncentive';
|
|
41
|
+
export * from './Incentives/ERC20PeggedVariableCriteriaIncentive';
|
|
41
42
|
// export * from './Incentives/ERC1155Incentive';
|
|
42
43
|
export * from './Incentives/Incentive';
|
|
43
44
|
export * from './Incentives/PointsIncentive';
|
package/src/utils.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { events } from '@boostxyz/signatures';
|
|
1
2
|
import {
|
|
2
3
|
type Config,
|
|
3
4
|
type ReadContractParameters,
|
|
@@ -61,6 +62,15 @@ export enum CheatCodes {
|
|
|
61
62
|
GAS_REBATE_INCENTIVE = 255,
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
/**
|
|
66
|
+
* The signature for the Transfer event for both ERC20 and ERC721.
|
|
67
|
+
*
|
|
68
|
+
* @type {Hex}
|
|
69
|
+
*/
|
|
70
|
+
export const TRANSFER_SIGNATURE = events.selectors[
|
|
71
|
+
'Transfer(address indexed,address indexed,uint256 indexed)'
|
|
72
|
+
] as Hex;
|
|
73
|
+
|
|
64
74
|
/**
|
|
65
75
|
* Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
|
|
66
76
|
* See (writeContract)[https://viem.sh/docs/contract/writeContract]
|
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
import { f as s, bK as h, bL as u, bM as g, bN as w, bO as p, bP as y, bQ as I, bR as A, bS as C, bT as V, bU as R, bV as v, bW as _, bX as E, bY as P, bZ as k } from "./generated-Hbd0NIf9.js";
|
|
2
|
-
import { f as D, g as T, h as i, i as N, j as x, k as B } from "./componentInterfaces-C4uAYjSo.js";
|
|
3
|
-
import { readContract as L } from "@wagmi/core";
|
|
4
|
-
import { InvalidComponentInterfaceError as j } from "./errors.js";
|
|
5
|
-
import { AllowListIncentive as q } from "./Incentives/AllowListIncentive.js";
|
|
6
|
-
import { CGDAIncentive as G } from "./Incentives/CGDAIncentive.js";
|
|
7
|
-
import { ERC20Incentive as K } from "./Incentives/ERC20Incentive.js";
|
|
8
|
-
import { encodeAbiParameters as t, zeroAddress as O } from "viem";
|
|
9
|
-
import { E as Y } from "./deployments-DzhmI-zL.js";
|
|
10
|
-
import { DeployableTarget as z } from "./Deployable/DeployableTarget.js";
|
|
11
|
-
import { prepareClaimPayload as r } from "./claiming.js";
|
|
12
|
-
import { RegistryType as F } from "./utils.js";
|
|
13
|
-
import { ERC20VariableCriteriaIncentive as M } from "./Incentives/ERC20VariableCriteriaIncentive.js";
|
|
14
|
-
import { ERC20VariableIncentive as n } from "./Incentives/ERC20VariableIncentive.js";
|
|
15
|
-
import { PointsIncentive as Q } from "./Incentives/PointsIncentive.js";
|
|
16
|
-
const S = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6127e6806100bd5f395ff3fe60806040526004361061020e575f3560e01c806354d1f13d11610117578063d54ad2a11161009f578063ec87621c1161006e578063ec87621c14610739578063f04e283e14610763578063f2fde38b1461077f578063fe9fbb801461079b578063fee81cf4146107d75761020e565b8063d54ad2a114610681578063db09da12146106ab578063dcc21361146106e7578063dcc59b6f1461070f5761020e565b80639214fa4d116100e65780639214fa4d1461058d578063a4d66daf146105b7578063bb1757cf146105e1578063be4994f81461061d578063c884ef83146106455761020e565b806354d1f13d14610525578063715018a61461052f57806375b238fc146105395780638da5cb5b146105635761020e565b80632de948071161019a578063474f5a4411610169578063474f5a441461042a5780634a4ee7b1146104675780634e7165a214610483578063514e62fc146104bf578063547d1864146104fb5761020e565b80632de948071461037457806338d52e0f146103b05780634359d28a146103da578063439fab91146104025761020e565b80631cd64df4116101e15780631cd64df4146102b05780631f1cb62b146102ec578063228cb73314610316578063256929621461034057806328d6183b1461034a5761020e565b806301ffc9a71461021257806307621eca1461024e578063183a4f6e146102785780631c10893f14610294575b5f80fd5b34801561021d575f80fd5b5061023860048036038101906102339190611ab3565b610813565b6040516102459190611af8565b60405180910390f35b348015610259575f80fd5b5061026261088c565b60405161026f9190611b29565b60405180910390f35b610292600480360381019061028d9190611b6c565b610894565b005b6102ae60048036038101906102a99190611bf1565b6108a1565b005b3480156102bb575f80fd5b506102d660048036038101906102d19190611bf1565b6108b7565b6040516102e39190611af8565b60405180910390f35b3480156102f7575f80fd5b506103006108cd565b60405161030d9190611c3e565b60405180910390f35b348015610321575f80fd5b5061032a6108f2565b6040516103379190611b29565b60405180910390f35b6103486108f7565b005b348015610355575f80fd5b5061035e610948565b60405161036b9190611c66565b60405180910390f35b34801561037f575f80fd5b5061039a60048036038101906103959190611c7f565b61096f565b6040516103a79190611b29565b60405180910390f35b3480156103bb575f80fd5b506103c4610988565b6040516103d19190611c3e565b60405180910390f35b3480156103e5575f80fd5b5061040060048036038101906103fb9190611d60565b6109ad565b005b34801561040d575f80fd5b5061042860048036038101906104239190611e33565b610abb565b005b348015610435575f80fd5b50610450600480360381019061044b9190611e33565b610d45565b60405161045e929190611e7e565b60405180910390f35b610481600480360381019061047c9190611bf1565b610eaf565b005b34801561048e575f80fd5b506104a960048036038101906104a49190611e33565b610ec5565b6040516104b69190611f15565b60405180910390f35b3480156104ca575f80fd5b506104e560048036038101906104e09190611bf1565b610f9a565b6040516104f29190611af8565b60405180910390f35b348015610506575f80fd5b5061050f610fb1565b60405161051c9190611b29565b60405180910390f35b61052d610fb7565b005b610537610ff0565b005b348015610544575f80fd5b5061054d611003565b60405161055a9190611b29565b60405180910390f35b34801561056e575f80fd5b50610577611008565b6040516105849190611c3e565b60405180910390f35b348015610598575f80fd5b506105a1611030565b6040516105ae9190611c3e565b60405180910390f35b3480156105c2575f80fd5b506105cb611058565b6040516105d89190611b29565b60405180910390f35b3480156105ec575f80fd5b5061060760048036038101906106029190611f35565b61105e565b6040516106149190611af8565b60405180910390f35b348015610628575f80fd5b50610643600480360381019061063e9190611fe7565b611239565b005b348015610650575f80fd5b5061066b60048036038101906106669190611c7f565b6112ef565b6040516106789190611af8565b60405180910390f35b34801561068c575f80fd5b5061069561130c565b6040516106a29190611b29565b60405180910390f35b3480156106b6575f80fd5b506106d160048036038101906106cc9190611f35565b611312565b6040516106de9190611af8565b60405180910390f35b3480156106f2575f80fd5b5061070d60048036038101906107089190611fe7565b611355565b005b34801561071a575f80fd5b5061072361140b565b6040516107309190611b29565b60405180910390f35b348015610744575f80fd5b5061074d611411565b60405161075a9190611b29565b60405180910390f35b61077d60048036038101906107789190611c7f565b611416565b005b61079960048036038101906107949190611c7f565b611454565b005b3480156107a6575f80fd5b506107c160048036038101906107bc9190611c7f565b61147d565b6040516107ce9190611af8565b60405180910390f35b3480156107e2575f80fd5b506107fd60048036038101906107f89190611c7f565b6114d0565b60405161080a9190611b29565b60405180910390f35b5f7f56586338000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108855750610884826114e9565b5b9050919050565b5f8054905090565b61089e3382611562565b50565b6108a9611571565b6108b382826115a8565b5050565b5f81826108c38561096f565b1614905092915050565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5481565b5f6109006115b8565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f5658633800000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109b8816115c2565b8282905085859050146109f7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ab3575f848483818110610a1857610a17612065565b5b9050602002016020810190610a2d91906120bc565b90506001151581151503610a7257610a6d878784818110610a5157610a50612065565b5b9050602002016020810190610a669190611c7f565b60016115a8565b610aa5565b610aa4878784818110610a8857610a87612065565b5b9050602002016020810190610a9d9190611c7f565b6001611562565b5b5080806001019150506109f9565b505050505050565b5f610ac46115f7565b90508054600382558015610af65760018160011c14303b10610aed5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b0791906121f0565b90505f81604001511480610b1e57505f8160600151145b15610b55576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f816060015190505f610b8a30845f015173ffffffffffffffffffffffffffffffffffffffff1661162090919063ffffffff16565b905081811015610bd857825f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610bcf9392919061221b565b60405180910390fd5b825f015160035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826020015160075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082604001515f819055508260600151600581905550610c7d33611653565b610c8c83608001516001611729565b826020015173ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff167fd20715546497e6d32bc9b61b35416a25a8cc41d2fb7f389a1bb26dc040213a3b856040015186606001518760800151604051610d0093929190612250565b60405180910390a35050508015610d40576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610d528161176a565b5f8585810190610d62919061239e565b90505f8160200151806020019051810190610d7d91906123f9565b90508060055f828254610d909190612451565b92505081905550610de6825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117919092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610e5a939291906124e9565b604051602081830303815290604052604051610e769190611f15565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610eb7611571565b610ec18282611562565b5050565b60605f8383810190610ed791906121f0565b90505f81606001519050604051806080016040528060016002811115610f0057610eff612525565b5b8152602001835f015173ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610f5f919061257b565b604051602081830303815290604052815250604051602001610f819190612691565b6040516020818303038152906040529250505092915050565b5f8082610fa68561096f565b161415905092915050565b60025481565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610ff8611571565b6110015f6117da565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60055481565b5f611067611571565b5f83838101906110779190612736565b90505f816020015180602001905181019061109291906123f9565b905061109e86826118a0565b6110d4576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554816006546110e5919061277d565b111561111d576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060065f82825461112e919061277d565b92505081905550600160045f828254611147919061277d565b9250508190555061119a868260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117919092919063ffffffff16565b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168884604051602001611208939291906124e9565b6040516020818303038152906040526040516112249190611f15565b60405180910390a26001925050509392505050565b6002611244816115c2565b828290508585905014611283576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156112e7576112da8686838181106112a6576112a5612065565b5b90506020020160208101906112bb9190611c7f565b8585848181106112ce576112cd612065565b5b905060200201356115a8565b8080600101915050611285565b505050505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b60065481565b5f8083838101906113239190612736565b90505f816020015180602001905181019061133e91906123f9565b905061134a86826118a0565b925050509392505050565b6002611360816115c2565b82829050858590501461139f576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015611403576113f68686838181106113c2576113c1612065565b5b90506020020160208101906113d79190611c7f565b8585848181106113ea576113e9612065565b5b90506020020135611562565b80806001019150506113a1565b505050505050565b60045481565b600181565b61141e611571565b63389a75e1600c52805f526020600c20805442111561144457636f5e88185f526004601cfd5b5f815550611451816117da565b50565b61145c611571565b8060601b61147157637448fbae5f526004601cfd5b61147a816117da565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff1661149d611008565b73ffffffffffffffffffffffffffffffffffffffff1614806114c957506114c8826002600117610f9a565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061155b575061155a8261190f565b5b9050919050565b61156d82825f611988565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146115a6576382b429005f526004601cfd5b565b6115b482826001611988565b5050565b5f6202a300905090565b638b78c6d8195433146115f457638b78c6d8600c52335f52806020600c2054166115f3576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b61165b6119e0565b156116d3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561169557630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611726565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c20541661178e576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166117d1576390b8ec185f526004601cfd5b5f603452505050565b6117e26119e0565b15611847577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b821781555061189d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015611907575060055482600654611904919061277d565b11155b905092915050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806119815750611980826119e4565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836119aa57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611a9281611a5e565b8114611a9c575f80fd5b50565b5f81359050611aad81611a89565b92915050565b5f60208284031215611ac857611ac7611a56565b5b5f611ad584828501611a9f565b91505092915050565b5f8115159050919050565b611af281611ade565b82525050565b5f602082019050611b0b5f830184611ae9565b92915050565b5f819050919050565b611b2381611b11565b82525050565b5f602082019050611b3c5f830184611b1a565b92915050565b611b4b81611b11565b8114611b55575f80fd5b50565b5f81359050611b6681611b42565b92915050565b5f60208284031215611b8157611b80611a56565b5b5f611b8e84828501611b58565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611bc082611b97565b9050919050565b611bd081611bb6565b8114611bda575f80fd5b50565b5f81359050611beb81611bc7565b92915050565b5f8060408385031215611c0757611c06611a56565b5b5f611c1485828601611bdd565b9250506020611c2585828601611b58565b9150509250929050565b611c3881611bb6565b82525050565b5f602082019050611c515f830184611c2f565b92915050565b611c6081611a5e565b82525050565b5f602082019050611c795f830184611c57565b92915050565b5f60208284031215611c9457611c93611a56565b5b5f611ca184828501611bdd565b91505092915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611ccb57611cca611caa565b5b8235905067ffffffffffffffff811115611ce857611ce7611cae565b5b602083019150836020820283011115611d0457611d03611cb2565b5b9250929050565b5f8083601f840112611d2057611d1f611caa565b5b8235905067ffffffffffffffff811115611d3d57611d3c611cae565b5b602083019150836020820283011115611d5957611d58611cb2565b5b9250929050565b5f805f8060408587031215611d7857611d77611a56565b5b5f85013567ffffffffffffffff811115611d9557611d94611a5a565b5b611da187828801611cb6565b9450945050602085013567ffffffffffffffff811115611dc457611dc3611a5a565b5b611dd087828801611d0b565b925092505092959194509250565b5f8083601f840112611df357611df2611caa565b5b8235905067ffffffffffffffff811115611e1057611e0f611cae565b5b602083019150836001820283011115611e2c57611e2b611cb2565b5b9250929050565b5f8060208385031215611e4957611e48611a56565b5b5f83013567ffffffffffffffff811115611e6657611e65611a5a565b5b611e7285828601611dde565b92509250509250929050565b5f604082019050611e915f830185611b1a565b611e9e6020830184611c2f565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611ee782611ea5565b611ef18185611eaf565b9350611f01818560208601611ebf565b611f0a81611ecd565b840191505092915050565b5f6020820190508181035f830152611f2d8184611edd565b905092915050565b5f805f60408486031215611f4c57611f4b611a56565b5b5f611f5986828701611bdd565b935050602084013567ffffffffffffffff811115611f7a57611f79611a5a565b5b611f8686828701611dde565b92509250509250925092565b5f8083601f840112611fa757611fa6611caa565b5b8235905067ffffffffffffffff811115611fc457611fc3611cae565b5b602083019150836020820283011115611fe057611fdf611cb2565b5b9250929050565b5f805f8060408587031215611fff57611ffe611a56565b5b5f85013567ffffffffffffffff81111561201c5761201b611a5a565b5b61202887828801611cb6565b9450945050602085013567ffffffffffffffff81111561204b5761204a611a5a565b5b61205787828801611f92565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61209b81611ade565b81146120a5575f80fd5b50565b5f813590506120b681612092565b92915050565b5f602082840312156120d1576120d0611a56565b5b5f6120de848285016120a8565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61212182611ecd565b810181811067ffffffffffffffff821117156121405761213f6120eb565b5b80604052505050565b5f612152611a4d565b905061215e8282612118565b919050565b5f80fd5b5f60a0828403121561217c5761217b6120e7565b5b61218660a0612149565b90505f61219584828501611bdd565b5f8301525060206121a884828501611bdd565b60208301525060406121bc84828501611b58565b60408301525060606121d084828501611b58565b60608301525060806121e484828501611bdd565b60808301525092915050565b5f60a0828403121561220557612204611a56565b5b5f61221284828501612167565b91505092915050565b5f60608201905061222e5f830186611c2f565b61223b6020830185611b1a565b6122486040830184611b1a565b949350505050565b5f6060820190506122635f830186611b1a565b6122706020830185611b1a565b61227d6040830184611c2f565b949350505050565b5f80fd5b5f67ffffffffffffffff8211156122a3576122a26120eb565b5b6122ac82611ecd565b9050602081019050919050565b828183375f83830152505050565b5f6122d96122d484612289565b612149565b9050828152602081018484840111156122f5576122f4612285565b5b6123008482856122b9565b509392505050565b5f82601f83011261231c5761231b611caa565b5b813561232c8482602086016122c7565b91505092915050565b5f6040828403121561234a576123496120e7565b5b6123546040612149565b90505f61236384828501611bdd565b5f83015250602082013567ffffffffffffffff81111561238657612385612163565b5b61239284828501612308565b60208301525092915050565b5f602082840312156123b3576123b2611a56565b5b5f82013567ffffffffffffffff8111156123d0576123cf611a5a565b5b6123dc84828501612335565b91505092915050565b5f815190506123f381611b42565b92915050565b5f6020828403121561240e5761240d611a56565b5b5f61241b848285016123e5565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61245b82611b11565b915061246683611b11565b925082820390508181111561247e5761247d612424565b5b92915050565b5f8160601b9050919050565b5f61249a82612484565b9050919050565b5f6124ab82612490565b9050919050565b6124c36124be82611bb6565b6124a1565b82525050565b5f819050919050565b6124e36124de82611b11565b6124c9565b82525050565b5f6124f482866124b2565b60148201915061250482856124b2565b60148201915061251482846124d2565b602082019150819050949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b61255b81611b11565b82525050565b602082015f8201516125755f850182612552565b50505050565b5f60208201905061258e5f830184612561565b92915050565b600381106125a5576125a4612525565b5b50565b5f8190506125b582612594565b919050565b5f6125c4826125a8565b9050919050565b6125d4816125ba565b82525050565b6125e381611bb6565b82525050565b5f82825260208201905092915050565b5f61260382611ea5565b61260d81856125e9565b935061261d818560208601611ebf565b61262681611ecd565b840191505092915050565b5f608083015f8301516126465f8601826125cb565b50602083015161265960208601826125da565b50604083015161266c60408601826125da565b506060830151848203606086015261268482826125f9565b9150508091505092915050565b5f6020820190508181035f8301526126a98184612631565b905092915050565b5f604082840312156126c6576126c56120e7565b5b6126d06040612149565b90505f82013567ffffffffffffffff8111156126ef576126ee612163565b5b6126fb84828501612308565b5f83015250602082013567ffffffffffffffff81111561271e5761271d612163565b5b61272a84828501612308565b60208301525092915050565b5f6020828403121561274b5761274a611a56565b5b5f82013567ffffffffffffffff81111561276857612767611a5a565b5b612774848285016126b1565b91505092915050565b5f61278782611b11565b915061279283611b11565b92508282019050808211156127aa576127a9612424565b5b9291505056fea26469706673582212202beefdd32df0168ac2dac98d82b522781beec2d4ca4f57cad53a6f4a313ab35164736f6c634300081a0033", c = class c extends z {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments), this.abi = s;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The owner of the incentive
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
* @async
|
|
25
|
-
* @param {?ReadParams} [params]
|
|
26
|
-
* @returns {Promise<Address>}
|
|
27
|
-
*/
|
|
28
|
-
async owner(f) {
|
|
29
|
-
return await h(this._config, {
|
|
30
|
-
address: this.assertValidAddress(),
|
|
31
|
-
args: [],
|
|
32
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
33
|
-
...f
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`
|
|
38
|
-
*
|
|
39
|
-
* @public
|
|
40
|
-
* @async
|
|
41
|
-
* @param {?ReadParams} [params]
|
|
42
|
-
* @returns {Promise<bigint>} - The current reward
|
|
43
|
-
*/
|
|
44
|
-
async currentReward(f) {
|
|
45
|
-
return await u(this._config, {
|
|
46
|
-
address: this.assertValidAddress(),
|
|
47
|
-
args: [],
|
|
48
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
49
|
-
...f
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The number of claims that have been made
|
|
54
|
-
*
|
|
55
|
-
* @public
|
|
56
|
-
* @async
|
|
57
|
-
* @param {?ReadParams} [params]
|
|
58
|
-
* @returns {Promise<bigint>}
|
|
59
|
-
*/
|
|
60
|
-
async claims(f) {
|
|
61
|
-
return await g(this._config, {
|
|
62
|
-
address: this.assertValidAddress(),
|
|
63
|
-
args: [],
|
|
64
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
65
|
-
...f
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* The total amount of rewards claimed
|
|
70
|
-
*
|
|
71
|
-
* @public
|
|
72
|
-
* @async
|
|
73
|
-
* @param {?ReadParams} [params]
|
|
74
|
-
* @returns {Promise<bigint>}
|
|
75
|
-
*/
|
|
76
|
-
async totalClaimed(f) {
|
|
77
|
-
return await w(this._config, {
|
|
78
|
-
address: this.assertValidAddress(),
|
|
79
|
-
args: [],
|
|
80
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
81
|
-
...f
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* A mapping of address to claim status
|
|
86
|
-
*
|
|
87
|
-
* @public
|
|
88
|
-
* @async
|
|
89
|
-
* @param {Address} address
|
|
90
|
-
* @param {?ReadParams} [params]
|
|
91
|
-
* @returns {Promise<boolean>}
|
|
92
|
-
*/
|
|
93
|
-
async claimed(f, b) {
|
|
94
|
-
return await p(this._config, {
|
|
95
|
-
address: this.assertValidAddress(),
|
|
96
|
-
args: [f],
|
|
97
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
98
|
-
...b
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* The address of the ERC20-like token
|
|
103
|
-
*
|
|
104
|
-
* @public
|
|
105
|
-
* @async
|
|
106
|
-
* @param {?ReadParams} [params]
|
|
107
|
-
* @returns {Promise<Address>}
|
|
108
|
-
*/
|
|
109
|
-
async asset(f) {
|
|
110
|
-
return await y(this._config, {
|
|
111
|
-
address: this.assertValidAddress(),
|
|
112
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
113
|
-
...f
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* The address of the pegged ERC20-like token
|
|
118
|
-
*
|
|
119
|
-
* @public
|
|
120
|
-
* @async
|
|
121
|
-
* @param {?ReadParams} [params]
|
|
122
|
-
* @returns {Promise<Address>}
|
|
123
|
-
*/
|
|
124
|
-
async peg(f) {
|
|
125
|
-
return await I(this._config, {
|
|
126
|
-
address: this.assertValidAddress(),
|
|
127
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
128
|
-
...f
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* The reward amount issued for each claim
|
|
133
|
-
*
|
|
134
|
-
* @public
|
|
135
|
-
* @async
|
|
136
|
-
* @param {?ReadParams} [params]
|
|
137
|
-
* @returns {Promise<bigint>}
|
|
138
|
-
*/
|
|
139
|
-
async reward(f) {
|
|
140
|
-
return await A(this._config, {
|
|
141
|
-
address: this.assertValidAddress(),
|
|
142
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
143
|
-
...f
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* The limit (max possible rewards payout in reward token)
|
|
148
|
-
*
|
|
149
|
-
* @public
|
|
150
|
-
* @async
|
|
151
|
-
* @param {?ReadParams} [params]
|
|
152
|
-
* @returns {Promise<bigint>}
|
|
153
|
-
*/
|
|
154
|
-
async limit(f) {
|
|
155
|
-
return await C(this._config, {
|
|
156
|
-
address: this.assertValidAddress(),
|
|
157
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
158
|
-
...f
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Claim the incentive
|
|
163
|
-
*
|
|
164
|
-
* @public
|
|
165
|
-
* @async
|
|
166
|
-
* @param {ClaimPayload} payload
|
|
167
|
-
* @param {?WriteParams} [params]
|
|
168
|
-
* @returns {Promise<boolean>} - Returns true if successfully claimed
|
|
169
|
-
*/
|
|
170
|
-
async claim(f, b) {
|
|
171
|
-
return await this.awaitResult(this.claimRaw(f, b));
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Claim the incentive
|
|
175
|
-
*
|
|
176
|
-
* @public
|
|
177
|
-
* @async
|
|
178
|
-
* @param {ClaimPayload} payload
|
|
179
|
-
* @param {?WriteParams} [params]
|
|
180
|
-
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
|
|
181
|
-
*/
|
|
182
|
-
async claimRaw(f, b) {
|
|
183
|
-
const { request: a, result: e } = await V(
|
|
184
|
-
this._config,
|
|
185
|
-
{
|
|
186
|
-
address: this.assertValidAddress(),
|
|
187
|
-
args: [r(f)],
|
|
188
|
-
...this.optionallyAttachAccount(),
|
|
189
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
190
|
-
...b
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
return { hash: await R(this._config, a), result: e };
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Clawback assets from the incentive
|
|
197
|
-
*
|
|
198
|
-
* @public
|
|
199
|
-
* @async
|
|
200
|
-
* @param {ClaimPayload} payload
|
|
201
|
-
* @param {?WriteParams} [params]
|
|
202
|
-
* @returns {Promise<boolean>} - True if the assets were successfully clawbacked
|
|
203
|
-
*/
|
|
204
|
-
async clawback(f, b) {
|
|
205
|
-
return await this.awaitResult(this.clawbackRaw(f, b));
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Clawback assets from the incentive
|
|
209
|
-
*
|
|
210
|
-
* @public
|
|
211
|
-
* @async
|
|
212
|
-
* @param {ClaimPayload} payload
|
|
213
|
-
* @param {?WriteParams} [params]
|
|
214
|
-
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
|
|
215
|
-
*/
|
|
216
|
-
async clawbackRaw(f, b) {
|
|
217
|
-
const { request: a, result: e } = await v(
|
|
218
|
-
this._config,
|
|
219
|
-
{
|
|
220
|
-
address: this.assertValidAddress(),
|
|
221
|
-
args: [r(f)],
|
|
222
|
-
...this.optionallyAttachAccount(),
|
|
223
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
224
|
-
...b
|
|
225
|
-
}
|
|
226
|
-
);
|
|
227
|
-
return { hash: await _(this._config, a), result: e };
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Check if an incentive is claimable.
|
|
231
|
-
*
|
|
232
|
-
* @public
|
|
233
|
-
* @async
|
|
234
|
-
* @param {ClaimPayload} payload
|
|
235
|
-
* @param {?ReadParams} [params]
|
|
236
|
-
* @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
|
|
237
|
-
*/
|
|
238
|
-
async isClaimable(f, b) {
|
|
239
|
-
return await E(this._config, {
|
|
240
|
-
address: this.assertValidAddress(),
|
|
241
|
-
args: [f.target, f.data],
|
|
242
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
243
|
-
...b
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* read the peg token for the incentive.
|
|
248
|
-
*
|
|
249
|
-
* @public
|
|
250
|
-
* @async
|
|
251
|
-
* @param {?ReadParams} [params]
|
|
252
|
-
* @returns {Promise<Address>} = The address of the token the reward is pegged to
|
|
253
|
-
*/
|
|
254
|
-
async getPeg(f) {
|
|
255
|
-
return await P(this._config, {
|
|
256
|
-
address: this.assertValidAddress(),
|
|
257
|
-
args: [],
|
|
258
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
259
|
-
...f
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`
|
|
264
|
-
*
|
|
265
|
-
* @public
|
|
266
|
-
* @async
|
|
267
|
-
* @param {?ReadParams} [params]
|
|
268
|
-
* @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.
|
|
269
|
-
*/
|
|
270
|
-
async getTotalBudget(f) {
|
|
271
|
-
return await this.limit(f);
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
275
|
-
*
|
|
276
|
-
* @public
|
|
277
|
-
* @async
|
|
278
|
-
* @param {?ReadParams} [params]
|
|
279
|
-
* @returns {Promise<boolean>} - True if total claims is less than limit
|
|
280
|
-
*/
|
|
281
|
-
async canBeClaimed(f) {
|
|
282
|
-
return await this.getRemainingClaimPotential(f) > 0n;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
286
|
-
*
|
|
287
|
-
* @public
|
|
288
|
-
* @async
|
|
289
|
-
* @param {?ReadParams} [params]
|
|
290
|
-
* @returns {Promise<bigint>} - True if total claims is less than limit
|
|
291
|
-
*/
|
|
292
|
-
async getRemainingClaimPotential(f) {
|
|
293
|
-
const [b, a] = await Promise.all([
|
|
294
|
-
this.claims(f),
|
|
295
|
-
this.limit(f)
|
|
296
|
-
]);
|
|
297
|
-
return a - b;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* @inheritdoc
|
|
301
|
-
*
|
|
302
|
-
* @public
|
|
303
|
-
* @param {?ERC20PeggedIncentivePayload} [_payload]
|
|
304
|
-
* @param {?DeployableOptions} [_options]
|
|
305
|
-
* @returns {GenericDeployableParams}
|
|
306
|
-
*/
|
|
307
|
-
buildParameters(f, b) {
|
|
308
|
-
const [a, e] = this.validateDeploymentConfig(
|
|
309
|
-
f,
|
|
310
|
-
b
|
|
311
|
-
);
|
|
312
|
-
return {
|
|
313
|
-
abi: s,
|
|
314
|
-
bytecode: S,
|
|
315
|
-
args: [U(a)],
|
|
316
|
-
...this.optionallyAttachAccount(e.account)
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Encodes an amount to clawback from the incentive
|
|
321
|
-
*
|
|
322
|
-
* @public
|
|
323
|
-
* @param {bigint} amount - How much of the asset to clawback
|
|
324
|
-
* @returns {Hex} - Returns an encoded uint256
|
|
325
|
-
*/
|
|
326
|
-
buildClawbackData(f) {
|
|
327
|
-
return t([{ type: "uint256" }], [f]);
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Builds the claim data for the ERC20PeggedIncentive.
|
|
331
|
-
*
|
|
332
|
-
* @public
|
|
333
|
-
* @param {bigint} rewardAmount
|
|
334
|
-
* @returns {Hash} Returns the encoded claim data
|
|
335
|
-
* @description This function returns the encoded claim data for the ERC20PeggedIncentive.
|
|
336
|
-
*/
|
|
337
|
-
buildClaimData(f) {
|
|
338
|
-
return t(
|
|
339
|
-
[{ type: "uint256", name: "rewardAmount" }],
|
|
340
|
-
[f]
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
c.bases = {
|
|
345
|
-
31337: void 0,
|
|
346
|
-
...Y
|
|
347
|
-
}, c.registryType = F.INCENTIVE;
|
|
348
|
-
let o = c;
|
|
349
|
-
function U({
|
|
350
|
-
asset: d,
|
|
351
|
-
peg: f,
|
|
352
|
-
reward: b,
|
|
353
|
-
limit: a,
|
|
354
|
-
manager: e = O
|
|
355
|
-
}) {
|
|
356
|
-
return t(
|
|
357
|
-
[
|
|
358
|
-
{ type: "address", name: "asset" },
|
|
359
|
-
{ type: "address", name: "peg" },
|
|
360
|
-
{ type: "uint256", name: "reward" },
|
|
361
|
-
{ type: "uint256", name: "limit" },
|
|
362
|
-
{ type: "address", name: "manager" }
|
|
363
|
-
],
|
|
364
|
-
[d, f, b, a, e]
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
const l = {
|
|
368
|
-
[D]: Q,
|
|
369
|
-
[T]: K,
|
|
370
|
-
[i]: n,
|
|
371
|
-
[N]: q,
|
|
372
|
-
// [AERC1155Incentive as Hex]: ERC1155Incentive,
|
|
373
|
-
[x]: G,
|
|
374
|
-
[i]: n,
|
|
375
|
-
[B]: M
|
|
376
|
-
};
|
|
377
|
-
async function r0(d, f, b) {
|
|
378
|
-
const a = await L(d.config, {
|
|
379
|
-
abi: k,
|
|
380
|
-
functionName: "getComponentInterface",
|
|
381
|
-
address: f,
|
|
382
|
-
...b
|
|
383
|
-
}), e = l[a];
|
|
384
|
-
if (!e)
|
|
385
|
-
throw new j(
|
|
386
|
-
Object.keys(l),
|
|
387
|
-
a
|
|
388
|
-
);
|
|
389
|
-
return new e(d, f);
|
|
390
|
-
}
|
|
391
|
-
export {
|
|
392
|
-
o as E,
|
|
393
|
-
l as I,
|
|
394
|
-
r0 as i,
|
|
395
|
-
U as p
|
|
396
|
-
};
|
|
397
|
-
//# sourceMappingURL=Incentive-M45PaQsT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Incentive-M45PaQsT.js","sources":["../src/Incentives/ERC20PeggedIncentive.ts","../src/Incentives/Incentive.ts"],"sourcesContent":["import {\n erc20PeggedIncentiveAbi,\n readErc20PeggedIncentiveAsset,\n readErc20PeggedIncentiveClaimed,\n readErc20PeggedIncentiveClaims,\n readErc20PeggedIncentiveCurrentReward,\n readErc20PeggedIncentiveGetPeg,\n readErc20PeggedIncentiveIsClaimable,\n readErc20PeggedIncentiveLimit,\n readErc20PeggedIncentiveOwner,\n readErc20PeggedIncentivePeg,\n readErc20PeggedIncentiveReward,\n readErc20PeggedIncentiveTotalClaimed,\n simulateErc20PeggedIncentiveClaim,\n simulateErc20PeggedIncentiveClawback,\n writeErc20PeggedIncentiveClaim,\n writeErc20PeggedIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedIncentive.sol/ERC20PeggedIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20PeggedIncentiveAbi };\n\n/**\n * The object representation of a `ERC20PeggedIncentive.InitPayload`\n *\n * @export\n * @interface ERC20PeggedIncentivePayload\n * @typedef {ERC20PeggedIncentivePayload}\n */\nexport interface ERC20PeggedIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The peg to normalize to.\n *\n * @type {Address}\n */\n peg: Address;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * Total spend for the incentive.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * (Optional) The address of the entity that can managed the incentive.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20PeggedIncentive` event types.\n *\n * @export\n * @typedef {ERC20PeggedIncentiveLog}\n * @template {ContractEventName<typeof erc20PeggedIncentiveAbi>} [event=ContractEventName<\n * typeof erc20PeggedIncentiveAbi\n * >]\n */\nexport type ERC20PeggedIncentiveLog<\n event extends ContractEventName<\n typeof erc20PeggedIncentiveAbi\n > = ContractEventName<typeof erc20PeggedIncentiveAbi>,\n> = GenericLog<typeof erc20PeggedIncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20PeggedIncentive\n * @typedef {ERC20PeggedIncentive}\n * @extends {DeployableTarget<ERC20PeggedIncentivePayload>}\n */\nexport class ERC20PeggedIncentive extends DeployableTarget<\n ERC20PeggedIncentivePayload,\n typeof erc20PeggedIncentiveAbi\n> {\n public override readonly abi = erc20PeggedIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_ERC20_INCENTIVE_BASE,\n ...(ERC20IncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20PeggedIncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20PeggedIncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20PeggedIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20PeggedIncentiveTotalClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20PeggedIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20PeggedIncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the pegged ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async peg(params?: ReadParams) {\n return await readErc20PeggedIncentivePeg(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20PeggedIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max possible rewards payout in reward token)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20PeggedIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20PeggedIncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20PeggedIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20PeggedIncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20PeggedIncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20PeggedIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * read the peg token for the incentive.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} = The address of the token the reward is pegged to\n */\n public async getPeg(params?: ReadParams) {\n return await readErc20PeggedIncentiveGetPeg(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * Builds the claim data for the ERC20PeggedIncentive.\n *\n * @public\n * @param {bigint} rewardAmount\n * @returns {Hash} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20PeggedIncentive.\n */\n public buildClaimData(rewardAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'rewardAmount' }],\n [rewardAmount],\n );\n }\n}\n\n/**\n * Given a {@link ERC20PeggedIncentivePayload}, properly encode a `ERC20PeggedIncentive.InitPayload` for use with {@link ERC20PeggedIncentive} initialization.\n *\n * @param {ERC20PeggedIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {Address} param0.peg - The peg to normalize to.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can manage the incentive.\n * @returns {Hex}\n */\nexport function prepareERC20PeggedIncentivePayload({\n asset,\n peg,\n reward,\n limit,\n manager = zeroAddress,\n}: ERC20PeggedIncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'peg' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [asset, peg, reward, limit, manager],\n );\n}\n","import { aIncentiveAbi } from '@boostxyz/evm';\nimport {\n AAllowListIncentive,\n ACGDAIncentive,\n AERC20Incentive,\n AERC20PeggedIncentive,\n AERC20VariableCriteriaIncentive,\n AERC20VariableIncentive,\n // AERC20VariableCriteriaIncentive\n APointsIncentive,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport type { ReadParams } from '../utils';\nimport { AllowListIncentive } from './AllowListIncentive';\nimport { CGDAIncentive } from './CGDAIncentive';\nimport { ERC20Incentive } from './ERC20Incentive';\nimport { ERC20PeggedIncentive } from './ERC20PeggedIncentive';\nimport { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n// import { ERC1155Incentive } from './ERC1155Incentive';\nimport { PointsIncentive } from './PointsIncentive';\n\nexport {\n AllowListIncentive,\n CGDAIncentive,\n // ERC1155Incentive,\n ERC20Incentive,\n ERC20PeggedIncentive,\n PointsIncentive,\n ERC20VariableIncentive,\n ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A union type representing all valid protocol Incentive implementations\n *\n * @export\n * @typedef {Incentive}\n */\nexport type Incentive =\n | AllowListIncentive\n | CGDAIncentive\n | ERC20Incentive\n // | ERC1155Incentive\n | ERC20PeggedIncentive\n | PointsIncentive\n | ERC20VariableIncentive\n | ERC20VariableCriteriaIncentive;\n\n/**\n * A map of Incentive component interfaces to their constructors.\n *\n * @type {{ \"0xc5b24b8e\": typeof PointsIncentive; \"0x8c901437\": typeof ERC20Incentive; \"0x4414fbb4\": typeof ERC20PeggedIncentive; \"0x56586338\" typeof AllowListIncentive; \"0xa39e44d9\": typeof CGDAIncentive; \"0xa8e4af1e\": typeof ERC20VariableIncentive; \"0x90318111\": typeof ERC20VariableCriteriaIncentive }}\n */\nexport const IncentiveByComponentInterface = {\n [APointsIncentive as Hex]: PointsIncentive,\n [AERC20Incentive as Hex]: ERC20Incentive,\n [AERC20VariableIncentive as Hex]: ERC20VariableIncentive,\n [AAllowListIncentive]: AllowListIncentive,\n // [AERC1155Incentive as Hex]: ERC1155Incentive,\n [ACGDAIncentive as Hex]: CGDAIncentive,\n [AERC20VariableIncentive as Hex]: ERC20VariableIncentive,\n [AERC20VariableCriteriaIncentive as Hex]: ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Incentive}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function incentiveFromAddress(\n options: DeployableOptions,\n address: Address,\n params?: ReadParams,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aIncentiveAbi,\n functionName: 'getComponentInterface',\n address,\n ...params,\n })) as keyof typeof IncentiveByComponentInterface;\n const Ctor = IncentiveByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(IncentiveByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["_ERC20PeggedIncentive","DeployableTarget","erc20PeggedIncentiveAbi","params","readErc20PeggedIncentiveOwner","readErc20PeggedIncentiveCurrentReward","readErc20PeggedIncentiveClaims","readErc20PeggedIncentiveTotalClaimed","address","readErc20PeggedIncentiveClaimed","readErc20PeggedIncentiveAsset","readErc20PeggedIncentivePeg","readErc20PeggedIncentiveReward","readErc20PeggedIncentiveLimit","payload","request","result","simulateErc20PeggedIncentiveClaim","prepareClaimPayload","writeErc20PeggedIncentiveClaim","simulateErc20PeggedIncentiveClawback","writeErc20PeggedIncentiveClawback","readErc20PeggedIncentiveIsClaimable","readErc20PeggedIncentiveGetPeg","claims","limit","_payload","_options","options","bytecode","prepareERC20PeggedIncentivePayload","amount","encodeAbiParameters","rewardAmount","ERC20IncentiveBases","RegistryType","ERC20PeggedIncentive","asset","peg","reward","manager","zeroAddress","IncentiveByComponentInterface","APointsIncentive","PointsIncentive","AERC20Incentive","ERC20Incentive","AERC20VariableIncentive","ERC20VariableIncentive","AAllowListIncentive","AllowListIncentive","ACGDAIncentive","CGDAIncentive","AERC20VariableCriteriaIncentive","ERC20VariableCriteriaIncentive","incentiveFromAddress","interfaceId","readContract","aIncentiveAbi","Ctor","InvalidComponentInterfaceError"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("./generated-CNkDfjzI.cjs"),c=require("./componentInterfaces-Bt-4sNB5.cjs"),g=require("@wagmi/core"),m=require("./errors.cjs"),I=require("./Incentives/AllowListIncentive.cjs"),y=require("./Incentives/CGDAIncentive.cjs"),w=require("./Incentives/ERC20Incentive.cjs"),s=require("viem"),A=require("./deployments-CMdsItcq.cjs"),C=require("./Deployable/DeployableTarget.cjs"),o=require("./claiming.cjs"),p=require("./utils.cjs"),v=require("./Incentives/ERC20VariableCriteriaIncentive.cjs"),l=require("./Incentives/ERC20VariableIncentive.cjs"),V=require("./Incentives/PointsIncentive.cjs"),R="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6127e6806100bd5f395ff3fe60806040526004361061020e575f3560e01c806354d1f13d11610117578063d54ad2a11161009f578063ec87621c1161006e578063ec87621c14610739578063f04e283e14610763578063f2fde38b1461077f578063fe9fbb801461079b578063fee81cf4146107d75761020e565b8063d54ad2a114610681578063db09da12146106ab578063dcc21361146106e7578063dcc59b6f1461070f5761020e565b80639214fa4d116100e65780639214fa4d1461058d578063a4d66daf146105b7578063bb1757cf146105e1578063be4994f81461061d578063c884ef83146106455761020e565b806354d1f13d14610525578063715018a61461052f57806375b238fc146105395780638da5cb5b146105635761020e565b80632de948071161019a578063474f5a4411610169578063474f5a441461042a5780634a4ee7b1146104675780634e7165a214610483578063514e62fc146104bf578063547d1864146104fb5761020e565b80632de948071461037457806338d52e0f146103b05780634359d28a146103da578063439fab91146104025761020e565b80631cd64df4116101e15780631cd64df4146102b05780631f1cb62b146102ec578063228cb73314610316578063256929621461034057806328d6183b1461034a5761020e565b806301ffc9a71461021257806307621eca1461024e578063183a4f6e146102785780631c10893f14610294575b5f80fd5b34801561021d575f80fd5b5061023860048036038101906102339190611ab3565b610813565b6040516102459190611af8565b60405180910390f35b348015610259575f80fd5b5061026261088c565b60405161026f9190611b29565b60405180910390f35b610292600480360381019061028d9190611b6c565b610894565b005b6102ae60048036038101906102a99190611bf1565b6108a1565b005b3480156102bb575f80fd5b506102d660048036038101906102d19190611bf1565b6108b7565b6040516102e39190611af8565b60405180910390f35b3480156102f7575f80fd5b506103006108cd565b60405161030d9190611c3e565b60405180910390f35b348015610321575f80fd5b5061032a6108f2565b6040516103379190611b29565b60405180910390f35b6103486108f7565b005b348015610355575f80fd5b5061035e610948565b60405161036b9190611c66565b60405180910390f35b34801561037f575f80fd5b5061039a60048036038101906103959190611c7f565b61096f565b6040516103a79190611b29565b60405180910390f35b3480156103bb575f80fd5b506103c4610988565b6040516103d19190611c3e565b60405180910390f35b3480156103e5575f80fd5b5061040060048036038101906103fb9190611d60565b6109ad565b005b34801561040d575f80fd5b5061042860048036038101906104239190611e33565b610abb565b005b348015610435575f80fd5b50610450600480360381019061044b9190611e33565b610d45565b60405161045e929190611e7e565b60405180910390f35b610481600480360381019061047c9190611bf1565b610eaf565b005b34801561048e575f80fd5b506104a960048036038101906104a49190611e33565b610ec5565b6040516104b69190611f15565b60405180910390f35b3480156104ca575f80fd5b506104e560048036038101906104e09190611bf1565b610f9a565b6040516104f29190611af8565b60405180910390f35b348015610506575f80fd5b5061050f610fb1565b60405161051c9190611b29565b60405180910390f35b61052d610fb7565b005b610537610ff0565b005b348015610544575f80fd5b5061054d611003565b60405161055a9190611b29565b60405180910390f35b34801561056e575f80fd5b50610577611008565b6040516105849190611c3e565b60405180910390f35b348015610598575f80fd5b506105a1611030565b6040516105ae9190611c3e565b60405180910390f35b3480156105c2575f80fd5b506105cb611058565b6040516105d89190611b29565b60405180910390f35b3480156105ec575f80fd5b5061060760048036038101906106029190611f35565b61105e565b6040516106149190611af8565b60405180910390f35b348015610628575f80fd5b50610643600480360381019061063e9190611fe7565b611239565b005b348015610650575f80fd5b5061066b60048036038101906106669190611c7f565b6112ef565b6040516106789190611af8565b60405180910390f35b34801561068c575f80fd5b5061069561130c565b6040516106a29190611b29565b60405180910390f35b3480156106b6575f80fd5b506106d160048036038101906106cc9190611f35565b611312565b6040516106de9190611af8565b60405180910390f35b3480156106f2575f80fd5b5061070d60048036038101906107089190611fe7565b611355565b005b34801561071a575f80fd5b5061072361140b565b6040516107309190611b29565b60405180910390f35b348015610744575f80fd5b5061074d611411565b60405161075a9190611b29565b60405180910390f35b61077d60048036038101906107789190611c7f565b611416565b005b61079960048036038101906107949190611c7f565b611454565b005b3480156107a6575f80fd5b506107c160048036038101906107bc9190611c7f565b61147d565b6040516107ce9190611af8565b60405180910390f35b3480156107e2575f80fd5b506107fd60048036038101906107f89190611c7f565b6114d0565b60405161080a9190611b29565b60405180910390f35b5f7f56586338000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108855750610884826114e9565b5b9050919050565b5f8054905090565b61089e3382611562565b50565b6108a9611571565b6108b382826115a8565b5050565b5f81826108c38561096f565b1614905092915050565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5481565b5f6109006115b8565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f5658633800000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109b8816115c2565b8282905085859050146109f7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ab3575f848483818110610a1857610a17612065565b5b9050602002016020810190610a2d91906120bc565b90506001151581151503610a7257610a6d878784818110610a5157610a50612065565b5b9050602002016020810190610a669190611c7f565b60016115a8565b610aa5565b610aa4878784818110610a8857610a87612065565b5b9050602002016020810190610a9d9190611c7f565b6001611562565b5b5080806001019150506109f9565b505050505050565b5f610ac46115f7565b90508054600382558015610af65760018160011c14303b10610aed5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b0791906121f0565b90505f81604001511480610b1e57505f8160600151145b15610b55576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f816060015190505f610b8a30845f015173ffffffffffffffffffffffffffffffffffffffff1661162090919063ffffffff16565b905081811015610bd857825f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610bcf9392919061221b565b60405180910390fd5b825f015160035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826020015160075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082604001515f819055508260600151600581905550610c7d33611653565b610c8c83608001516001611729565b826020015173ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff167fd20715546497e6d32bc9b61b35416a25a8cc41d2fb7f389a1bb26dc040213a3b856040015186606001518760800151604051610d0093929190612250565b60405180910390a35050508015610d40576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610d528161176a565b5f8585810190610d62919061239e565b90505f8160200151806020019051810190610d7d91906123f9565b90508060055f828254610d909190612451565b92505081905550610de6825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117919092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610e5a939291906124e9565b604051602081830303815290604052604051610e769190611f15565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610eb7611571565b610ec18282611562565b5050565b60605f8383810190610ed791906121f0565b90505f81606001519050604051806080016040528060016002811115610f0057610eff612525565b5b8152602001835f015173ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610f5f919061257b565b604051602081830303815290604052815250604051602001610f819190612691565b6040516020818303038152906040529250505092915050565b5f8082610fa68561096f565b161415905092915050565b60025481565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610ff8611571565b6110015f6117da565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60055481565b5f611067611571565b5f83838101906110779190612736565b90505f816020015180602001905181019061109291906123f9565b905061109e86826118a0565b6110d4576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554816006546110e5919061277d565b111561111d576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060065f82825461112e919061277d565b92505081905550600160045f828254611147919061277d565b9250508190555061119a868260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117919092919063ffffffff16565b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168884604051602001611208939291906124e9565b6040516020818303038152906040526040516112249190611f15565b60405180910390a26001925050509392505050565b6002611244816115c2565b828290508585905014611283576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156112e7576112da8686838181106112a6576112a5612065565b5b90506020020160208101906112bb9190611c7f565b8585848181106112ce576112cd612065565b5b905060200201356115a8565b8080600101915050611285565b505050505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b60065481565b5f8083838101906113239190612736565b90505f816020015180602001905181019061133e91906123f9565b905061134a86826118a0565b925050509392505050565b6002611360816115c2565b82829050858590501461139f576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015611403576113f68686838181106113c2576113c1612065565b5b90506020020160208101906113d79190611c7f565b8585848181106113ea576113e9612065565b5b90506020020135611562565b80806001019150506113a1565b505050505050565b60045481565b600181565b61141e611571565b63389a75e1600c52805f526020600c20805442111561144457636f5e88185f526004601cfd5b5f815550611451816117da565b50565b61145c611571565b8060601b61147157637448fbae5f526004601cfd5b61147a816117da565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff1661149d611008565b73ffffffffffffffffffffffffffffffffffffffff1614806114c957506114c8826002600117610f9a565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061155b575061155a8261190f565b5b9050919050565b61156d82825f611988565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146115a6576382b429005f526004601cfd5b565b6115b482826001611988565b5050565b5f6202a300905090565b638b78c6d8195433146115f457638b78c6d8600c52335f52806020600c2054166115f3576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b61165b6119e0565b156116d3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561169557630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611726565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c20541661178e576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166117d1576390b8ec185f526004601cfd5b5f603452505050565b6117e26119e0565b15611847577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b821781555061189d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015611907575060055482600654611904919061277d565b11155b905092915050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806119815750611980826119e4565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836119aa57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611a9281611a5e565b8114611a9c575f80fd5b50565b5f81359050611aad81611a89565b92915050565b5f60208284031215611ac857611ac7611a56565b5b5f611ad584828501611a9f565b91505092915050565b5f8115159050919050565b611af281611ade565b82525050565b5f602082019050611b0b5f830184611ae9565b92915050565b5f819050919050565b611b2381611b11565b82525050565b5f602082019050611b3c5f830184611b1a565b92915050565b611b4b81611b11565b8114611b55575f80fd5b50565b5f81359050611b6681611b42565b92915050565b5f60208284031215611b8157611b80611a56565b5b5f611b8e84828501611b58565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611bc082611b97565b9050919050565b611bd081611bb6565b8114611bda575f80fd5b50565b5f81359050611beb81611bc7565b92915050565b5f8060408385031215611c0757611c06611a56565b5b5f611c1485828601611bdd565b9250506020611c2585828601611b58565b9150509250929050565b611c3881611bb6565b82525050565b5f602082019050611c515f830184611c2f565b92915050565b611c6081611a5e565b82525050565b5f602082019050611c795f830184611c57565b92915050565b5f60208284031215611c9457611c93611a56565b5b5f611ca184828501611bdd565b91505092915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611ccb57611cca611caa565b5b8235905067ffffffffffffffff811115611ce857611ce7611cae565b5b602083019150836020820283011115611d0457611d03611cb2565b5b9250929050565b5f8083601f840112611d2057611d1f611caa565b5b8235905067ffffffffffffffff811115611d3d57611d3c611cae565b5b602083019150836020820283011115611d5957611d58611cb2565b5b9250929050565b5f805f8060408587031215611d7857611d77611a56565b5b5f85013567ffffffffffffffff811115611d9557611d94611a5a565b5b611da187828801611cb6565b9450945050602085013567ffffffffffffffff811115611dc457611dc3611a5a565b5b611dd087828801611d0b565b925092505092959194509250565b5f8083601f840112611df357611df2611caa565b5b8235905067ffffffffffffffff811115611e1057611e0f611cae565b5b602083019150836001820283011115611e2c57611e2b611cb2565b5b9250929050565b5f8060208385031215611e4957611e48611a56565b5b5f83013567ffffffffffffffff811115611e6657611e65611a5a565b5b611e7285828601611dde565b92509250509250929050565b5f604082019050611e915f830185611b1a565b611e9e6020830184611c2f565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611ee782611ea5565b611ef18185611eaf565b9350611f01818560208601611ebf565b611f0a81611ecd565b840191505092915050565b5f6020820190508181035f830152611f2d8184611edd565b905092915050565b5f805f60408486031215611f4c57611f4b611a56565b5b5f611f5986828701611bdd565b935050602084013567ffffffffffffffff811115611f7a57611f79611a5a565b5b611f8686828701611dde565b92509250509250925092565b5f8083601f840112611fa757611fa6611caa565b5b8235905067ffffffffffffffff811115611fc457611fc3611cae565b5b602083019150836020820283011115611fe057611fdf611cb2565b5b9250929050565b5f805f8060408587031215611fff57611ffe611a56565b5b5f85013567ffffffffffffffff81111561201c5761201b611a5a565b5b61202887828801611cb6565b9450945050602085013567ffffffffffffffff81111561204b5761204a611a5a565b5b61205787828801611f92565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61209b81611ade565b81146120a5575f80fd5b50565b5f813590506120b681612092565b92915050565b5f602082840312156120d1576120d0611a56565b5b5f6120de848285016120a8565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61212182611ecd565b810181811067ffffffffffffffff821117156121405761213f6120eb565b5b80604052505050565b5f612152611a4d565b905061215e8282612118565b919050565b5f80fd5b5f60a0828403121561217c5761217b6120e7565b5b61218660a0612149565b90505f61219584828501611bdd565b5f8301525060206121a884828501611bdd565b60208301525060406121bc84828501611b58565b60408301525060606121d084828501611b58565b60608301525060806121e484828501611bdd565b60808301525092915050565b5f60a0828403121561220557612204611a56565b5b5f61221284828501612167565b91505092915050565b5f60608201905061222e5f830186611c2f565b61223b6020830185611b1a565b6122486040830184611b1a565b949350505050565b5f6060820190506122635f830186611b1a565b6122706020830185611b1a565b61227d6040830184611c2f565b949350505050565b5f80fd5b5f67ffffffffffffffff8211156122a3576122a26120eb565b5b6122ac82611ecd565b9050602081019050919050565b828183375f83830152505050565b5f6122d96122d484612289565b612149565b9050828152602081018484840111156122f5576122f4612285565b5b6123008482856122b9565b509392505050565b5f82601f83011261231c5761231b611caa565b5b813561232c8482602086016122c7565b91505092915050565b5f6040828403121561234a576123496120e7565b5b6123546040612149565b90505f61236384828501611bdd565b5f83015250602082013567ffffffffffffffff81111561238657612385612163565b5b61239284828501612308565b60208301525092915050565b5f602082840312156123b3576123b2611a56565b5b5f82013567ffffffffffffffff8111156123d0576123cf611a5a565b5b6123dc84828501612335565b91505092915050565b5f815190506123f381611b42565b92915050565b5f6020828403121561240e5761240d611a56565b5b5f61241b848285016123e5565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61245b82611b11565b915061246683611b11565b925082820390508181111561247e5761247d612424565b5b92915050565b5f8160601b9050919050565b5f61249a82612484565b9050919050565b5f6124ab82612490565b9050919050565b6124c36124be82611bb6565b6124a1565b82525050565b5f819050919050565b6124e36124de82611b11565b6124c9565b82525050565b5f6124f482866124b2565b60148201915061250482856124b2565b60148201915061251482846124d2565b602082019150819050949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b61255b81611b11565b82525050565b602082015f8201516125755f850182612552565b50505050565b5f60208201905061258e5f830184612561565b92915050565b600381106125a5576125a4612525565b5b50565b5f8190506125b582612594565b919050565b5f6125c4826125a8565b9050919050565b6125d4816125ba565b82525050565b6125e381611bb6565b82525050565b5f82825260208201905092915050565b5f61260382611ea5565b61260d81856125e9565b935061261d818560208601611ebf565b61262681611ecd565b840191505092915050565b5f608083015f8301516126465f8601826125cb565b50602083015161265960208601826125da565b50604083015161266c60408601826125da565b506060830151848203606086015261268482826125f9565b9150508091505092915050565b5f6020820190508181035f8301526126a98184612631565b905092915050565b5f604082840312156126c6576126c56120e7565b5b6126d06040612149565b90505f82013567ffffffffffffffff8111156126ef576126ee612163565b5b6126fb84828501612308565b5f83015250602082013567ffffffffffffffff81111561271e5761271d612163565b5b61272a84828501612308565b60208301525092915050565b5f6020828403121561274b5761274a611a56565b5b5f82013567ffffffffffffffff81111561276857612767611a5a565b5b612774848285016126b1565b91505092915050565b5f61278782611b11565b915061279283611b11565b92508282019050808211156127aa576127a9612424565b5b9291505056fea26469706673582212202beefdd32df0168ac2dac98d82b522781beec2d4ca4f57cad53a6f4a313ab35164736f6c634300081a0033",i=class i extends C.DeployableTarget{constructor(){super(...arguments),this.abi=a.f}async owner(f){return await a.lI(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.nI(this._config,{address:this.assertValidAddress(),args:[],...f})}async claims(f){return await a.tI(this._config,{address:this.assertValidAddress(),args:[],...f})}async totalClaimed(f){return await a.wI(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.eI(this._config,{address:this.assertValidAddress(),args:[f],...b})}async asset(f){return await a.Yg(this._config,{address:this.assertValidAddress(),...f})}async peg(f){return await a.dI(this._config,{address:this.assertValidAddress(),...f})}async reward(f){return await a.mI(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.uI(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:d}=await a.VI(this._config,{address:this.assertValidAddress(),args:[o.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.gI(this._config,e),result:d}}async clawback(f,b){return await this.awaitResult(this.clawbackRaw(f,b))}async clawbackRaw(f,b){const{request:e,result:d}=await a.kI(this._config,{address:this.assertValidAddress(),args:[o.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.II(this._config,e),result:d}}async isClaimable(f,b){return await a.pI(this._config,{address:this.assertValidAddress(),args:[f.target,f.data],...b})}async getPeg(f){return await a.iI(this._config,{address:this.assertValidAddress(),args:[],...f})}async getTotalBudget(f){return await this.limit(f)}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,d]=this.validateDeploymentConfig(f,b);return{abi:a.f,bytecode:R,args:[u(e)],...this.optionallyAttachAccount(d.account)}}buildClawbackData(f){return s.encodeAbiParameters([{type:"uint256"}],[f])}buildClaimData(f){return s.encodeAbiParameters([{type:"uint256",name:"rewardAmount"}],[f])}};i.bases={31337:void 0,...A.ERC20Incentive},i.registryType=p.RegistryType.INCENTIVE;let r=i;function u({asset:t,peg:f,reward:b,limit:e,manager:d=s.zeroAddress}){return s.encodeAbiParameters([{type:"address",name:"asset"},{type:"address",name:"peg"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"address",name:"manager"}],[t,f,b,e,d])}const n={[c.APointsIncentive]:V.PointsIncentive,[c.AERC20Incentive]:w.ERC20Incentive,[c.AERC20VariableIncentive]:l.ERC20VariableIncentive,[c.AAllowListIncentive]:I.AllowListIncentive,[c.ACGDAIncentive]:y.CGDAIncentive,[c.AERC20VariableIncentive]:l.ERC20VariableIncentive,[c.AERC20VariableCriteriaIncentive]:v.ERC20VariableCriteriaIncentive};async function q(t,f,b){const e=await g.readContract(t.config,{abi:a.K,functionName:"getComponentInterface",address:f,...b}),d=n[e];if(!d)throw new m.InvalidComponentInterfaceError(Object.keys(n),e);return new d(t,f)}exports.ERC20PeggedIncentive=r;exports.IncentiveByComponentInterface=n;exports.incentiveFromAddress=q;exports.prepareERC20PeggedIncentivePayload=u;
|
|
2
|
-
//# sourceMappingURL=Incentive-axLU7ndr.cjs.map
|