@boostxyz/sdk 6.1.2 → 7.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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 +10 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +84 -83
- 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.js +14 -14
- 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.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +1894 -267
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +808 -497
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +47 -47
- package/dist/Budget-B_kgJGDu.cjs +2 -0
- package/dist/Budget-B_kgJGDu.cjs.map +1 -0
- package/dist/Budget-Bvi5Qjqp.js +1124 -0
- package/dist/Budget-Bvi5Qjqp.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 +9 -6
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +4 -0
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +25 -25
- package/dist/Budgets/ManagedBudgetWithFees.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -1
- package/dist/Budgets/TransparentBudget.d.ts +944 -0
- package/dist/Budgets/TransparentBudget.d.ts.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +4 -0
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +1 -1
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js.map +1 -1
- 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 +19 -19
- package/dist/Incentive-CLKutfnD.js +445 -0
- package/dist/Incentive-CLKutfnD.js.map +1 -0
- package/dist/Incentive-CLSVNxDz.cjs +2 -0
- package/dist/Incentive-CLSVNxDz.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +9 -9
- 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.js +5 -5
- 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 +17 -17
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedIncentive.d.ts +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/{ERC20PeggedVariableCriteriaIncentive.d.ts → ERC20PeggedVariableCriteriaIncentiveV2.d.ts} +39 -27
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +625 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/{ERC20VariableCriteriaIncentive.d.ts → ERC20VariableCriteriaIncentiveV2.d.ts} +42 -13
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +242 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +3 -3
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +22 -22
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +8 -8
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +13 -12
- package/dist/Incentives/Incentive.js.map +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.js +13 -13
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-C1C_BHkY.js +133 -0
- package/dist/{SimpleDenyList-BKfPoTo1.js.map → SimpleDenyList-C1C_BHkY.js.map} +1 -1
- package/dist/SimpleDenyList-CWthbyj7.cjs +2 -0
- package/dist/{SimpleDenyList-DgjVf7FK.cjs.map → SimpleDenyList-CWthbyj7.cjs.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts.map +1 -1
- package/dist/Validators/LimitedSignerValidator.js +48 -52
- 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.js +54 -54
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/componentInterfaces-BVHB4Fjw.js +21 -0
- package/dist/componentInterfaces-BVHB4Fjw.js.map +1 -0
- package/dist/componentInterfaces-BqhL-meV.cjs +2 -0
- package/dist/componentInterfaces-BqhL-meV.cjs.map +1 -0
- package/dist/deployments-D9QxJGrC.cjs +2 -0
- package/dist/deployments-D9QxJGrC.cjs.map +1 -0
- package/dist/deployments-De8_J7SS.js +120 -0
- package/dist/{deployments-W_LUj833.js.map → deployments-De8_J7SS.js.map} +1 -1
- package/dist/deployments.json +63 -48
- package/dist/{generated-CElkFqkY.js → generated-BJfQ-EBO.js} +1268 -737
- package/dist/generated-BJfQ-EBO.js.map +1 -0
- package/dist/generated-mJJNq-xb.cjs +3 -0
- package/dist/generated-mJJNq-xb.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +162 -158
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +13 -7
- package/src/Actions/EventAction.ts +11 -0
- package/src/BoostCore.test.ts +14 -9
- package/src/BoostCore.ts +428 -26
- package/src/Budgets/Budget.ts +8 -1
- package/src/Budgets/TransparentBudget.test.ts +70 -0
- package/src/Budgets/TransparentBudget.ts +334 -0
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Incentives/ERC20PeggedIncentive.ts +1 -1
- package/src/Incentives/{ERC20PeggedVariableCriteriaIncentive.test.ts → ERC20PeggedVariableCriteriaIncentiveV2.test.ts} +14 -10
- package/src/Incentives/{ERC20PeggedVariableCriteriaIncentive.ts → ERC20PeggedVariableCriteriaIncentiveV2.ts} +122 -100
- package/src/Incentives/{ERC20VariableCriteriaIncentive.test.ts → ERC20VariableCriteriaIncentiveV2.test.ts} +18 -13
- package/src/Incentives/{ERC20VariableCriteriaIncentive.ts → ERC20VariableCriteriaIncentiveV2.ts} +83 -24
- package/src/Incentives/ERC20VariableIncentive.ts +4 -2
- package/src/Incentives/Incentive.ts +12 -12
- package/src/Validators/LimitedSignerValidator.ts +1 -4
- package/src/index.test.ts +2 -2
- package/src/index.ts +3 -2
- package/src/utils.ts +1 -1
- package/dist/Budget-BjfL8dVX.cjs +0 -2
- package/dist/Budget-BjfL8dVX.cjs.map +0 -1
- package/dist/Budget-DD7IPuDx.js +0 -922
- package/dist/Budget-DD7IPuDx.js.map +0 -1
- package/dist/Incentive-V1RjH38L.js +0 -1036
- package/dist/Incentive-V1RjH38L.js.map +0 -1
- package/dist/Incentive-gVTfsnMB.cjs +0 -2
- package/dist/Incentive-gVTfsnMB.cjs.map +0 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +0 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +0 -2
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +0 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +0 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +0 -207
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +0 -1
- package/dist/SimpleDenyList-BKfPoTo1.js +0 -133
- package/dist/SimpleDenyList-DgjVf7FK.cjs +0 -2
- package/dist/componentInterfaces-CA1UIqWL.js +0 -20
- package/dist/componentInterfaces-CA1UIqWL.js.map +0 -1
- package/dist/componentInterfaces-aBgBbB7r.cjs +0 -2
- package/dist/componentInterfaces-aBgBbB7r.cjs.map +0 -1
- package/dist/deployments-CwTZr-cK.cjs +0 -2
- package/dist/deployments-CwTZr-cK.cjs.map +0 -1
- package/dist/deployments-W_LUj833.js +0 -117
- package/dist/generated-BPiHi7W2.cjs +0 -3
- package/dist/generated-BPiHi7W2.cjs.map +0 -1
- package/dist/generated-CElkFqkY.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { encodeAbiParameters as y, zeroAddress as t, zeroHash as
|
|
3
|
-
import { E } from "../deployments-
|
|
4
|
-
import { DeployableTarget as
|
|
1
|
+
import { b as n, aO as g, aP as w, aQ as m, aR as p, aS as A, aT as R, aU as I, aV as V, aW as _, aX as P, aY as C, aZ as T, a_ as O, a$ as N, b0 as D, b1 as L } from "../generated-BJfQ-EBO.js";
|
|
2
|
+
import { encodeAbiParameters as y, zeroAddress as t, zeroHash as k } from "viem";
|
|
3
|
+
import { E as v } from "../deployments-De8_J7SS.js";
|
|
4
|
+
import { DeployableTarget as E } from "../Deployable/DeployableTarget.js";
|
|
5
5
|
import { prepareClaimPayload as o, StrategyType as c } from "../claiming.js";
|
|
6
|
-
import { RegistryType as
|
|
7
|
-
const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b612135806100855f395ff3fe608060405260043610610243575f3560e01c806354d1f13d11610131578063c884ef83116100ac578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b14610677578063fe9fbb801461068a578063fee81cf4146106a9575f80fd5b8063ec87621c14610650578063f04e283e14610664575f80fd5b8063c884ef83146105cf578063db09da12146105fd578063dcc213611461061c578063dcc59b6f1461063b575f80fd5b8063a4d66daf11610101578063b30906d4116100e7578063b30906d414610572578063bb1757cf14610591578063be4994f8146105b0575f80fd5b8063a4d66daf14610537578063a8c62e761461054c575f80fd5b806354d1f13d146104fb578063715018a61461050357806375b238fc1461050b5780638da5cb5b1461051f575f80fd5b80632de94807116101c1578063439fab91116101915780634a4ee7b1116101775780634a4ee7b1146104875780634e7165a21461049a578063514e62fc146104c6575f80fd5b8063439fab911461041f578063474f5a441461043e575f80fd5b80632de948071461035f57806330db555f1461039057806338d52e0f146103af5780634359d28a14610400575f80fd5b80631cd64df411610216578063228cb733116101fc578063228cb73314610309578063256929621461031d57806328d6183b14610325575f80fd5b80631cd64df4146102c05780632275aea9146102f5575f80fd5b806301ffc9a71461024757806307621eca1461027b578063183a4f6e146102985780631c10893f146102ad575b5f80fd5b348015610252575f80fd5b506102666102613660046119da565b6106da565b60405190151581526020015b60405180910390f35b348015610286575f80fd5b505f545b604051908152602001610272565b6102ab6102a6366004611a19565b610735565b005b6102ab6102bb366004611a58565b610742565b3480156102cb575f80fd5b506102666102da366004611a58565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610300575f80fd5b506102ab610758565b348015610314575f80fd5b5061028a5f5481565b6102ab6108d7565b348015610330575f80fd5b506040517f7cc1d5bb000000000000000000000000000000000000000000000000000000008152602001610272565b34801561036a575f80fd5b5061028a610379366004611a80565b638b78c6d8600c9081525f91909152602090205490565b34801561039b575f80fd5b506102ab6103aa366004611a19565b610924565b3480156103ba575f80fd5b506004546103db9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610272565b34801561040b575f80fd5b506102ab61041a366004611ae1565b610a83565b34801561042a575f80fd5b506102ab610439366004611b8b565b610b7d565b348015610449575f80fd5b5061045d610458366004611b8b565b610e4a565b6040805192835273ffffffffffffffffffffffffffffffffffffffff909116602083015201610272565b6102ab610495366004611a58565b61104d565b3480156104a5575f80fd5b506104b96104b4366004611b8b565b61105f565b6040516102729190611bf8565b3480156104d1575f80fd5b506102666104e0366004611a58565b638b78c6d8600c9081525f9290925260209091205416151590565b6102ab61112f565b6102ab611168565b348015610516575f80fd5b5061028a600281565b34801561052a575f80fd5b50638b78c6d819546103db565b348015610542575f80fd5b5061028a60065481565b348015610557575f80fd5b506002546105659060ff1681565b6040516102729190611c4b565b34801561057d575f80fd5b506103db61058c366004611a19565b61117b565b34801561059c575f80fd5b506102666105ab366004611c59565b6111b0565b3480156105bb575f80fd5b506102ab6105ca366004611ae1565b611421565b3480156105da575f80fd5b506102666105e9366004611a80565b60016020525f908152604090205460ff1681565b348015610608575f80fd5b50610266610617366004611c59565b6114bf565b348015610627575f80fd5b506102ab610636366004611ae1565b6114d1565b348015610646575f80fd5b5061028a60055481565b34801561065b575f80fd5b5061028a600181565b6102ab610672366004611a80565b61156f565b6102ab610685366004611a80565b6115a9565b348015610695575f80fd5b506102666106a4366004611a80565b6115cf565b3480156106b4575f80fd5b5061028a6106c3366004611a80565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7cc1d5bb00000000000000000000000000000000000000000000000000000000148061072f575061072f8261162e565b92915050565b61073f3382611683565b50565b61074a61168e565b61075482826116a8565b5050565b6001610763816116b4565b600160025460ff16600181111561077c5761077c611c0a565b146107b3576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f604051806020016040528042446107cb9190611cd5565b905260038054602083208084529293505f926107e79190611d15565b815481106107f7576107f7611d28565b5f918252602082200154905460045473ffffffffffffffffffffffffffffffffffffffff928316935061082d92169083906116d8565b6004545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529284901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8216907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d39060680160408051601f19818403018152908290526108ca91611bf8565b60405180910390a2505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161092f81611721565b815f03610968576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60045461098d9073ffffffffffffffffffffffffffffffffffffffff16333085611752565b600160025460ff1660018111156109a6576109a6611c0a565b036109dd576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f546109e99083611d15565b15610a20576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8054610a2d9084611d55565b90508060065f828254610a409190611cd5565b909155505060408051338152602081018590527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a1505050565b6002610a8e81611721565b838214610ac7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610b75575f848483818110610ae457610ae4611d28565b9050602002016020810190610af99190611d68565b9050801515600103610b3b57610b36878784818110610b1a57610b1a611d28565b9050602002016020810190610b2f9190611a80565b60016116a8565b610b6c565b610b6c878784818110610b5057610b50611d28565b9050602002016020810190610b659190611a80565b6001611683565b50600101610ac9565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610bce5760018160011c14303b10610bc55763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610bdc83850185611e0e565b905080604001515f1480610bf257506060810151155b15610c29576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600182602001516001811115610c4257610c42611c0a565b03610c51578160400151610c65565b81606001518260400151610c659190611e93565b82519091505f90610c8c9073ffffffffffffffffffffffffffffffffffffffff16306117aa565b905081811015610cf65782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101829052604481018390526064015b60405180910390fd5b8251600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790556020830151600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610d7a57610d7a611c0a565b021790555060408301515f556060830151600655610d97336117dd565b610da683608001516001611825565b825f015173ffffffffffffffffffffffffffffffffffffffff167fe83379cf1b79044fa1d0063e68012349f4f5fb730e6a875bdc9d463747ecd0858460200151856040015186606001518760800151604051610e059493929190611eaa565b60405180910390a25050508015610e45576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e5781611721565b5f610e6485870187611ee9565b90505f8160200151806020019051810190610e7f9190611fc0565b9050600160025460ff166001811115610e9a57610e9a611c0a565b03610f11575f5481141580610eb057505f600554115b15610f08573382604051602001610ec79190611fd7565b60408051601f19818403018152908290527f4139d81d000000000000000000000000000000000000000000000000000000008252610ced9291600401612011565b5f600655610f56565b5f54610f1d9082611d15565b15610f34573382604051602001610ec79190611fd7565b5f54610f409082611d55565b60065f828254610f50919061203f565b90915550505b8151600454610f7e9173ffffffffffffffffffffffffffffffffffffffff90911690836116d8565b81516004546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d39060680160408051601f198184030181529082905261101e91611bf8565b60405180910390a260045490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b61105561168e565b6107548282611683565b60605f61106e83850185611e0e565b90505f60018260200151600181111561108957611089611c0a565b036110985781604001516110ac565b816060015182604001516110ac9190611e93565b6040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184526060830152915192935061111692909101612052565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61117061168e565b6111795f611866565b565b6003818154811061118a575f80fd5b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b5f6111b961168e565b6111c2846118b0565b6111f8576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60025460ff16600181111561121057611210611c0a565b036113375760058054905f611224836120c8565b909155505073ffffffffffffffffffffffffffffffffffffffff8085165f908152600160208190526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790555460045461128a92169086906116d8565b6004545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529287901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8516907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d39060680160408051601f198184030181529082905261132791611bf8565b60405180910390a250600161141a565b60058054905f611346836120c8565b909155505073ffffffffffffffffffffffffffffffffffffffff84165f81815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560038054928301815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055517ff0abe0f5c6f02112a9a4332e7b091bf49040ffddeedb73785a9b9a0a3ca7f1539190a25060015b9392505050565b600261142c81611721565b838214611465576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610b75576114b786868381811061148457611484611d28565b90506020020160208101906114999190611a80565b8585848181106114ab576114ab611d28565b905060200201356116a8565b600101611467565b5f6114c9846118b0565b949350505050565b60026114dc81611721565b838214611515576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610b755761156786868381811061153457611534611d28565b90506020020160208101906115499190611a80565b85858481811061155b5761155b611d28565b90506020020135611683565b600101611517565b61157761168e565b63389a75e1600c52805f526020600c20805442111561159d57636f5e88185f526004601cfd5b5f905561073f81611866565b6115b161168e565b8060601b6115c657637448fbae5f526004601cfd5b61073f81611866565b5f8173ffffffffffffffffffffffffffffffffffffffff166115f4638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff16148061072f5750638b78c6d8600c9081525f8390526020902054600316151561072f565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa921670500000000000000000000000000000000000000000000000000000000148061072f575061072f826118ed565b61075482825f611983565b638b78c6d819543314611179576382b429005f526004601cfd5b61075482826001611983565b638b78c6d8600c52335f52806020600c20541661073f576382b429005f526004601cfd5b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611718576390b8ec185f526004601cfd5b5f603452505050565b638b78c6d81954331461073f57638b78c6d8600c52335f52806020600c20541661073f576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f5114171661179d57637939f4245f526004601cfd5b5f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001602052604081205460ff1615801561072f57506006546005541092915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061072f57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461072f565b638b78c6d8600c52825f526020600c208054838117836119a4575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f602082840312156119ea575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461141a575f80fd5b5f60208284031215611a29575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a53575f80fd5b919050565b5f8060408385031215611a69575f80fd5b611a7283611a30565b946020939093013593505050565b5f60208284031215611a90575f80fd5b61141a82611a30565b5f8083601f840112611aa9575f80fd5b50813567ffffffffffffffff811115611ac0575f80fd5b6020830191508360208260051b8501011115611ada575f80fd5b9250929050565b5f805f8060408587031215611af4575f80fd5b843567ffffffffffffffff811115611b0a575f80fd5b611b1687828801611a99565b909550935050602085013567ffffffffffffffff811115611b35575f80fd5b611b4187828801611a99565b95989497509550505050565b5f8083601f840112611b5d575f80fd5b50813567ffffffffffffffff811115611b74575f80fd5b602083019150836020828501011115611ada575f80fd5b5f8060208385031215611b9c575f80fd5b823567ffffffffffffffff811115611bb2575f80fd5b611bbe85828601611b4d565b90969095509350505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61141a6020830184611bca565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611c4757611c47611c0a565b9052565b6020810161072f8284611c37565b5f805f60408486031215611c6b575f80fd5b611c7484611a30565b9250602084013567ffffffffffffffff811115611c8f575f80fd5b611c9b86828701611b4d565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561072f5761072f611ca8565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611d2357611d23611ce8565b500690565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82611d6357611d63611ce8565b500490565b5f60208284031215611d78575f80fd5b8135801515811461141a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff81118282101715611dd757611dd7611d87565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e0657611e06611d87565b604052919050565b5f60a0828403128015611e1f575f80fd5b5060405160a0810167ffffffffffffffff81118282101715611e4357611e43611d87565b604052611e4f83611a30565b8152602083013560028110611e62575f80fd5b60208201526040838101359082015260608084013590820152611e8760808401611a30565b60808201529392505050565b808202811582820484141761072f5761072f611ca8565b60808101611eb88287611c37565b84602083015283604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b5f60208284031215611ef9575f80fd5b813567ffffffffffffffff811115611f0f575f80fd5b820160408185031215611f20575f80fd5b611f28611db4565b611f3182611a30565b8152602082013567ffffffffffffffff811115611f4c575f80fd5b80830192505084601f830112611f60575f80fd5b813567ffffffffffffffff811115611f7a57611f7a611d87565b611f8d6020601f19601f84011601611ddd565b818152866020838601011115611fa1575f80fd5b816020850160208301375f602092820183015290820152949350505050565b5f60208284031215611fd0575f80fd5b5051919050565b6020815273ffffffffffffffffffffffffffffffffffffffff82511660208201525f60208301516040808401526114c96060840182611bca565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f6114c96040830184611bca565b8181038181111561072f5761072f611ca8565b602081525f82516003811061206957612069611c0a565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526114c960a0840182611bca565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036120f8576120f8611ca8565b506001019056fea264697066735822122088443730ea9175c8d52add442a13f07026ebe487eeb655e4277c54c4a70cdd2064736f6c634300081a0033", s = class s extends L {
|
|
6
|
+
import { RegistryType as q } from "../utils.js";
|
|
7
|
+
const x = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b612149806100895f395ff3fe608060405260043610610243575f3560e01c806354d1f13d11610131578063c884ef83116100ac578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b14610677578063fe9fbb801461068a578063fee81cf4146106a9575f80fd5b8063ec87621c14610650578063f04e283e14610664575f80fd5b8063c884ef83146105cf578063db09da12146105fd578063dcc213611461061c578063dcc59b6f1461063b575f80fd5b8063a4d66daf11610101578063b30906d4116100e7578063b30906d414610572578063bb1757cf14610591578063be4994f8146105b0575f80fd5b8063a4d66daf14610537578063a8c62e761461054c575f80fd5b806354d1f13d146104fb578063715018a61461050357806375b238fc1461050b5780638da5cb5b1461051f575f80fd5b80632de94807116101c1578063439fab91116101915780634a4ee7b1116101775780634a4ee7b1146104875780634e7165a21461049a578063514e62fc146104c6575f80fd5b8063439fab911461041f578063474f5a441461043e575f80fd5b80632de948071461035f57806330db555f1461039057806338d52e0f146103af5780634359d28a14610400575f80fd5b80631cd64df411610216578063228cb733116101fc578063228cb73314610309578063256929621461031d57806328d6183b14610325575f80fd5b80631cd64df4146102c05780632275aea9146102f5575f80fd5b806301ffc9a71461024757806307621eca1461027b578063183a4f6e146102985780631c10893f146102ad575b5f80fd5b348015610252575f80fd5b506102666102613660046119ee565b6106da565b60405190151581526020015b60405180910390f35b348015610286575f80fd5b505f545b604051908152602001610272565b6102ab6102a6366004611a2d565b610735565b005b6102ab6102bb366004611a6c565b610742565b3480156102cb575f80fd5b506102666102da366004611a6c565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610300575f80fd5b506102ab610758565b348015610314575f80fd5b5061028a5f5481565b6102ab6108d7565b348015610330575f80fd5b506040517f7cc1d5bb000000000000000000000000000000000000000000000000000000008152602001610272565b34801561036a575f80fd5b5061028a610379366004611a94565b638b78c6d8600c9081525f91909152602090205490565b34801561039b575f80fd5b506102ab6103aa366004611a2d565b610924565b3480156103ba575f80fd5b506004546103db9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610272565b34801561040b575f80fd5b506102ab61041a366004611af5565b610a83565b34801561042a575f80fd5b506102ab610439366004611b9f565b610b7d565b348015610449575f80fd5b5061045d610458366004611b9f565b610e4a565b6040805192835273ffffffffffffffffffffffffffffffffffffffff909116602083015201610272565b6102ab610495366004611a6c565b61104d565b3480156104a5575f80fd5b506104b96104b4366004611b9f565b61105f565b6040516102729190611c0c565b3480156104d1575f80fd5b506102666104e0366004611a6c565b638b78c6d8600c9081525f9290925260209091205416151590565b6102ab61112f565b6102ab611168565b348015610516575f80fd5b5061028a600281565b34801561052a575f80fd5b50638b78c6d819546103db565b348015610542575f80fd5b5061028a60065481565b348015610557575f80fd5b506002546105659060ff1681565b6040516102729190611c5f565b34801561057d575f80fd5b506103db61058c366004611a2d565b61117b565b34801561059c575f80fd5b506102666105ab366004611c6d565b6111b0565b3480156105bb575f80fd5b506102ab6105ca366004611af5565b611421565b3480156105da575f80fd5b506102666105e9366004611a94565b60016020525f908152604090205460ff1681565b348015610608575f80fd5b50610266610617366004611c6d565b6114bf565b348015610627575f80fd5b506102ab610636366004611af5565b6114d1565b348015610646575f80fd5b5061028a60055481565b34801561065b575f80fd5b5061028a600181565b6102ab610672366004611a94565b61156f565b6102ab610685366004611a94565b6115a9565b348015610695575f80fd5b506102666106a4366004611a94565b6115cf565b3480156106b4575f80fd5b5061028a6106c3366004611a94565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7cc1d5bb00000000000000000000000000000000000000000000000000000000148061072f575061072f8261162e565b92915050565b61073f3382611683565b50565b61074a61168e565b61075482826116a8565b5050565b6001610763816116b4565b600160025460ff16600181111561077c5761077c611c1e565b146107b3576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f604051806020016040528042446107cb9190611ce9565b905260038054602083208084529293505f926107e79190611d29565b815481106107f7576107f7611d3c565b5f918252602082200154905460045473ffffffffffffffffffffffffffffffffffffffff928316935061082d92169083906116d8565b6004545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529284901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8216907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d39060680160408051601f19818403018152908290526108ca91611c0c565b60405180910390a2505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161092f8161172b565b815f03610968576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60045461098d9073ffffffffffffffffffffffffffffffffffffffff1633308561175c565b600160025460ff1660018111156109a6576109a6611c1e565b036109dd576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f546109e99083611d29565b15610a20576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8054610a2d9084611d69565b90508060065f828254610a409190611ce9565b909155505060408051338152602081018590527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a1505050565b6002610a8e8161172b565b838214610ac7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610b75575f848483818110610ae457610ae4611d3c565b9050602002016020810190610af99190611d7c565b9050801515600103610b3b57610b36878784818110610b1a57610b1a611d3c565b9050602002016020810190610b2f9190611a94565b60016116a8565b610b6c565b610b6c878784818110610b5057610b50611d3c565b9050602002016020810190610b659190611a94565b6001611683565b50600101610ac9565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610bce5760018160011c14303b10610bc55763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610bdc83850185611e22565b905080604001515f1480610bf257506060810151155b15610c29576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600182602001516001811115610c4257610c42611c1e565b03610c51578160400151610c65565b81606001518260400151610c659190611ea7565b82519091505f90610c8c9073ffffffffffffffffffffffffffffffffffffffff16306117be565b905081811015610cf65782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101829052604481018390526064015b60405180910390fd5b8251600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790556020830151600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610d7a57610d7a611c1e565b021790555060408301515f556060830151600655610d97336117f1565b610da683608001516001611839565b825f015173ffffffffffffffffffffffffffffffffffffffff167fe83379cf1b79044fa1d0063e68012349f4f5fb730e6a875bdc9d463747ecd0858460200151856040015186606001518760800151604051610e059493929190611ebe565b60405180910390a25050508015610e45576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e578161172b565b5f610e6485870187611efd565b90505f8160200151806020019051810190610e7f9190611fd4565b9050600160025460ff166001811115610e9a57610e9a611c1e565b03610f11575f5481141580610eb057505f600554115b15610f08573382604051602001610ec79190611feb565b60408051601f19818403018152908290527f4139d81d000000000000000000000000000000000000000000000000000000008252610ced9291600401612025565b5f600655610f56565b5f54610f1d9082611d29565b15610f34573382604051602001610ec79190611feb565b5f54610f409082611d69565b60065f828254610f509190612053565b90915550505b8151600454610f7e9173ffffffffffffffffffffffffffffffffffffffff90911690836116d8565b81516004546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d39060680160408051601f198184030181529082905261101e91611c0c565b60405180910390a260045490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b61105561168e565b6107548282611683565b60605f61106e83850185611e22565b90505f60018260200151600181111561108957611089611c1e565b036110985781604001516110ac565b816060015182604001516110ac9190611ea7565b6040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184526060830152915192935061111692909101612066565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61117061168e565b6111795f61187a565b565b6003818154811061118a575f80fd5b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b5f6111b961168e565b6111c2846118c4565b6111f8576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60025460ff16600181111561121057611210611c1e565b036113375760058054905f611224836120dc565b909155505073ffffffffffffffffffffffffffffffffffffffff8085165f908152600160208190526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790555460045461128a92169086906116d8565b6004545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529287901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8516907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d39060680160408051601f198184030181529082905261132791611c0c565b60405180910390a250600161141a565b60058054905f611346836120dc565b909155505073ffffffffffffffffffffffffffffffffffffffff84165f81815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560038054928301815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055517ff0abe0f5c6f02112a9a4332e7b091bf49040ffddeedb73785a9b9a0a3ca7f1539190a25060015b9392505050565b600261142c8161172b565b838214611465576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610b75576114b786868381811061148457611484611d3c565b90506020020160208101906114999190611a94565b8585848181106114ab576114ab611d3c565b905060200201356116a8565b600101611467565b5f6114c9846118c4565b949350505050565b60026114dc8161172b565b838214611515576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610b755761156786868381811061153457611534611d3c565b90506020020160208101906115499190611a94565b85858481811061155b5761155b611d3c565b90506020020135611683565b600101611517565b61157761168e565b63389a75e1600c52805f526020600c20805442111561159d57636f5e88185f526004601cfd5b5f905561073f8161187a565b6115b161168e565b8060601b6115c657637448fbae5f526004601cfd5b61073f8161187a565b5f8173ffffffffffffffffffffffffffffffffffffffff166115f4638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff16148061072f5750638b78c6d8600c9081525f8390526020902054600316151561072f565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa921670500000000000000000000000000000000000000000000000000000000148061072f575061072f82611901565b61075482825f611997565b638b78c6d819543314611179576382b429005f526004601cfd5b61075482826001611997565b638b78c6d8600c52335f52806020600c20541661073f576382b429005f526004601cfd5b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661172157803d853b151710611721576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d81954331461073f57638b78c6d8600c52335f52806020600c20541661073f576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f5114166117b057803d873b1517106117b057637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001602052604081205460ff1615801561072f57506006546005541092915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061072f57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461072f565b638b78c6d8600c52825f526020600c208054838117836119b8575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f602082840312156119fe575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461141a575f80fd5b5f60208284031215611a3d575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a67575f80fd5b919050565b5f8060408385031215611a7d575f80fd5b611a8683611a44565b946020939093013593505050565b5f60208284031215611aa4575f80fd5b61141a82611a44565b5f8083601f840112611abd575f80fd5b50813567ffffffffffffffff811115611ad4575f80fd5b6020830191508360208260051b8501011115611aee575f80fd5b9250929050565b5f805f8060408587031215611b08575f80fd5b843567ffffffffffffffff811115611b1e575f80fd5b611b2a87828801611aad565b909550935050602085013567ffffffffffffffff811115611b49575f80fd5b611b5587828801611aad565b95989497509550505050565b5f8083601f840112611b71575f80fd5b50813567ffffffffffffffff811115611b88575f80fd5b602083019150836020828501011115611aee575f80fd5b5f8060208385031215611bb0575f80fd5b823567ffffffffffffffff811115611bc6575f80fd5b611bd285828601611b61565b90969095509350505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61141a6020830184611bde565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611c5b57611c5b611c1e565b9052565b6020810161072f8284611c4b565b5f805f60408486031215611c7f575f80fd5b611c8884611a44565b9250602084013567ffffffffffffffff811115611ca3575f80fd5b611caf86828701611b61565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561072f5761072f611cbc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611d3757611d37611cfc565b500690565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82611d7757611d77611cfc565b500490565b5f60208284031215611d8c575f80fd5b8135801515811461141a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff81118282101715611deb57611deb611d9b565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e1a57611e1a611d9b565b604052919050565b5f60a0828403128015611e33575f80fd5b5060405160a0810167ffffffffffffffff81118282101715611e5757611e57611d9b565b604052611e6383611a44565b8152602083013560028110611e76575f80fd5b60208201526040838101359082015260608084013590820152611e9b60808401611a44565b60808201529392505050565b808202811582820484141761072f5761072f611cbc565b60808101611ecc8287611c4b565b84602083015283604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b5f60208284031215611f0d575f80fd5b813567ffffffffffffffff811115611f23575f80fd5b820160408185031215611f34575f80fd5b611f3c611dc8565b611f4582611a44565b8152602082013567ffffffffffffffff811115611f60575f80fd5b80830192505084601f830112611f74575f80fd5b813567ffffffffffffffff811115611f8e57611f8e611d9b565b611fa16020601f19601f84011601611df1565b818152866020838601011115611fb5575f80fd5b816020850160208301375f602092820183015290820152949350505050565b5f60208284031215611fe4575f80fd5b5051919050565b6020815273ffffffffffffffffffffffffffffffffffffffff82511660208201525f60208301516040808401526114c96060840182611bde565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f6114c96040830184611bde565b8181038181111561072f5761072f611cbc565b602081525f82516003811061207d5761207d611c1e565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526114c960a0840182611bde565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361210c5761210c611cbc565b506001019056fea26469706673582212209def68a22e935c7af91e946bb2187abd14944a4cd3b455abbdb234120eea61b564736f6c634300081a0033", s = class s extends E {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments), this.abi = n;
|
|
10
10
|
}
|
|
@@ -97,7 +97,7 @@ const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
97
97
|
* @returns {Promise<StrategyType>}
|
|
98
98
|
*/
|
|
99
99
|
strategy(f) {
|
|
100
|
-
return
|
|
100
|
+
return R(this._config, {
|
|
101
101
|
address: this.assertValidAddress(),
|
|
102
102
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
103
103
|
...f
|
|
@@ -112,7 +112,7 @@ const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
112
112
|
* @returns {Promise<bigint>}
|
|
113
113
|
*/
|
|
114
114
|
async reward(f) {
|
|
115
|
-
return await
|
|
115
|
+
return await I(this._config, {
|
|
116
116
|
address: this.assertValidAddress(),
|
|
117
117
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
118
118
|
...f
|
|
@@ -206,7 +206,7 @@ const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
206
206
|
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
|
|
207
207
|
*/
|
|
208
208
|
async clawbackRaw(f, b) {
|
|
209
|
-
const { request: a, result: d } = await
|
|
209
|
+
const { request: a, result: d } = await T(
|
|
210
210
|
this._config,
|
|
211
211
|
{
|
|
212
212
|
address: this.assertValidAddress(),
|
|
@@ -216,7 +216,7 @@ const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
216
216
|
...b
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
|
-
return { hash: await
|
|
219
|
+
return { hash: await O(this._config, a), result: d };
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
222
|
* Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.
|
|
@@ -228,7 +228,7 @@ const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
228
228
|
* @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
|
|
229
229
|
*/
|
|
230
230
|
async isClaimable(f, b) {
|
|
231
|
-
return await
|
|
231
|
+
return await N(this._config, {
|
|
232
232
|
address: this.assertValidAddress(),
|
|
233
233
|
args: [f.target, f.data],
|
|
234
234
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -255,7 +255,7 @@ const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
255
255
|
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
256
256
|
*/
|
|
257
257
|
async drawRaffleRaw(f) {
|
|
258
|
-
const { request: b, result: a } = await
|
|
258
|
+
const { request: b, result: a } = await D(
|
|
259
259
|
this._config,
|
|
260
260
|
{
|
|
261
261
|
address: this.assertValidAddress(),
|
|
@@ -264,7 +264,7 @@ const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
264
264
|
...f
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
|
-
return { hash: await
|
|
267
|
+
return { hash: await L(this._config, b), result: a };
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
270
270
|
* Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`
|
|
@@ -326,7 +326,7 @@ const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
326
326
|
);
|
|
327
327
|
return {
|
|
328
328
|
abi: n,
|
|
329
|
-
bytecode:
|
|
329
|
+
bytecode: x,
|
|
330
330
|
args: [h(a)],
|
|
331
331
|
...this.optionallyAttachAccount(d.account)
|
|
332
332
|
};
|
|
@@ -373,13 +373,13 @@ const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
373
373
|
* @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.
|
|
374
374
|
*/
|
|
375
375
|
buildClaimData() {
|
|
376
|
-
return
|
|
376
|
+
return k;
|
|
377
377
|
}
|
|
378
378
|
};
|
|
379
379
|
s.bases = {
|
|
380
380
|
31337: void 0,
|
|
381
|
-
...
|
|
382
|
-
}, s.registryType =
|
|
381
|
+
...v
|
|
382
|
+
}, s.registryType = q.INCENTIVE;
|
|
383
383
|
let l = s;
|
|
384
384
|
function h({
|
|
385
385
|
asset: u,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20Incentive.js","sources":["../../src/Incentives/ERC20Incentive.ts"],"sourcesContent":["import {\n erc20IncentiveAbi,\n readErc20IncentiveAsset,\n readErc20IncentiveClaimed,\n readErc20IncentiveClaims,\n readErc20IncentiveCurrentReward,\n readErc20IncentiveEntries,\n readErc20IncentiveIsClaimable,\n readErc20IncentiveLimit,\n readErc20IncentiveOwner,\n readErc20IncentiveReward,\n readErc20IncentiveStrategy,\n simulateErc20IncentiveClaim,\n simulateErc20IncentiveClawback,\n simulateErc20IncentiveDrawRaffle,\n writeErc20IncentiveClaim,\n writeErc20IncentiveClawback,\n writeErc20IncentiveDrawRaffle,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20Incentive.sol/ERC20Incentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n 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 {\n type ClaimPayload,\n StrategyType,\n prepareClaimPayload,\n} from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20IncentiveAbi };\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive.\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed. This should ideally be 1n for `RAFFLE` strategy types.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * (Optional) The address of the entity that can trigger a raffle.\n * If omitted, the incentive will have no manager with permissions to draw the raffle.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20Incentive` event types.\n *\n * @export\n * @typedef {ERC20IncentiveLog}\n * @template {ContractEventName<typeof erc20IncentiveAbi>} [event=ContractEventName<\n * typeof erc20IncentiveAbi\n * >]\n */\nexport type ERC20IncentiveLog<\n event extends ContractEventName<typeof erc20IncentiveAbi> = ContractEventName<\n typeof erc20IncentiveAbi\n >,\n> = GenericLog<typeof erc20IncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20Incentive\n * @typedef {ERC20Incentive}\n * @extends {DeployableTarget<ERC20IncentivePayload>}\n */\nexport class ERC20Incentive extends DeployableTarget<\n ERC20IncentivePayload,\n typeof erc20IncentiveAbi\n> {\n public override readonly abi = erc20IncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 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 readErc20IncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20IncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20IncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20IncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20IncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The strategy for the incentive (MINT or POOL)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<StrategyType>}\n */\n public strategy(params?: ReadParams): Promise<StrategyType> {\n return readErc20IncentiveStrategy(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<StrategyType>;\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20IncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20IncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The set of addresses that have claimed a slot in the incentive raffle, accessed by bigint index.\n *\n * @public\n * @async\n * @param {bigint} i - Index of address\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async entries(i: bigint, params?: ReadParams) {\n return await readErc20IncentiveEntries(this._config, {\n address: this.assertValidAddress(),\n args: [i],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(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 simulateErc20IncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(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 simulateErc20IncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20IncentiveIsClaimable(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 * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async drawRaffle(params?: WriteParams) {\n return await this.awaitResult(this.drawRaffleRaw(params));\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async drawRaffleRaw(params?: WriteParams) {\n const { request, result } = await simulateErc20IncentiveDrawRaffle(\n this._config,\n {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveDrawRaffle(this._config, request);\n return { hash, result };\n }\n\n /**\n * 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 if (\n this.payload?.strategy !== undefined &&\n this.payload?.limit !== undefined &&\n this.payload?.reward !== undefined\n ) {\n return (this.payload.strategy as StrategyType) === StrategyType.POOL\n ? this.payload.limit * this.payload.reward\n : this.payload.reward;\n }\n const [strategy, limit, reward] = await Promise.all([\n this.strategy(params),\n this.limit(params),\n this.reward(params),\n ]);\n return strategy === StrategyType.POOL ? limit * reward : reward;\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 {?ERC20IncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20IncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20IncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20IncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * 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 * A helper that composes a typed \"top-up\" parameter object\n * given a net top-up amount. You can name it whatever you like\n * (e.g. topupParamsFromNetAmount, getTopupPayload, etc.).\n *\n * @public\n * @param {bigint} netAmount The net top-up tokens the user wants to add\n * @param {?WriteParams} [params] (optional) if you need them\n * @returns {Hex} the ABI-encoded data for top-up\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n // 1. Build a typed object matching your `ERC20IncentivePayload`.\n // For example, you might want to increment `limit` by `netAmount`,\n // or set `reward = netAmount`. That’s up to your logic:\n const asset = await this.asset();\n const typed: ERC20IncentivePayload = {\n asset: asset || zeroAddress,\n strategy: StrategyType.POOL, // e.g. StrategyType.POOL\n reward: 1n, // store net top-up as the \"reward\"\n limit: netAmount, // or maybe add netAmount to existing limit\n manager: this.payload?.manager || zeroAddress,\n };\n\n // 2. Encode it with your existing `prepareERC20IncentivePayload(...)`.\n return prepareERC20IncentivePayload(typed);\n }\n\n /**\n * Builds the claim data for the ERC20Incentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can draw raffles - defaults to unset\n * @returns {Hex}\n */\nexport function prepareERC20IncentivePayload({\n asset,\n strategy,\n reward,\n limit,\n manager = zeroAddress,\n}: ERC20IncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [\n asset,\n strategy,\n reward,\n // unclear how user set limit should work for raffle, so in order to avoid passing 0's let's correct it\n limit === 0n && strategy === StrategyType.RAFFLE ? 1n : limit,\n manager,\n ],\n );\n}\n"],"names":["_ERC20Incentive","DeployableTarget","erc20IncentiveAbi","params","readErc20IncentiveOwner","readErc20IncentiveCurrentReward","readErc20IncentiveClaims","address","readErc20IncentiveClaimed","readErc20IncentiveAsset","readErc20IncentiveStrategy","readErc20IncentiveReward","readErc20IncentiveLimit","i","readErc20IncentiveEntries","payload","request","result","simulateErc20IncentiveClaim","prepareClaimPayload","writeErc20IncentiveClaim","simulateErc20IncentiveClawback","writeErc20IncentiveClawback","readErc20IncentiveIsClaimable","simulateErc20IncentiveDrawRaffle","writeErc20IncentiveDrawRaffle","_a","_b","_c","StrategyType","strategy","limit","reward","claims","_payload","_options","options","bytecode","prepareERC20IncentivePayload","amount","encodeAbiParameters","netAmount","typed","zeroAddress","zeroHash","ERC20IncentiveBases","RegistryType","ERC20Incentive","asset","manager"],"mappings":";;;;;;o4hBAiHaA,IAAN,MAAMA,UAAuBC,EAGlC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAwB,KAAK,SAAS;AAAA,MACjD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cAAcA,GAAqB;AACvC,WAAA,MAAME,EAAgC,KAAK,SAAS;AAAA,MACzD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,OAAOA,GAAqB;AAChC,WAAA,MAAMG,EAAyB,KAAK,SAAS;AAAA,MAClD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIH;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAa,QAAQI,GAAkBJ,GAAqB;AACnD,WAAA,MAAMK,EAA0B,KAAK,SAAS;AAAA,MACnD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACD,CAAO;AAAA;AAAA,MAEd,GAAIJ;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAO;AAAA,EACP,GAAI6C;AAAA,GASN7C,EAAuB,eAA6B8C,EAAa;AAvB5D,IAAMC,IAAN/C;AAybA,SAASsC,EAA6B;AAAA,EAC3C,OAAAU;AAAA,EACA,UAAAlB;AAAA,EACA,QAAAE;AAAA,EACA,OAAAD;AAAA,EACA,SAAAkB,IAAUN;AACZ,GAA0B;AACjB,SAAAH;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,SAAS,MAAM,WAAW;AAAA,MAClC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,MAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,WAAW,MAAM,UAAU;AAAA,IACrC;AAAA,IACA;AAAA,MACEQ;AAAA,MACAlB;AAAA,MACAE;AAAA;AAAA,MAEAD,MAAU,MAAMD,MAAaD,EAAa,SAAS,KAAKE;AAAA,MACxDkB;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ERC20Incentive.js","sources":["../../src/Incentives/ERC20Incentive.ts"],"sourcesContent":["import {\n erc20IncentiveAbi,\n readErc20IncentiveAsset,\n readErc20IncentiveClaimed,\n readErc20IncentiveClaims,\n readErc20IncentiveCurrentReward,\n readErc20IncentiveEntries,\n readErc20IncentiveIsClaimable,\n readErc20IncentiveLimit,\n readErc20IncentiveOwner,\n readErc20IncentiveReward,\n readErc20IncentiveStrategy,\n simulateErc20IncentiveClaim,\n simulateErc20IncentiveClawback,\n simulateErc20IncentiveDrawRaffle,\n writeErc20IncentiveClaim,\n writeErc20IncentiveClawback,\n writeErc20IncentiveDrawRaffle,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20Incentive.sol/ERC20Incentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n 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 {\n type ClaimPayload,\n StrategyType,\n prepareClaimPayload,\n} from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20IncentiveAbi };\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive.\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed. This should ideally be 1n for `RAFFLE` strategy types.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * (Optional) The address of the entity that can trigger a raffle.\n * If omitted, the incentive will have no manager with permissions to draw the raffle.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20Incentive` event types.\n *\n * @export\n * @typedef {ERC20IncentiveLog}\n * @template {ContractEventName<typeof erc20IncentiveAbi>} [event=ContractEventName<\n * typeof erc20IncentiveAbi\n * >]\n */\nexport type ERC20IncentiveLog<\n event extends ContractEventName<typeof erc20IncentiveAbi> = ContractEventName<\n typeof erc20IncentiveAbi\n >,\n> = GenericLog<typeof erc20IncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20Incentive\n * @typedef {ERC20Incentive}\n * @extends {DeployableTarget<ERC20IncentivePayload>}\n */\nexport class ERC20Incentive extends DeployableTarget<\n ERC20IncentivePayload,\n typeof erc20IncentiveAbi\n> {\n public override readonly abi = erc20IncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 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 readErc20IncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20IncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20IncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20IncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20IncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The strategy for the incentive (MINT or POOL)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<StrategyType>}\n */\n public strategy(params?: ReadParams): Promise<StrategyType> {\n return readErc20IncentiveStrategy(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<StrategyType>;\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20IncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20IncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The set of addresses that have claimed a slot in the incentive raffle, accessed by bigint index.\n *\n * @public\n * @async\n * @param {bigint} i - Index of address\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async entries(i: bigint, params?: ReadParams) {\n return await readErc20IncentiveEntries(this._config, {\n address: this.assertValidAddress(),\n args: [i],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(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 simulateErc20IncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(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 simulateErc20IncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20IncentiveIsClaimable(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 * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async drawRaffle(params?: WriteParams) {\n return await this.awaitResult(this.drawRaffleRaw(params));\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async drawRaffleRaw(params?: WriteParams) {\n const { request, result } = await simulateErc20IncentiveDrawRaffle(\n this._config,\n {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveDrawRaffle(this._config, request);\n return { hash, result };\n }\n\n /**\n * 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 if (\n this.payload?.strategy !== undefined &&\n this.payload?.limit !== undefined &&\n this.payload?.reward !== undefined\n ) {\n return (this.payload.strategy as StrategyType) === StrategyType.POOL\n ? this.payload.limit * this.payload.reward\n : this.payload.reward;\n }\n const [strategy, limit, reward] = await Promise.all([\n this.strategy(params),\n this.limit(params),\n this.reward(params),\n ]);\n return strategy === StrategyType.POOL ? limit * reward : reward;\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 {?ERC20IncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20IncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20IncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20IncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * 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 * A helper that composes a typed \"top-up\" parameter object\n * given a net top-up amount. You can name it whatever you like\n * (e.g. topupParamsFromNetAmount, getTopupPayload, etc.).\n *\n * @public\n * @param {bigint} netAmount The net top-up tokens the user wants to add\n * @param {?WriteParams} [params] (optional) if you need them\n * @returns {Hex} the ABI-encoded data for top-up\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n // 1. Build a typed object matching your `ERC20IncentivePayload`.\n // For example, you might want to increment `limit` by `netAmount`,\n // or set `reward = netAmount`. That’s up to your logic:\n const asset = await this.asset();\n const typed: ERC20IncentivePayload = {\n asset: asset || zeroAddress,\n strategy: StrategyType.POOL, // e.g. StrategyType.POOL\n reward: 1n, // store net top-up as the \"reward\"\n limit: netAmount, // or maybe add netAmount to existing limit\n manager: this.payload?.manager || zeroAddress,\n };\n\n // 2. Encode it with your existing `prepareERC20IncentivePayload(...)`.\n return prepareERC20IncentivePayload(typed);\n }\n\n /**\n * Builds the claim data for the ERC20Incentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can draw raffles - defaults to unset\n * @returns {Hex}\n */\nexport function prepareERC20IncentivePayload({\n asset,\n strategy,\n reward,\n limit,\n manager = zeroAddress,\n}: ERC20IncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [\n asset,\n strategy,\n reward,\n // unclear how user set limit should work for raffle, so in order to avoid passing 0's let's correct it\n limit === 0n && strategy === StrategyType.RAFFLE ? 1n : limit,\n manager,\n ],\n );\n}\n"],"names":["_ERC20Incentive","DeployableTarget","erc20IncentiveAbi","params","readErc20IncentiveOwner","readErc20IncentiveCurrentReward","readErc20IncentiveClaims","address","readErc20IncentiveClaimed","readErc20IncentiveAsset","readErc20IncentiveStrategy","readErc20IncentiveReward","readErc20IncentiveLimit","i","readErc20IncentiveEntries","payload","request","result","simulateErc20IncentiveClaim","prepareClaimPayload","writeErc20IncentiveClaim","simulateErc20IncentiveClawback","writeErc20IncentiveClawback","readErc20IncentiveIsClaimable","simulateErc20IncentiveDrawRaffle","writeErc20IncentiveDrawRaffle","_a","_b","_c","StrategyType","strategy","limit","reward","claims","_payload","_options","options","bytecode","prepareERC20IncentivePayload","amount","encodeAbiParameters","netAmount","typed","zeroAddress","zeroHash","ERC20IncentiveBases","RegistryType","ERC20Incentive","asset","manager"],"mappings":";;;;;;o7hBAiHaA,IAAN,MAAMA,UAAuBC,EAGlC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAwB,KAAK,SAAS;AAAA,MACjD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cAAcA,GAAqB;AACvC,WAAA,MAAME,EAAgC,KAAK,SAAS;AAAA,MACzD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAA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@public
|
|
933
933
|
* @param {Hex} claimData
|
|
934
|
-
* @returns {
|
|
934
|
+
* @returns {bigint} Returns the reward amount from a claim data payload
|
|
935
935
|
*/
|
|
936
936
|
decodeClaimData(claimData: Hex): bigint;
|
|
937
937
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-mJJNq-xb.cjs"),m=require("@wagmi/core"),s=require("viem"),v=require("../deployments-D9QxJGrC.cjs"),p=require("../Actions/EventAction.cjs"),T=require("../Deployable/DeployableTarget.cjs"),w=require("../claiming.cjs"),r=require("../errors.cjs"),A=require("../utils.cjs"),D="0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6122ba806100895f395ff3fe6080604052600436106102ab575f3560e01c8063715018a611610165578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146107a9578063fe9fbb80146107bc578063fee81cf4146107db575f80fd5b8063ec87621c14610782578063f04e283e14610796575f80fd5b8063db09da12116100ac578063db09da121461072f578063dcc213611461074e578063dcc59b6f1461076d575f80fd5b8063c884ef83146106ec578063d54ad2a11461071a575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf1461069a578063be4994f8146106b9578063c213f3f9146106d8575f80fd5b8063a4d66daf14610664578063a871ced214610679575f80fd5b8063775486871161014b57806377548687146105b45780638da5cb5b146106225780639214fa4d1461063a575f80fd5b8063715018a61461059857806375b238fc146105a0575f80fd5b806330db555f1161020f5780634a4ee7b1116101c5578063514e62fc116101ab578063514e62fc14610546578063547d18641461057b57806354d1f13d14610590575f80fd5b80634a4ee7b1146105075780634e7165a21461051a575f80fd5b80634359d28a116101f55780634359d28a14610480578063439fab911461049f578063474f5a44146104be575f80fd5b806330db555f1461043557806338d52e0f14610454575f80fd5b80631f1cb62b11610264578063256929621161024a57806325692962146103c257806328d6183b146103ca5780632de9480714610404575f80fd5b80631f1cb62b1461035d578063228cb733146103ae575f80fd5b8063183a4f6e11610294578063183a4f6e146103005780631c10893f146103155780631cd64df414610328575f80fd5b806301ffc9a7146102af57806307621eca146102e3575b5f80fd5b3480156102ba575f80fd5b506102ce6102c93660046119c5565b61080c565b60405190151581526020015b60405180910390f35b3480156102ee575f80fd5b505f545b6040519081526020016102da565b61031361030e366004611a0b565b610867565b005b610313610323366004611a4a565b610874565b348015610333575f80fd5b506102ce610342366004611a4a565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610368575f80fd5b50600a546103899073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102da565b3480156103b9575f80fd5b506102f25f5481565b61031361088a565b3480156103d5575f80fd5b506040517ff60c99c90000000000000000000000000000000000000000000000000000000081526020016102da565b34801561040f575f80fd5b506102f261041e366004611a72565b638b78c6d8600c9081525f91909152602090205490565b348015610440575f80fd5b5061031361044f366004611a0b565b6108d7565b34801561045f575f80fd5b506006546103899073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048b575f80fd5b5061031361049a366004611ad3565b610993565b3480156104aa575f80fd5b506103136104b9366004611b7d565b610a8d565b3480156104c9575f80fd5b506104dd6104d8366004611b7d565b610e1c565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102da565b610313610515366004611a4a565b610f7e565b348015610525575f80fd5b50610539610534366004611b7d565b610f90565b6040516102da9190611c08565b348015610551575f80fd5b506102ce610560366004611a4a565b638b78c6d8600c9081525f9290925260209091205416151590565b348015610586575f80fd5b506102f260025481565b61031361102a565b610313611063565b3480156105ab575f80fd5b506102f2600281565b3480156105bf575f80fd5b506003546004546005546106119260ff90811692918082169173ffffffffffffffffffffffffffffffffffffffff61010083041691750100000000000000000000000000000000000000000090041685565b6040516102da959493929190611c57565b34801561062d575f80fd5b50638b78c6d81954610389565b348015610645575f80fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff16610389565b34801561066f575f80fd5b506102f260085481565b348015610684575f80fd5b5061068d611076565b6040516102da9190611d0a565b3480156106a5575f80fd5b506102ce6106b4366004611d18565b61115c565b3480156106c4575f80fd5b506103136106d3366004611ad3565b611389565b3480156106e3575f80fd5b50600b546102f2565b3480156106f7575f80fd5b506102ce610706366004611a72565b60016020525f908152604090205460ff1681565b348015610725575f80fd5b506102f260095481565b34801561073a575f80fd5b506102ce610749366004611d18565b611427565b348015610759575f80fd5b50610313610768366004611ad3565b61149a565b348015610778575f80fd5b506102f260075481565b34801561078d575f80fd5b506102f2600181565b6103136107a4366004611a72565b611538565b6103136107b7366004611a72565b611572565b3480156107c7575f80fd5b506102ce6107d6366004611a72565b611598565b3480156107e6575f80fd5b506102f26107f5366004611a72565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167ff60c99c90000000000000000000000000000000000000000000000000000000014806108615750610861826115f7565b92915050565b610871338261164c565b50565b61087c611657565b6108868282611671565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60016108e28161167d565b815f0361091b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546109409073ffffffffffffffffffffffffffffffffffffffff163330856116ae565b8160085f8282546109519190611d94565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b600261099e8161167d565b8382146109d7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85575f8484838181106109f4576109f4611da7565b9050602002016020810190610a099190611dd4565b9050801515600103610a4b57610a46878784818110610a2a57610a2a611da7565b9050602002016020810190610a3f9190611a72565b6001611671565b610a7c565b610a7c878784818110610a6057610a60611da7565b9050602002016020810190610a759190611a72565b600161164c565b506001016109d9565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ade5760018160011c14303b10610ad55763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610aec83850185611e9b565b905080606001515f03610b2b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015181515f90610b549073ffffffffffffffffffffffffffffffffffffffff1630611710565b905081811015610bbd5782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b60c083015183516006805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556020860151600a805491909316911617905560408401515f55606084015160085560a0840151600b5580516003805483929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610c7157610c71611c1a565b021790555060208201516001808301919091556040830151600283018054606086015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090911660ff90931692909217919091178082556080850151927fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909116907501000000000000000000000000000000000000000000908490811115610d3657610d36611c1a565b0217905550905050610d4733611743565b610d568460800151600161178b565b836020015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff167f2610f3b22dbb1fc9e125919ede742dad90b4f3dd49ce0c10118c6ef34410e3c98660400151876060015188608001518960a001518a60c00151604051610dd6959493929190611fa1565b60405180910390a3505050508015610e17576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e298161167d565b5f610e3685870187612093565b90505f8160200151806020019051810190610e519190612110565b90508060085f828254610e649190612127565b90915550508151600654610e919173ffffffffffffffffffffffffffffffffffffffff90911690836117cc565b81516006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610f4f91611c08565b60405180910390a260065490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610f86611657565b610886828261164c565b60605f610f9f83850185611e9b565b6060818101516040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184529482019490945290519394509092611011920161213a565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61106b611657565b6110745f61181f565b565b6040805160a0810182525f808252602082018190529181018290526060810182905260808101919091526040805160a0810190915260038054829060ff1660018111156110c5576110c5611c1a565b60018111156110d6576110d6611c1a565b81526001828101546020830152600283015460ff808216604085015273ffffffffffffffffffffffffffffffffffffffff61010083041660608501526080909301927501000000000000000000000000000000000000000000909104169081111561114357611143611c1a565b600181111561115457611154611c1a565b905250919050565b5f611165611657565b5f611172838501856121b8565b90505f816020015180602001905181019061118d9190612110565b90505f80545f0361119f5750806111c2565b670de0b6b3a7640000825f546111b59190612235565b6111bf919061224c565b90505b600b54158015906111d45750600b5481115b156111de5750600b545b6111e781611869565b61121d576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008548160095461122e9190611d94565b1115611266576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060095f8282546112779190611d94565b92505081905550600160075f8282546112909190611d94565b90915550506006546112b99073ffffffffffffffffffffffffffffffffffffffff1688836117cc565b6006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261137491611c08565b60405180910390a25060019695505050505050565b60026113948161167d565b8382146113cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a855761141f8686838181106113ec576113ec611da7565b90506020020160208101906114019190611a72565b85858481811061141357611413611da7565b90506020020135611671565b6001016113cf565b5f8080611436848601866121b8565b90505f81602001518060200190518101906114519190612110565b90505f545f0361146357809250611486565b670de0b6b3a7640000815f546114799190612235565b611483919061224c565b92505b61148f83611869565b979650505050505050565b60026114a58161167d565b8382146114de576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85576115308686838181106114fd576114fd611da7565b90506020020160208101906115129190611a72565b85858481811061152457611524611da7565b9050602002013561164c565b6001016114e0565b611540611657565b63389a75e1600c52805f526020600c20805442111561156657636f5e88185f526004601cfd5b5f90556108718161181f565b61157a611657565b8060601b61158f57637448fbae5f526004601cfd5b6108718161181f565b5f8173ffffffffffffffffffffffffffffffffffffffff166115bd638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108615750638b78c6d8600c9081525f83905260209020546003161515610861565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f56586338000000000000000000000000000000000000000000000000000000001480610861575061086182611883565b61088682825f6118d8565b638b78c6d819543314611074576382b429005f526004601cfd5b610886828260016118d8565b638b78c6d81954331461087157638b78c6d8600c52335f52806020600c205416610871576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661170257803d873b15171061170257637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661181557803d853b151710611815576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f6008548260095461187b9190611d94565b111592915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa921670500000000000000000000000000000000000000000000000000000000148061086157506108618261192f565b638b78c6d8600c52825f526020600c208054838117836118f9575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061086157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610861565b5f602082840312156119d5575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611a04575f80fd5b9392505050565b5f60208284031215611a1b575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a45575f80fd5b919050565b5f8060408385031215611a5b575f80fd5b611a6483611a22565b946020939093013593505050565b5f60208284031215611a82575f80fd5b611a0482611a22565b5f8083601f840112611a9b575f80fd5b50813567ffffffffffffffff811115611ab2575f80fd5b6020830191508360208260051b8501011115611acc575f80fd5b9250929050565b5f805f8060408587031215611ae6575f80fd5b843567ffffffffffffffff811115611afc575f80fd5b611b0887828801611a8b565b909550935050602085013567ffffffffffffffff811115611b27575f80fd5b611b3387828801611a8b565b95989497509550505050565b5f8083601f840112611b4f575f80fd5b50813567ffffffffffffffff811115611b66575f80fd5b602083019150836020828501011115611acc575f80fd5b5f8060208385031215611b8e575f80fd5b823567ffffffffffffffff811115611ba4575f80fd5b611bb085828601611b3f565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f611a046020830184611bbc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061087157610871611c1a565b60a08101611c6487611c47565b86825285602083015260ff8516604083015273ffffffffffffffffffffffffffffffffffffffff84166060830152611c9b83611c47565b8260808301529695505050505050565b8051611cb681611c47565b808352506020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301526080810151611cff81611c47565b806080840152505050565b60a081016108618284611cab565b5f805f60408486031215611d2a575f80fd5b611d3384611a22565b9250602084013567ffffffffffffffff811115611d4e575f80fd5b611d5a86828701611b3f565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561086157610861611d67565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611de4575f80fd5b81358015158114611a04575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160e0810167ffffffffffffffff81118282101715611e4357611e43611df3565b60405290565b60405160a0810167ffffffffffffffff81118282101715611e4357611e43611df3565b6040805190810167ffffffffffffffff81118282101715611e4357611e43611df3565b60028110610871575f80fd5b5f81830361016081128015611eae575f80fd5b50611eb7611e20565b611ec084611a22565b8152611ece60208501611a22565b60208201526040848101359082015260608085013590820152611ef360808501611a22565b608082015260a084810135818301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4083011215611f2f575f80fd5b611f37611e49565b915060c0840135611f4781611e8f565b825260e0840135602083015261010084013560ff81168114611f67575f80fd5b6040830152611f796101208501611a22565b6060830152610140840135611f8d81611e8f565b608083015260c08101919091529392505050565b8581526020810185905273ffffffffffffffffffffffffffffffffffffffff84166040820152606081018390526101208101611fe06080830184611cab565b9695505050505050565b5f82601f830112611ff9575f80fd5b813567ffffffffffffffff81111561201357612013611df3565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff8111828210171561206057612060611df3565b604052818152838201602001851015612077575f80fd5b816020850160208301375f918101602001919091529392505050565b5f602082840312156120a3575f80fd5b813567ffffffffffffffff8111156120b9575f80fd5b8201604081850312156120ca575f80fd5b6120d2611e6c565b6120db82611a22565b8152602082013567ffffffffffffffff8111156120f6575f80fd5b61210286828501611fea565b602083015250949350505050565b5f60208284031215612120575f80fd5b5051919050565b8181038181111561086157610861611d67565b602081525f82516003811061215157612151611c1a565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526121b060a0840182611bbc565b949350505050565b5f602082840312156121c8575f80fd5b813567ffffffffffffffff8111156121de575f80fd5b8201604081850312156121ef575f80fd5b6121f7611e6c565b813567ffffffffffffffff81111561220d575f80fd5b61221986828501611fea565b825250602082013567ffffffffffffffff8111156120f6575f80fd5b808202811582820484141761086157610861611d67565b5f8261227f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea26469706673582212204e4cf647127c9375d9d4d84240a56dd4ae0f1f1727bcc814e7c0f19d99a9cc9664736f6c634300081a0033",u=class u extends T.DeployableTarget{constructor(){super(...arguments),this.abi=c.y}async owner(f){return await c.t6(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await c.GM(this._config,{address:this.assertValidAddress(),args:[],...f})}async getMaxReward(f){return await c.jM(this._config,{...f,address:this.assertValidAddress()})}async getIncentiveScalar({chainId:f,hash:e,knownSignatures:b},t){var d;const a=await this.getIncentiveCriteria(t);if(a.criteriaType===p.SignatureType.EVENT){const i=await m.getTransactionReceipt(this._config,{chainId:f,hash:e});if(a.fieldIndex===A.CheatCodes.GAS_REBATE_INCENTIVE)return i.gasUsed*i.effectiveGasPrice+(i.blobGasUsed??0n)*(i.blobGasPrice??0n);const o=i.logs;if(o.length===0)throw new r.NoMatchingLogsError(`No logs found for event signature ${a.signature}`);try{const l=b[a.signature],n=s.parseEventLogs({abi:[l],logs:o});if(n==null||n.length===0)throw new r.NoMatchingLogsError(`No logs found for event signature ${a.signature}`);const h=((d=n[0])==null?void 0:d.args)[a.fieldIndex];if(h===void 0)throw new r.DecodedArgsError(`Decoded argument at index ${a.fieldIndex} is undefined`);return BigInt(h)}catch(l){throw new r.DecodedArgsError(`Failed to decode event log for signature ${a.signature}: ${l.message}`)}}else if(a.criteriaType===p.SignatureType.FUNC){const i=await m.getTransaction(this._config,{chainId:f,hash:e});try{const o=b[a.signature],n=s.decodeFunctionData({abi:[o],data:i.input}).args[a.fieldIndex];if(n==null)throw new r.DecodedArgsError(`Decoded argument at index ${a.fieldIndex} is undefined`);return BigInt(n)}catch(o){throw new r.DecodedArgsError(`Failed to decode function data for signature ${a.signature}: ${o.message}`)}}else throw new r.InvalidCriteriaTypeError(`Invalid criteria type ${a.criteriaType}`)}async claims(f){return await c.WM(this._config,{address:this.assertValidAddress(),args:[],...f})}async totalClaimed(f){return await c.u6(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,e){return await c.qM(this._config,{address:this.assertValidAddress(),args:[f],...e})}async asset(f){return await c.DM(this._config,{address:this.assertValidAddress(),...f})}async peg(f){return await c.a6(this._config,{address:this.assertValidAddress(),...f})}async reward(f){return await c.s6(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await c.e6(this._config,{address:this.assertValidAddress(),...f})}async claim(f,e){return await this.awaitResult(this.claimRaw(f,e))}async claimRaw(f,e){const{request:b,result:t}=await c.C6(this._config,{address:this.assertValidAddress(),args:[w.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...e});return{hash:await c.d6(this._config,b),result:t}}async clawback(f,e){return await this.awaitResult(this.clawbackRaw(f,e))}async clawbackRaw(f,e){const{request:b,result:t}=await c.E6(this._config,{address:this.assertValidAddress(),args:[w.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...e});return{hash:await c.c6(this._config,b),result:t}}async isClaimable(f,e){return await c.YM(this._config,{address:this.assertValidAddress(),args:[f.target,f.data],...e})}async getPeg(f){return await c.$M(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[e,b]=await Promise.all([this.totalClaimed(f),this.limit(f)]);return b-e}async getIncentiveCriteria(f){try{return await c.ZM(this._config,{...f,address:this.assertValidAddress()})}catch(e){throw new r.IncentiveCriteriaNotFoundError(e)}}async getTopupPayload(f){var e,b,t,a,d;return y({asset:await this.asset()??s.zeroAddress,peg:((e=this.payload)==null?void 0:e.peg)??s.zeroAddress,reward:((b=this.payload)==null?void 0:b.reward)??0n,limit:f,maxReward:((t=this.payload)==null?void 0:t.maxReward)??0n,manager:((a=this.payload)==null?void 0:a.manager)??s.zeroAddress,criteria:((d=this.payload)==null?void 0:d.criteria)??{criteriaType:0,signature:s.zeroHash,fieldIndex:0,targetContract:s.zeroAddress,valueType:0}})}buildParameters(f,e){const[b,t]=this.validateDeploymentConfig(f,e);return{abi:c.y,bytecode:D,args:[y(b)],...this.optionallyAttachAccount(t.account)}}buildClawbackData(f){return s.encodeAbiParameters([{type:"uint256"}],[f])}buildClaimData(f){return s.encodeAbiParameters([{type:"uint256",name:"signedAmount"}],[f])}async decodeClaimData(f){const e=s.decodeAbiParameters([{type:"tuple",name:"BoostClaimData",components:[{type:"bytes",name:"validatorData"},{type:"bytes",name:"incentiveData"}]}],f),b=s.decodeAbiParameters([{type:"uint256"}],e[0].incentiveData)[0];let t=b;const[a,d]=await Promise.all([this.reward(),this.getMaxReward()]);return a===0n||(t=a*b/s.parseEther("1"),d!==0n&&t>d&&(t=d)),t}decodeClaimDataWithRewardDetails(f,e,b){const t=s.decodeAbiParameters([{type:"tuple",name:"BoostClaimData",components:[{type:"bytes",name:"validatorData"},{type:"bytes",name:"incentiveData"}]}],f),a=s.decodeAbiParameters([{type:"uint256"}],t[0].incentiveData)[0];let d=a;return e===0n||(d=e*a/s.parseEther("1"),b!==0n&&d>b&&(d=b)),d}};u.bases={31337:void 0,...v.ERC20PeggedVariableCriteriaIncentiveV2},u.registryType=A.RegistryType.INCENTIVE;let g=u;function y({asset:C,peg:f,reward:e,limit:b,maxReward:t=0n,manager:a=s.zeroAddress,criteria:d}){return s.encodeAbiParameters([{type:"tuple",name:"initPayloadExtended",components:[{type:"address",name:"asset"},{type:"address",name:"peg"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"address",name:"manager"},{type:"uint256",name:"maxReward"},{type:"tuple",name:"criteria",components:[{type:"uint8",name:"criteriaType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"},{type:"uint8",name:"valueType"}]}]}],[{asset:C,peg:f,reward:e,limit:b,manager:a,maxReward:t,criteria:{criteriaType:d.criteriaType,signature:d.signature,fieldIndex:d.fieldIndex,targetContract:d.targetContract,valueType:d.valueType}}])}exports.erc20PeggedVariableCriteriaIncentiveV2Abi=c.y;exports.ERC20PeggedVariableCriteriaIncentiveV2=g;exports.prepareERC20PeggedVariableCriteriaIncentiveV2Payload=y;
|
|
2
|
+
//# sourceMappingURL=ERC20PeggedVariableCriteriaIncentiveV2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ERC20PeggedVariableCriteriaIncentiveV2.cjs","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts"],"sourcesContent":["import {\n erc20PeggedVariableCriteriaIncentiveV2Abi,\n readErc20PeggedVariableCriteriaIncentiveV2Asset,\n readErc20PeggedVariableCriteriaIncentiveV2Claimed,\n readErc20PeggedVariableCriteriaIncentiveV2Claims,\n readErc20PeggedVariableCriteriaIncentiveV2CurrentReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria,\n readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetPeg,\n readErc20PeggedVariableCriteriaIncentiveV2IsClaimable,\n readErc20PeggedVariableCriteriaIncentiveV2Limit,\n readErc20PeggedVariableCriteriaIncentiveV2Owner,\n readErc20PeggedVariableCriteriaIncentiveV2Peg,\n readErc20PeggedVariableCriteriaIncentiveV2Reward,\n readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed,\n simulateErc20PeggedVariableCriteriaIncentiveV2Claim,\n simulateErc20PeggedVariableCriteriaIncentiveV2Clawback,\n writeErc20PeggedVariableCriteriaIncentiveV2Claim,\n writeErc20PeggedVariableCriteriaIncentiveV2Clawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedVariableCriteriaIncentiveV2.sol/ERC20PeggedVariableCriteriaIncentiveV2.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport type { AbiEvent } from 'abitype';\nimport {\n type AbiFunction,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n decodeFunctionData,\n encodeAbiParameters,\n parseEther,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20PeggedVariableCriteriaIncentiveV2 as ERC20PeggedVariableCriteriaIncentiveV2Bases } from '../../dist/deployments.json';\nimport { SignatureType } from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport {\n CheatCodes,\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\nimport type {\n GetIncentiveScalarParams,\n IncentiveCriteria,\n} from './ERC20VariableCriteriaIncentiveV2';\n\nexport { erc20PeggedVariableCriteriaIncentiveV2Abi };\n\n/**\n * The object representation of a `Erc20PeggedVariableCriteriaIncentiveV2.InitPayload`\n *\n * @export\n * @interface Erc20PeggedVariableCriteriaIncentiveV2\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2}\n */\nexport interface ERC20PeggedVariableCriteriaIncentiveV2Payload {\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 * Maximum reward each claim is elligible for.\n *\n * @type {bigint}\n */\n maxReward: 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 * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteria;\n}\n\n/**\n * A generic `viem.Log` event with support for `Erc20PeggedVariableCriteriaIncentiveV2` event types.\n *\n * @export\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2Log}\n * @template {ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>} [event=ContractEventName<\n * typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n * >]\n */\nexport type Erc20PeggedVariableCriteriaIncentiveV2Log<\n event extends ContractEventName<\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n > = ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>,\n> = GenericLog<typeof erc20PeggedVariableCriteriaIncentiveV2Abi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class Erc20PeggedVariableCriteriaIncentive\n * @typedef {ERC20PeggedVariableCriteriaIncentiveV2}\n * @extends {DeployableTarget<ERC20PeggedVariableCriteriaIncentiveV2>}\n */\nexport class ERC20PeggedVariableCriteriaIncentiveV2 extends DeployableTarget<\n ERC20PeggedVariableCriteriaIncentiveV2Payload,\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n> {\n public override readonly abi = erc20PeggedVariableCriteriaIncentiveV2Abi;\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\n .VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE,\n ...(ERC20PeggedVariableCriteriaIncentiveV2Bases 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 readErc20PeggedVariableCriteriaIncentiveV2Owner(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 readErc20PeggedVariableCriteriaIncentiveV2CurrentReward(\n this._config,\n {\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 /**\n * Retrieves the maximum reward amount per claim.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The maximum reward amount per claim\n */\n public async getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward =\n await readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return maxReward;\n }\n\n /**\n * Fetches the incentive scalar from a transaction hash\n *\n * @param {GetIncentiveScalarParams} params\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}\n */\n public async getIncentiveScalar(\n { chainId, hash, knownSignatures }: GetIncentiveScalarParams,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const totalCost =\n transactionReceipt.gasUsed * transactionReceipt.effectiveGasPrice + // Normal gas cost\n (transactionReceipt.blobGasUsed ?? 0n) *\n (transactionReceipt.blobGasPrice ?? 0n); // Blob gas cost - account for potential undefined values\n return totalCost;\n }\n const logs = transactionReceipt.logs;\n\n if (logs.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n // Decode the event log\n try {\n // Decode function data\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n const scalarValue = (decodedEvents[0]?.args as string[])[\n criteria.fieldIndex\n ];\n\n if (scalarValue === undefined) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode event log for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else if (criteria.criteriaType === SignatureType.FUNC) {\n // Fetch the transaction data\n const transaction = await getTransaction(this._config, {\n chainId,\n hash,\n });\n try {\n // Decode function data\n const func = knownSignatures[criteria.signature] as AbiFunction;\n const decodedFunction = decodeFunctionData({\n abi: [func],\n data: transaction.input,\n });\n const scalarValue = decodedFunction.args[criteria.fieldIndex] as string;\n if (scalarValue === undefined || scalarValue === null) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode function data for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else {\n throw new InvalidCriteriaTypeError(\n `Invalid criteria type ${criteria.criteriaType}`,\n );\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 readErc20PeggedVariableCriteriaIncentiveV2Claims(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2Claimed(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2Asset(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 readErc20PeggedVariableCriteriaIncentiveV2Peg(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 readErc20PeggedVariableCriteriaIncentiveV2Reward(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2Limit(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 } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Claim(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n const hash = await writeErc20PeggedVariableCriteriaIncentiveV2Claim(\n this._config,\n request,\n );\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 } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Clawback(\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 writeErc20PeggedVariableCriteriaIncentiveV2Clawback(\n this._config,\n request,\n );\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 readErc20PeggedVariableCriteriaIncentiveV2IsClaimable(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2GetPeg(\n this._config,\n {\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 /**\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 [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n\n /**\n *Functions from the ERC20VariableIncentive contract\n */\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getIncentiveCriteria(\n params?: ReadParams,\n ): Promise<IncentiveCriteria> {\n try {\n const criteria =\n await readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return criteria;\n } catch (e) {\n throw new IncentiveCriteriaNotFoundError(e as Error);\n }\n }\n\n /**\n * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing\n * the existing `limit` field by `netAmount`. The entire payload is then re-encoded\n * via `prepareERC20PeggedIncentivePayload(...)`.\n *\n * @public\n * @param {bigint} netAmount - The additional limit to add to this incentive.\n * @returns {Hex} The ABI-encoded payload with the updated `limit`.\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n return prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset: (await this.asset()) ?? zeroAddress,\n peg: this.payload?.peg ?? zeroAddress,\n reward: this.payload?.reward ?? 0n,\n limit: netAmount,\n maxReward: this.payload?.maxReward ?? 0n,\n manager: this.payload?.manager ?? zeroAddress,\n criteria: this.payload?.criteria ?? {\n criteriaType: 0,\n signature: zeroHash,\n fieldIndex: 0,\n targetContract: zeroAddress,\n valueType: 0,\n },\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedVariableCriteriaIncentiveV2Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedVariableCriteriaIncentiveV2Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedVariableCriteriaIncentiveV2Abi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedVariableCriteriaIncentiveV2Payload(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 ERC20PeggedVariableCriteriaIncentivePayload.\n *\n * @public\n * @param {bigint} signedAmount\n * @returns {Hash} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentiveV2Payload.\n */\n public buildClaimData(signedAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'signedAmount' }],\n [signedAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {Promise<bigint>} Returns the reward amount from a claim data payload\n */\n public async decodeClaimData(claimData: Hex) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n const [reward, maxReward] = await Promise.all([\n this.reward(),\n this.getMaxReward(),\n ]);\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n * Use this function instead of `decodeClaimData` if you have reward details.\n *\n * @public\n * @param {Hex} claimData\n * @param {bigint} [reward]\n * @param {bigint} [maxReward]\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimDataWithRewardDetails(\n claimData: Hex,\n reward: bigint,\n maxReward: bigint,\n ) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n}\n\n/**\n * Given a {@link ERC20PeggedVariableCriteriaIncentiveV2Payload}, properly encode a `ERC20PeggedVariableCriteriaIncentiveV2Payload.InitPayload` for use with {@link ERC20PeggedVariableCriteriaIncentiveV2Payload} initialization.\n *\n * @param {ERC20PeggedVariableCriteriaIncentiveV2Payload} 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 * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset,\n peg,\n reward,\n limit,\n maxReward = 0n,\n manager = zeroAddress,\n criteria,\n}: ERC20PeggedVariableCriteriaIncentiveV2Payload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\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 { type: 'uint256', name: 'maxReward' },\n {\n type: 'tuple',\n name: 'criteria',\n components: [\n { type: 'uint8', name: 'criteriaType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint8', name: 'valueType' },\n ],\n },\n ],\n },\n ],\n [\n {\n asset,\n peg,\n reward,\n limit,\n manager,\n maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n valueType: criteria.valueType,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20PeggedVariableCriteriaIncentiveV2","DeployableTarget","erc20PeggedVariableCriteriaIncentiveV2Abi","params","readErc20PeggedVariableCriteriaIncentiveV2Owner","readErc20PeggedVariableCriteriaIncentiveV2CurrentReward","readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","scalarValue","_a","DecodedArgsError","e","transaction","getTransaction","func","decodeFunctionData","InvalidCriteriaTypeError","readErc20PeggedVariableCriteriaIncentiveV2Claims","readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed","address","readErc20PeggedVariableCriteriaIncentiveV2Claimed","readErc20PeggedVariableCriteriaIncentiveV2Asset","readErc20PeggedVariableCriteriaIncentiveV2Peg","readErc20PeggedVariableCriteriaIncentiveV2Reward","readErc20PeggedVariableCriteriaIncentiveV2Limit","payload","request","result","simulateErc20PeggedVariableCriteriaIncentiveV2Claim","prepareClaimPayload","writeErc20PeggedVariableCriteriaIncentiveV2Claim","simulateErc20PeggedVariableCriteriaIncentiveV2Clawback","writeErc20PeggedVariableCriteriaIncentiveV2Clawback","readErc20PeggedVariableCriteriaIncentiveV2IsClaimable","readErc20PeggedVariableCriteriaIncentiveV2GetPeg","totalClaimed","limit","readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria","IncentiveCriteriaNotFoundError","netAmount","prepareERC20PeggedVariableCriteriaIncentiveV2Payload","zeroAddress","_b","_c","_d","_e","zeroHash","_payload","_options","options","bytecode","amount","encodeAbiParameters","signedAmount","claimData","boostClaimData","decodeAbiParameters","claimAmount","reward","maxReward","parseEther","ERC20PeggedVariableCriteriaIncentiveV2Bases","RegistryType","ERC20PeggedVariableCriteriaIncentiveV2","asset","peg","manager"],"mappings":"wgkBA4IaA,EAAN,MAAMA,UAA+CC,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