@boostxyz/sdk 5.5.0 → 6.0.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 +4 -4
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +2 -1
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +110 -105
- 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.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +2 -2
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +25 -25
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- 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.cjs.map +1 -1
- package/dist/Auth/PassthroughAuth.js +14 -14
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +261 -0
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +442 -262
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.js +43 -43
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budget-CsqSI4NH.cjs +2 -0
- package/dist/Budget-CsqSI4NH.cjs.map +1 -0
- package/dist/Budget-bMiAGF8s.js +922 -0
- package/dist/Budget-bMiAGF8s.js.map +1 -0
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.d.ts +5 -4
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +3 -3
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.js +53 -53
- package/dist/Budgets/ManagedBudgetWithFees.d.ts +26 -0
- package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts +1331 -0
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -0
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +15 -15
- package/dist/Incentive-DZLG6T1-.js +1036 -0
- package/dist/Incentive-DZLG6T1-.js.map +1 -0
- package/dist/Incentive-DvNdIJ_x.cjs +2 -0
- package/dist/Incentive-DvNdIJ_x.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +9 -1
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +64 -47
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +12 -1
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +64 -33
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.d.ts +37 -1
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +73 -49
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedIncentive.d.ts +35 -0
- package/dist/Incentives/ERC20PeggedIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +35 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +25 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +24 -24
- 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 +35 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +55 -38
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +25 -0
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +3 -3
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.d.ts +8 -0
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +50 -28
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-BAIrFBAW.cjs +2 -0
- package/dist/{SimpleDenyList-CsRXJPwm.cjs.map → SimpleDenyList-BAIrFBAW.cjs.map} +1 -1
- package/dist/SimpleDenyList-C734XLxt.js +133 -0
- package/dist/{SimpleDenyList-ByAr4X1r.js.map → SimpleDenyList-C734XLxt.js.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts.map +1 -1
- package/dist/Validators/LimitedSignerValidator.js +33 -33
- package/dist/Validators/LimitedSignerValidator.js.map +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +1 -1
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +26 -26
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +4 -4
- package/dist/componentInterfaces-5Ezh3Pvx.js +19 -0
- package/dist/componentInterfaces-5Ezh3Pvx.js.map +1 -0
- package/dist/componentInterfaces-Cm4Zfn1v.cjs +2 -0
- package/dist/componentInterfaces-Cm4Zfn1v.cjs.map +1 -0
- package/dist/{deployments-D0fs26TV.js → deployments-3RHH-eW7.js} +47 -47
- package/dist/{deployments-D0fs26TV.js.map → deployments-3RHH-eW7.js.map} +1 -1
- package/dist/deployments-CIXw_WKk.cjs +2 -0
- package/dist/deployments-CIXw_WKk.cjs.map +1 -0
- package/dist/deployments.json +24 -24
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/generated-BPiHi7W2.cjs +3 -0
- package/dist/generated-BPiHi7W2.cjs.map +1 -0
- package/dist/{generated-Cyvr_Tjx.js → generated-CElkFqkY.js} +1510 -608
- package/dist/generated-CElkFqkY.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 +153 -150
- package/package.json +2 -2
- package/src/Actions/EventAction.ts +25 -6
- package/src/AllowLists/SimpleAllowList.ts +2 -2
- package/src/BoostCore.test.ts +124 -2
- package/src/BoostCore.ts +259 -0
- package/src/Budgets/Budget.ts +8 -2
- package/src/Budgets/ManagedBudgetWithFees.test.ts +0 -1
- package/src/Budgets/ManagedBudgetWithFeesV2.test.ts +327 -0
- package/src/Budgets/ManagedBudgetWithFeesV2.ts +713 -0
- package/src/Incentives/AllowListIncentive.ts +17 -0
- package/src/Incentives/CGDAIncentive.ts +31 -0
- package/src/Incentives/ERC20Incentive.ts +27 -0
- package/src/Incentives/ERC20PeggedIncentive.ts +18 -0
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +26 -0
- package/src/Incentives/ERC20VariableIncentive.ts +18 -0
- package/src/Incentives/PointsIncentive.ts +22 -0
- package/src/Validators/LimitedSignerValidator.ts +1 -1
- package/src/Validators/SignerValidator.ts +1 -1
- package/src/errors.ts +1 -1
- package/src/index.ts +1 -0
- package/dist/Budget-AoNx7uFd.cjs +0 -2
- package/dist/Budget-AoNx7uFd.cjs.map +0 -1
- package/dist/Budget-DYIV9iNK.js +0 -463
- package/dist/Budget-DYIV9iNK.js.map +0 -1
- package/dist/Incentive-BbkfwGOb.cjs +0 -2
- package/dist/Incentive-BbkfwGOb.cjs.map +0 -1
- package/dist/Incentive-qlnv5kQB.js +0 -991
- package/dist/Incentive-qlnv5kQB.js.map +0 -1
- package/dist/SimpleDenyList-ByAr4X1r.js +0 -133
- package/dist/SimpleDenyList-CsRXJPwm.cjs +0 -2
- package/dist/componentInterfaces-D7r9xJmt.cjs +0 -2
- package/dist/componentInterfaces-D7r9xJmt.cjs.map +0 -1
- package/dist/componentInterfaces-PR3ijhgZ.js +0 -18
- package/dist/componentInterfaces-PR3ijhgZ.js.map +0 -1
- package/dist/deployments-DoIOqxco.cjs +0 -2
- package/dist/deployments-DoIOqxco.cjs.map +0 -1
- package/dist/generated-Cyvr_Tjx.js.map +0 -1
- package/dist/generated-DtYPHhtX.cjs +0 -3
- package/dist/generated-DtYPHhtX.cjs.map +0 -1
|
@@ -1,991 +0,0 @@
|
|
|
1
|
-
import { v as A, bQ as P, bR as T, bS as x, bT as N, bU as $, bV as B, bW as k, bX as F, bY as G, bZ as U, b_ as q, b$ as L, c0 as M, c1 as j, c2 as S, l as C, c3 as W, c4 as Y, c5 as J, c6 as X, c7 as Z, c8 as z, c9 as H, ca as K, cb as O, cc as Q, cd as f0, ce as b0, cf as a0, cg as e0, ch as d0, ci as c0, cj as t0, ck as s0 } from "./generated-Cyvr_Tjx.js";
|
|
2
|
-
import { f as i0, g as n0, h as r0, i as o0, j as l0, k as u0, l as m0, m as h0 } from "./componentInterfaces-PR3ijhgZ.js";
|
|
3
|
-
import { getTransactionReceipt as g0, getTransaction as y0, readContract as w0 } from "@wagmi/core";
|
|
4
|
-
import { NoMatchingLogsError as I, DecodedArgsError as u, InvalidCriteriaTypeError as p0, IncentiveCriteriaNotFoundError as A0, InvalidComponentInterfaceError as C0 } from "./errors.js";
|
|
5
|
-
import { AllowListIncentive as I0 } from "./Incentives/AllowListIncentive.js";
|
|
6
|
-
import { CGDAIncentive as v0 } from "./Incentives/CGDAIncentive.js";
|
|
7
|
-
import { ERC20Incentive as V0 } from "./Incentives/ERC20Incentive.js";
|
|
8
|
-
import { encodeAbiParameters as o, decodeAbiParameters as r, zeroAddress as D, parseEventLogs as _0, decodeFunctionData as D0, parseEther as v } from "viem";
|
|
9
|
-
import { g as R0, h as E0 } from "./deployments-D0fs26TV.js";
|
|
10
|
-
import { DeployableTarget as R } from "./Deployable/DeployableTarget.js";
|
|
11
|
-
import { prepareClaimPayload as m } from "./claiming.js";
|
|
12
|
-
import { RegistryType as E, CheatCodes as P0 } from "./utils.js";
|
|
13
|
-
import { SignatureType as V } from "./Actions/EventAction.js";
|
|
14
|
-
import { ERC20VariableCriteriaIncentive as T0 } from "./Incentives/ERC20VariableCriteriaIncentive.js";
|
|
15
|
-
import { ERC20VariableIncentive as x0 } from "./Incentives/ERC20VariableIncentive.js";
|
|
16
|
-
import { PointsIncentive as N0 } from "./Incentives/PointsIncentive.js";
|
|
17
|
-
const $0 = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6127bf806100bd5f395ff3fe60806040526004361061020e575f3560e01c806354d1f13d11610117578063d54ad2a11161009f578063ec87621c1161006e578063ec87621c14610739578063f04e283e14610763578063f2fde38b1461077f578063fe9fbb801461079b578063fee81cf4146107d75761020e565b8063d54ad2a114610681578063db09da12146106ab578063dcc21361146106e7578063dcc59b6f1461070f5761020e565b80639214fa4d116100e65780639214fa4d1461058d578063a4d66daf146105b7578063bb1757cf146105e1578063be4994f81461061d578063c884ef83146106455761020e565b806354d1f13d14610525578063715018a61461052f57806375b238fc146105395780638da5cb5b146105635761020e565b80632de948071161019a578063474f5a4411610169578063474f5a441461042a5780634a4ee7b1146104675780634e7165a214610483578063514e62fc146104bf578063547d1864146104fb5761020e565b80632de948071461037457806338d52e0f146103b05780634359d28a146103da578063439fab91146104025761020e565b80631cd64df4116101e15780631cd64df4146102b05780631f1cb62b146102ec578063228cb73314610316578063256929621461034057806328d6183b1461034a5761020e565b806301ffc9a71461021257806307621eca1461024e578063183a4f6e146102785780631c10893f14610294575b5f80fd5b34801561021d575f80fd5b5061023860048036038101906102339190611a8c565b610813565b6040516102459190611ad1565b60405180910390f35b348015610259575f80fd5b5061026261088c565b60405161026f9190611b02565b60405180910390f35b610292600480360381019061028d9190611b45565b610894565b005b6102ae60048036038101906102a99190611bca565b6108a1565b005b3480156102bb575f80fd5b506102d660048036038101906102d19190611bca565b6108b7565b6040516102e39190611ad1565b60405180910390f35b3480156102f7575f80fd5b506103006108cd565b60405161030d9190611c17565b60405180910390f35b348015610321575f80fd5b5061032a6108f2565b6040516103379190611b02565b60405180910390f35b6103486108f7565b005b348015610355575f80fd5b5061035e610948565b60405161036b9190611c3f565b60405180910390f35b34801561037f575f80fd5b5061039a60048036038101906103959190611c58565b61096f565b6040516103a79190611b02565b60405180910390f35b3480156103bb575f80fd5b506103c4610988565b6040516103d19190611c17565b60405180910390f35b3480156103e5575f80fd5b5061040060048036038101906103fb9190611d39565b6109ad565b005b34801561040d575f80fd5b5061042860048036038101906104239190611e0c565b610abb565b005b348015610435575f80fd5b50610450600480360381019061044b9190611e0c565b610d45565b60405161045e929190611e57565b60405180910390f35b610481600480360381019061047c9190611bca565b610eaf565b005b34801561048e575f80fd5b506104a960048036038101906104a49190611e0c565b610ec5565b6040516104b69190611eee565b60405180910390f35b3480156104ca575f80fd5b506104e560048036038101906104e09190611bca565b610f9a565b6040516104f29190611ad1565b60405180910390f35b348015610506575f80fd5b5061050f610fb1565b60405161051c9190611b02565b60405180910390f35b61052d610fb7565b005b610537610ff0565b005b348015610544575f80fd5b5061054d611003565b60405161055a9190611b02565b60405180910390f35b34801561056e575f80fd5b50610577611008565b6040516105849190611c17565b60405180910390f35b348015610598575f80fd5b506105a1611030565b6040516105ae9190611c17565b60405180910390f35b3480156105c2575f80fd5b506105cb611058565b6040516105d89190611b02565b60405180910390f35b3480156105ec575f80fd5b5061060760048036038101906106029190611f0e565b61105e565b6040516106149190611ad1565b60405180910390f35b348015610628575f80fd5b50610643600480360381019061063e9190611fc0565b611239565b005b348015610650575f80fd5b5061066b60048036038101906106669190611c58565b6112ef565b6040516106789190611ad1565b60405180910390f35b34801561068c575f80fd5b5061069561130c565b6040516106a29190611b02565b60405180910390f35b3480156106b6575f80fd5b506106d160048036038101906106cc9190611f0e565b611312565b6040516106de9190611ad1565b60405180910390f35b3480156106f2575f80fd5b5061070d60048036038101906107089190611fc0565b611355565b005b34801561071a575f80fd5b5061072361140b565b6040516107309190611b02565b60405180910390f35b348015610744575f80fd5b5061074d611411565b60405161075a9190611b02565b60405180910390f35b61077d60048036038101906107789190611c58565b611416565b005b61079960048036038101906107949190611c58565b611454565b005b3480156107a6575f80fd5b506107c160048036038101906107bc9190611c58565b61147d565b6040516107ce9190611ad1565b60405180910390f35b3480156107e2575f80fd5b506107fd60048036038101906107f89190611c58565b6114d0565b60405161080a9190611b02565b60405180910390f35b5f7f56586338000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108855750610884826114e9565b5b9050919050565b5f8054905090565b61089e3382611562565b50565b6108a9611571565b6108b382826115a8565b5050565b5f81826108c38561096f565b1614905092915050565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5481565b5f6109006115b8565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f5658633800000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109b8816115c2565b8282905085859050146109f7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ab3575f848483818110610a1857610a1761203e565b5b9050602002016020810190610a2d9190612095565b90506001151581151503610a7257610a6d878784818110610a5157610a5061203e565b5b9050602002016020810190610a669190611c58565b60016115a8565b610aa5565b610aa4878784818110610a8857610a8761203e565b5b9050602002016020810190610a9d9190611c58565b6001611562565b5b5080806001019150506109f9565b505050505050565b5f610ac46115f7565b90508054600382558015610af65760018160011c14303b10610aed5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b0791906121c9565b90505f81604001511480610b1e57505f8160600151145b15610b55576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f816060015190505f610b8a30845f015173ffffffffffffffffffffffffffffffffffffffff1661162090919063ffffffff16565b905081811015610bd857825f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610bcf939291906121f4565b60405180910390fd5b825f015160035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826020015160075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082604001515f819055508260600151600581905550610c7d33611653565b610c8c83608001516001611729565b826020015173ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff167fd20715546497e6d32bc9b61b35416a25a8cc41d2fb7f389a1bb26dc040213a3b856040015186606001518760800151604051610d0093929190612229565b60405180910390a35050508015610d40576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610d52816115c2565b5f8585810190610d629190612377565b90505f8160200151806020019051810190610d7d91906123d2565b90508060055f828254610d90919061242a565b92505081905550610de6825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176a9092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610e5a939291906124c2565b604051602081830303815290604052604051610e769190611eee565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610eb7611571565b610ec18282611562565b5050565b60605f8383810190610ed791906121c9565b90505f81606001519050604051806080016040528060016002811115610f0057610eff6124fe565b5b8152602001835f015173ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610f5f9190612554565b604051602081830303815290604052815250604051602001610f81919061266a565b6040516020818303038152906040529250505092915050565b5f8082610fa68561096f565b161415905092915050565b60025481565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610ff8611571565b6110015f6117b3565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60055481565b5f611067611571565b5f8383810190611077919061270f565b90505f816020015180602001905181019061109291906123d2565b905061109e8682611879565b6110d4576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554816006546110e59190612756565b111561111d576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060065f82825461112e9190612756565b92505081905550600160045f8282546111479190612756565b9250508190555061119a868260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176a9092919063ffffffff16565b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168884604051602001611208939291906124c2565b6040516020818303038152906040526040516112249190611eee565b60405180910390a26001925050509392505050565b6002611244816115c2565b828290508585905014611283576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156112e7576112da8686838181106112a6576112a561203e565b5b90506020020160208101906112bb9190611c58565b8585848181106112ce576112cd61203e565b5b905060200201356115a8565b8080600101915050611285565b505050505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b60065481565b5f808383810190611323919061270f565b90505f816020015180602001905181019061133e91906123d2565b905061134a8682611879565b925050509392505050565b6002611360816115c2565b82829050858590501461139f576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015611403576113f68686838181106113c2576113c161203e565b5b90506020020160208101906113d79190611c58565b8585848181106113ea576113e961203e565b5b90506020020135611562565b80806001019150506113a1565b505050505050565b60045481565b600181565b61141e611571565b63389a75e1600c52805f526020600c20805442111561144457636f5e88185f526004601cfd5b5f815550611451816117b3565b50565b61145c611571565b8060601b61147157637448fbae5f526004601cfd5b61147a816117b3565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff1661149d611008565b73ffffffffffffffffffffffffffffffffffffffff1614806114c957506114c8826002600117610f9a565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061155b575061155a826118e8565b5b9050919050565b61156d82825f611961565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146115a6576382b429005f526004601cfd5b565b6115b482826001611961565b5050565b5f6202a300905090565b638b78c6d8195433146115f457638b78c6d8600c52335f52806020600c2054166115f3576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b61165b6119b9565b156116d3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561169557630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611726565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166117aa576390b8ec185f526004601cfd5b5f603452505050565b6117bb6119b9565b15611820577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611876565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161580156118e05750600554826006546118dd9190612756565b11155b905092915050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061195a5750611959826119bd565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361198357848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611a6b81611a37565b8114611a75575f80fd5b50565b5f81359050611a8681611a62565b92915050565b5f60208284031215611aa157611aa0611a2f565b5b5f611aae84828501611a78565b91505092915050565b5f8115159050919050565b611acb81611ab7565b82525050565b5f602082019050611ae45f830184611ac2565b92915050565b5f819050919050565b611afc81611aea565b82525050565b5f602082019050611b155f830184611af3565b92915050565b611b2481611aea565b8114611b2e575f80fd5b50565b5f81359050611b3f81611b1b565b92915050565b5f60208284031215611b5a57611b59611a2f565b5b5f611b6784828501611b31565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611b9982611b70565b9050919050565b611ba981611b8f565b8114611bb3575f80fd5b50565b5f81359050611bc481611ba0565b92915050565b5f8060408385031215611be057611bdf611a2f565b5b5f611bed85828601611bb6565b9250506020611bfe85828601611b31565b9150509250929050565b611c1181611b8f565b82525050565b5f602082019050611c2a5f830184611c08565b92915050565b611c3981611a37565b82525050565b5f602082019050611c525f830184611c30565b92915050565b5f60208284031215611c6d57611c6c611a2f565b5b5f611c7a84828501611bb6565b91505092915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611ca457611ca3611c83565b5b8235905067ffffffffffffffff811115611cc157611cc0611c87565b5b602083019150836020820283011115611cdd57611cdc611c8b565b5b9250929050565b5f8083601f840112611cf957611cf8611c83565b5b8235905067ffffffffffffffff811115611d1657611d15611c87565b5b602083019150836020820283011115611d3257611d31611c8b565b5b9250929050565b5f805f8060408587031215611d5157611d50611a2f565b5b5f85013567ffffffffffffffff811115611d6e57611d6d611a33565b5b611d7a87828801611c8f565b9450945050602085013567ffffffffffffffff811115611d9d57611d9c611a33565b5b611da987828801611ce4565b925092505092959194509250565b5f8083601f840112611dcc57611dcb611c83565b5b8235905067ffffffffffffffff811115611de957611de8611c87565b5b602083019150836001820283011115611e0557611e04611c8b565b5b9250929050565b5f8060208385031215611e2257611e21611a2f565b5b5f83013567ffffffffffffffff811115611e3f57611e3e611a33565b5b611e4b85828601611db7565b92509250509250929050565b5f604082019050611e6a5f830185611af3565b611e776020830184611c08565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611ec082611e7e565b611eca8185611e88565b9350611eda818560208601611e98565b611ee381611ea6565b840191505092915050565b5f6020820190508181035f830152611f068184611eb6565b905092915050565b5f805f60408486031215611f2557611f24611a2f565b5b5f611f3286828701611bb6565b935050602084013567ffffffffffffffff811115611f5357611f52611a33565b5b611f5f86828701611db7565b92509250509250925092565b5f8083601f840112611f8057611f7f611c83565b5b8235905067ffffffffffffffff811115611f9d57611f9c611c87565b5b602083019150836020820283011115611fb957611fb8611c8b565b5b9250929050565b5f805f8060408587031215611fd857611fd7611a2f565b5b5f85013567ffffffffffffffff811115611ff557611ff4611a33565b5b61200187828801611c8f565b9450945050602085013567ffffffffffffffff81111561202457612023611a33565b5b61203087828801611f6b565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61207481611ab7565b811461207e575f80fd5b50565b5f8135905061208f8161206b565b92915050565b5f602082840312156120aa576120a9611a2f565b5b5f6120b784828501612081565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6120fa82611ea6565b810181811067ffffffffffffffff82111715612119576121186120c4565b5b80604052505050565b5f61212b611a26565b905061213782826120f1565b919050565b5f80fd5b5f60a08284031215612155576121546120c0565b5b61215f60a0612122565b90505f61216e84828501611bb6565b5f83015250602061218184828501611bb6565b602083015250604061219584828501611b31565b60408301525060606121a984828501611b31565b60608301525060806121bd84828501611bb6565b60808301525092915050565b5f60a082840312156121de576121dd611a2f565b5b5f6121eb84828501612140565b91505092915050565b5f6060820190506122075f830186611c08565b6122146020830185611af3565b6122216040830184611af3565b949350505050565b5f60608201905061223c5f830186611af3565b6122496020830185611af3565b6122566040830184611c08565b949350505050565b5f80fd5b5f67ffffffffffffffff82111561227c5761227b6120c4565b5b61228582611ea6565b9050602081019050919050565b828183375f83830152505050565b5f6122b26122ad84612262565b612122565b9050828152602081018484840111156122ce576122cd61225e565b5b6122d9848285612292565b509392505050565b5f82601f8301126122f5576122f4611c83565b5b81356123058482602086016122a0565b91505092915050565b5f60408284031215612323576123226120c0565b5b61232d6040612122565b90505f61233c84828501611bb6565b5f83015250602082013567ffffffffffffffff81111561235f5761235e61213c565b5b61236b848285016122e1565b60208301525092915050565b5f6020828403121561238c5761238b611a2f565b5b5f82013567ffffffffffffffff8111156123a9576123a8611a33565b5b6123b58482850161230e565b91505092915050565b5f815190506123cc81611b1b565b92915050565b5f602082840312156123e7576123e6611a2f565b5b5f6123f4848285016123be565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61243482611aea565b915061243f83611aea565b9250828203905081811115612457576124566123fd565b5b92915050565b5f8160601b9050919050565b5f6124738261245d565b9050919050565b5f61248482612469565b9050919050565b61249c61249782611b8f565b61247a565b82525050565b5f819050919050565b6124bc6124b782611aea565b6124a2565b82525050565b5f6124cd828661248b565b6014820191506124dd828561248b565b6014820191506124ed82846124ab565b602082019150819050949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b61253481611aea565b82525050565b602082015f82015161254e5f85018261252b565b50505050565b5f6020820190506125675f83018461253a565b92915050565b6003811061257e5761257d6124fe565b5b50565b5f81905061258e8261256d565b919050565b5f61259d82612581565b9050919050565b6125ad81612593565b82525050565b6125bc81611b8f565b82525050565b5f82825260208201905092915050565b5f6125dc82611e7e565b6125e681856125c2565b93506125f6818560208601611e98565b6125ff81611ea6565b840191505092915050565b5f608083015f83015161261f5f8601826125a4565b50602083015161263260208601826125b3565b50604083015161264560408601826125b3565b506060830151848203606086015261265d82826125d2565b9150508091505092915050565b5f6020820190508181035f830152612682818461260a565b905092915050565b5f6040828403121561269f5761269e6120c0565b5b6126a96040612122565b90505f82013567ffffffffffffffff8111156126c8576126c761213c565b5b6126d4848285016122e1565b5f83015250602082013567ffffffffffffffff8111156126f7576126f661213c565b5b612703848285016122e1565b60208301525092915050565b5f6020828403121561272457612723611a2f565b5b5f82013567ffffffffffffffff81111561274157612740611a33565b5b61274d8482850161268a565b91505092915050565b5f61276082611aea565b915061276b83611aea565b9250828201905080821115612783576127826123fd565b5b9291505056fea2646970667358221220dac302ea2cd5b1bd043f32307b4b55326db7520539ec80e9572f86826d8305f064736f6c634300081a0033", h = class h extends R {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments), this.abi = A;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* The owner of the incentive
|
|
23
|
-
*
|
|
24
|
-
* @public
|
|
25
|
-
* @async
|
|
26
|
-
* @param {?ReadParams} [params]
|
|
27
|
-
* @returns {Promise<Address>}
|
|
28
|
-
*/
|
|
29
|
-
async owner(f) {
|
|
30
|
-
return await P(this._config, {
|
|
31
|
-
address: this.assertValidAddress(),
|
|
32
|
-
args: [],
|
|
33
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
34
|
-
...f
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* 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)`
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
* @async
|
|
42
|
-
* @param {?ReadParams} [params]
|
|
43
|
-
* @returns {Promise<bigint>} - The current reward
|
|
44
|
-
*/
|
|
45
|
-
async currentReward(f) {
|
|
46
|
-
return await T(this._config, {
|
|
47
|
-
address: this.assertValidAddress(),
|
|
48
|
-
args: [],
|
|
49
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
50
|
-
...f
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* The number of claims that have been made
|
|
55
|
-
*
|
|
56
|
-
* @public
|
|
57
|
-
* @async
|
|
58
|
-
* @param {?ReadParams} [params]
|
|
59
|
-
* @returns {Promise<bigint>}
|
|
60
|
-
*/
|
|
61
|
-
async claims(f) {
|
|
62
|
-
return await x(this._config, {
|
|
63
|
-
address: this.assertValidAddress(),
|
|
64
|
-
args: [],
|
|
65
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
66
|
-
...f
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* The total amount of rewards claimed
|
|
71
|
-
*
|
|
72
|
-
* @public
|
|
73
|
-
* @async
|
|
74
|
-
* @param {?ReadParams} [params]
|
|
75
|
-
* @returns {Promise<bigint>}
|
|
76
|
-
*/
|
|
77
|
-
async totalClaimed(f) {
|
|
78
|
-
return await N(this._config, {
|
|
79
|
-
address: this.assertValidAddress(),
|
|
80
|
-
args: [],
|
|
81
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
82
|
-
...f
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* A mapping of address to claim status
|
|
87
|
-
*
|
|
88
|
-
* @public
|
|
89
|
-
* @async
|
|
90
|
-
* @param {Address} address
|
|
91
|
-
* @param {?ReadParams} [params]
|
|
92
|
-
* @returns {Promise<boolean>}
|
|
93
|
-
*/
|
|
94
|
-
async claimed(f, b) {
|
|
95
|
-
return await $(this._config, {
|
|
96
|
-
address: this.assertValidAddress(),
|
|
97
|
-
args: [f],
|
|
98
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
99
|
-
...b
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* The address of the ERC20-like token
|
|
104
|
-
*
|
|
105
|
-
* @public
|
|
106
|
-
* @async
|
|
107
|
-
* @param {?ReadParams} [params]
|
|
108
|
-
* @returns {Promise<Address>}
|
|
109
|
-
*/
|
|
110
|
-
async asset(f) {
|
|
111
|
-
return await B(this._config, {
|
|
112
|
-
address: this.assertValidAddress(),
|
|
113
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
114
|
-
...f
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* The address of the pegged ERC20-like token
|
|
119
|
-
*
|
|
120
|
-
* @public
|
|
121
|
-
* @async
|
|
122
|
-
* @param {?ReadParams} [params]
|
|
123
|
-
* @returns {Promise<Address>}
|
|
124
|
-
*/
|
|
125
|
-
async peg(f) {
|
|
126
|
-
return await k(this._config, {
|
|
127
|
-
address: this.assertValidAddress(),
|
|
128
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
129
|
-
...f
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* The reward amount issued for each claim
|
|
134
|
-
*
|
|
135
|
-
* @public
|
|
136
|
-
* @async
|
|
137
|
-
* @param {?ReadParams} [params]
|
|
138
|
-
* @returns {Promise<bigint>}
|
|
139
|
-
*/
|
|
140
|
-
async reward(f) {
|
|
141
|
-
return await F(this._config, {
|
|
142
|
-
address: this.assertValidAddress(),
|
|
143
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
144
|
-
...f
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* The limit (max possible rewards payout in reward token)
|
|
149
|
-
*
|
|
150
|
-
* @public
|
|
151
|
-
* @async
|
|
152
|
-
* @param {?ReadParams} [params]
|
|
153
|
-
* @returns {Promise<bigint>}
|
|
154
|
-
*/
|
|
155
|
-
async limit(f) {
|
|
156
|
-
return await G(this._config, {
|
|
157
|
-
address: this.assertValidAddress(),
|
|
158
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
159
|
-
...f
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Claim the incentive
|
|
164
|
-
*
|
|
165
|
-
* @public
|
|
166
|
-
* @async
|
|
167
|
-
* @param {ClaimPayload} payload
|
|
168
|
-
* @param {?WriteParams} [params]
|
|
169
|
-
* @returns {Promise<boolean>} - Returns true if successfully claimed
|
|
170
|
-
*/
|
|
171
|
-
async claim(f, b) {
|
|
172
|
-
return await this.awaitResult(this.claimRaw(f, b));
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Claim the incentive
|
|
176
|
-
*
|
|
177
|
-
* @public
|
|
178
|
-
* @async
|
|
179
|
-
* @param {ClaimPayload} payload
|
|
180
|
-
* @param {?WriteParams} [params]
|
|
181
|
-
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
|
|
182
|
-
*/
|
|
183
|
-
async claimRaw(f, b) {
|
|
184
|
-
const { request: a, result: e } = await U(
|
|
185
|
-
this._config,
|
|
186
|
-
{
|
|
187
|
-
address: this.assertValidAddress(),
|
|
188
|
-
args: [m(f)],
|
|
189
|
-
...this.optionallyAttachAccount(),
|
|
190
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
191
|
-
...b
|
|
192
|
-
}
|
|
193
|
-
);
|
|
194
|
-
return { hash: await q(this._config, a), result: e };
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Clawback assets from the incentive
|
|
198
|
-
*
|
|
199
|
-
* @public
|
|
200
|
-
* @async
|
|
201
|
-
* @param {ClaimPayload} payload
|
|
202
|
-
* @param {?WriteParams} [params]
|
|
203
|
-
* @returns {Promise<boolean>} - True if the assets were successfully clawbacked
|
|
204
|
-
*/
|
|
205
|
-
async clawback(f, b) {
|
|
206
|
-
return await this.awaitResult(this.clawbackRaw(f, b));
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Clawback assets from the incentive
|
|
210
|
-
*
|
|
211
|
-
* @public
|
|
212
|
-
* @async
|
|
213
|
-
* @param {ClaimPayload} payload
|
|
214
|
-
* @param {?WriteParams} [params]
|
|
215
|
-
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
|
|
216
|
-
*/
|
|
217
|
-
async clawbackRaw(f, b) {
|
|
218
|
-
const { request: a, result: e } = await L(
|
|
219
|
-
this._config,
|
|
220
|
-
{
|
|
221
|
-
address: this.assertValidAddress(),
|
|
222
|
-
args: [m(f)],
|
|
223
|
-
...this.optionallyAttachAccount(),
|
|
224
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
225
|
-
...b
|
|
226
|
-
}
|
|
227
|
-
);
|
|
228
|
-
return { hash: await M(this._config, a), result: e };
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Check if an incentive is claimable.
|
|
232
|
-
*
|
|
233
|
-
* @public
|
|
234
|
-
* @async
|
|
235
|
-
* @param {ClaimPayload} payload
|
|
236
|
-
* @param {?ReadParams} [params]
|
|
237
|
-
* @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
|
|
238
|
-
*/
|
|
239
|
-
async isClaimable(f, b) {
|
|
240
|
-
return await j(this._config, {
|
|
241
|
-
address: this.assertValidAddress(),
|
|
242
|
-
args: [f.target, f.data],
|
|
243
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
244
|
-
...b
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* read the peg token for the incentive.
|
|
249
|
-
*
|
|
250
|
-
* @public
|
|
251
|
-
* @async
|
|
252
|
-
* @param {?ReadParams} [params]
|
|
253
|
-
* @returns {Promise<Address>} = The address of the token the reward is pegged to
|
|
254
|
-
*/
|
|
255
|
-
async getPeg(f) {
|
|
256
|
-
return await S(this._config, {
|
|
257
|
-
address: this.assertValidAddress(),
|
|
258
|
-
args: [],
|
|
259
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
260
|
-
...f
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`
|
|
265
|
-
*
|
|
266
|
-
* @public
|
|
267
|
-
* @async
|
|
268
|
-
* @param {?ReadParams} [params]
|
|
269
|
-
* @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.
|
|
270
|
-
*/
|
|
271
|
-
async getTotalBudget(f) {
|
|
272
|
-
return await this.limit(f);
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
276
|
-
*
|
|
277
|
-
* @public
|
|
278
|
-
* @async
|
|
279
|
-
* @param {?ReadParams} [params]
|
|
280
|
-
* @returns {Promise<boolean>} - True if total claims is less than limit
|
|
281
|
-
*/
|
|
282
|
-
async canBeClaimed(f) {
|
|
283
|
-
return await this.getRemainingClaimPotential(f) > 0n;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
287
|
-
*
|
|
288
|
-
* @public
|
|
289
|
-
* @async
|
|
290
|
-
* @param {?ReadParams} [params]
|
|
291
|
-
* @returns {Promise<bigint>} - True if total claims is less than limit
|
|
292
|
-
*/
|
|
293
|
-
async getRemainingClaimPotential(f) {
|
|
294
|
-
const [b, a] = await Promise.all([
|
|
295
|
-
this.totalClaimed(f),
|
|
296
|
-
this.limit(f)
|
|
297
|
-
]);
|
|
298
|
-
return a - b;
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* @inheritdoc
|
|
302
|
-
*
|
|
303
|
-
* @public
|
|
304
|
-
* @param {?ERC20PeggedIncentivePayload} [_payload]
|
|
305
|
-
* @param {?DeployableOptions} [_options]
|
|
306
|
-
* @returns {GenericDeployableParams}
|
|
307
|
-
*/
|
|
308
|
-
buildParameters(f, b) {
|
|
309
|
-
const [a, e] = this.validateDeploymentConfig(
|
|
310
|
-
f,
|
|
311
|
-
b
|
|
312
|
-
);
|
|
313
|
-
return {
|
|
314
|
-
abi: A,
|
|
315
|
-
bytecode: $0,
|
|
316
|
-
args: [B0(a)],
|
|
317
|
-
...this.optionallyAttachAccount(e.account)
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Encodes an amount to clawback from the incentive
|
|
322
|
-
*
|
|
323
|
-
* @public
|
|
324
|
-
* @param {bigint} amount - How much of the asset to clawback
|
|
325
|
-
* @returns {Hex} - Returns an encoded uint256
|
|
326
|
-
*/
|
|
327
|
-
buildClawbackData(f) {
|
|
328
|
-
return o([{ type: "uint256" }], [f]);
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Builds the claim data for the ERC20PeggedIncentive.
|
|
332
|
-
*
|
|
333
|
-
* @public
|
|
334
|
-
* @param {bigint} rewardAmount
|
|
335
|
-
* @returns {Hash} Returns the encoded claim data
|
|
336
|
-
* @description This function returns the encoded claim data for the ERC20PeggedIncentive.
|
|
337
|
-
*/
|
|
338
|
-
buildClaimData(f) {
|
|
339
|
-
return o(
|
|
340
|
-
[{ type: "uint256", name: "rewardAmount" }],
|
|
341
|
-
[f]
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Decodes claim data for the ERC20PeggedIncentive, returning the claim amount.
|
|
346
|
-
* Useful when deriving amount claimed from logs.
|
|
347
|
-
*
|
|
348
|
-
* @public
|
|
349
|
-
* @param {Hex} claimData
|
|
350
|
-
* @returns {BigInt} Returns the reward amount from a claim data payload
|
|
351
|
-
*/
|
|
352
|
-
decodeClaimData(f) {
|
|
353
|
-
const b = r(
|
|
354
|
-
[
|
|
355
|
-
{
|
|
356
|
-
type: "tuple",
|
|
357
|
-
name: "BoostClaimData",
|
|
358
|
-
components: [
|
|
359
|
-
{ type: "bytes", name: "validatorData" },
|
|
360
|
-
{ type: "bytes", name: "incentiveData" }
|
|
361
|
-
]
|
|
362
|
-
}
|
|
363
|
-
],
|
|
364
|
-
f
|
|
365
|
-
);
|
|
366
|
-
return r(
|
|
367
|
-
[{ type: "uint256" }],
|
|
368
|
-
b[0].incentiveData
|
|
369
|
-
)[0];
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
h.bases = {
|
|
373
|
-
31337: void 0,
|
|
374
|
-
...R0
|
|
375
|
-
}, h.registryType = E.INCENTIVE;
|
|
376
|
-
let y = h;
|
|
377
|
-
function B0({
|
|
378
|
-
asset: i,
|
|
379
|
-
peg: f,
|
|
380
|
-
reward: b,
|
|
381
|
-
limit: a,
|
|
382
|
-
manager: e = D
|
|
383
|
-
}) {
|
|
384
|
-
return o(
|
|
385
|
-
[
|
|
386
|
-
{ type: "address", name: "asset" },
|
|
387
|
-
{ type: "address", name: "peg" },
|
|
388
|
-
{ type: "uint256", name: "reward" },
|
|
389
|
-
{ type: "uint256", name: "limit" },
|
|
390
|
-
{ type: "address", name: "manager" }
|
|
391
|
-
],
|
|
392
|
-
[i, f, b, a, e]
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
|
-
const k0 = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612e66806100bd5f395ff3fe60806040526004361061022f575f3560e01c8063715018a61161012d578063c884ef83116100aa578063ec87621c1161006e578063ec87621c146107db578063f04e283e14610805578063f2fde38b14610821578063fe9fbb801461083d578063fee81cf4146108795761022f565b8063c884ef83146106e7578063d54ad2a114610723578063db09da121461074d578063dcc2136114610789578063dcc59b6f146107b15761022f565b8063a4d66daf116100f1578063a4d66daf14610605578063a871ced21461062f578063bb1757cf14610659578063be4994f814610695578063c213f3f9146106bd5761022f565b8063715018a61461055057806375b238fc1461055a57806377548687146105845780638da5cb5b146105b15780639214fa4d146105db5761022f565b80632de94807116101bb5780634a4ee7b11161017f5780634a4ee7b1146104885780634e7165a2146104a4578063514e62fc146104e0578063547d18641461051c57806354d1f13d146105465761022f565b80632de948071461039557806338d52e0f146103d15780634359d28a146103fb578063439fab9114610423578063474f5a441461044b5761022f565b80631cd64df4116102025780631cd64df4146102d15780631f1cb62b1461030d578063228cb73314610337578063256929621461036157806328d6183b1461036b5761022f565b806301ffc9a71461023357806307621eca1461026f578063183a4f6e146102995780631c10893f146102b5575b5f80fd5b34801561023e575f80fd5b5061025960048036038101906102549190611e0d565b6108b5565b6040516102669190611e52565b60405180910390f35b34801561027a575f80fd5b5061028361092e565b6040516102909190611e83565b60405180910390f35b6102b360048036038101906102ae9190611ec6565b610936565b005b6102cf60048036038101906102ca9190611f4b565b610943565b005b3480156102dc575f80fd5b506102f760048036038101906102f29190611f4b565b610959565b6040516103049190611e52565b60405180910390f35b348015610318575f80fd5b5061032161096f565b60405161032e9190611f98565b60405180910390f35b348015610342575f80fd5b5061034b610994565b6040516103589190611e83565b60405180910390f35b610369610999565b005b348015610376575f80fd5b5061037f6109ea565b60405161038c9190611fc0565b60405180910390f35b3480156103a0575f80fd5b506103bb60048036038101906103b69190611fd9565b610a11565b6040516103c89190611e83565b60405180910390f35b3480156103dc575f80fd5b506103e5610a2a565b6040516103f29190611f98565b60405180910390f35b348015610406575f80fd5b50610421600480360381019061041c91906120ba565b610a4f565b005b34801561042e575f80fd5b506104496004803603810190610444919061218d565b610b5d565b005b348015610456575f80fd5b50610471600480360381019061046c919061218d565b610e9c565b60405161047f9291906121d8565b60405180910390f35b6104a2600480360381019061049d9190611f4b565b611006565b005b3480156104af575f80fd5b506104ca60048036038101906104c5919061218d565b61101c565b6040516104d7919061226f565b60405180910390f35b3480156104eb575f80fd5b5061050660048036038101906105019190611f4b565b6110f1565b6040516105139190611e52565b60405180910390f35b348015610527575f80fd5b50610530611108565b60405161053d9190611e83565b60405180910390f35b61054e61110e565b005b610558611147565b005b348015610565575f80fd5b5061056e61115a565b60405161057b9190611e83565b60405180910390f35b34801561058f575f80fd5b5061059861115f565b6040516105a89493929190612335565b60405180910390f35b3480156105bc575f80fd5b506105c56111b4565b6040516105d29190611f98565b60405180910390f35b3480156105e6575f80fd5b506105ef6111dc565b6040516105fc9190611f98565b60405180910390f35b348015610610575f80fd5b50610619611204565b6040516106269190611e83565b60405180910390f35b34801561063a575f80fd5b5061064361120a565b6040516106509190612407565b60405180910390f35b348015610664575f80fd5b5061067f600480360381019061067a9190612420565b6112d9565b60405161068c9190611e52565b60405180910390f35b3480156106a0575f80fd5b506106bb60048036038101906106b691906124d2565b611506565b005b3480156106c8575f80fd5b506106d16115bc565b6040516106de9190611e83565b60405180910390f35b3480156106f2575f80fd5b5061070d60048036038101906107089190611fd9565b6115c5565b60405161071a9190611e52565b60405180910390f35b34801561072e575f80fd5b506107376115e2565b6040516107449190611e83565b60405180910390f35b348015610758575f80fd5b50610773600480360381019061076e9190612420565b6115e8565b6040516107809190611e52565b60405180910390f35b348015610794575f80fd5b506107af60048036038101906107aa91906124d2565b61165f565b005b3480156107bc575f80fd5b506107c5611715565b6040516107d29190611e83565b60405180910390f35b3480156107e6575f80fd5b506107ef61171b565b6040516107fc9190611e83565b60405180910390f35b61081f600480360381019061081a9190611fd9565b611720565b005b61083b60048036038101906108369190611fd9565b61175e565b005b348015610848575f80fd5b50610863600480360381019061085e9190611fd9565b611787565b6040516108709190611e52565b60405180910390f35b348015610884575f80fd5b5061089f600480360381019061089a9190611fd9565b6117da565b6040516108ac9190611e83565b60405180910390f35b5f7ff60c99c9000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109275750610926826117f3565b5b9050919050565b5f8054905090565b610940338261186c565b50565b61094b61187b565b61095582826118b2565b5050565b5f818261096585610a11565b1614905092915050565b600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5481565b5f6109a26118c2565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7ff60c99c900000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6002610a5a816118cc565b828290508585905014610a99576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610b55575f848483818110610aba57610ab9612550565b5b9050602002016020810190610acf91906125a7565b90506001151581151503610b1457610b0f878784818110610af357610af2612550565b5b9050602002016020810190610b089190611fd9565b60016118b2565b610b47565b610b46878784818110610b2a57610b29612550565b5b9050602002016020810190610b3f9190611fd9565b600161186c565b5b508080600101915050610a9b565b505050505050565b5f610b66611901565b90508054600382558015610b985760018160011c14303b10610b8f5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610ba991906127f0565b90505f816060015103610be8576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f816060015190505f610c1d30845f015173ffffffffffffffffffffffffffffffffffffffff1661192a90919063ffffffff16565b905081811015610c6b57825f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610c629392919061281c565b60405180910390fd5b5f8360c001519050835f015160065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360200151600a5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083604001515f8190555083606001516008819055508360a00151600b819055508060035f820151815f015f6101000a81548160ff02191690836001811115610d4557610d4461228f565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610dc73361195d565b610dd684608001516001611a33565b836020015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff167fdc505a50c6f2c816d981a377c8177e2604d8302821a502bc9f742e0748f338428660400151876060015188608001518960a001518a60c00151604051610e56959493929190612851565b60405180910390a3505050508015610e97576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610ea9816118cc565b5f8585810190610eb991906129bc565b90505f8160200151806020019051810190610ed49190612a17565b90508060085f828254610ee79190612a6f565b92505081905550610f3d825f01518260065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a749092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610fb193929190612b07565b604051602081830303815290604052604051610fcd919061226f565b60405180910390a28060065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b61100e61187b565b611018828261186c565b5050565b60605f838381019061102e91906127f0565b90505f816060015190506040518060800160405280600160028111156110575761105661228f565b5b8152602001835f015173ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff1681526020016040518060200160405280848152506040516020016110b69190612b6c565b6040516020818303038152906040528152506040516020016110d89190612c73565b6040516020818303038152906040529250505092915050565b5f80826110fd85610a11565b161415905092915050565b60025481565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61114f61187b565b6111585f611abd565b565b600281565b6003805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b611212611d55565b60036040518060800160405290815f82015f9054906101000a900460ff1660018111156112425761124161228f565b5b60018111156112545761125361228f565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f6112e261187b565b5f83838101906112f29190612d18565b90505f816020015180602001905181019061130d9190612a17565b90505f805f540361132057819050611343565b670de0b6b3a7640000825f546113369190612d5f565b6113409190612dcd565b90505b5f600b54141580156113565750600b5481115b1561136157600b5490505b61136a81611b83565b6113a0576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600854816009546113b19190612dfd565b11156113e9576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060095f8282546113fa9190612dfd565b92505081905550600160075f8282546114139190612dfd565b92505081905550611466878260065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a749092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689846040516020016114d493929190612b07565b6040516020818303038152906040526040516114f0919061226f565b60405180910390a2600193505050509392505050565b6002611511816118cc565b828290508585905014611550576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156115b4576115a786868381811061157357611572612550565b5b90506020020160208101906115889190611fd9565b85858481811061159b5761159a612550565b5b905060200201356118b2565b8080600101915050611552565b505050505050565b5f600b54905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b60095481565b5f805f84848101906115fa9190612d18565b90505f81602001518060200190518101906116159190612a17565b90505f8054036116275780925061164a565b670de0b6b3a7640000815f5461163d9190612d5f565b6116479190612dcd565b92505b61165383611b83565b93505050509392505050565b600261166a816118cc565b8282905085859050146116a9576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561170d576117008686838181106116cc576116cb612550565b5b90506020020160208101906116e19190611fd9565b8585848181106116f4576116f3612550565b5b9050602002013561186c565b80806001019150506116ab565b505050505050565b60075481565b600181565b61172861187b565b63389a75e1600c52805f526020600c20805442111561174e57636f5e88185f526004601cfd5b5f81555061175b81611abd565b50565b61176661187b565b8060601b61177b57637448fbae5f526004601cfd5b61178481611abd565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166117a76111b4565b73ffffffffffffffffffffffffffffffffffffffff1614806117d357506117d28260026001176110f1565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f56586338000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611865575061186482611b9e565b5b9050919050565b61187782825f611c17565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146118b0576382b429005f526004601cfd5b565b6118be82826001611c17565b5050565b5f6202a300905090565b638b78c6d8195433146118fe57638b78c6d8600c52335f52806020600c2054166118fd576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b611965611c6f565b156119dd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561199f57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611a30565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611ab4576390b8ec185f526004601cfd5b5f603452505050565b611ac5611c6f565b15611b2a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611b80565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60085482600954611b959190612dfd565b11159050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611c105750611c0f82611c73565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611c3957848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611ce55750611ce482611cec565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611d7357611d7261228f565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611dec81611db8565b8114611df6575f80fd5b50565b5f81359050611e0781611de3565b92915050565b5f60208284031215611e2257611e21611db0565b5b5f611e2f84828501611df9565b91505092915050565b5f8115159050919050565b611e4c81611e38565b82525050565b5f602082019050611e655f830184611e43565b92915050565b5f819050919050565b611e7d81611e6b565b82525050565b5f602082019050611e965f830184611e74565b92915050565b611ea581611e6b565b8114611eaf575f80fd5b50565b5f81359050611ec081611e9c565b92915050565b5f60208284031215611edb57611eda611db0565b5b5f611ee884828501611eb2565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611f1a82611ef1565b9050919050565b611f2a81611f10565b8114611f34575f80fd5b50565b5f81359050611f4581611f21565b92915050565b5f8060408385031215611f6157611f60611db0565b5b5f611f6e85828601611f37565b9250506020611f7f85828601611eb2565b9150509250929050565b611f9281611f10565b82525050565b5f602082019050611fab5f830184611f89565b92915050565b611fba81611db8565b82525050565b5f602082019050611fd35f830184611fb1565b92915050565b5f60208284031215611fee57611fed611db0565b5b5f611ffb84828501611f37565b91505092915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261202557612024612004565b5b8235905067ffffffffffffffff81111561204257612041612008565b5b60208301915083602082028301111561205e5761205d61200c565b5b9250929050565b5f8083601f84011261207a57612079612004565b5b8235905067ffffffffffffffff81111561209757612096612008565b5b6020830191508360208202830111156120b3576120b261200c565b5b9250929050565b5f805f80604085870312156120d2576120d1611db0565b5b5f85013567ffffffffffffffff8111156120ef576120ee611db4565b5b6120fb87828801612010565b9450945050602085013567ffffffffffffffff81111561211e5761211d611db4565b5b61212a87828801612065565b925092505092959194509250565b5f8083601f84011261214d5761214c612004565b5b8235905067ffffffffffffffff81111561216a57612169612008565b5b6020830191508360018202830111156121865761218561200c565b5b9250929050565b5f80602083850312156121a3576121a2611db0565b5b5f83013567ffffffffffffffff8111156121c0576121bf611db4565b5b6121cc85828601612138565b92509250509250929050565b5f6040820190506121eb5f830185611e74565b6121f86020830184611f89565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f612241826121ff565b61224b8185612209565b935061225b818560208601612219565b61226481612227565b840191505092915050565b5f6020820190508181035f8301526122878184612237565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b600281106122cd576122cc61228f565b5b50565b5f8190506122dd826122bc565b919050565b5f6122ec826122d0565b9050919050565b6122fc816122e2565b82525050565b5f819050919050565b61231481612302565b82525050565b5f60ff82169050919050565b61232f8161231a565b82525050565b5f6080820190506123485f8301876122f3565b612355602083018661230b565b6123626040830185612326565b61236f6060830184611f89565b95945050505050565b612381816122e2565b82525050565b61239081612302565b82525050565b61239f8161231a565b82525050565b6123ae81611f10565b82525050565b608082015f8201516123c85f850182612378565b5060208201516123db6020850182612387565b5060408201516123ee6040850182612396565b50606082015161240160608501826123a5565b50505050565b5f60808201905061241a5f8301846123b4565b92915050565b5f805f6040848603121561243757612436611db0565b5b5f61244486828701611f37565b935050602084013567ffffffffffffffff81111561246557612464611db4565b5b61247186828701612138565b92509250509250925092565b5f8083601f84011261249257612491612004565b5b8235905067ffffffffffffffff8111156124af576124ae612008565b5b6020830191508360208202830111156124cb576124ca61200c565b5b9250929050565b5f805f80604085870312156124ea576124e9611db0565b5b5f85013567ffffffffffffffff81111561250757612506611db4565b5b61251387828801612010565b9450945050602085013567ffffffffffffffff81111561253657612535611db4565b5b6125428782880161247d565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61258681611e38565b8114612590575f80fd5b50565b5f813590506125a18161257d565b92915050565b5f602082840312156125bc576125bb611db0565b5b5f6125c984828501612593565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61260c82612227565b810181811067ffffffffffffffff8211171561262b5761262a6125d6565b5b80604052505050565b5f61263d611da7565b90506126498282612603565b919050565b5f80fd5b6002811061265e575f80fd5b50565b5f8135905061266f81612652565b92915050565b61267e81612302565b8114612688575f80fd5b50565b5f8135905061269981612675565b92915050565b6126a88161231a565b81146126b2575f80fd5b50565b5f813590506126c38161269f565b92915050565b5f608082840312156126de576126dd6125d2565b5b6126e86080612634565b90505f6126f784828501612661565b5f83015250602061270a8482850161268b565b602083015250604061271e848285016126b5565b604083015250606061273284828501611f37565b60608301525092915050565b5f6101408284031215612754576127536125d2565b5b61275e60e0612634565b90505f61276d84828501611f37565b5f83015250602061278084828501611f37565b602083015250604061279484828501611eb2565b60408301525060606127a884828501611eb2565b60608301525060806127bc84828501611f37565b60808301525060a06127d084828501611eb2565b60a08301525060c06127e4848285016126c9565b60c08301525092915050565b5f610140828403121561280657612805611db0565b5b5f6128138482850161273e565b91505092915050565b5f60608201905061282f5f830186611f89565b61283c6020830185611e74565b6128496040830184611e74565b949350505050565b5f610100820190506128655f830188611e74565b6128726020830187611e74565b61287f6040830186611f89565b61288c6060830185611e74565b61289960808301846123b4565b9695505050505050565b5f80fd5b5f67ffffffffffffffff8211156128c1576128c06125d6565b5b6128ca82612227565b9050602081019050919050565b828183375f83830152505050565b5f6128f76128f2846128a7565b612634565b905082815260208101848484011115612913576129126128a3565b5b61291e8482856128d7565b509392505050565b5f82601f83011261293a57612939612004565b5b813561294a8482602086016128e5565b91505092915050565b5f60408284031215612968576129676125d2565b5b6129726040612634565b90505f61298184828501611f37565b5f83015250602082013567ffffffffffffffff8111156129a4576129a361264e565b5b6129b084828501612926565b60208301525092915050565b5f602082840312156129d1576129d0611db0565b5b5f82013567ffffffffffffffff8111156129ee576129ed611db4565b5b6129fa84828501612953565b91505092915050565b5f81519050612a1181611e9c565b92915050565b5f60208284031215612a2c57612a2b611db0565b5b5f612a3984828501612a03565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612a7982611e6b565b9150612a8483611e6b565b9250828203905081811115612a9c57612a9b612a42565b5b92915050565b5f8160601b9050919050565b5f612ab882612aa2565b9050919050565b5f612ac982612aae565b9050919050565b612ae1612adc82611f10565b612abf565b82525050565b5f819050919050565b612b01612afc82611e6b565b612ae7565b82525050565b5f612b128286612ad0565b601482019150612b228285612ad0565b601482019150612b328284612af0565b602082019150819050949350505050565b612b4c81611e6b565b82525050565b602082015f820151612b665f850182612b43565b50505050565b5f602082019050612b7f5f830184612b52565b92915050565b60038110612b9657612b9561228f565b5b50565b5f819050612ba682612b85565b919050565b5f612bb582612b99565b9050919050565b612bc581612bab565b82525050565b5f82825260208201905092915050565b5f612be5826121ff565b612bef8185612bcb565b9350612bff818560208601612219565b612c0881612227565b840191505092915050565b5f608083015f830151612c285f860182612bbc565b506020830151612c3b60208601826123a5565b506040830151612c4e60408601826123a5565b5060608301518482036060860152612c668282612bdb565b9150508091505092915050565b5f6020820190508181035f830152612c8b8184612c13565b905092915050565b5f60408284031215612ca857612ca76125d2565b5b612cb26040612634565b90505f82013567ffffffffffffffff811115612cd157612cd061264e565b5b612cdd84828501612926565b5f83015250602082013567ffffffffffffffff811115612d0057612cff61264e565b5b612d0c84828501612926565b60208301525092915050565b5f60208284031215612d2d57612d2c611db0565b5b5f82013567ffffffffffffffff811115612d4a57612d49611db4565b5b612d5684828501612c93565b91505092915050565b5f612d6982611e6b565b9150612d7483611e6b565b9250828202612d8281611e6b565b91508282048414831517612d9957612d98612a42565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612dd782611e6b565b9150612de283611e6b565b925082612df257612df1612da0565b5b828204905092915050565b5f612e0782611e6b565b9150612e1283611e6b565b9250828201905080821115612e2a57612e29612a42565b5b9291505056fea264697066735822122050bb6a176feb20b04fcded40293358e8fdba927c1e1bf68a160c7fa7cac6b41664736f6c634300081a0033", g = class g extends R {
|
|
396
|
-
constructor() {
|
|
397
|
-
super(...arguments), this.abi = C;
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* The owner of the incentive
|
|
401
|
-
*
|
|
402
|
-
* @public
|
|
403
|
-
* @async
|
|
404
|
-
* @param {?ReadParams} [params]
|
|
405
|
-
* @returns {Promise<Address>}
|
|
406
|
-
*/
|
|
407
|
-
async owner(f) {
|
|
408
|
-
return await W(this._config, {
|
|
409
|
-
address: this.assertValidAddress(),
|
|
410
|
-
args: [],
|
|
411
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
412
|
-
...f
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* 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)`
|
|
417
|
-
*
|
|
418
|
-
* @public
|
|
419
|
-
* @async
|
|
420
|
-
* @param {?ReadParams} [params]
|
|
421
|
-
* @returns {Promise<bigint>} - The current reward
|
|
422
|
-
*/
|
|
423
|
-
async currentReward(f) {
|
|
424
|
-
return await Y(
|
|
425
|
-
this._config,
|
|
426
|
-
{
|
|
427
|
-
address: this.assertValidAddress(),
|
|
428
|
-
args: [],
|
|
429
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
430
|
-
...f
|
|
431
|
-
}
|
|
432
|
-
);
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* Retrieves the maximum reward amount per claim.
|
|
436
|
-
*
|
|
437
|
-
* @public
|
|
438
|
-
* @async
|
|
439
|
-
* @param {?ReadParams} [params]
|
|
440
|
-
* @returns {Promise<bigint>} The maximum reward amount per claim
|
|
441
|
-
*/
|
|
442
|
-
async getMaxReward(f) {
|
|
443
|
-
return await J(this._config, {
|
|
444
|
-
...f,
|
|
445
|
-
address: this.assertValidAddress()
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Fetches the incentive scalar from a transaction hash
|
|
450
|
-
*
|
|
451
|
-
* @param {GetIncentiveScalarParams} params
|
|
452
|
-
* @param {?ReadParams} [params]
|
|
453
|
-
* @returns {Promise<bigint>}
|
|
454
|
-
* @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}
|
|
455
|
-
*/
|
|
456
|
-
async getIncentiveScalar({ chainId: f, hash: b, knownSignatures: a }, e) {
|
|
457
|
-
var c;
|
|
458
|
-
const d = await this.getIncentiveCriteria(e);
|
|
459
|
-
if (d.criteriaType === V.EVENT) {
|
|
460
|
-
const t = await g0(this._config, {
|
|
461
|
-
chainId: f,
|
|
462
|
-
hash: b
|
|
463
|
-
});
|
|
464
|
-
if (d.fieldIndex === P0.GAS_REBATE_INCENTIVE)
|
|
465
|
-
return t.gasUsed * t.effectiveGasPrice + // Normal gas cost
|
|
466
|
-
(t.blobGasUsed ?? 0n) * (t.blobGasPrice ?? 0n);
|
|
467
|
-
const n = t.logs;
|
|
468
|
-
if (n.length === 0)
|
|
469
|
-
throw new I(
|
|
470
|
-
`No logs found for event signature ${d.signature}`
|
|
471
|
-
);
|
|
472
|
-
try {
|
|
473
|
-
const l = a[d.signature], s = _0({
|
|
474
|
-
abi: [l],
|
|
475
|
-
logs: n
|
|
476
|
-
});
|
|
477
|
-
if (s == null || s.length === 0)
|
|
478
|
-
throw new I(
|
|
479
|
-
`No logs found for event signature ${d.signature}`
|
|
480
|
-
);
|
|
481
|
-
const p = ((c = s[0]) == null ? void 0 : c.args)[d.fieldIndex];
|
|
482
|
-
if (p === void 0)
|
|
483
|
-
throw new u(
|
|
484
|
-
`Decoded argument at index ${d.fieldIndex} is undefined`
|
|
485
|
-
);
|
|
486
|
-
return BigInt(p);
|
|
487
|
-
} catch (l) {
|
|
488
|
-
throw new u(
|
|
489
|
-
`Failed to decode event log for signature ${d.signature}: ${l.message}`
|
|
490
|
-
);
|
|
491
|
-
}
|
|
492
|
-
} else if (d.criteriaType === V.FUNC) {
|
|
493
|
-
const t = await y0(this._config, {
|
|
494
|
-
chainId: f,
|
|
495
|
-
hash: b
|
|
496
|
-
});
|
|
497
|
-
try {
|
|
498
|
-
const n = a[d.signature], s = D0({
|
|
499
|
-
abi: [n],
|
|
500
|
-
data: t.input
|
|
501
|
-
}).args[d.fieldIndex];
|
|
502
|
-
if (s == null)
|
|
503
|
-
throw new u(
|
|
504
|
-
`Decoded argument at index ${d.fieldIndex} is undefined`
|
|
505
|
-
);
|
|
506
|
-
return BigInt(s);
|
|
507
|
-
} catch (n) {
|
|
508
|
-
throw new u(
|
|
509
|
-
`Failed to decode function data for signature ${d.signature}: ${n.message}`
|
|
510
|
-
);
|
|
511
|
-
}
|
|
512
|
-
} else
|
|
513
|
-
throw new p0(
|
|
514
|
-
`Invalid criteria type ${d.criteriaType}`
|
|
515
|
-
);
|
|
516
|
-
}
|
|
517
|
-
/**
|
|
518
|
-
* The number of claims that have been made
|
|
519
|
-
*
|
|
520
|
-
* @public
|
|
521
|
-
* @async
|
|
522
|
-
* @param {?ReadParams} [params]
|
|
523
|
-
* @returns {Promise<bigint>}
|
|
524
|
-
*/
|
|
525
|
-
async claims(f) {
|
|
526
|
-
return await X(this._config, {
|
|
527
|
-
address: this.assertValidAddress(),
|
|
528
|
-
args: [],
|
|
529
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
530
|
-
...f
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* The total amount of rewards claimed
|
|
535
|
-
*
|
|
536
|
-
* @public
|
|
537
|
-
* @async
|
|
538
|
-
* @param {?ReadParams} [params]
|
|
539
|
-
* @returns {Promise<bigint>}
|
|
540
|
-
*/
|
|
541
|
-
async totalClaimed(f) {
|
|
542
|
-
return await Z(
|
|
543
|
-
this._config,
|
|
544
|
-
{
|
|
545
|
-
address: this.assertValidAddress(),
|
|
546
|
-
args: [],
|
|
547
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
548
|
-
...f
|
|
549
|
-
}
|
|
550
|
-
);
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
553
|
-
* A mapping of address to claim status
|
|
554
|
-
*
|
|
555
|
-
* @public
|
|
556
|
-
* @async
|
|
557
|
-
* @param {Address} address
|
|
558
|
-
* @param {?ReadParams} [params]
|
|
559
|
-
* @returns {Promise<boolean>}
|
|
560
|
-
*/
|
|
561
|
-
async claimed(f, b) {
|
|
562
|
-
return await z(this._config, {
|
|
563
|
-
address: this.assertValidAddress(),
|
|
564
|
-
args: [f],
|
|
565
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
566
|
-
...b
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* The address of the ERC20-like token
|
|
571
|
-
*
|
|
572
|
-
* @public
|
|
573
|
-
* @async
|
|
574
|
-
* @param {?ReadParams} [params]
|
|
575
|
-
* @returns {Promise<Address>}
|
|
576
|
-
*/
|
|
577
|
-
async asset(f) {
|
|
578
|
-
return await H(this._config, {
|
|
579
|
-
address: this.assertValidAddress(),
|
|
580
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
581
|
-
...f
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* The address of the pegged ERC20-like token
|
|
586
|
-
*
|
|
587
|
-
* @public
|
|
588
|
-
* @async
|
|
589
|
-
* @param {?ReadParams} [params]
|
|
590
|
-
* @returns {Promise<Address>}
|
|
591
|
-
*/
|
|
592
|
-
async peg(f) {
|
|
593
|
-
return await K(this._config, {
|
|
594
|
-
address: this.assertValidAddress(),
|
|
595
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
596
|
-
...f
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* The reward amount issued for each claim
|
|
601
|
-
*
|
|
602
|
-
* @public
|
|
603
|
-
* @async
|
|
604
|
-
* @param {?ReadParams} [params]
|
|
605
|
-
* @returns {Promise<bigint>}
|
|
606
|
-
*/
|
|
607
|
-
async reward(f) {
|
|
608
|
-
return await O(this._config, {
|
|
609
|
-
address: this.assertValidAddress(),
|
|
610
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
611
|
-
...f
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* The limit (max possible rewards payout in reward token)
|
|
616
|
-
*
|
|
617
|
-
* @public
|
|
618
|
-
* @async
|
|
619
|
-
* @param {?ReadParams} [params]
|
|
620
|
-
* @returns {Promise<bigint>}
|
|
621
|
-
*/
|
|
622
|
-
async limit(f) {
|
|
623
|
-
return await Q(this._config, {
|
|
624
|
-
address: this.assertValidAddress(),
|
|
625
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
626
|
-
...f
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* Claim the incentive
|
|
631
|
-
*
|
|
632
|
-
* @public
|
|
633
|
-
* @async
|
|
634
|
-
* @param {ClaimPayload} payload
|
|
635
|
-
* @param {?WriteParams} [params]
|
|
636
|
-
* @returns {Promise<boolean>} - Returns true if successfully claimed
|
|
637
|
-
*/
|
|
638
|
-
async claim(f, b) {
|
|
639
|
-
return await this.awaitResult(this.claimRaw(f, b));
|
|
640
|
-
}
|
|
641
|
-
/**
|
|
642
|
-
* Claim the incentive
|
|
643
|
-
*
|
|
644
|
-
* @public
|
|
645
|
-
* @async
|
|
646
|
-
* @param {ClaimPayload} payload
|
|
647
|
-
* @param {?WriteParams} [params]
|
|
648
|
-
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
|
|
649
|
-
*/
|
|
650
|
-
async claimRaw(f, b) {
|
|
651
|
-
const { request: a, result: e } = await f0(this._config, {
|
|
652
|
-
address: this.assertValidAddress(),
|
|
653
|
-
args: [m(f)],
|
|
654
|
-
...this.optionallyAttachAccount(),
|
|
655
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
656
|
-
...b
|
|
657
|
-
});
|
|
658
|
-
return { hash: await b0(
|
|
659
|
-
this._config,
|
|
660
|
-
a
|
|
661
|
-
), result: e };
|
|
662
|
-
}
|
|
663
|
-
/**
|
|
664
|
-
* Clawback assets from the incentive
|
|
665
|
-
*
|
|
666
|
-
* @public
|
|
667
|
-
* @async
|
|
668
|
-
* @param {ClaimPayload} payload
|
|
669
|
-
* @param {?WriteParams} [params]
|
|
670
|
-
* @returns {Promise<boolean>} - True if the assets were successfully clawbacked
|
|
671
|
-
*/
|
|
672
|
-
async clawback(f, b) {
|
|
673
|
-
return await this.awaitResult(this.clawbackRaw(f, b));
|
|
674
|
-
}
|
|
675
|
-
/**
|
|
676
|
-
* Clawback assets from the incentive
|
|
677
|
-
*
|
|
678
|
-
* @public
|
|
679
|
-
* @async
|
|
680
|
-
* @param {ClaimPayload} payload
|
|
681
|
-
* @param {?WriteParams} [params]
|
|
682
|
-
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
|
|
683
|
-
*/
|
|
684
|
-
async clawbackRaw(f, b) {
|
|
685
|
-
const { request: a, result: e } = await a0(this._config, {
|
|
686
|
-
address: this.assertValidAddress(),
|
|
687
|
-
args: [m(f)],
|
|
688
|
-
...this.optionallyAttachAccount(),
|
|
689
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
690
|
-
...b
|
|
691
|
-
});
|
|
692
|
-
return { hash: await e0(
|
|
693
|
-
this._config,
|
|
694
|
-
a
|
|
695
|
-
), result: e };
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Check if an incentive is claimable.
|
|
699
|
-
*
|
|
700
|
-
* @public
|
|
701
|
-
* @async
|
|
702
|
-
* @param {ClaimPayload} payload
|
|
703
|
-
* @param {?ReadParams} [params]
|
|
704
|
-
* @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
|
|
705
|
-
*/
|
|
706
|
-
async isClaimable(f, b) {
|
|
707
|
-
return await d0(
|
|
708
|
-
this._config,
|
|
709
|
-
{
|
|
710
|
-
address: this.assertValidAddress(),
|
|
711
|
-
args: [f.target, f.data],
|
|
712
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
713
|
-
...b
|
|
714
|
-
}
|
|
715
|
-
);
|
|
716
|
-
}
|
|
717
|
-
/**
|
|
718
|
-
* read the peg token for the incentive.
|
|
719
|
-
*
|
|
720
|
-
* @public
|
|
721
|
-
* @async
|
|
722
|
-
* @param {?ReadParams} [params]
|
|
723
|
-
* @returns {Promise<Address>} = The address of the token the reward is pegged to
|
|
724
|
-
*/
|
|
725
|
-
async getPeg(f) {
|
|
726
|
-
return await c0(this._config, {
|
|
727
|
-
address: this.assertValidAddress(),
|
|
728
|
-
args: [],
|
|
729
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
730
|
-
...f
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
/**
|
|
734
|
-
* Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`
|
|
735
|
-
*
|
|
736
|
-
* @public
|
|
737
|
-
* @async
|
|
738
|
-
* @param {?ReadParams} [params]
|
|
739
|
-
* @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.
|
|
740
|
-
*/
|
|
741
|
-
async getTotalBudget(f) {
|
|
742
|
-
return await this.limit(f);
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
746
|
-
*
|
|
747
|
-
* @public
|
|
748
|
-
* @async
|
|
749
|
-
* @param {?ReadParams} [params]
|
|
750
|
-
* @returns {Promise<boolean>} - True if total claims is less than limit
|
|
751
|
-
*/
|
|
752
|
-
async canBeClaimed(f) {
|
|
753
|
-
return await this.getRemainingClaimPotential(f) > 0n;
|
|
754
|
-
}
|
|
755
|
-
/**
|
|
756
|
-
* Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
757
|
-
*
|
|
758
|
-
* @public
|
|
759
|
-
* @async
|
|
760
|
-
* @param {?ReadParams} [params]
|
|
761
|
-
* @returns {Promise<bigint>} - True if total claims is less than limit
|
|
762
|
-
*/
|
|
763
|
-
async getRemainingClaimPotential(f) {
|
|
764
|
-
const [b, a] = await Promise.all([
|
|
765
|
-
this.totalClaimed(f),
|
|
766
|
-
this.limit(f)
|
|
767
|
-
]);
|
|
768
|
-
return a - b;
|
|
769
|
-
}
|
|
770
|
-
/**
|
|
771
|
-
*Functions from the ERC20VariableIncentive contract
|
|
772
|
-
*/
|
|
773
|
-
/**
|
|
774
|
-
* Fetches the IncentiveCriteria struct from the contract
|
|
775
|
-
*
|
|
776
|
-
* @param {?ReadParams} [params]
|
|
777
|
-
* @returns {Promise<IncentiveCriteria>} Incentive criteria structure
|
|
778
|
-
* @throws {IncentiveCriteriaNotFoundError}
|
|
779
|
-
*/
|
|
780
|
-
async getIncentiveCriteria(f) {
|
|
781
|
-
try {
|
|
782
|
-
return await t0(
|
|
783
|
-
this._config,
|
|
784
|
-
{
|
|
785
|
-
...f,
|
|
786
|
-
address: this.assertValidAddress()
|
|
787
|
-
}
|
|
788
|
-
);
|
|
789
|
-
} catch (b) {
|
|
790
|
-
throw new A0(b);
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
* @inheritdoc
|
|
795
|
-
*
|
|
796
|
-
* @public
|
|
797
|
-
* @param {?ERC20PeggedVariableCriteriaIncentivePayload} [_payload]
|
|
798
|
-
* @param {?DeployableOptions} [_options]
|
|
799
|
-
* @returns {GenericDeployableParams}
|
|
800
|
-
*/
|
|
801
|
-
buildParameters(f, b) {
|
|
802
|
-
const [a, e] = this.validateDeploymentConfig(
|
|
803
|
-
f,
|
|
804
|
-
b
|
|
805
|
-
);
|
|
806
|
-
return {
|
|
807
|
-
abi: C,
|
|
808
|
-
bytecode: k0,
|
|
809
|
-
args: [F0(a)],
|
|
810
|
-
...this.optionallyAttachAccount(e.account)
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
|
-
/**
|
|
814
|
-
* Encodes an amount to clawback from the incentive
|
|
815
|
-
*
|
|
816
|
-
* @public
|
|
817
|
-
* @param {bigint} amount - How much of the asset to clawback
|
|
818
|
-
* @returns {Hex} - Returns an encoded uint256
|
|
819
|
-
*/
|
|
820
|
-
buildClawbackData(f) {
|
|
821
|
-
return o([{ type: "uint256" }], [f]);
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
|
|
825
|
-
*
|
|
826
|
-
* @public
|
|
827
|
-
* @param {bigint} signedAmount
|
|
828
|
-
* @returns {Hash} Returns the encoded claim data
|
|
829
|
-
* @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
|
|
830
|
-
*/
|
|
831
|
-
buildClaimData(f) {
|
|
832
|
-
return o(
|
|
833
|
-
[{ type: "uint256", name: "signedAmount" }],
|
|
834
|
-
[f]
|
|
835
|
-
);
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.
|
|
839
|
-
* Useful when deriving amount claimed from logs.
|
|
840
|
-
*
|
|
841
|
-
* @public
|
|
842
|
-
* @param {Hex} claimData
|
|
843
|
-
* @returns {BigInt} Returns the reward amount from a claim data payload
|
|
844
|
-
*/
|
|
845
|
-
async decodeClaimData(f) {
|
|
846
|
-
const b = r(
|
|
847
|
-
[
|
|
848
|
-
{
|
|
849
|
-
type: "tuple",
|
|
850
|
-
name: "BoostClaimData",
|
|
851
|
-
components: [
|
|
852
|
-
{ type: "bytes", name: "validatorData" },
|
|
853
|
-
{ type: "bytes", name: "incentiveData" }
|
|
854
|
-
]
|
|
855
|
-
}
|
|
856
|
-
],
|
|
857
|
-
f
|
|
858
|
-
), a = r(
|
|
859
|
-
[{ type: "uint256" }],
|
|
860
|
-
b[0].incentiveData
|
|
861
|
-
)[0];
|
|
862
|
-
let e = a;
|
|
863
|
-
const [d, c] = await Promise.all([
|
|
864
|
-
this.reward(),
|
|
865
|
-
this.getMaxReward()
|
|
866
|
-
]);
|
|
867
|
-
return d === 0n || (e = d * a / v("1"), c !== 0n && e > c && (e = c)), e;
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.
|
|
871
|
-
* Useful when deriving amount claimed from logs.
|
|
872
|
-
* Use this function instead of `decodeClaimData` if you have reward details.
|
|
873
|
-
*
|
|
874
|
-
* @public
|
|
875
|
-
* @param {Hex} claimData
|
|
876
|
-
* @param {bigint} [reward]
|
|
877
|
-
* @param {bigint} [maxReward]
|
|
878
|
-
* @returns {BigInt} Returns the reward amount from a claim data payload
|
|
879
|
-
*/
|
|
880
|
-
decodeClaimDataWithRewardDetails(f, b, a) {
|
|
881
|
-
const e = r(
|
|
882
|
-
[
|
|
883
|
-
{
|
|
884
|
-
type: "tuple",
|
|
885
|
-
name: "BoostClaimData",
|
|
886
|
-
components: [
|
|
887
|
-
{ type: "bytes", name: "validatorData" },
|
|
888
|
-
{ type: "bytes", name: "incentiveData" }
|
|
889
|
-
]
|
|
890
|
-
}
|
|
891
|
-
],
|
|
892
|
-
f
|
|
893
|
-
), d = r(
|
|
894
|
-
[{ type: "uint256" }],
|
|
895
|
-
e[0].incentiveData
|
|
896
|
-
)[0];
|
|
897
|
-
let c = d;
|
|
898
|
-
return b === 0n || (c = b * d / v("1"), a !== 0n && c > a && (c = a)), c;
|
|
899
|
-
}
|
|
900
|
-
};
|
|
901
|
-
g.bases = {
|
|
902
|
-
31337: void 0,
|
|
903
|
-
...E0
|
|
904
|
-
}, g.registryType = E.INCENTIVE;
|
|
905
|
-
let w = g;
|
|
906
|
-
function F0({
|
|
907
|
-
asset: i,
|
|
908
|
-
peg: f,
|
|
909
|
-
reward: b,
|
|
910
|
-
limit: a,
|
|
911
|
-
maxReward: e = 0n,
|
|
912
|
-
manager: d = D,
|
|
913
|
-
criteria: c
|
|
914
|
-
}) {
|
|
915
|
-
return o(
|
|
916
|
-
[
|
|
917
|
-
{
|
|
918
|
-
type: "tuple",
|
|
919
|
-
name: "initPayloadExtended",
|
|
920
|
-
components: [
|
|
921
|
-
{ type: "address", name: "asset" },
|
|
922
|
-
{ type: "address", name: "peg" },
|
|
923
|
-
{ type: "uint256", name: "reward" },
|
|
924
|
-
{ type: "uint256", name: "limit" },
|
|
925
|
-
{ type: "address", name: "manager" },
|
|
926
|
-
{ type: "uint256", name: "maxReward" },
|
|
927
|
-
{
|
|
928
|
-
type: "tuple",
|
|
929
|
-
name: "criteria",
|
|
930
|
-
components: [
|
|
931
|
-
{ type: "uint8", name: "criteriaType" },
|
|
932
|
-
{ type: "bytes32", name: "signature" },
|
|
933
|
-
{ type: "uint8", name: "fieldIndex" },
|
|
934
|
-
{ type: "address", name: "targetContract" }
|
|
935
|
-
]
|
|
936
|
-
}
|
|
937
|
-
]
|
|
938
|
-
}
|
|
939
|
-
],
|
|
940
|
-
[
|
|
941
|
-
{
|
|
942
|
-
asset: i,
|
|
943
|
-
peg: f,
|
|
944
|
-
reward: b,
|
|
945
|
-
limit: a,
|
|
946
|
-
manager: d,
|
|
947
|
-
maxReward: e,
|
|
948
|
-
criteria: {
|
|
949
|
-
criteriaType: c.criteriaType,
|
|
950
|
-
signature: c.signature,
|
|
951
|
-
fieldIndex: c.fieldIndex,
|
|
952
|
-
targetContract: c.targetContract
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
]
|
|
956
|
-
);
|
|
957
|
-
}
|
|
958
|
-
const _ = {
|
|
959
|
-
[i0]: N0,
|
|
960
|
-
[n0]: V0,
|
|
961
|
-
[r0]: w,
|
|
962
|
-
[o0]: y,
|
|
963
|
-
[l0]: I0,
|
|
964
|
-
// [AERC1155Incentive as Hex]: ERC1155Incentive,
|
|
965
|
-
[u0]: v0,
|
|
966
|
-
[m0]: x0,
|
|
967
|
-
[h0]: T0
|
|
968
|
-
};
|
|
969
|
-
async function Q0(i, f, b) {
|
|
970
|
-
const a = await w0(i.config, {
|
|
971
|
-
abi: s0,
|
|
972
|
-
functionName: "getComponentInterface",
|
|
973
|
-
address: f,
|
|
974
|
-
...b
|
|
975
|
-
}), e = _[a];
|
|
976
|
-
if (!e)
|
|
977
|
-
throw new C0(
|
|
978
|
-
Object.keys(_),
|
|
979
|
-
a
|
|
980
|
-
);
|
|
981
|
-
return new e(i, f);
|
|
982
|
-
}
|
|
983
|
-
export {
|
|
984
|
-
y as E,
|
|
985
|
-
_ as I,
|
|
986
|
-
w as a,
|
|
987
|
-
F0 as b,
|
|
988
|
-
Q0 as i,
|
|
989
|
-
B0 as p
|
|
990
|
-
};
|
|
991
|
-
//# sourceMappingURL=Incentive-qlnv5kQB.js.map
|