@boostxyz/sdk 5.5.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +4 -4
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +2 -1
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +110 -105
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +2 -2
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +25 -25
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.cjs.map +1 -1
- package/dist/Auth/PassthroughAuth.js +14 -14
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +261 -0
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +442 -262
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.js +43 -43
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budget-CsqSI4NH.cjs +2 -0
- package/dist/Budget-CsqSI4NH.cjs.map +1 -0
- package/dist/Budget-bMiAGF8s.js +922 -0
- package/dist/Budget-bMiAGF8s.js.map +1 -0
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.d.ts +5 -4
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +3 -3
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.js +53 -53
- package/dist/Budgets/ManagedBudgetWithFees.d.ts +26 -0
- package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts +1331 -0
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -0
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +15 -15
- package/dist/Incentive-DZLG6T1-.js +1036 -0
- package/dist/Incentive-DZLG6T1-.js.map +1 -0
- package/dist/Incentive-DvNdIJ_x.cjs +2 -0
- package/dist/Incentive-DvNdIJ_x.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +9 -1
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +64 -47
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +12 -1
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +64 -33
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.d.ts +37 -1
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +73 -49
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedIncentive.d.ts +35 -0
- package/dist/Incentives/ERC20PeggedIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +35 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +25 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +24 -24
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +35 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +55 -38
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +25 -0
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +3 -3
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.d.ts +8 -0
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +50 -28
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-BAIrFBAW.cjs +2 -0
- package/dist/{SimpleDenyList-CsRXJPwm.cjs.map → SimpleDenyList-BAIrFBAW.cjs.map} +1 -1
- package/dist/SimpleDenyList-C734XLxt.js +133 -0
- package/dist/{SimpleDenyList-ByAr4X1r.js.map → SimpleDenyList-C734XLxt.js.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts.map +1 -1
- package/dist/Validators/LimitedSignerValidator.js +33 -33
- package/dist/Validators/LimitedSignerValidator.js.map +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +1 -1
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +26 -26
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +4 -4
- package/dist/componentInterfaces-5Ezh3Pvx.js +19 -0
- package/dist/componentInterfaces-5Ezh3Pvx.js.map +1 -0
- package/dist/componentInterfaces-Cm4Zfn1v.cjs +2 -0
- package/dist/componentInterfaces-Cm4Zfn1v.cjs.map +1 -0
- package/dist/{deployments-D0fs26TV.js → deployments-3RHH-eW7.js} +47 -47
- package/dist/{deployments-D0fs26TV.js.map → deployments-3RHH-eW7.js.map} +1 -1
- package/dist/deployments-CIXw_WKk.cjs +2 -0
- package/dist/deployments-CIXw_WKk.cjs.map +1 -0
- package/dist/deployments.json +24 -24
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/generated-BPiHi7W2.cjs +3 -0
- package/dist/generated-BPiHi7W2.cjs.map +1 -0
- package/dist/{generated-Cyvr_Tjx.js → generated-CElkFqkY.js} +1510 -608
- package/dist/generated-CElkFqkY.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +153 -150
- package/package.json +2 -2
- package/src/Actions/EventAction.ts +25 -6
- package/src/AllowLists/SimpleAllowList.ts +2 -2
- package/src/BoostCore.test.ts +124 -2
- package/src/BoostCore.ts +259 -0
- package/src/Budgets/Budget.ts +8 -2
- package/src/Budgets/ManagedBudgetWithFees.test.ts +0 -1
- package/src/Budgets/ManagedBudgetWithFeesV2.test.ts +327 -0
- package/src/Budgets/ManagedBudgetWithFeesV2.ts +713 -0
- package/src/Incentives/AllowListIncentive.ts +17 -0
- package/src/Incentives/CGDAIncentive.ts +31 -0
- package/src/Incentives/ERC20Incentive.ts +27 -0
- package/src/Incentives/ERC20PeggedIncentive.ts +18 -0
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +26 -0
- package/src/Incentives/ERC20VariableIncentive.ts +18 -0
- package/src/Incentives/PointsIncentive.ts +22 -0
- package/src/Validators/LimitedSignerValidator.ts +1 -1
- package/src/Validators/SignerValidator.ts +1 -1
- package/src/errors.ts +1 -1
- package/src/index.ts +1 -0
- package/dist/Budget-AoNx7uFd.cjs +0 -2
- package/dist/Budget-AoNx7uFd.cjs.map +0 -1
- package/dist/Budget-DYIV9iNK.js +0 -463
- package/dist/Budget-DYIV9iNK.js.map +0 -1
- package/dist/Incentive-BbkfwGOb.cjs +0 -2
- package/dist/Incentive-BbkfwGOb.cjs.map +0 -1
- package/dist/Incentive-qlnv5kQB.js +0 -991
- package/dist/Incentive-qlnv5kQB.js.map +0 -1
- package/dist/SimpleDenyList-ByAr4X1r.js +0 -133
- package/dist/SimpleDenyList-CsRXJPwm.cjs +0 -2
- package/dist/componentInterfaces-D7r9xJmt.cjs +0 -2
- package/dist/componentInterfaces-D7r9xJmt.cjs.map +0 -1
- package/dist/componentInterfaces-PR3ijhgZ.js +0 -18
- package/dist/componentInterfaces-PR3ijhgZ.js.map +0 -1
- package/dist/deployments-DoIOqxco.cjs +0 -2
- package/dist/deployments-DoIOqxco.cjs.map +0 -1
- package/dist/generated-Cyvr_Tjx.js.map +0 -1
- package/dist/generated-DtYPHhtX.cjs +0 -3
- package/dist/generated-DtYPHhtX.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { d as l,
|
|
1
|
+
import { d as l, b1 as w, b2 as I } from "../generated-CElkFqkY.js";
|
|
2
2
|
import { getTransactionReceipt as v, getTransaction as E } from "@wagmi/core";
|
|
3
3
|
import { parseEventLogs as x, decodeFunctionData as C, encodeAbiParameters as T, zeroHash as A, zeroAddress as N } from "viem";
|
|
4
|
-
import { b as R } from "../deployments-
|
|
4
|
+
import { b as R } from "../deployments-3RHH-eW7.js";
|
|
5
5
|
import { SignatureType as o } from "../Actions/EventAction.js";
|
|
6
6
|
import { IncentiveCriteriaNotFoundError as V, NoMatchingLogsError as p, DecodedArgsError as i, InvalidCriteriaTypeError as $ } from "../errors.js";
|
|
7
7
|
import { CheatCodes as y } from "../utils.js";
|
|
8
8
|
import { ERC20VariableIncentive as F } from "./ERC20VariableIncentive.js";
|
|
9
|
-
const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612d1b806100bd5f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c6e565b61084b565b6040516102509190611cb3565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611ce4565b60405180910390f35b61029d60048036038101906102989190611d27565b6108cc565b005b6102b960048036038101906102b49190611dac565b6108d9565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611dac565b6108ef565b6040516102ee9190611cb3565b60405180910390f35b348015610302575f80fd5b5061030b610905565b6040516103189190611ce4565b60405180910390f35b61032961090a565b005b348015610336575f80fd5b5061033f61095b565b60405161034c9190611df9565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611e12565b610982565b6040516103889190611ce4565b60405180910390f35b34801561039c575f80fd5b506103a561099b565b6040516103b29190611e4c565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611f1b565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190611fee565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190611fee565b610d9c565b60405161043f929190612039565b60405180910390f35b610462600480360381019061045d9190611dac565b610f06565b005b34801561046f575f80fd5b5061048a60048036038101906104859190611fee565b610f1c565b60405161049791906120d0565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611dac565b610fea565b6040516104d39190611cb3565b60405180910390f35b6104e4611001565b005b3480156104f1575f80fd5b506104fa61103a565b6040516105079190611ce4565b60405180910390f35b610518611040565b005b348015610525575f80fd5b5061052e611053565b60405161053b9190611ce4565b60405180910390f35b34801561054f575f80fd5b50610558611058565b6040516105689493929190612196565b60405180910390f35b34801561057c575f80fd5b506105856110ad565b6040516105929190611e4c565b60405180910390f35b3480156105a6575f80fd5b506105af6110d5565b6040516105bc9190611ce4565b60405180910390f35b3480156105d0575f80fd5b506105d96110db565b6040516105e69190612268565b60405180910390f35b3480156105fa575f80fd5b5061061560048036038101906106109190612281565b6111aa565b6040516106229190611cb3565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c9190612333565b6113d7565b005b34801561065e575f80fd5b5061066761148d565b6040516106749190611ce4565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611e12565b611496565b6040516106b09190611cb3565b60405180910390f35b3480156106c4575f80fd5b506106cd6114b3565b6040516106da9190611ce4565b60405180910390f35b3480156106ee575f80fd5b5061070960048036038101906107049190612281565b6114b9565b6040516107169190611cb3565b60405180910390f35b34801561072a575f80fd5b5061074560048036038101906107409190612333565b6114cc565b005b348015610752575f80fd5b5061075b611582565b6040516107689190611ce4565b60405180910390f35b34801561077c575f80fd5b50610785611588565b6040516107929190611ce4565b60405180910390f35b6107b560048036038101906107b09190611e12565b61158d565b005b6107d160048036038101906107cc9190611e12565b6115cb565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611e12565b6115f4565b6040516108069190611cb3565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611e12565b611647565b6040516108429190611ce4565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc82611660565b5b9050919050565b5f8054905090565b6108d633826116d9565b50565b6108e16116e8565b6108eb828261171f565b5050565b5f81826108fb85610982565b1614905092915050565b5f5481565b5f61091361172f565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb81611739565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a6123b1565b5b9050602002016020810190610a409190612408565b90506001151581151503610a8557610a80878784818110610a6457610a636123b1565b5b9050602002016020810190610a799190611e12565b600161171f565b610ab8565b610ab7878784818110610a9b57610a9a6123b1565b5b9050602002016020810190610ab09190611e12565b60016116d9565b5b508080600101915050610a0c565b505050505050565b5f610ad761176e565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a9190612629565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661179790919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb93929190612655565b60405180910390fd5b8560035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550845f8190555083600281905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c796120f0565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc336117ca565b610d073360016118a0565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610d53949392919061268a565b60405180910390a2505050505050508015610d97576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610da981611739565b5f8585810190610db991906127e6565b90505f8160200151806020019051810190610dd49190612841565b90508060025f828254610de79190612899565b92505081905550610e3d825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118e19092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610eb193929190612931565b604051602081830303815290604052604051610ecd91906120d0565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610f0e6116e8565b610f1882826116d9565b5050565b60605f808484810190610f2f91906129a8565b9250509150604051806080016040528060016002811115610f5357610f526120f0565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610faf9190612a21565b604051602081830303815290604052815250604051602001610fd19190612b28565b6040516020818303038152906040529250505092915050565b5f8082610ff685610982565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b6110486116e8565b6110515f61192a565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b6110e3611bb6565b60076040518060800160405290815f82015f9054906101000a900460ff166001811115611113576111126120f0565b5b6001811115611125576111246120f0565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f6111b36116e8565b5f83838101906111c39190612bcd565b90505f81602001518060200190518101906111de9190612841565b90505f6111ea876119f0565b611220576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80540361123057819050611253565b670de0b6b3a7640000825f546112469190612c14565b6112509190612c82565b90505b5f60065414158015611266575060065481115b156112715760065490505b600254816005546112829190612cb2565b11156112ba576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112cb9190612cb2565b92505081905550600160045f8282546112e49190612cb2565b92505081905550611337878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118e19092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689846040516020016113a593929190612931565b6040516020818303038152906040526040516113c191906120d0565b60405180910390a2600193505050509392505050565b60026113e281611739565b828290508585905014611421576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561148557611478868683818110611444576114436123b1565b5b90506020020160208101906114599190611e12565b85858481811061146c5761146b6123b1565b5b9050602002013561171f565b8080600101915050611423565b505050505050565b5f600654905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f6114c3846119f0565b90509392505050565b60026114d781611739565b828290508585905014611516576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561157a5761156d868683818110611539576115386123b1565b5b905060200201602081019061154e9190611e12565b858584818110611561576115606123b1565b5b905060200201356116d9565b8080600101915050611518565b505050505050565b60045481565b600181565b6115956116e8565b63389a75e1600c52805f526020600c2080544211156115bb57636f5e88185f526004601cfd5b5f8155506115c88161192a565b50565b6115d36116e8565b8060601b6115e857637448fbae5f526004601cfd5b6115f18161192a565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166116146110ad565b73ffffffffffffffffffffffffffffffffffffffff161480611640575061163f826002600117610fea565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806116d257506116d1826119ff565b5b9050919050565b6116e482825f611a78565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461171d576382b429005f526004601cfd5b565b61172b82826001611a78565b5050565b5f6202a300905090565b638b78c6d81954331461176b57638b78c6d8600c52335f52806020600c20541661176a576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6117d2611ad0565b1561184a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561180c57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061189d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611921576390b8ec185f526004601cfd5b5f603452505050565b611932611ad0565b15611997577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506119ed565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a715750611a7082611ad4565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611a9a57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b465750611b4582611b4d565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611bd457611bd36120f0565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c4d81611c19565b8114611c57575f80fd5b50565b5f81359050611c6881611c44565b92915050565b5f60208284031215611c8357611c82611c11565b5b5f611c9084828501611c5a565b91505092915050565b5f8115159050919050565b611cad81611c99565b82525050565b5f602082019050611cc65f830184611ca4565b92915050565b5f819050919050565b611cde81611ccc565b82525050565b5f602082019050611cf75f830184611cd5565b92915050565b611d0681611ccc565b8114611d10575f80fd5b50565b5f81359050611d2181611cfd565b92915050565b5f60208284031215611d3c57611d3b611c11565b5b5f611d4984828501611d13565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611d7b82611d52565b9050919050565b611d8b81611d71565b8114611d95575f80fd5b50565b5f81359050611da681611d82565b92915050565b5f8060408385031215611dc257611dc1611c11565b5b5f611dcf85828601611d98565b9250506020611de085828601611d13565b9150509250929050565b611df381611c19565b82525050565b5f602082019050611e0c5f830184611dea565b92915050565b5f60208284031215611e2757611e26611c11565b5b5f611e3484828501611d98565b91505092915050565b611e4681611d71565b82525050565b5f602082019050611e5f5f830184611e3d565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611e8657611e85611e65565b5b8235905067ffffffffffffffff811115611ea357611ea2611e69565b5b602083019150836020820283011115611ebf57611ebe611e6d565b5b9250929050565b5f8083601f840112611edb57611eda611e65565b5b8235905067ffffffffffffffff811115611ef857611ef7611e69565b5b602083019150836020820283011115611f1457611f13611e6d565b5b9250929050565b5f805f8060408587031215611f3357611f32611c11565b5b5f85013567ffffffffffffffff811115611f5057611f4f611c15565b5b611f5c87828801611e71565b9450945050602085013567ffffffffffffffff811115611f7f57611f7e611c15565b5b611f8b87828801611ec6565b925092505092959194509250565b5f8083601f840112611fae57611fad611e65565b5b8235905067ffffffffffffffff811115611fcb57611fca611e69565b5b602083019150836001820283011115611fe757611fe6611e6d565b5b9250929050565b5f806020838503121561200457612003611c11565b5b5f83013567ffffffffffffffff81111561202157612020611c15565b5b61202d85828601611f99565b92509250509250929050565b5f60408201905061204c5f830185611cd5565b6120596020830184611e3d565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6120a282612060565b6120ac818561206a565b93506120bc81856020860161207a565b6120c581612088565b840191505092915050565b5f6020820190508181035f8301526120e88184612098565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061212e5761212d6120f0565b5b50565b5f81905061213e8261211d565b919050565b5f61214d82612131565b9050919050565b61215d81612143565b82525050565b5f819050919050565b61217581612163565b82525050565b5f60ff82169050919050565b6121908161217b565b82525050565b5f6080820190506121a95f830187612154565b6121b6602083018661216c565b6121c36040830185612187565b6121d06060830184611e3d565b95945050505050565b6121e281612143565b82525050565b6121f181612163565b82525050565b6122008161217b565b82525050565b61220f81611d71565b82525050565b608082015f8201516122295f8501826121d9565b50602082015161223c60208501826121e8565b50604082015161224f60408501826121f7565b5060608201516122626060850182612206565b50505050565b5f60808201905061227b5f830184612215565b92915050565b5f805f6040848603121561229857612297611c11565b5b5f6122a586828701611d98565b935050602084013567ffffffffffffffff8111156122c6576122c5611c15565b5b6122d286828701611f99565b92509250509250925092565b5f8083601f8401126122f3576122f2611e65565b5b8235905067ffffffffffffffff8111156123105761230f611e69565b5b60208301915083602082028301111561232c5761232b611e6d565b5b9250929050565b5f805f806040858703121561234b5761234a611c11565b5b5f85013567ffffffffffffffff81111561236857612367611c15565b5b61237487828801611e71565b9450945050602085013567ffffffffffffffff81111561239757612396611c15565b5b6123a3878288016122de565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6123e781611c99565b81146123f1575f80fd5b50565b5f81359050612402816123de565b92915050565b5f6020828403121561241d5761241c611c11565b5b5f61242a848285016123f4565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61246d82612088565b810181811067ffffffffffffffff8211171561248c5761248b612437565b5b80604052505050565b5f61249e611c08565b90506124aa8282612464565b919050565b5f80fd5b600281106124bf575f80fd5b50565b5f813590506124d0816124b3565b92915050565b6124df81612163565b81146124e9575f80fd5b50565b5f813590506124fa816124d6565b92915050565b6125098161217b565b8114612513575f80fd5b50565b5f8135905061252481612500565b92915050565b5f6080828403121561253f5761253e612433565b5b6125496080612495565b90505f612558848285016124c2565b5f83015250602061256b848285016124ec565b602083015250604061257f84828501612516565b604083015250606061259384828501611d98565b60608301525092915050565b5f61010082840312156125b5576125b4612433565b5b6125bf60a0612495565b90505f6125ce84828501611d98565b5f8301525060206125e184828501611d13565b60208301525060406125f584828501611d13565b604083015250606061260984828501611d13565b606083015250608061261d8482850161252a565b60808301525092915050565b5f610100828403121561263f5761263e611c11565b5b5f61264c8482850161259f565b91505092915050565b5f6060820190506126685f830186611e3d565b6126756020830185611cd5565b6126826040830184611cd5565b949350505050565b5f60e08201905061269d5f830187611cd5565b6126aa6020830186611cd5565b6126b76040830185611cd5565b6126c46060830184612215565b95945050505050565b5f80fd5b5f67ffffffffffffffff8211156126eb576126ea612437565b5b6126f482612088565b9050602081019050919050565b828183375f83830152505050565b5f61272161271c846126d1565b612495565b90508281526020810184848401111561273d5761273c6126cd565b5b612748848285612701565b509392505050565b5f82601f83011261276457612763611e65565b5b813561277484826020860161270f565b91505092915050565b5f6040828403121561279257612791612433565b5b61279c6040612495565b90505f6127ab84828501611d98565b5f83015250602082013567ffffffffffffffff8111156127ce576127cd6124af565b5b6127da84828501612750565b60208301525092915050565b5f602082840312156127fb576127fa611c11565b5b5f82013567ffffffffffffffff81111561281857612817611c15565b5b6128248482850161277d565b91505092915050565b5f8151905061283b81611cfd565b92915050565b5f6020828403121561285657612855611c11565b5b5f6128638482850161282d565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6128a382611ccc565b91506128ae83611ccc565b92508282039050818111156128c6576128c561286c565b5b92915050565b5f8160601b9050919050565b5f6128e2826128cc565b9050919050565b5f6128f3826128d8565b9050919050565b61290b61290682611d71565b6128e9565b82525050565b5f819050919050565b61292b61292682611ccc565b612911565b82525050565b5f61293c82866128fa565b60148201915061294c82856128fa565b60148201915061295c828461291a565b602082019150819050949350505050565b5f61297782611d52565b9050919050565b6129878161296d565b8114612991575f80fd5b50565b5f813590506129a28161297e565b92915050565b5f805f606084860312156129bf576129be611c11565b5b5f6129cc86828701612994565b93505060206129dd86828701611d13565b92505060406129ee86828701611d13565b9150509250925092565b612a0181611ccc565b82525050565b602082015f820151612a1b5f8501826129f8565b50505050565b5f602082019050612a345f830184612a07565b92915050565b60038110612a4b57612a4a6120f0565b5b50565b5f819050612a5b82612a3a565b919050565b5f612a6a82612a4e565b9050919050565b612a7a81612a60565b82525050565b5f82825260208201905092915050565b5f612a9a82612060565b612aa48185612a80565b9350612ab481856020860161207a565b612abd81612088565b840191505092915050565b5f608083015f830151612add5f860182612a71565b506020830151612af06020860182612206565b506040830151612b036040860182612206565b5060608301518482036060860152612b1b8282612a90565b9150508091505092915050565b5f6020820190508181035f830152612b408184612ac8565b905092915050565b5f60408284031215612b5d57612b5c612433565b5b612b676040612495565b90505f82013567ffffffffffffffff811115612b8657612b856124af565b5b612b9284828501612750565b5f83015250602082013567ffffffffffffffff811115612bb557612bb46124af565b5b612bc184828501612750565b60208301525092915050565b5f60208284031215612be257612be1611c11565b5b5f82013567ffffffffffffffff811115612bff57612bfe611c15565b5b612c0b84828501612b48565b91505092915050565b5f612c1e82611ccc565b9150612c2983611ccc565b9250828202612c3781611ccc565b91508282048414831517612c4e57612c4d61286c565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612c8c82611ccc565b9150612c9783611ccc565b925082612ca757612ca6612c55565b5b828204905092915050565b5f612cbc82611ccc565b9150612cc783611ccc565b9250828201905080821115612cdf57612cde61286c565b5b9291505056fea2646970667358221220238a2694ac11aa8bece7145721bd76ab9cc7b07442e8c97be4bdd87624df868664736f6c634300081a0033", s = class s extends F {
|
|
9
|
+
const _ = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b612096806100855f395ff3fe608060405260043610610277575f3560e01c8063715018a61161014b578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b14610703578063fe9fbb8014610716578063fee81cf414610735575f80fd5b8063ec87621c146106dc578063f04e283e146106f0575f80fd5b8063db09da12116100ac578063db09da1214610689578063dcc21361146106a8578063dcc59b6f146106c7575f80fd5b8063c884ef8314610646578063d54ad2a114610674575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf146105f4578063be4994f814610613578063c213f3f914610632575f80fd5b8063a4d66daf146105be578063a871ced2146105d3575f80fd5b8063715018a61461053857806375b238fc1461054057806377548687146105545780638da5cb5b146105a6575f80fd5b806330db555f116101f55780634a4ee7b1116101ab578063514e62fc11610191578063514e62fc146104e657806354d1f13d1461051b57806366a78e6c14610523575f80fd5b80634a4ee7b1146104a75780634e7165a2146104ba575f80fd5b80634359d28a116101db5780634359d28a14610420578063439fab911461043f578063474f5a441461045e575f80fd5b806330db555f146103b057806338d52e0f146103cf575f80fd5b80631cd64df41161024a5780632569296211610230578063256929621461033d57806328d6183b146103455780632de948071461037f575f80fd5b80631cd64df4146102f4578063228cb73314610329575f80fd5b806301ffc9a71461027b57806307621eca146102af578063183a4f6e146102cc5780631c10893f146102e1575b5f80fd5b348015610286575f80fd5b5061029a6102953660046117f6565b610766565b60405190151581526020015b60405180910390f35b3480156102ba575f80fd5b505f545b6040519081526020016102a6565b6102df6102da36600461183c565b6107c1565b005b6102df6102ef366004611874565b6107ce565b3480156102ff575f80fd5b5061029a61030e366004611874565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610334575f80fd5b506102be5f5481565b6102df6107e4565b348015610350575f80fd5b506040517f52b8e45c0000000000000000000000000000000000000000000000000000000081526020016102a6565b34801561038a575f80fd5b506102be61039936600461189e565b638b78c6d8600c9081525f91909152602090205490565b3480156103bb575f80fd5b506102df6103ca36600461183c565b610831565b3480156103da575f80fd5b506003546103fb9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102a6565b34801561042b575f80fd5b506102df61043a366004611901565b6108ed565b34801561044a575f80fd5b506102df6104593660046119ab565b6109e7565b348015610469575f80fd5b5061047d6104783660046119ab565b610cd1565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102a6565b6102df6104b5366004611874565b610e33565b3480156104c5575f80fd5b506104d96104d43660046119ab565b610e45565b6040516102a69190611a36565b3480156104f1575f80fd5b5061029a610500366004611874565b638b78c6d8600c9081525f9290925260209091205416151590565b6102df610f2e565b34801561052e575f80fd5b506102be60065481565b6102df610f67565b34801561054b575f80fd5b506102be600281565b34801561055f575f80fd5b506007546008546009546105969260ff908116929190811690610100900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102a69493929190611a89565b3480156105b1575f80fd5b50638b78c6d819546103fb565b3480156105c9575f80fd5b506102be60025481565b3480156105de575f80fd5b506105e7610f7a565b6040516102a69190611b11565b3480156105ff575f80fd5b5061029a61060e366004611b1f565b611014565b34801561061e575f80fd5b506102df61062d366004611901565b611245565b34801561063d575f80fd5b506006546102be565b348015610651575f80fd5b5061029a61066036600461189e565b60016020525f908152604090205460ff1681565b34801561067f575f80fd5b506102be60055481565b348015610694575f80fd5b5061029a6106a3366004611b1f565b6112e3565b3480156106b3575f80fd5b506102df6106c2366004611901565b6112f9565b3480156106d2575f80fd5b506102be60045481565b3480156106e7575f80fd5b506102be600181565b6102df6106fe36600461189e565b611397565b6102df61071136600461189e565b6113d1565b348015610721575f80fd5b5061029a61073036600461189e565b6113f7565b348015610740575f80fd5b506102be61074f36600461189e565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f52b8e45c0000000000000000000000000000000000000000000000000000000014806107bb57506107bb82611456565b92915050565b6107cb33826114ab565b50565b6107d66114b6565b6107e082826114d0565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161083c816114dc565b815f03610875576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035461089a9073ffffffffffffffffffffffffffffffffffffffff1633308561150d565b8160025f8282546108ab9190611b9d565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026108f8816114dc565b838214610931576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df575f84848381811061094e5761094e611bb0565b90506020020160208101906109639190611bdd565b90508015156001036109a5576109a087878481811061098457610984611bb0565b9050602002016020810190610999919061189e565b60016114d0565b6109d6565b6109d68787848181106109ba576109ba611bb0565b90506020020160208101906109cf919061189e565b60016114ab565b50600101610933565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610a385760018160011c14303b10610a2f5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610a4683850185611c98565b805160208201516040830151606084015160808501519495509293919290915f839003610a9f576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ac073ffffffffffffffffffffffffffffffffffffffff871630611565565b905083811015610b295786516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810185905260640160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555f8581556002859055600684905560055581516007805484929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610bba57610bba611a48565b02179055506020820151600182015560408201516002909101805460609093015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090931660ff90921691909117919091179055610c3133611598565b610c3c3360016115e0565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610c889493929190611d6f565b60405180910390a2505050505050508015610ccc576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610cde816114dc565b5f610ceb85870187611e43565b90505f8160200151806020019051810190610d069190611ec2565b90508060025f828254610d199190611ed9565b90915550508151600354610d469173ffffffffffffffffffffffffffffffffffffffff9091169083611621565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610e0491611a36565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610e3b6114b6565b6107e082826114ab565b60605f80610e5584860186611eec565b9250509150604051806080016040528060016002811115610e7857610e78611a48565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610ed79151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610f159190602001611f1e565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610f6f6114b6565b610f785f61166a565b565b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810190915260078054829060ff166001811115610fc257610fc2611a48565b6001811115610fd357610fd3611a48565b81526001820154602082015260029091015460ff81166040830152610100900473ffffffffffffffffffffffffffffffffffffffff16606090910152919050565b5f61101d6114b6565b5f61102a83850185611f94565b90505f81602001518060200190518101906110459190611ec2565b90505f6110556002546005541090565b61108b576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f545f0361109a5750806110bd565b670de0b6b3a7640000825f546110b09190612011565b6110ba9190612028565b90505b600654158015906110cf575060065481115b156110d957506006545b600254816005546110ea9190611b9d565b1115611122576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546111339190611b9d565b92505081905550600160045f82825461114c9190611b9d565b90915550506003546111759073ffffffffffffffffffffffffffffffffffffffff168883611621565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261123091611a36565b60405180910390a25060019695505050505050565b6002611250816114dc565b838214611289576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df576112db8686838181106112a8576112a8611bb0565b90506020020160208101906112bd919061189e565b8585848181106112cf576112cf611bb0565b905060200201356114d0565b60010161128b565b5f6112f16002546005541090565b949350505050565b6002611304816114dc565b83821461133d576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df5761138f86868381811061135c5761135c611bb0565b9050602002016020810190611371919061189e565b85858481811061138357611383611bb0565b905060200201356114ab565b60010161133f565b61139f6114b6565b63389a75e1600c52805f526020600c2080544211156113c557636f5e88185f526004601cfd5b5f90556107cb8161166a565b6113d96114b6565b8060601b6113ee57637448fbae5f526004601cfd5b6107cb8161166a565b5f8173ffffffffffffffffffffffffffffffffffffffff1661141c638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806107bb5750638b78c6d8600c9081525f839052602090205460031615156107bb565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f903181110000000000000000000000000000000000000000000000000000000014806107bb57506107bb826116b4565b6107e082825f611709565b638b78c6d819543314610f78576382b429005f526004601cfd5b6107e082826001611709565b638b78c6d8195433146107cb57638b78c6d8600c52335f52806020600c2054166107cb576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f5114171661155857637939f4245f526004601cfd5b5f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611661576390b8ec185f526004601cfd5b5f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa92167050000000000000000000000000000000000000000000000000000000014806107bb57506107bb82611760565b638b78c6d8600c52825f526020600c2080548381178361172a575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806107bb57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107bb565b5f60208284031215611806575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611835575f80fd5b9392505050565b5f6020828403121561184c575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146107cb575f80fd5b5f8060408385031215611885575f80fd5b823561189081611853565b946020939093013593505050565b5f602082840312156118ae575f80fd5b813561183581611853565b5f8083601f8401126118c9575f80fd5b50813567ffffffffffffffff8111156118e0575f80fd5b6020830191508360208260051b85010111156118fa575f80fd5b9250929050565b5f805f8060408587031215611914575f80fd5b843567ffffffffffffffff81111561192a575f80fd5b611936878288016118b9565b909550935050602085013567ffffffffffffffff811115611955575f80fd5b611961878288016118b9565b95989497509550505050565b5f8083601f84011261197d575f80fd5b50813567ffffffffffffffff811115611994575f80fd5b6020830191508360208285010111156118fa575f80fd5b5f80602083850312156119bc575f80fd5b823567ffffffffffffffff8111156119d2575f80fd5b6119de8582860161196d565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f61183560208301846119ea565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611a8557611a85611a48565b9052565b60808101611a978287611a75565b84602083015260ff8416604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b611ad6828251611a75565b6020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301525050565b608081016107bb8284611acb565b5f805f60408486031215611b31575f80fd5b8335611b3c81611853565b9250602084013567ffffffffffffffff811115611b57575f80fd5b611b638682870161196d565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156107bb576107bb611b70565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611bed575f80fd5b81358015158114611835575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160a0810167ffffffffffffffff81118282101715611c4c57611c4c611bfc565b60405290565b6040516080810167ffffffffffffffff81118282101715611c4c57611c4c611bfc565b6040805190810167ffffffffffffffff81118282101715611c4c57611c4c611bfc565b5f81830361010081128015611cab575f80fd5b50611cb4611c29565b8335611cbf81611853565b815260208481013590820152604080850135908201526060808501359082015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083011215611d0e575f80fd5b611d16611c52565b9150608084013560028110611d29575f80fd5b825260a0840135602083015260c084013560ff81168114611d48575f80fd5b604083015260e0840135611d5b81611853565b606083015260808101919091529392505050565b848152602081018490526040810183905260e08101611d916060830184611acb565b95945050505050565b5f82601f830112611da9575f80fd5b813567ffffffffffffffff811115611dc357611dc3611bfc565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff81118282101715611e1057611e10611bfc565b604052818152838201602001851015611e27575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215611e53575f80fd5b813567ffffffffffffffff811115611e69575f80fd5b820160408185031215611e7a575f80fd5b611e82611c75565b8135611e8d81611853565b8152602082013567ffffffffffffffff811115611ea8575f80fd5b611eb486828501611d9a565b602083015250949350505050565b5f60208284031215611ed2575f80fd5b5051919050565b818103818111156107bb576107bb611b70565b5f805f60608486031215611efe575f80fd5b8335611f0981611853565b95602085013595506040909401359392505050565b602081525f825160038110611f3557611f35611a48565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526112f160a08401826119ea565b5f60208284031215611fa4575f80fd5b813567ffffffffffffffff811115611fba575f80fd5b820160408185031215611fcb575f80fd5b611fd3611c75565b813567ffffffffffffffff811115611fe9575f80fd5b611ff586828501611d9a565b825250602082013567ffffffffffffffff811115611ea8575f80fd5b80820281158282048414176107bb576107bb611b70565b5f8261205b577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220a054d83b4648d8288f47fd626c174e69093fb97c77e64305e6a84b53711a253064736f6c634300081a0033", s = class s extends F {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments), this.abi = l;
|
|
12
12
|
}
|
|
@@ -57,32 +57,32 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
57
57
|
* @returns {Promise<bigint>}
|
|
58
58
|
* @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}
|
|
59
59
|
*/
|
|
60
|
-
async getIncentiveScalar({ chainId: b, hash: e, knownSignatures: t },
|
|
60
|
+
async getIncentiveScalar({ chainId: b, hash: e, knownSignatures: t }, d) {
|
|
61
61
|
var u;
|
|
62
|
-
const f = await this.getIncentiveCriteria(
|
|
62
|
+
const f = await this.getIncentiveCriteria(d);
|
|
63
63
|
if (f.criteriaType === o.EVENT) {
|
|
64
|
-
const
|
|
64
|
+
const a = await v(this._config, {
|
|
65
65
|
chainId: b,
|
|
66
66
|
hash: e
|
|
67
67
|
});
|
|
68
68
|
if (f.fieldIndex === y.GAS_REBATE_INCENTIVE)
|
|
69
|
-
return
|
|
70
|
-
(
|
|
71
|
-
const r =
|
|
69
|
+
return a.gasUsed * a.effectiveGasPrice + // Normal gas cost
|
|
70
|
+
(a.blobGasUsed ?? 0n) * (a.blobGasPrice ?? 0n);
|
|
71
|
+
const r = a.logs;
|
|
72
72
|
if (r.length === 0)
|
|
73
73
|
throw new p(
|
|
74
74
|
`No logs found for event signature ${f.signature}`
|
|
75
75
|
);
|
|
76
76
|
try {
|
|
77
|
-
const n = t[f.signature],
|
|
77
|
+
const n = t[f.signature], c = x({
|
|
78
78
|
abi: [n],
|
|
79
79
|
logs: r
|
|
80
80
|
});
|
|
81
|
-
if (
|
|
81
|
+
if (c == null || c.length === 0)
|
|
82
82
|
throw new p(
|
|
83
83
|
`No logs found for event signature ${f.signature}`
|
|
84
84
|
);
|
|
85
|
-
const g = ((u =
|
|
85
|
+
const g = ((u = c[0]) == null ? void 0 : u.args)[f.fieldIndex];
|
|
86
86
|
if (g === void 0)
|
|
87
87
|
throw new i(
|
|
88
88
|
`Decoded argument at index ${f.fieldIndex} is undefined`
|
|
@@ -94,20 +94,20 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
} else if (f.criteriaType === o.FUNC) {
|
|
97
|
-
const
|
|
97
|
+
const a = await E(this._config, {
|
|
98
98
|
chainId: b,
|
|
99
99
|
hash: e
|
|
100
100
|
});
|
|
101
101
|
try {
|
|
102
|
-
const r = t[f.signature],
|
|
102
|
+
const r = t[f.signature], c = C({
|
|
103
103
|
abi: [r],
|
|
104
|
-
data:
|
|
104
|
+
data: a.input
|
|
105
105
|
}).args[f.fieldIndex];
|
|
106
|
-
if (
|
|
106
|
+
if (c == null)
|
|
107
107
|
throw new i(
|
|
108
108
|
`Decoded argument at index ${f.fieldIndex} is undefined`
|
|
109
109
|
);
|
|
110
|
-
return BigInt(
|
|
110
|
+
return BigInt(c);
|
|
111
111
|
} catch (r) {
|
|
112
112
|
throw new i(
|
|
113
113
|
`Failed to decode function data for signature ${f.signature}: ${r.message}`
|
|
@@ -127,7 +127,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
127
127
|
* @returns {GenericDeployableParams}
|
|
128
128
|
*/
|
|
129
129
|
buildParameters(b, e) {
|
|
130
|
-
const [t,
|
|
130
|
+
const [t, d] = this.validateDeploymentConfig(
|
|
131
131
|
b,
|
|
132
132
|
e
|
|
133
133
|
);
|
|
@@ -135,7 +135,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
135
135
|
abi: l,
|
|
136
136
|
bytecode: _,
|
|
137
137
|
args: [P(t)],
|
|
138
|
-
...this.optionallyAttachAccount(
|
|
138
|
+
...this.optionallyAttachAccount(d.account)
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
};
|
|
@@ -157,7 +157,7 @@ function P({
|
|
|
157
157
|
reward: b,
|
|
158
158
|
limit: e,
|
|
159
159
|
maxReward: t = 0n,
|
|
160
|
-
criteria:
|
|
160
|
+
criteria: d
|
|
161
161
|
}) {
|
|
162
162
|
return T(
|
|
163
163
|
[
|
|
@@ -189,10 +189,10 @@ function P({
|
|
|
189
189
|
limit: e,
|
|
190
190
|
maxReward: t,
|
|
191
191
|
criteria: {
|
|
192
|
-
criteriaType:
|
|
193
|
-
signature:
|
|
194
|
-
fieldIndex:
|
|
195
|
-
targetContract:
|
|
192
|
+
criteriaType: d.criteriaType,
|
|
193
|
+
signature: d.signature,
|
|
194
|
+
fieldIndex: d.fieldIndex,
|
|
195
|
+
targetContract: d.targetContract
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20VariableCriteriaIncentive.js","sources":["../../src/Incentives/ERC20VariableCriteriaIncentive.ts"],"sourcesContent":["import {\n erc20VariableCriteriaIncentiveAbi,\n readErc20VariableCriteriaIncentiveGetIncentiveCriteria,\n readErc20VariableCriteriaIncentiveGetMaxReward,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableCriteriaIncentive.sol/ERC20VariableCriteriaIncentive.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport {\n type AbiEvent,\n type AbiFunction,\n type Address,\n type Hex,\n decodeFunctionData,\n encodeAbiParameters,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20VariableCriteriaIncentive as ERC20VariableCriteriaIncentiveBases } from '../../dist/deployments.json';\nimport { SignatureType } from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport { CheatCodes, type ReadParams } from '../utils';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n\nexport { erc20VariableCriteriaIncentiveAbi };\n\nexport interface ERC20VariableCriteriaIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The amount of the asset to distribute as reward.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The total amount claimable in a single claim or maximum per-action reward.\n *\n * @type {bigint}\n * @optional\n */\n maxReward?: bigint;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteria;\n}\n\nexport interface IncentiveCriteria {\n /**\n * The type of criteria used, either function signature or event signature.\n *\n * @type {SignatureType}\n */\n criteriaType: SignatureType;\n /**\n * The function or event signature used for criteria matching.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index of the field from where the scalar value is extracted.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the contract where the event/function is called/emitted.\n *\n * @type {Address}\n */\n targetContract: Address;\n}\n\nexport interface ReadIncentiveCriteriaParams extends ReadParams {}\n\nexport interface GetIncentiveScalarParams {\n chainId: number;\n hash: Hex;\n knownSignatures: Record<Hex, AbiFunction | AbiEvent>;\n}\n\n/**\n * Extended ERC20 Variable Criteria Incentive class that fetches incentive criteria and scalar\n *\n * @export\n * @class ERC20VariableCriteriaIncentive\n * @typedef {ERC20VariableCriteriaIncentive}\n * @extends {ERC20VariableIncentive<ERC20VariableCriteriaIncentivePayload, typeof erc20VariableCriteriaIncentiveAbi>}\n */\nexport class ERC20VariableCriteriaIncentive extends ERC20VariableIncentive<\n ERC20VariableCriteriaIncentivePayload,\n typeof erc20VariableCriteriaIncentiveAbi\n> {\n //@ts-expect-error instantiated correctly\n public override readonly abi = erc20VariableCriteriaIncentiveAbi;\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_VARIABLE_CRITERIA_INCENTIVE_BASE,\n ...(ERC20VariableCriteriaIncentiveBases as Record<number, Address>),\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 readErc20VariableCriteriaIncentiveGetIncentiveCriteria(\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 * 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 getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward = await readErc20VariableCriteriaIncentiveGetMaxReward(\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 * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableCriteriaIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20VariableCriteriaIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableCriteriaIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20VariableCriteriaIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Creates an IncentiveCriteria object representing a gas rebate incentive.\n * This object defines a variable incentive criteria where the criteria will be the gas spent.\n *\n * The criteria uses a signatureType of EVENT, with a special `fieldIndex` of 255 (using CheatCodes enum), which indicates\n * that the entire gas cost of the transaction will be used as the scalar value. If you don't want to\n * rebate the entire gas cost, you can use a reward value on the incentive..\n *\n * - `criteriaType`: EVENT, indicating it's based on event logs.\n * - `signature`: A zeroed signature (0x0000...0000), matching any event.\n * - `fieldIndex`: 255, indicating the use of transaction gas cost using CheatCodes enum.\n * - `targetContract`: A zeroed address (0x0000...0000), applicable to any contract.\n *\n * @returns {IncentiveCriteria} Returns an IncentiveCriteria object for a gas rebate.\n *\n * @example\n * const incentive = gasRebateIncentiveCriteria();\n * const actionPayload = {\n * criteria: incentive,\n * asset: \"0xAssetAddress\",\n * reward: 0, // Set to zero to rebate the entire gas cost\n * limit: BigInt(1000) // This is the total spend limit for the incentive\n * };\n * deployIncentive(actionPayload);\n */\nexport function gasRebateIncentiveCriteria(): IncentiveCriteria {\n return {\n criteriaType: SignatureType.EVENT,\n signature: zeroHash,\n fieldIndex: CheatCodes.GAS_REBATE_INCENTIVE,\n targetContract: zeroAddress,\n };\n}\n\n/**\n *\n *\n * @param {InitPayloadExtended} param0\n * @param {Address} param0.asset - The address of the ERC20 asset to incentivize.\n * @param {bigint} param0.reward - The reward amount to distribute per action.\n * @param {bigint} param0.limit - The total limit of the asset distribution.\n * @param {bigint} param0.maxReward - The maximum value claimable from a single completion.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20VariableCriteriaIncentivePayload({\n asset,\n reward,\n limit,\n maxReward = 0n,\n criteria,\n}: ERC20VariableCriteriaIncentivePayload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\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 ],\n },\n ],\n },\n ],\n [\n {\n asset: asset,\n reward: reward,\n limit: limit,\n maxReward: maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20VariableCriteriaIncentive","ERC20VariableIncentive","erc20VariableCriteriaIncentiveAbi","params","readErc20VariableCriteriaIncentiveGetIncentiveCriteria","IncentiveCriteriaNotFoundError","readErc20VariableCriteriaIncentiveGetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","scalarValue","_a","DecodedArgsError","e","transaction","getTransaction","func","decodeFunctionData","InvalidCriteriaTypeError","_payload","_options","payload","options","bytecode","prepareERC20VariableCriteriaIncentivePayload","ERC20VariableCriteriaIncentiveBases","ERC20VariableCriteriaIncentive","gasRebateIncentiveCriteria","zeroHash","zeroAddress","asset","reward","limit","maxReward","encodeAbiParameters"],"mappings":";;;;;;;;g8tBAgHaA,IAAN,MAAMA,UAAu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AAAA,QACA,UAAU;AAAA,UACR,cAAcjC,EAAS;AAAA,UACvB,WAAWA,EAAS;AAAA,UACpB,YAAYA,EAAS;AAAA,UACrB,gBAAgBA,EAAS;AAAA,QAC3B;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ERC20VariableCriteriaIncentive.js","sources":["../../src/Incentives/ERC20VariableCriteriaIncentive.ts"],"sourcesContent":["import {\n erc20VariableCriteriaIncentiveAbi,\n readErc20VariableCriteriaIncentiveGetIncentiveCriteria,\n readErc20VariableCriteriaIncentiveGetMaxReward,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableCriteriaIncentive.sol/ERC20VariableCriteriaIncentive.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport {\n type AbiEvent,\n type AbiFunction,\n type Address,\n type Hex,\n decodeFunctionData,\n encodeAbiParameters,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20VariableCriteriaIncentive as ERC20VariableCriteriaIncentiveBases } from '../../dist/deployments.json';\nimport { SignatureType } from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport { CheatCodes, type ReadParams } from '../utils';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n\nexport { erc20VariableCriteriaIncentiveAbi };\n\nexport interface ERC20VariableCriteriaIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The amount of the asset to distribute as reward.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The total amount claimable in a single claim or maximum per-action reward.\n *\n * @type {bigint}\n * @optional\n */\n maxReward?: bigint;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteria;\n}\n\nexport interface IncentiveCriteria {\n /**\n * The type of criteria used, either function signature or event signature.\n *\n * @type {SignatureType}\n */\n criteriaType: SignatureType;\n /**\n * The function or event signature used for criteria matching.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index of the field from where the scalar value is extracted.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the contract where the event/function is called/emitted.\n *\n * @type {Address}\n */\n targetContract: Address;\n}\n\nexport interface ReadIncentiveCriteriaParams extends ReadParams {}\n\nexport interface GetIncentiveScalarParams {\n chainId: number;\n hash: Hex;\n knownSignatures: Record<Hex, AbiFunction | AbiEvent>;\n}\n\n/**\n * Extended ERC20 Variable Criteria Incentive class that fetches incentive criteria and scalar\n *\n * @export\n * @class ERC20VariableCriteriaIncentive\n * @typedef {ERC20VariableCriteriaIncentive}\n * @extends {ERC20VariableIncentive<ERC20VariableCriteriaIncentivePayload, typeof erc20VariableCriteriaIncentiveAbi>}\n */\nexport class ERC20VariableCriteriaIncentive extends ERC20VariableIncentive<\n ERC20VariableCriteriaIncentivePayload,\n typeof erc20VariableCriteriaIncentiveAbi\n> {\n //@ts-expect-error instantiated correctly\n public override readonly abi = erc20VariableCriteriaIncentiveAbi;\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_VARIABLE_CRITERIA_INCENTIVE_BASE,\n ...(ERC20VariableCriteriaIncentiveBases as Record<number, Address>),\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 readErc20VariableCriteriaIncentiveGetIncentiveCriteria(\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 * 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 getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward = await readErc20VariableCriteriaIncentiveGetMaxReward(\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 * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableCriteriaIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20VariableCriteriaIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableCriteriaIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20VariableCriteriaIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Creates an IncentiveCriteria object representing a gas rebate incentive.\n * This object defines a variable incentive criteria where the criteria will be the gas spent.\n *\n * The criteria uses a signatureType of EVENT, with a special `fieldIndex` of 255 (using CheatCodes enum), which indicates\n * that the entire gas cost of the transaction will be used as the scalar value. If you don't want to\n * rebate the entire gas cost, you can use a reward value on the incentive..\n *\n * - `criteriaType`: EVENT, indicating it's based on event logs.\n * - `signature`: A zeroed signature (0x0000...0000), matching any event.\n * - `fieldIndex`: 255, indicating the use of transaction gas cost using CheatCodes enum.\n * - `targetContract`: A zeroed address (0x0000...0000), applicable to any contract.\n *\n * @returns {IncentiveCriteria} Returns an IncentiveCriteria object for a gas rebate.\n *\n * @example\n * const incentive = gasRebateIncentiveCriteria();\n * const actionPayload = {\n * criteria: incentive,\n * asset: \"0xAssetAddress\",\n * reward: 0, // Set to zero to rebate the entire gas cost\n * limit: BigInt(1000) // This is the total spend limit for the incentive\n * };\n * deployIncentive(actionPayload);\n */\nexport function gasRebateIncentiveCriteria(): IncentiveCriteria {\n return {\n criteriaType: SignatureType.EVENT,\n signature: zeroHash,\n fieldIndex: CheatCodes.GAS_REBATE_INCENTIVE,\n targetContract: zeroAddress,\n };\n}\n\n/**\n *\n *\n * @param {InitPayloadExtended} param0\n * @param {Address} param0.asset - The address of the ERC20 asset to incentivize.\n * @param {bigint} param0.reward - The reward amount to distribute per action.\n * @param {bigint} param0.limit - The total limit of the asset distribution.\n * @param {bigint} param0.maxReward - The maximum value claimable from a single completion.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20VariableCriteriaIncentivePayload({\n asset,\n reward,\n limit,\n maxReward = 0n,\n criteria,\n}: ERC20VariableCriteriaIncentivePayload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\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 ],\n },\n ],\n },\n ],\n [\n {\n asset: asset,\n reward: reward,\n limit: limit,\n maxReward: maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20VariableCriteriaIncentive","ERC20VariableIncentive","erc20VariableCriteriaIncentiveAbi","params","readErc20VariableCriteriaIncentiveGetIncentiveCriteria","IncentiveCriteriaNotFoundError","readErc20VariableCriteriaIncentiveGetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","scalarValue","_a","DecodedArgsError","e","transaction","getTransaction","func","decodeFunctionData","InvalidCriteriaTypeError","_payload","_options","payload","options","bytecode","prepareERC20VariableCriteriaIncentivePayload","ERC20VariableCriteriaIncentiveBases","ERC20VariableCriteriaIncentive","gasRebateIncentiveCriteria","zeroHash","zeroAddress","asset","reward","limit","maxReward","encodeAbiParameters"],"mappings":";;;;;;;;skhBAgHaA,IAAN,MAAMA,UAAuCC,EAGlD;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAKL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwB/B,MAAa,qBACXC,GAC4B;AACxB,QAAA;AAUK,aARL,MAAMC;AAAAA,QACJ,KAAK;AAAA,QACL;AAAA,UACE,GAAGD;AAAA,UACH,SAAS,KAAK,mBAAmB;AAAA,QACnC;AAAA,MAAA;AAAA,aAIG,GAAG;AACJ,YAAA,IAAIE,EAA+B,CAAU;AAAA,IACrD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAa,aAAaF,GAAsC;AASvD,WARW,MAAMG;AAAAA,MACtB,KAAK;AAAA,MACL;AAAA,QACE,GAA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ACA,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAjC;AACF,GAA0C;AACjC,SAAAkC;AAAA,IACL;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,YAAY;AAAA,UACV,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,UACjC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,UAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,UACjC,EAAE,MAAM,WAAW,MAAM,YAAY;AAAA,UACrC;AAAA,YACE,MAAM;AAAA,YACN,MAAM;AAAA,YACN,YAAY;AAAA,cACV,EAAE,MAAM,SAAS,MAAM,eAAe;AAAA,cACtC,EAAE,MAAM,WAAW,MAAM,YAAY;AAAA,cACrC,EAAE,MAAM,SAAS,MAAM,aAAa;AAAA,cACpC,EAAE,MAAM,WAAW,MAAM,iBAAiB;AAAA,YAC5C;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE,OAAAJ;AAAA,QACA,QAAAC;AAAA,QACA,OAAAC;AAAA,QACA,WAAAC;AAAA,QACA,UAAU;AAAA,UACR,cAAcjC,EAAS;AAAA,UACvB,WAAWA,EAAS;AAAA,UACpB,YAAYA,EAAS;AAAA,UACrB,gBAAgBA,EAAS;AAAA,QAC3B;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-DtYPHhtX.cjs"),c=require("viem"),o=require("../deployments-DoIOqxco.cjs"),u=require("../Deployable/DeployableTarget.cjs"),i=require("../claiming.cjs"),h=require("../utils.cjs"),g="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6126fd806100bd5f395ff3fe6080604052600436106101ed575f3560e01c806354d1f13d1161010c578063d54ad2a11161009f578063ec87621c1161006e578063ec87621c1461069a578063f04e283e146106c4578063f2fde38b146106e0578063fe9fbb80146106fc578063fee81cf414610738576101ed565b8063d54ad2a1146105e2578063db09da121461060c578063dcc2136114610648578063dcc59b6f14610670576101ed565b8063a4d66daf116100db578063a4d66daf14610518578063bb1757cf14610542578063be4994f81461057e578063c884ef83146105a6576101ed565b806354d1f13d146104b0578063715018a6146104ba57806375b238fc146104c45780638da5cb5b146104ee576101ed565b80632de9480711610184578063474f5a4411610153578063474f5a44146103df5780634a4ee7b11461041c5780634e7165a214610438578063514e62fc14610474576101ed565b80632de948071461032957806338d52e0f146103655780634359d28a1461038f578063439fab91146103b7576101ed565b80631cd64df4116101c05780631cd64df41461028f578063228cb733146102cb57806325692962146102f557806328d6183b146102ff576101ed565b806301ffc9a7146101f157806307621eca1461022d578063183a4f6e146102575780631c10893f14610273575b5f80fd5b3480156101fc575f80fd5b50610217600480360381019061021291906118c3565b610774565b6040516102249190611908565b60405180910390f35b348015610238575f80fd5b506102416107ed565b60405161024e9190611939565b60405180910390f35b610271600480360381019061026c919061197c565b6107f5565b005b61028d60048036038101906102889190611a01565b610802565b005b34801561029a575f80fd5b506102b560048036038101906102b09190611a01565b610818565b6040516102c29190611908565b60405180910390f35b3480156102d6575f80fd5b506102df61082e565b6040516102ec9190611939565b60405180910390f35b6102fd610833565b005b34801561030a575f80fd5b50610313610884565b6040516103209190611a4e565b60405180910390f35b348015610334575f80fd5b5061034f600480360381019061034a9190611a67565b6108ab565b60405161035c9190611939565b60405180910390f35b348015610370575f80fd5b506103796108c4565b6040516103869190611aa1565b60405180910390f35b34801561039a575f80fd5b506103b560048036038101906103b09190611b70565b6108e9565b005b3480156103c2575f80fd5b506103dd60048036038101906103d89190611c43565b6109f7565b005b3480156103ea575f80fd5b5061040560048036038101906104009190611c43565b610c0d565b604051610413929190611c8e565b60405180910390f35b61043660048036038101906104319190611a01565b610d77565b005b348015610443575f80fd5b5061045e60048036038101906104599190611c43565b610d8d565b60405161046b9190611d25565b60405180910390f35b34801561047f575f80fd5b5061049a60048036038101906104959190611a01565b610e5b565b6040516104a79190611908565b60405180910390f35b6104b8610e72565b005b6104c2610eab565b005b3480156104cf575f80fd5b506104d8610ebe565b6040516104e59190611939565b60405180910390f35b3480156104f9575f80fd5b50610502610ec3565b60405161050f9190611aa1565b60405180910390f35b348015610523575f80fd5b5061052c610eeb565b6040516105399190611939565b60405180910390f35b34801561054d575f80fd5b5061056860048036038101906105639190611d45565b610ef1565b6040516105759190611908565b60405180910390f35b348015610589575f80fd5b506105a4600480360381019061059f9190611df7565b611100565b005b3480156105b1575f80fd5b506105cc60048036038101906105c79190611a67565b6111b6565b6040516105d99190611908565b60405180910390f35b3480156105ed575f80fd5b506105f66111d3565b6040516106039190611939565b60405180910390f35b348015610617575f80fd5b50610632600480360381019061062d9190611d45565b6111d9565b60405161063f9190611908565b60405180910390f35b348015610653575f80fd5b5061066e60048036038101906106699190611df7565b6111ec565b005b34801561067b575f80fd5b506106846112a2565b6040516106919190611939565b60405180910390f35b3480156106a5575f80fd5b506106ae6112a8565b6040516106bb9190611939565b60405180910390f35b6106de60048036038101906106d99190611a67565b6112ad565b005b6106fa60048036038101906106f59190611a67565b6112eb565b005b348015610707575f80fd5b50610722600480360381019061071d9190611a67565b611314565b60405161072f9190611908565b60405180910390f35b348015610743575f80fd5b5061075e60048036038101906107599190611a67565b611367565b60405161076b9190611939565b60405180910390f35b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107e657506107e582611380565b5b9050919050565b5f8054905090565b6107ff33826113f9565b50565b61080a611408565b610814828261143f565b5050565b5f8182610824856108ab565b1614905092915050565b5f5481565b5f61083c61144f565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f9031811100000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026108f481611459565b828290508585905014610933576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156109ef575f84848381811061095457610953611e75565b5b90506020020160208101906109699190611ecc565b905060011515811515036109ae576109a987878481811061098d5761098c611e75565b5b90506020020160208101906109a29190611a67565b600161143f565b6109e1565b6109e08787848181106109c4576109c3611e75565b5b90506020020160208101906109d99190611a67565b60016113f9565b5b508080600101915050610935565b505050505050565b5f610a0061148e565b90508054600382558015610a325760018160011c14303b10610a295763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610a439190611fec565b90505f815f015190505f826020015190505f836040015190505f8103610a95576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610abf308573ffffffffffffffffffffffffffffffffffffffff166114b790919063ffffffff16565b905081811015610b0d57845f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610b0493929190612017565b60405180910390fd5b8360035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825f81905550816002819055505f600581905550610b6a336114ea565b5f85606001519050610b7d8160016115c0565b8473ffffffffffffffffffffffffffffffffffffffff167fac711f624f923566afa4d63e74d67927870a724791c9569f0143ddea22657a0d8585604051610bc592919061204c565b60405180910390a25050505050508015610c08576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610c1a81611459565b5f8585810190610c2a919061218c565b90505f8160200151806020019051810190610c4591906121e7565b90508060025f828254610c58919061223f565b92505081905550610cae825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116019092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610d22939291906122d7565b604051602081830303815290604052604051610d3e9190611d25565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610d7f611408565b610d8982826113f9565b5050565b60605f808484810190610da0919061234e565b9250509150604051806080016040528060016002811115610dc457610dc361239e565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610e2091906123f4565b604051602081830303815290604052815250604051602001610e42919061250a565b6040516020818303038152906040529250505092915050565b5f8082610e67856108ab565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610eb3611408565b610ebc5f61164a565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b5f610efa611408565b5f8383810190610f0a91906125af565b90505f8160200151806020019051810190610f2591906121e7565b90505f610f3187611710565b610f67576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805403610f7757819050610f9a565b670de0b6b3a7640000825f54610f8d91906125f6565b610f979190612664565b90505b60025481600554610fab9190612694565b1115610fe3576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f828254610ff49190612694565b92505081905550600160045f82825461100d9190612694565b92505081905550611060878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116019092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689846040516020016110ce939291906122d7565b6040516020818303038152906040526040516110ea9190611d25565b60405180910390a2600193505050509392505050565b600261110b81611459565b82829050858590501461114a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156111ae576111a186868381811061116d5761116c611e75565b5b90506020020160208101906111829190611a67565b85858481811061119557611194611e75565b5b9050602002013561143f565b808060010191505061114c565b505050505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f6111e384611710565b90509392505050565b60026111f781611459565b828290508585905014611236576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561129a5761128d86868381811061125957611258611e75565b5b905060200201602081019061126e9190611a67565b85858481811061128157611280611e75565b5b905060200201356113f9565b8080600101915050611238565b505050505050565b60045481565b600181565b6112b5611408565b63389a75e1600c52805f526020600c2080544211156112db57636f5e88185f526004601cfd5b5f8155506112e88161164a565b50565b6112f3611408565b8060601b61130857637448fbae5f526004601cfd5b6113118161164a565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff16611334610ec3565b73ffffffffffffffffffffffffffffffffffffffff161480611360575061135f826002600117610e5b565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806113f257506113f18261171f565b5b9050919050565b61140482825f611798565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461143d576382b429005f526004601cfd5b565b61144b82826001611798565b5050565b5f6202a300905090565b638b78c6d81954331461148b57638b78c6d8600c52335f52806020600c20541661148a576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6114f26117f0565b1561156a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561152c57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3506115bd565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611641576390b8ec185f526004601cfd5b5f603452505050565b6116526117f0565b156116b7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b821781555061170d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806117915750611790826117f4565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836117ba57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6118a28161186e565b81146118ac575f80fd5b50565b5f813590506118bd81611899565b92915050565b5f602082840312156118d8576118d7611866565b5b5f6118e5848285016118af565b91505092915050565b5f8115159050919050565b611902816118ee565b82525050565b5f60208201905061191b5f8301846118f9565b92915050565b5f819050919050565b61193381611921565b82525050565b5f60208201905061194c5f83018461192a565b92915050565b61195b81611921565b8114611965575f80fd5b50565b5f8135905061197681611952565b92915050565b5f6020828403121561199157611990611866565b5b5f61199e84828501611968565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6119d0826119a7565b9050919050565b6119e0816119c6565b81146119ea575f80fd5b50565b5f813590506119fb816119d7565b92915050565b5f8060408385031215611a1757611a16611866565b5b5f611a24858286016119ed565b9250506020611a3585828601611968565b9150509250929050565b611a488161186e565b82525050565b5f602082019050611a615f830184611a3f565b92915050565b5f60208284031215611a7c57611a7b611866565b5b5f611a89848285016119ed565b91505092915050565b611a9b816119c6565b82525050565b5f602082019050611ab45f830184611a92565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611adb57611ada611aba565b5b8235905067ffffffffffffffff811115611af857611af7611abe565b5b602083019150836020820283011115611b1457611b13611ac2565b5b9250929050565b5f8083601f840112611b3057611b2f611aba565b5b8235905067ffffffffffffffff811115611b4d57611b4c611abe565b5b602083019150836020820283011115611b6957611b68611ac2565b5b9250929050565b5f805f8060408587031215611b8857611b87611866565b5b5f85013567ffffffffffffffff811115611ba557611ba461186a565b5b611bb187828801611ac6565b9450945050602085013567ffffffffffffffff811115611bd457611bd361186a565b5b611be087828801611b1b565b925092505092959194509250565b5f8083601f840112611c0357611c02611aba565b5b8235905067ffffffffffffffff811115611c2057611c1f611abe565b5b602083019150836001820283011115611c3c57611c3b611ac2565b5b9250929050565b5f8060208385031215611c5957611c58611866565b5b5f83013567ffffffffffffffff811115611c7657611c7561186a565b5b611c8285828601611bee565b92509250509250929050565b5f604082019050611ca15f83018561192a565b611cae6020830184611a92565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611cf782611cb5565b611d018185611cbf565b9350611d11818560208601611ccf565b611d1a81611cdd565b840191505092915050565b5f6020820190508181035f830152611d3d8184611ced565b905092915050565b5f805f60408486031215611d5c57611d5b611866565b5b5f611d69868287016119ed565b935050602084013567ffffffffffffffff811115611d8a57611d8961186a565b5b611d9686828701611bee565b92509250509250925092565b5f8083601f840112611db757611db6611aba565b5b8235905067ffffffffffffffff811115611dd457611dd3611abe565b5b602083019150836020820283011115611df057611def611ac2565b5b9250929050565b5f805f8060408587031215611e0f57611e0e611866565b5b5f85013567ffffffffffffffff811115611e2c57611e2b61186a565b5b611e3887828801611ac6565b9450945050602085013567ffffffffffffffff811115611e5b57611e5a61186a565b5b611e6787828801611da2565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b611eab816118ee565b8114611eb5575f80fd5b50565b5f81359050611ec681611ea2565b92915050565b5f60208284031215611ee157611ee0611866565b5b5f611eee84828501611eb8565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611f3182611cdd565b810181811067ffffffffffffffff82111715611f5057611f4f611efb565b5b80604052505050565b5f611f6261185d565b9050611f6e8282611f28565b919050565b5f80fd5b5f60808284031215611f8c57611f8b611ef7565b5b611f966080611f59565b90505f611fa5848285016119ed565b5f830152506020611fb884828501611968565b6020830152506040611fcc84828501611968565b6040830152506060611fe0848285016119ed565b60608301525092915050565b5f6080828403121561200157612000611866565b5b5f61200e84828501611f77565b91505092915050565b5f60608201905061202a5f830186611a92565b612037602083018561192a565b612044604083018461192a565b949350505050565b5f60408201905061205f5f83018561192a565b61206c602083018461192a565b9392505050565b5f80fd5b5f67ffffffffffffffff82111561209157612090611efb565b5b61209a82611cdd565b9050602081019050919050565b828183375f83830152505050565b5f6120c76120c284612077565b611f59565b9050828152602081018484840111156120e3576120e2612073565b5b6120ee8482856120a7565b509392505050565b5f82601f83011261210a57612109611aba565b5b813561211a8482602086016120b5565b91505092915050565b5f6040828403121561213857612137611ef7565b5b6121426040611f59565b90505f612151848285016119ed565b5f83015250602082013567ffffffffffffffff81111561217457612173611f73565b5b612180848285016120f6565b60208301525092915050565b5f602082840312156121a1576121a0611866565b5b5f82013567ffffffffffffffff8111156121be576121bd61186a565b5b6121ca84828501612123565b91505092915050565b5f815190506121e181611952565b92915050565b5f602082840312156121fc576121fb611866565b5b5f612209848285016121d3565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61224982611921565b915061225483611921565b925082820390508181111561226c5761226b612212565b5b92915050565b5f8160601b9050919050565b5f61228882612272565b9050919050565b5f6122998261227e565b9050919050565b6122b16122ac826119c6565b61228f565b82525050565b5f819050919050565b6122d16122cc82611921565b6122b7565b82525050565b5f6122e282866122a0565b6014820191506122f282856122a0565b60148201915061230282846122c0565b602082019150819050949350505050565b5f61231d826119a7565b9050919050565b61232d81612313565b8114612337575f80fd5b50565b5f8135905061234881612324565b92915050565b5f805f6060848603121561236557612364611866565b5b5f6123728682870161233a565b935050602061238386828701611968565b925050604061239486828701611968565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6123d481611921565b82525050565b602082015f8201516123ee5f8501826123cb565b50505050565b5f6020820190506124075f8301846123da565b92915050565b6003811061241e5761241d61239e565b5b50565b5f81905061242e8261240d565b919050565b5f61243d82612421565b9050919050565b61244d81612433565b82525050565b61245c816119c6565b82525050565b5f82825260208201905092915050565b5f61247c82611cb5565b6124868185612462565b9350612496818560208601611ccf565b61249f81611cdd565b840191505092915050565b5f608083015f8301516124bf5f860182612444565b5060208301516124d26020860182612453565b5060408301516124e56040860182612453565b50606083015184820360608601526124fd8282612472565b9150508091505092915050565b5f6020820190508181035f83015261252281846124aa565b905092915050565b5f6040828403121561253f5761253e611ef7565b5b6125496040611f59565b90505f82013567ffffffffffffffff81111561256857612567611f73565b5b612574848285016120f6565b5f83015250602082013567ffffffffffffffff81111561259757612596611f73565b5b6125a3848285016120f6565b60208301525092915050565b5f602082840312156125c4576125c3611866565b5b5f82013567ffffffffffffffff8111156125e1576125e061186a565b5b6125ed8482850161252a565b91505092915050565b5f61260082611921565b915061260b83611921565b925082820261261981611921565b915082820484148315176126305761262f612212565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61266e82611921565b915061267983611921565b92508261268957612688612637565b5b828204905092915050565b5f61269e82611921565b91506126a983611921565b92508282019050808211156126c1576126c0612212565b5b9291505056fea26469706673582212209cef536cb54b749e44521d5e5c41ba45adacf436cac0cbb6baf2a091acf63d9a64736f6c634300081a0033",t=class t extends u.DeployableTarget{constructor(){super(...arguments),this.abi=a.g}async owner(f){return await a.cM(this._config,{address:this.assertValidAddress(),args:[],...f})}async totalClaimed(f){return await a.TM(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.rM(this._config,{address:this.assertValidAddress(),args:[],...f})}async claims(f){return await a.sM(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.iM(this._config,{address:this.assertValidAddress(),args:[f],...b})}async asset(f){return await a.aM(this._config,{address:this.assertValidAddress(),...f})}async reward(f){return await a.fM(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.dM(this._config,{address:this.assertValidAddress(),...f})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:d}=await a.kM(this._config,{address:this.assertValidAddress(),args:[i.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.IM(this._config,e),result:d}}async clawback(f,b){return await this.awaitResult(this.clawbackRaw(f,b))}async clawbackRaw(f,b){const{request:e,result:d}=await a.PM(this._config,{address:this.assertValidAddress(),args:[i.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.hM(this._config,e),result:d}}async isClaimable(f,b){return await a.yM(this._config,{address:this.assertValidAddress(),args:[f.target,f.data],...b})}async getTotalBudget(f){var b;return((b=this.payload)==null?void 0:b.limit)!==void 0?this.payload.limit:await this.limit(f)}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[b,e]=await Promise.all([this.totalClaimed(f),this.limit(f)]);return e-b}buildClaimData(f){return c.encodeAbiParameters([{type:"uint256",name:"rewardAmount"}],[f])}decodeClaimData(f){return BigInt(c.decodeAbiParameters([{type:"uint256"}],f)[0])}buildClawbackData(f){return c.encodeAbiParameters([{type:"uint256"}],[f])}buildParameters(f,b){const[e,d]=this.validateDeploymentConfig(f,b);return{abi:a.g,bytecode:g,args:[r(e)],...this.optionallyAttachAccount(d.account)}}};t.bases={31337:void 0,...o.ERC20VariableIncentive},t.registryType=h.RegistryType.INCENTIVE;let s=t;function r({asset:n,reward:f,limit:b,manager:e}){return c.encodeAbiParameters([{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"address",name:"manager"}],[n,f,b,e])}exports.erc20VariableIncentiveAbi=a.g;exports.ERC20VariableIncentive=s;exports.prepareERC20VariableIncentivePayload=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-BPiHi7W2.cjs"),c=require("viem"),o=require("../deployments-CIXw_WKk.cjs"),u=require("../Deployable/DeployableTarget.cjs"),r=require("../claiming.cjs"),h=require("../utils.cjs"),m="0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b611c6d806100855f395ff3fe60806040526004361061020f575f3560e01c806354d1f13d11610117578063d54ad2a1116100ac578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146105ff578063fe9fbb8014610612578063fee81cf414610631575f80fd5b8063ec87621c146105d8578063f04e283e146105ec575f80fd5b8063d54ad2a114610570578063db09da1214610585578063dcc21361146105a4578063dcc59b6f146105c3575f80fd5b8063a4d66daf116100e7578063a4d66daf146104ef578063bb1757cf14610504578063be4994f814610523578063c884ef8314610542575f80fd5b806354d1f13d146104b3578063715018a6146104bb57806375b238fc146104c35780638da5cb5b146104d7575f80fd5b80632de94807116101a7578063439fab91116101775780634a4ee7b11161015d5780634a4ee7b11461043f5780634e7165a214610452578063514e62fc1461047e575f80fd5b8063439fab91146103d7578063474f5a44146103f6575f80fd5b80632de948071461031757806330db555f1461034857806338d52e0f146103675780634359d28a146103b8575f80fd5b80631cd64df4116101e25780631cd64df41461028c578063228cb733146102c157806325692962146102d557806328d6183b146102dd575f80fd5b806301ffc9a71461021357806307621eca14610247578063183a4f6e146102645780631c10893f14610279575b5f80fd5b34801561021e575f80fd5b5061023261022d366004611527565b610662565b60405190151581526020015b60405180910390f35b348015610252575f80fd5b505f545b60405190815260200161023e565b61027761027236600461156d565b6106bd565b005b6102776102873660046115a5565b6106ca565b348015610297575f80fd5b506102326102a63660046115a5565b638b78c6d8600c9081525f9290925260209091205481161490565b3480156102cc575f80fd5b506102565f5481565b6102776106e0565b3480156102e8575f80fd5b506040517f9031811100000000000000000000000000000000000000000000000000000000815260200161023e565b348015610322575f80fd5b506102566103313660046115cf565b638b78c6d8600c9081525f91909152602090205490565b348015610353575f80fd5b5061027761036236600461156d565b61072d565b348015610372575f80fd5b506003546103939073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161023e565b3480156103c3575f80fd5b506102776103d2366004611632565b6107e9565b3480156103e2575f80fd5b506102776103f13660046116dc565b6108e3565b348015610401575f80fd5b506104156104103660046116dc565b610b0d565b6040805192835273ffffffffffffffffffffffffffffffffffffffff90911660208301520161023e565b61027761044d3660046115a5565b610c6f565b34801561045d575f80fd5b5061047161046c3660046116dc565b610c81565b60405161023e9190611767565b348015610489575f80fd5b506102326104983660046115a5565b638b78c6d8600c9081525f9290925260209091205416151590565b610277610d6a565b610277610da3565b3480156104ce575f80fd5b50610256600281565b3480156104e2575f80fd5b50638b78c6d81954610393565b3480156104fa575f80fd5b5061025660025481565b34801561050f575f80fd5b5061023261051e366004611779565b610db6565b34801561052e575f80fd5b5061027761053d366004611632565b610fcb565b34801561054d575f80fd5b5061023261055c3660046115cf565b60016020525f908152604090205460ff1681565b34801561057b575f80fd5b5061025660055481565b348015610590575f80fd5b5061023261059f366004611779565b611069565b3480156105af575f80fd5b506102776105be366004611632565b61107f565b3480156105ce575f80fd5b5061025660045481565b3480156105e3575f80fd5b50610256600181565b6102776105fa3660046115cf565b61111d565b61027761060d3660046115cf565b611157565b34801561061d575f80fd5b5061023261062c3660046115cf565b61117d565b34801561063c575f80fd5b5061025661064b3660046115cf565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f903181110000000000000000000000000000000000000000000000000000000014806106b757506106b7826111dc565b92915050565b6106c73382611231565b50565b6106d261123c565b6106dc8282611256565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161073881611262565b815f03610771576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003546107969073ffffffffffffffffffffffffffffffffffffffff16333085611293565b8160025f8282546107a791906117f7565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026107f481611262565b83821461082d576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156108db575f84848381811061084a5761084a61180a565b905060200201602081019061085f9190611837565b90508015156001036108a15761089c8787848181106108805761088061180a565b905060200201602081019061089591906115cf565b6001611256565b6108d2565b6108d28787848181106108b6576108b661180a565b90506020020160208101906108cb91906115cf565b6001611231565b5060010161082f565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156109345760018160011c14303b1061092b5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610942838501856118ac565b80516020820151604083015192935090915f81900361098d576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6109ae73ffffffffffffffffffffffffffffffffffffffff8516306112eb565b905081811015610a175784516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86161790555f8381556002839055600555610a6c3361131e565b6060850151610a7c816001611366565b604080518581526020810185905273ffffffffffffffffffffffffffffffffffffffff8716917fac711f624f923566afa4d63e74d67927870a724791c9569f0143ddea22657a0d910160405180910390a25050505050508015610b08576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610b1a81611262565b5f610b27858701876119c8565b90505f8160200151806020019051810190610b429190611a47565b90508060025f828254610b559190611a5e565b90915550508151600354610b829173ffffffffffffffffffffffffffffffffffffffff90911690836113a7565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610c4091611767565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610c7761123c565b6106dc8282611231565b60605f80610c9184860186611a71565b9250509150604051806080016040528060016002811115610cb457610cb4611aa3565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610d139151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610d519190602001611ad0565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610dab61123c565b610db45f6113f0565b565b5f610dbf61123c565b5f610dcc83850185611b6b565b90505f8160200151806020019051810190610de79190611a47565b90505f610df76002546005541090565b610e2d576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f545f03610e3c575080610e5f565b670de0b6b3a7640000825f54610e529190611be8565b610e5c9190611bff565b90505b60025481600554610e7091906117f7565b1115610ea8576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f828254610eb991906117f7565b92505081905550600160045f828254610ed291906117f7565b9091555050600354610efb9073ffffffffffffffffffffffffffffffffffffffff1688836113a7565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610fb691611767565b60405180910390a25060019695505050505050565b6002610fd681611262565b83821461100f576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156108db5761106186868381811061102e5761102e61180a565b905060200201602081019061104391906115cf565b8585848181106110555761105561180a565b90506020020135611256565b600101611011565b5f6110776002546005541090565b949350505050565b600261108a81611262565b8382146110c3576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156108db576111158686838181106110e2576110e261180a565b90506020020160208101906110f791906115cf565b8585848181106111095761110961180a565b90506020020135611231565b6001016110c5565b61112561123c565b63389a75e1600c52805f526020600c20805442111561114b57636f5e88185f526004601cfd5b5f90556106c7816113f0565b61115f61123c565b8060601b61117457637448fbae5f526004601cfd5b6106c7816113f0565b5f8173ffffffffffffffffffffffffffffffffffffffff166111a2638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806106b75750638b78c6d8600c9081525f839052602090205460031615156106b7565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa92167050000000000000000000000000000000000000000000000000000000014806106b757506106b78261143a565b6106dc82825f6114d0565b638b78c6d819543314610db4576382b429005f526004601cfd5b6106dc828260016114d0565b638b78c6d8195433146106c757638b78c6d8600c52335f52806020600c2054166106c7576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f511417166112de57637939f4245f526004601cfd5b5f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166113e7576390b8ec185f526004601cfd5b5f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806106b757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146106b7565b638b78c6d8600c52825f526020600c208054838117836114f1575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f60208284031215611537575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611566575f80fd5b9392505050565b5f6020828403121561157d575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146106c7575f80fd5b5f80604083850312156115b6575f80fd5b82356115c181611584565b946020939093013593505050565b5f602082840312156115df575f80fd5b813561156681611584565b5f8083601f8401126115fa575f80fd5b50813567ffffffffffffffff811115611611575f80fd5b6020830191508360208260051b850101111561162b575f80fd5b9250929050565b5f805f8060408587031215611645575f80fd5b843567ffffffffffffffff81111561165b575f80fd5b611667878288016115ea565b909550935050602085013567ffffffffffffffff811115611686575f80fd5b611692878288016115ea565b95989497509550505050565b5f8083601f8401126116ae575f80fd5b50813567ffffffffffffffff8111156116c5575f80fd5b60208301915083602082850101111561162b575f80fd5b5f80602083850312156116ed575f80fd5b823567ffffffffffffffff811115611703575f80fd5b61170f8582860161169e565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f611566602083018461171b565b5f805f6040848603121561178b575f80fd5b833561179681611584565b9250602084013567ffffffffffffffff8111156117b1575f80fd5b6117bd8682870161169e565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156106b7576106b76117ca565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611847575f80fd5b81358015158114611566575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff811182821017156118a6576118a6611856565b60405290565b5f60808284031280156118bd575f80fd5b506040516080810167ffffffffffffffff811182821017156118e1576118e1611856565b60405282356118ef81611584565b81526020838101359082015260408084013590820152606083013561191381611584565b60608201529392505050565b5f82601f83011261192e575f80fd5b813567ffffffffffffffff81111561194857611948611856565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff8111828210171561199557611995611856565b6040528181528382016020018510156119ac575f80fd5b816020850160208301375f918101602001919091529392505050565b5f602082840312156119d8575f80fd5b813567ffffffffffffffff8111156119ee575f80fd5b8201604081850312156119ff575f80fd5b611a07611883565b8135611a1281611584565b8152602082013567ffffffffffffffff811115611a2d575f80fd5b611a398682850161191f565b602083015250949350505050565b5f60208284031215611a57575f80fd5b5051919050565b818103818111156106b7576106b76117ca565b5f805f60608486031215611a83575f80fd5b8335611a8e81611584565b95602085013595506040909401359392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b602081525f825160038110611b0c577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff6040840151166060830152606083015160808084015261107760a084018261171b565b5f60208284031215611b7b575f80fd5b813567ffffffffffffffff811115611b91575f80fd5b820160408185031215611ba2575f80fd5b611baa611883565b813567ffffffffffffffff811115611bc0575f80fd5b611bcc8682850161191f565b825250602082013567ffffffffffffffff811115611a2d575f80fd5b80820281158282048414176106b7576106b76117ca565b5f82611c32577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220359b85089605758f3c64773e6f7fe7639dfc5ac1adb7a4578b2b6a3ca7f4a83864736f6c634300081a0033",t=class t extends u.DeployableTarget{constructor(){super(...arguments),this.abi=a.A}async owner(f){return await a.pR(this._config,{address:this.assertValidAddress(),args:[],...f})}async totalClaimed(f){return await a.mR(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.tR(this._config,{address:this.assertValidAddress(),args:[],...f})}async claims(f){return await a.eR(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.Y6(this._config,{address:this.assertValidAddress(),args:[f],...b})}async asset(f){return await a.X6(this._config,{address:this.assertValidAddress(),...f})}async reward(f){return await a.yR(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.oR(this._config,{address:this.assertValidAddress(),...f})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:d}=await a.VR(this._config,{address:this.assertValidAddress(),args:[r.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.vR(this._config,e),result:d}}async clawback(f,b){return await this.awaitResult(this.clawbackRaw(f,b))}async clawbackRaw(f,b){const{request:e,result:d}=await a.HR(this._config,{address:this.assertValidAddress(),args:[r.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.wR(this._config,e),result:d}}async isClaimable(f,b){return await a.rR(this._config,{address:this.assertValidAddress(),args:[f.target,f.data],...b})}async getTotalBudget(f){var b;return((b=this.payload)==null?void 0:b.limit)!==void 0?this.payload.limit:await this.limit(f)}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[b,e]=await Promise.all([this.totalClaimed(f),this.limit(f)]);return e-b}async getTopupPayload(f){return i({asset:await this.asset(),reward:f,manager:c.zeroAddress,limit:1n})}buildClaimData(f){return c.encodeAbiParameters([{type:"uint256",name:"rewardAmount"}],[f])}decodeClaimData(f){return BigInt(c.decodeAbiParameters([{type:"uint256"}],f)[0])}buildClawbackData(f){return c.encodeAbiParameters([{type:"uint256"}],[f])}buildParameters(f,b){const[e,d]=this.validateDeploymentConfig(f,b);return{abi:a.A,bytecode:m,args:[i(e)],...this.optionallyAttachAccount(d.account)}}};t.bases={31337:void 0,...o.ERC20VariableIncentive},t.registryType=h.RegistryType.INCENTIVE;let s=t;function i({asset:n,reward:f,limit:b,manager:e}){return c.encodeAbiParameters([{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"address",name:"manager"}],[n,f,b,e])}exports.erc20VariableIncentiveAbi=a.A;exports.ERC20VariableIncentive=s;exports.prepareERC20VariableIncentivePayload=i;
|
|
2
2
|
//# sourceMappingURL=ERC20VariableIncentive.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20VariableIncentive.cjs","sources":["../../src/Incentives/ERC20VariableIncentive.ts"],"sourcesContent":["import {\n erc20VariableIncentiveAbi,\n readErc20VariableIncentiveAsset,\n readErc20VariableIncentiveClaimed,\n readErc20VariableIncentiveClaims,\n readErc20VariableIncentiveCurrentReward,\n readErc20VariableIncentiveIsClaimable,\n readErc20VariableIncentiveLimit,\n readErc20VariableIncentiveOwner,\n readErc20VariableIncentiveReward,\n readErc20VariableIncentiveTotalClaimed,\n simulateErc20VariableIncentiveClaim,\n simulateErc20VariableIncentiveClawback,\n writeErc20VariableIncentiveClaim,\n writeErc20VariableIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableIncentive.sol/ERC20VariableIncentive.json';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n encodeAbiParameters,\n} from 'viem';\nimport { ERC20VariableIncentive as ERC20VariableIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20VariableIncentiveAbi };\n/**\n * The object representation of a `ERC20VariableIncentivePayload.InitPayload`\n *\n * @export\n * @interface ERC20VariableIncentivePayload\n * @typedef {ERC20VariableIncentivePayload}\n */\nexport interface ERC20VariableIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The reward multiplier. If 0, the signed amount from the claim payload is used directly. Variable amount (in ETH decimal format) will by multiplied by this value.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The entity that can `clawback` funds\n *\n * @type {Address}\n */\n manager: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20VariableIncentive` event types.\n *\n * @export\n * @typedef {ERC20VariableIncentiveLog}\n * @template {ContractEventName<typeof erc20VariableIncentiveAbi>} [event=ContractEventName<\n * typeof erc20VariableIncentiveAbi\n * >]\n */\nexport type ERC20VariableIncentiveLog<\n event extends ContractEventName<\n typeof erc20VariableIncentiveAbi\n > = ContractEventName<typeof erc20VariableIncentiveAbi>,\n> = GenericLog<typeof erc20VariableIncentiveAbi, event>;\n\n/**\n * A modified ERC20 incentive implementation that allows claiming of variable token amounts with a spending limit\n *\n * @export\n * @class ERC20VariableIncentive\n * @typedef {ERC20VariableIncentive}\n * @template [Payload=ERC20VariableIncentivePayload | undefined]\n * @template {Abi} [ABI=typeof erc20VariableIncentiveAbi]\n * @extends {DeployableTarget<ERC20VariableIncentivePayload, ABI>}\n */\nexport class ERC20VariableIncentive<\n Payload = ERC20VariableIncentivePayload | undefined,\n ABI extends Abi = typeof erc20VariableIncentiveAbi,\n> extends DeployableTarget<Payload, ABI> {\n //@ts-expect-error it is instantiated correctly\n public override readonly abi = erc20VariableIncentiveAbi;\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_VARIABLE_INCENTIVE_BASE,\n ...(ERC20VariableIncentiveBases 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 readErc20VariableIncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20VariableIncentiveTotalClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20VariableIncentiveCurrentReward(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 readErc20VariableIncentiveClaims(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 readErc20VariableIncentiveClaimed(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 readErc20VariableIncentiveAsset(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 readErc20VariableIncentiveReward(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 readErc20VariableIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClaim(\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 writeErc20VariableIncentiveClaim(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 simulateErc20VariableIncentiveClawback(\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 writeErc20VariableIncentiveClawback(\n this._config,\n request,\n );\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 readErc20VariableIncentiveIsClaimable(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 * 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 ((this.payload as ERC20VariableIncentivePayload)?.limit !== undefined) {\n return (this.payload as ERC20VariableIncentivePayload).limit;\n }\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claimed amount 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 limit minus total claimed is greater than 0\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how much of the underlying asset remains by comparing the the limit against the total amount claimed. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - Limit minus total claimed\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 * Builds the claim data for the ERC20VariableIncentive.\n *\n * @public\n * @param {bigint} rewardAmount\n * @returns {Hex} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20VariableIncentive.\n */\n public buildClaimData(rewardAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'rewardAmount' }],\n [rewardAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20VariableIncentive, returning the encoded claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimData(data: Hex) {\n return BigInt(decodeAbiParameters([{ type: 'uint256' }], data)[0]);\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 * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [\n prepareERC20VariableIncentivePayload(\n payload as ERC20VariableIncentivePayload,\n ),\n ],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link ERC20VariableIncentivePayload}, properly encode a ` ERC20VariableIncentive.InitPayload` for use with {@link ERC20VariableIncentive} initialization.\n *\n * @param {ERC20VariableIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\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 * @returns {Hex}\n */\nexport function prepareERC20VariableIncentivePayload({\n asset,\n reward,\n limit,\n manager,\n}: ERC20VariableIncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [asset, reward, limit, manager],\n );\n}\n"],"names":["_ERC20VariableIncentive","DeployableTarget","erc20VariableIncentiveAbi","params","readErc20VariableIncentiveOwner","readErc20VariableIncentiveTotalClaimed","readErc20VariableIncentiveCurrentReward","readErc20VariableIncentiveClaims","address","readErc20VariableIncentiveClaimed","readErc20VariableIncentiveAsset","readErc20VariableIncentiveReward","readErc20VariableIncentiveLimit","payload","request","result","simulateErc20VariableIncentiveClaim","prepareClaimPayload","writeErc20VariableIncentiveClaim","simulateErc20VariableIncentiveClawback","writeErc20VariableIncentiveClawback","readErc20VariableIncentiveIsClaimable","_a","totalClaimed","limit","rewardAmount","encodeAbiParameters","data","decodeAbiParameters","amount","_payload","_options","options","bytecode","prepareERC20VariableIncentivePayload","ERC20VariableIncentiveBases","RegistryType","ERC20VariableIncentive","asset","reward","manager"],"mappings":"0poBAmGaA,EAAN,MAAMA,UAGHC,EAAAA,gBAA+B,CAHlC,aAAA,CAAA,MAAA,GAAA,SAAA,EAKL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,MAAMC,EAAqB,CAC/B,OAAA,MAAMC,EAAAA,GAAgC,KAAK,QAAS,CACzD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,aAAaA,EAAqB,CACtC,OAAA,MAAME,EAAAA,GAAuC,KAAK,QAAS,CAChE,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,cAAcA,EAAqB,CACvC,OAAA,MAAMG,EAAAA,GAAwC,KAAK,QAAS,CACjE,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMI,EAAAA,GAAiC,KAAK,QAAS,CAC1D,QAAS,KAAK,mBAAmB,EACjC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IAAK7B,EAAA,EACL,SAAA+B,EACA,KAAM,CACJC,EACErB,CACF,CACF,EACA,GAAG,KAAK,wBAAwBmB,EAAQ,OAAO,CAAA,CAEnD,CACF,EA9VEhC,EAAuB,MAAiC,CACtD,MAAO,OACP,GAAImC,EAAA,sBAAA,EASNnC,EAAuB,aAA6BoC,EAAa,aAAA,UAxB5D,IAAMC,EAANrC,EAsXA,SAASkC,EAAqC,CACnD,MAAAI,EACA,OAAAC,EACA,MAAAf,EACA,QAAAgB,CACF,EAAkC,CACzB,OAAAd,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,SAAU,CACrC,EACA,CAACY,EAAOC,EAAQf,EAAOgB,CAAO,CAAA,CAElC"}
|
|
1
|
+
{"version":3,"file":"ERC20VariableIncentive.cjs","sources":["../../src/Incentives/ERC20VariableIncentive.ts"],"sourcesContent":["import {\n erc20VariableIncentiveAbi,\n readErc20VariableIncentiveAsset,\n readErc20VariableIncentiveClaimed,\n readErc20VariableIncentiveClaims,\n readErc20VariableIncentiveCurrentReward,\n readErc20VariableIncentiveIsClaimable,\n readErc20VariableIncentiveLimit,\n readErc20VariableIncentiveOwner,\n readErc20VariableIncentiveReward,\n readErc20VariableIncentiveTotalClaimed,\n simulateErc20VariableIncentiveClaim,\n simulateErc20VariableIncentiveClawback,\n writeErc20VariableIncentiveClaim,\n writeErc20VariableIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableIncentive.sol/ERC20VariableIncentive.json';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n encodeAbiParameters,\n zeroAddress,\n} from 'viem';\nimport { ERC20VariableIncentive as ERC20VariableIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20VariableIncentiveAbi };\n/**\n * The object representation of a `ERC20VariableIncentivePayload.InitPayload`\n *\n * @export\n * @interface ERC20VariableIncentivePayload\n * @typedef {ERC20VariableIncentivePayload}\n */\nexport interface ERC20VariableIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The reward multiplier. If 0, the signed amount from the claim payload is used directly. Variable amount (in ETH decimal format) will by multiplied by this value.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The entity that can `clawback` funds\n *\n * @type {Address}\n */\n manager: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20VariableIncentive` event types.\n *\n * @export\n * @typedef {ERC20VariableIncentiveLog}\n * @template {ContractEventName<typeof erc20VariableIncentiveAbi>} [event=ContractEventName<\n * typeof erc20VariableIncentiveAbi\n * >]\n */\nexport type ERC20VariableIncentiveLog<\n event extends ContractEventName<\n typeof erc20VariableIncentiveAbi\n > = ContractEventName<typeof erc20VariableIncentiveAbi>,\n> = GenericLog<typeof erc20VariableIncentiveAbi, event>;\n\n/**\n * A modified ERC20 incentive implementation that allows claiming of variable token amounts with a spending limit\n *\n * @export\n * @class ERC20VariableIncentive\n * @typedef {ERC20VariableIncentive}\n * @template [Payload=ERC20VariableIncentivePayload | undefined]\n * @template {Abi} [ABI=typeof erc20VariableIncentiveAbi]\n * @extends {DeployableTarget<ERC20VariableIncentivePayload, ABI>}\n */\nexport class ERC20VariableIncentive<\n Payload = ERC20VariableIncentivePayload | undefined,\n ABI extends Abi = typeof erc20VariableIncentiveAbi,\n> extends DeployableTarget<Payload, ABI> {\n //@ts-expect-error it is instantiated correctly\n public override readonly abi = erc20VariableIncentiveAbi;\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_VARIABLE_INCENTIVE_BASE,\n ...(ERC20VariableIncentiveBases 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 readErc20VariableIncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20VariableIncentiveTotalClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20VariableIncentiveCurrentReward(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 readErc20VariableIncentiveClaims(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 readErc20VariableIncentiveClaimed(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 readErc20VariableIncentiveAsset(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 readErc20VariableIncentiveReward(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 readErc20VariableIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClaim(\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 writeErc20VariableIncentiveClaim(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 simulateErc20VariableIncentiveClawback(\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 writeErc20VariableIncentiveClawback(\n this._config,\n request,\n );\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 readErc20VariableIncentiveIsClaimable(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 * 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 ((this.payload as ERC20VariableIncentivePayload)?.limit !== undefined) {\n return (this.payload as ERC20VariableIncentivePayload).limit;\n }\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claimed amount 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 limit minus total claimed is greater than 0\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how much of the underlying asset remains by comparing the the limit against the total amount claimed. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - Limit minus total claimed\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 * 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 prepareERC20VariableIncentivePayload({\n asset: (await this.asset()) as Address,\n reward: netAmount,\n manager: zeroAddress,\n limit: 1n,\n });\n }\n\n /**\n * Builds the claim data for the ERC20VariableIncentive.\n *\n * @public\n * @param {bigint} rewardAmount\n * @returns {Hex} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20VariableIncentive.\n */\n public buildClaimData(rewardAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'rewardAmount' }],\n [rewardAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20VariableIncentive, returning the encoded claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimData(data: Hex) {\n return BigInt(decodeAbiParameters([{ type: 'uint256' }], data)[0]);\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 * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [\n prepareERC20VariableIncentivePayload(\n payload as ERC20VariableIncentivePayload,\n ),\n ],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link ERC20VariableIncentivePayload}, properly encode a ` ERC20VariableIncentive.InitPayload` for use with {@link ERC20VariableIncentive} initialization.\n *\n * @param {ERC20VariableIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\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 * @returns {Hex}\n */\nexport function prepareERC20VariableIncentivePayload({\n asset,\n reward,\n limit,\n manager,\n}: ERC20VariableIncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [asset, reward, limit, manager],\n );\n}\n"],"names":["_ERC20VariableIncentive","DeployableTarget","erc20VariableIncentiveAbi","params","readErc20VariableIncentiveOwner","readErc20VariableIncentiveTotalClaimed","readErc20VariableIncentiveCurrentReward","readErc20VariableIncentiveClaims","address","readErc20VariableIncentiveClaimed","readErc20VariableIncentiveAsset","readErc20VariableIncentiveReward","readErc20VariableIncentiveLimit","payload","request","result","simulateErc20VariableIncentiveClaim","prepareClaimPayload","writeErc20VariableIncentiveClaim","simulateErc20VariableIncentiveClawback","writeErc20VariableIncentiveClawback","readErc20VariableIncentiveIsClaimable","_a","totalClaimed","limit","netAmount","prepareERC20VariableIncentivePayload","zeroAddress","rewardAmount","encodeAbiParameters","data","decodeAbiParameters","amount","_payload","_options","options","bytecode","ERC20VariableIncentiveBases","RegistryType","ERC20VariableIncentive","asset","reward","manager"],"mappings":"0wdAoGaA,EAAN,MAAMA,UAGHC,EAAAA,gBAA+B,CAHlC,aAAA,CAAA,MAAA,GAAA,SAAA,EAKL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,MAAMC,EAAqB,CAC/B,OAAA,MAAMC,EAAAA,GAAgC,KAAK,QAAS,CACzD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,aAAaA,EAAqB,CACtC,OAAA,MAAME,EAAAA,GAAuC,KAAK,QAAS,CAChE,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,cAAcA,EAAqB,CACvC,OAAA,MAAMG,EAAAA,GAAwC,KAAK,QAAS,CACjE,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMI,EAAAA,G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C,OAAAH,EAAAA,oBAAoB,CAAC,CAAE,KAAM,UAAW,EAAG,CAACG,CAAM,CAAC,CAC5D,CAUgB,gBACdC,EACAC,EACyB,CACzB,KAAM,CAACrB,EAASsB,CAAO,EAAI,KAAK,yBAC9BF,EACAC,CAAA,EAEK,MAAA,CACL,IAAKhC,EAAA,EACL,SAAAkC,EACA,KAAM,CACJV,EACEb,CACF,CACF,EACA,GAAG,KAAK,wBAAwBsB,EAAQ,OAAO,CAAA,CAEnD,CACF,EA/WEnC,EAAuB,MAAiC,CACtD,MAAO,OACP,GAAIqC,EAAA,sBAAA,EASNrC,EAAuB,aAA6BsC,EAAa,aAAA,UAxB5D,IAAMC,EAANvC,EAuYA,SAAS0B,EAAqC,CACnD,MAAAc,EACA,OAAAC,EACA,MAAAjB,EACA,QAAAkB,CACF,EAAkC,CACzB,OAAAb,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,SAAU,CACrC,EACA,CAACW,EAAOC,EAAQjB,EAAOkB,CAAO,CAAA,CAElC"}
|
|
@@ -226,6 +226,21 @@ export declare class ERC20VariableIncentive<Payload = ERC20VariableIncentivePayl
|
|
|
226
226
|
readonly indexed: true;
|
|
227
227
|
}];
|
|
228
228
|
readonly name: "RolesUpdated";
|
|
229
|
+
}, {
|
|
230
|
+
readonly type: "event";
|
|
231
|
+
readonly anonymous: false;
|
|
232
|
+
readonly inputs: readonly [{
|
|
233
|
+
readonly name: "sender";
|
|
234
|
+
readonly internalType: "address";
|
|
235
|
+
readonly type: "address";
|
|
236
|
+
readonly indexed: false;
|
|
237
|
+
}, {
|
|
238
|
+
readonly name: "amount";
|
|
239
|
+
readonly internalType: "uint256";
|
|
240
|
+
readonly type: "uint256";
|
|
241
|
+
readonly indexed: false;
|
|
242
|
+
}];
|
|
243
|
+
readonly name: "ToppedUp";
|
|
229
244
|
}, {
|
|
230
245
|
readonly type: "function";
|
|
231
246
|
readonly inputs: readonly [];
|
|
@@ -608,6 +623,16 @@ export declare class ERC20VariableIncentive<Payload = ERC20VariableIncentivePayl
|
|
|
608
623
|
readonly type: "bool";
|
|
609
624
|
}];
|
|
610
625
|
readonly stateMutability: "view";
|
|
626
|
+
}, {
|
|
627
|
+
readonly type: "function";
|
|
628
|
+
readonly inputs: readonly [{
|
|
629
|
+
readonly name: "amount";
|
|
630
|
+
readonly internalType: "uint256";
|
|
631
|
+
readonly type: "uint256";
|
|
632
|
+
}];
|
|
633
|
+
readonly name: "topup";
|
|
634
|
+
readonly outputs: readonly [];
|
|
635
|
+
readonly stateMutability: "nonpayable";
|
|
611
636
|
}, {
|
|
612
637
|
readonly type: "function";
|
|
613
638
|
readonly inputs: readonly [];
|
|
@@ -801,6 +826,16 @@ export declare class ERC20VariableIncentive<Payload = ERC20VariableIncentivePayl
|
|
|
801
826
|
* @returns {Promise<bigint>} - Limit minus total claimed
|
|
802
827
|
*/
|
|
803
828
|
getRemainingClaimPotential(params?: ReadParams): Promise<bigint>;
|
|
829
|
+
/**
|
|
830
|
+
* Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing
|
|
831
|
+
* the existing `limit` field by `netAmount`. The entire payload is then re-encoded
|
|
832
|
+
* via `prepareERC20PeggedIncentivePayload(...)`.
|
|
833
|
+
*
|
|
834
|
+
* @public
|
|
835
|
+
* @param {bigint} netAmount - The additional limit to add to this incentive.
|
|
836
|
+
* @returns {Hex} The ABI-encoded payload with the updated `limit`.
|
|
837
|
+
*/
|
|
838
|
+
getTopupPayload(netAmount: bigint): Promise<Hex>;
|
|
804
839
|
/**
|
|
805
840
|
* Builds the claim data for the ERC20VariableIncentive.
|
|
806
841
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20VariableIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20VariableIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EAc1B,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"ERC20VariableIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20VariableIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EAc1B,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAIT,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,yBAAyB,EAAE,CAAC;AACrC;;;;;;GAMG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,CACnC,KAAK,SAAS,iBAAiB,CAC7B,OAAO,yBAAyB,CACjC,GAAG,iBAAiB,CAAC,OAAO,yBAAyB,CAAC,IACrD,UAAU,CAAC,OAAO,yBAAyB,EAAE,KAAK,CAAC,CAAC;AAExD;;;;;;;;;GASG;AACH,qBAAa,sBAAsB,CACjC,OAAO,GAAG,6BAA6B,GAAG,SAAS,EACnD,GAAG,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