@boostxyz/sdk 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +5 -5
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +18 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +201 -132
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.js +8 -8
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +14 -0
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +94 -75
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +6 -6
- package/dist/{Budget-fHCvlPfB.js → Budget-CTxrE06r.js} +53 -53
- package/dist/{Budget-fHCvlPfB.js.map → Budget-CTxrE06r.js.map} +1 -1
- package/dist/{Budget-Cnyh81n5.cjs → Budget-Cui2BUr4.cjs} +2 -2
- package/dist/{Budget-Cnyh81n5.cjs.map → Budget-Cui2BUr4.cjs.map} +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +3 -3
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.js +29 -29
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +15 -15
- package/dist/Incentive-AWwdbmix.cjs +2 -0
- package/dist/Incentive-AWwdbmix.cjs.map +1 -0
- package/dist/Incentive-CsFJZxYl.js +901 -0
- package/dist/Incentive-CsFJZxYl.js.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.js +11 -11
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +24 -22
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +19 -19
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +1035 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +19 -19
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +25 -23
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +6 -5
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +17 -16
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.js +8 -8
- package/dist/{SimpleDenyList-CgQvS1ek.cjs → SimpleDenyList-DQT0Fj3v.cjs} +2 -2
- package/dist/{SimpleDenyList-CgQvS1ek.cjs.map → SimpleDenyList-DQT0Fj3v.cjs.map} +1 -1
- package/dist/{SimpleDenyList-GZlSeh2G.js → SimpleDenyList-kcqV-01w.js} +12 -12
- package/dist/{SimpleDenyList-GZlSeh2G.js.map → SimpleDenyList-kcqV-01w.js.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.js +18 -18
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +16 -16
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +4 -4
- package/dist/componentInterfaces-D7r9xJmt.cjs +2 -0
- package/dist/componentInterfaces-D7r9xJmt.cjs.map +1 -0
- package/dist/componentInterfaces-PR3ijhgZ.js +18 -0
- package/dist/componentInterfaces-PR3ijhgZ.js.map +1 -0
- package/dist/{deployments-CMdsItcq.cjs → deployments-BNFI9vnc.cjs} +2 -2
- package/dist/deployments-BNFI9vnc.cjs.map +1 -0
- package/dist/{deployments-DzhmI-zL.js → deployments-D68FgefY.js} +31 -31
- package/dist/deployments-D68FgefY.js.map +1 -0
- package/dist/deployments.json +20 -15
- package/dist/generated-CRD9XfOT.cjs +3 -0
- package/dist/generated-CRD9XfOT.cjs.map +1 -0
- package/dist/{generated-Hbd0NIf9.js → generated-ClbO_ULI.js} +1274 -709
- package/dist/generated-ClbO_ULI.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +133 -129
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +7 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1121 -41
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/Actions/EventAction.ts +85 -1
- package/src/BoostCore.ts +27 -0
- package/src/Incentives/CGDAIncentive.ts +3 -1
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.test.ts +315 -0
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +728 -0
- package/src/Incentives/ERC20VariableIncentive.ts +3 -1
- package/src/Incentives/Incentive.ts +8 -2
- package/src/index.ts +1 -0
- package/src/utils.ts +10 -0
- package/dist/Incentive-M45PaQsT.js +0 -397
- package/dist/Incentive-M45PaQsT.js.map +0 -1
- package/dist/Incentive-axLU7ndr.cjs +0 -2
- package/dist/Incentive-axLU7ndr.cjs.map +0 -1
- package/dist/componentInterfaces-Bt-4sNB5.cjs +0 -2
- package/dist/componentInterfaces-Bt-4sNB5.cjs.map +0 -1
- package/dist/componentInterfaces-C4uAYjSo.js +0 -16
- package/dist/componentInterfaces-C4uAYjSo.js.map +0 -1
- package/dist/deployments-CMdsItcq.cjs.map +0 -1
- package/dist/deployments-DzhmI-zL.js.map +0 -1
- package/dist/generated-CNkDfjzI.cjs +0 -3
- package/dist/generated-CNkDfjzI.cjs.map +0 -1
- package/dist/generated-Hbd0NIf9.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ERC20PeggedVariableCriteriaIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uCAAuC,EAkBxC,MAAM,eAAe,CAAC;AAIvB,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAMvB,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,KAAK,YA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AM,EAAE,MAAM;IAIvC;;;;;;;OAOG;IACI,cAAc,CAAC,YAAY,EAAE,MAAM;CAM3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kDAAkD,CAAC,EACjE,KAAK,EACL,GAAG,EACH,MAAM,EACN,KAAK,EACL,SAAc,EACd,OAAqB,EACrB,QAAQ,GACT,EAAE,2CAA2C,iBA2C7C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-CNkDfjzI.cjs"),h=require("@wagmi/core"),o=require("viem"),C=require("../deployments-CMdsItcq.cjs"),u=require("../Actions/EventAction.cjs"),c=require("../errors.cjs"),E=require("../utils.cjs"),I=require("./ERC20VariableIncentive.cjs"),w="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612d42806100bd5f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c95565b61084b565b6040516102509190611cda565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611d0b565b60405180910390f35b61029d60048036038101906102989190611d4e565b6108cc565b005b6102b960048036038101906102b49190611dd3565b6108d9565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611dd3565b6108ef565b6040516102ee9190611cda565b60405180910390f35b348015610302575f80fd5b5061030b610905565b6040516103189190611d0b565b60405180910390f35b61032961090a565b005b348015610336575f80fd5b5061033f61095b565b60405161034c9190611e20565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611e39565b610982565b6040516103889190611d0b565b60405180910390f35b34801561039c575f80fd5b506103a561099b565b6040516103b29190611e73565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611f42565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190612015565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190612015565b610d9c565b60405161043f929190612060565b60405180910390f35b610462600480360381019061045d9190611dd3565b610f06565b005b34801561046f575f80fd5b5061048a60048036038101906104859190612015565b610f1c565b60405161049791906120f7565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611dd3565b610fea565b6040516104d39190611cda565b60405180910390f35b6104e4611001565b005b3480156104f1575f80fd5b506104fa61103a565b6040516105079190611d0b565b60405180910390f35b610518611040565b005b348015610525575f80fd5b5061052e611053565b60405161053b9190611d0b565b60405180910390f35b34801561054f575f80fd5b50610558611058565b60405161056894939291906121bd565b60405180910390f35b34801561057c575f80fd5b506105856110ad565b6040516105929190611e73565b60405180910390f35b3480156105a6575f80fd5b506105af6110d5565b6040516105bc9190611d0b565b60405180910390f35b3480156105d0575f80fd5b506105d96110db565b6040516105e6919061228f565b60405180910390f35b3480156105fa575f80fd5b50610615600480360381019061061091906122a8565b6111aa565b6040516106229190611cda565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c919061235a565b6113d7565b005b34801561065e575f80fd5b5061066761148d565b6040516106749190611d0b565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611e39565b611496565b6040516106b09190611cda565b60405180910390f35b3480156106c4575f80fd5b506106cd6114b3565b6040516106da9190611d0b565b60405180910390f35b3480156106ee575f80fd5b50610709600480360381019061070491906122a8565b6114b9565b6040516107169190611cda565b60405180910390f35b34801561072a575f80fd5b506107456004803603810190610740919061235a565b6114cc565b005b348015610752575f80fd5b5061075b611582565b6040516107689190611d0b565b60405180910390f35b34801561077c575f80fd5b50610785611588565b6040516107929190611d0b565b60405180910390f35b6107b560048036038101906107b09190611e39565b61158d565b005b6107d160048036038101906107cc9190611e39565b6115cb565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611e39565b6115f4565b6040516108069190611cda565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611e39565b611647565b6040516108429190611d0b565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc82611660565b5b9050919050565b5f8054905090565b6108d633826116d9565b50565b6108e16116e8565b6108eb828261171f565b5050565b5f81826108fb85610982565b1614905092915050565b5f5481565b5f61091361172f565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb81611739565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a6123d8565b5b9050602002016020810190610a40919061242f565b90506001151581151503610a8557610a80878784818110610a6457610a636123d8565b5b9050602002016020810190610a799190611e39565b600161171f565b610ab8565b610ab7878784818110610a9b57610a9a6123d8565b5b9050602002016020810190610ab09190611e39565b60016116d9565b5b508080600101915050610a0c565b505050505050565b5f610ad761176e565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a9190612650565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661179790919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb9392919061267c565b60405180910390fd5b8560035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550845f8190555083600281905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c79612117565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc336117ca565b610d073360016118a0565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610d5394939291906126b1565b60405180910390a2505050505050508015610d97576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610da9816118e1565b5f8585810190610db9919061280d565b90505f8160200151806020019051810190610dd49190612868565b90508060025f828254610de791906128c0565b92505081905550610e3d825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119089092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610eb193929190612958565b604051602081830303815290604052604051610ecd91906120f7565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610f0e6116e8565b610f1882826116d9565b5050565b60605f808484810190610f2f91906129cf565b9250509150604051806080016040528060016002811115610f5357610f52612117565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610faf9190612a48565b604051602081830303815290604052815250604051602001610fd19190612b4f565b6040516020818303038152906040529250505092915050565b5f8082610ff685610982565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b6110486116e8565b6110515f611951565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b6110e3611bdd565b60076040518060800160405290815f82015f9054906101000a900460ff16600181111561111357611112612117565b5b600181111561112557611124612117565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f6111b36116e8565b5f83838101906111c39190612bf4565b90505f81602001518060200190518101906111de9190612868565b90505f6111ea87611a17565b611220576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80540361123057819050611253565b670de0b6b3a7640000825f546112469190612c3b565b6112509190612ca9565b90505b5f60065414158015611266575060065481115b156112715760065490505b600254816005546112829190612cd9565b11156112ba576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112cb9190612cd9565b92505081905550600160045f8282546112e49190612cd9565b92505081905550611337878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119089092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689846040516020016113a593929190612958565b6040516020818303038152906040526040516113c191906120f7565b60405180910390a2600193505050509392505050565b60026113e281611739565b828290508585905014611421576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561148557611478868683818110611444576114436123d8565b5b90506020020160208101906114599190611e39565b85858481811061146c5761146b6123d8565b5b9050602002013561171f565b8080600101915050611423565b505050505050565b5f600654905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f6114c384611a17565b90509392505050565b60026114d781611739565b828290508585905014611516576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561157a5761156d868683818110611539576115386123d8565b5b905060200201602081019061154e9190611e39565b858584818110611561576115606123d8565b5b905060200201356116d9565b8080600101915050611518565b505050505050565b60045481565b600181565b6115956116e8565b63389a75e1600c52805f526020600c2080544211156115bb57636f5e88185f526004601cfd5b5f8155506115c881611951565b50565b6115d36116e8565b8060601b6115e857637448fbae5f526004601cfd5b6115f181611951565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166116146110ad565b73ffffffffffffffffffffffffffffffffffffffff161480611640575061163f826002600117610fea565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806116d257506116d182611a26565b5b9050919050565b6116e482825f611a9f565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461171d576382b429005f526004601cfd5b565b61172b82826001611a9f565b5050565b5f6202a300905090565b638b78c6d81954331461176b57638b78c6d8600c52335f52806020600c20541661176a576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6117d2611af7565b1561184a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561180c57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061189d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c205416611905576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611948576390b8ec185f526004601cfd5b5f603452505050565b611959611af7565b156119be577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611a14565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a985750611a9782611afb565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611ac157848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b6d5750611b6c82611b74565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611bfb57611bfa612117565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c7481611c40565b8114611c7e575f80fd5b50565b5f81359050611c8f81611c6b565b92915050565b5f60208284031215611caa57611ca9611c38565b5b5f611cb784828501611c81565b91505092915050565b5f8115159050919050565b611cd481611cc0565b82525050565b5f602082019050611ced5f830184611ccb565b92915050565b5f819050919050565b611d0581611cf3565b82525050565b5f602082019050611d1e5f830184611cfc565b92915050565b611d2d81611cf3565b8114611d37575f80fd5b50565b5f81359050611d4881611d24565b92915050565b5f60208284031215611d6357611d62611c38565b5b5f611d7084828501611d3a565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611da282611d79565b9050919050565b611db281611d98565b8114611dbc575f80fd5b50565b5f81359050611dcd81611da9565b92915050565b5f8060408385031215611de957611de8611c38565b5b5f611df685828601611dbf565b9250506020611e0785828601611d3a565b9150509250929050565b611e1a81611c40565b82525050565b5f602082019050611e335f830184611e11565b92915050565b5f60208284031215611e4e57611e4d611c38565b5b5f611e5b84828501611dbf565b91505092915050565b611e6d81611d98565b82525050565b5f602082019050611e865f830184611e64565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611ead57611eac611e8c565b5b8235905067ffffffffffffffff811115611eca57611ec9611e90565b5b602083019150836020820283011115611ee657611ee5611e94565b5b9250929050565b5f8083601f840112611f0257611f01611e8c565b5b8235905067ffffffffffffffff811115611f1f57611f1e611e90565b5b602083019150836020820283011115611f3b57611f3a611e94565b5b9250929050565b5f805f8060408587031215611f5a57611f59611c38565b5b5f85013567ffffffffffffffff811115611f7757611f76611c3c565b5b611f8387828801611e98565b9450945050602085013567ffffffffffffffff811115611fa657611fa5611c3c565b5b611fb287828801611eed565b925092505092959194509250565b5f8083601f840112611fd557611fd4611e8c565b5b8235905067ffffffffffffffff811115611ff257611ff1611e90565b5b60208301915083600182028301111561200e5761200d611e94565b5b9250929050565b5f806020838503121561202b5761202a611c38565b5b5f83013567ffffffffffffffff81111561204857612047611c3c565b5b61205485828601611fc0565b92509250509250929050565b5f6040820190506120735f830185611cfc565b6120806020830184611e64565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6120c982612087565b6120d38185612091565b93506120e38185602086016120a1565b6120ec816120af565b840191505092915050565b5f6020820190508181035f83015261210f81846120bf565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061215557612154612117565b5b50565b5f81905061216582612144565b919050565b5f61217482612158565b9050919050565b6121848161216a565b82525050565b5f819050919050565b61219c8161218a565b82525050565b5f60ff82169050919050565b6121b7816121a2565b82525050565b5f6080820190506121d05f83018761217b565b6121dd6020830186612193565b6121ea60408301856121ae565b6121f76060830184611e64565b95945050505050565b6122098161216a565b82525050565b6122188161218a565b82525050565b612227816121a2565b82525050565b61223681611d98565b82525050565b608082015f8201516122505f850182612200565b506020820151612263602085018261220f565b506040820151612276604085018261221e565b506060820151612289606085018261222d565b50505050565b5f6080820190506122a25f83018461223c565b92915050565b5f805f604084860312156122bf576122be611c38565b5b5f6122cc86828701611dbf565b935050602084013567ffffffffffffffff8111156122ed576122ec611c3c565b5b6122f986828701611fc0565b92509250509250925092565b5f8083601f84011261231a57612319611e8c565b5b8235905067ffffffffffffffff81111561233757612336611e90565b5b60208301915083602082028301111561235357612352611e94565b5b9250929050565b5f805f806040858703121561237257612371611c38565b5b5f85013567ffffffffffffffff81111561238f5761238e611c3c565b5b61239b87828801611e98565b9450945050602085013567ffffffffffffffff8111156123be576123bd611c3c565b5b6123ca87828801612305565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61240e81611cc0565b8114612418575f80fd5b50565b5f8135905061242981612405565b92915050565b5f6020828403121561244457612443611c38565b5b5f6124518482850161241b565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612494826120af565b810181811067ffffffffffffffff821117156124b3576124b261245e565b5b80604052505050565b5f6124c5611c2f565b90506124d1828261248b565b919050565b5f80fd5b600281106124e6575f80fd5b50565b5f813590506124f7816124da565b92915050565b6125068161218a565b8114612510575f80fd5b50565b5f81359050612521816124fd565b92915050565b612530816121a2565b811461253a575f80fd5b50565b5f8135905061254b81612527565b92915050565b5f608082840312156125665761256561245a565b5b61257060806124bc565b90505f61257f848285016124e9565b5f83015250602061259284828501612513565b60208301525060406125a68482850161253d565b60408301525060606125ba84828501611dbf565b60608301525092915050565b5f61010082840312156125dc576125db61245a565b5b6125e660a06124bc565b90505f6125f584828501611dbf565b5f83015250602061260884828501611d3a565b602083015250604061261c84828501611d3a565b604083015250606061263084828501611d3a565b606083015250608061264484828501612551565b60808301525092915050565b5f610100828403121561266657612665611c38565b5b5f612673848285016125c6565b91505092915050565b5f60608201905061268f5f830186611e64565b61269c6020830185611cfc565b6126a96040830184611cfc565b949350505050565b5f60e0820190506126c45f830187611cfc565b6126d16020830186611cfc565b6126de6040830185611cfc565b6126eb606083018461223c565b95945050505050565b5f80fd5b5f67ffffffffffffffff8211156127125761271161245e565b5b61271b826120af565b9050602081019050919050565b828183375f83830152505050565b5f612748612743846126f8565b6124bc565b905082815260208101848484011115612764576127636126f4565b5b61276f848285612728565b509392505050565b5f82601f83011261278b5761278a611e8c565b5b813561279b848260208601612736565b91505092915050565b5f604082840312156127b9576127b861245a565b5b6127c360406124bc565b90505f6127d284828501611dbf565b5f83015250602082013567ffffffffffffffff8111156127f5576127f46124d6565b5b61280184828501612777565b60208301525092915050565b5f6020828403121561282257612821611c38565b5b5f82013567ffffffffffffffff81111561283f5761283e611c3c565b5b61284b848285016127a4565b91505092915050565b5f8151905061286281611d24565b92915050565b5f6020828403121561287d5761287c611c38565b5b5f61288a84828501612854565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6128ca82611cf3565b91506128d583611cf3565b92508282039050818111156128ed576128ec612893565b5b92915050565b5f8160601b9050919050565b5f612909826128f3565b9050919050565b5f61291a826128ff565b9050919050565b61293261292d82611d98565b612910565b82525050565b5f819050919050565b61295261294d82611cf3565b612938565b82525050565b5f6129638286612921565b6014820191506129738285612921565b6014820191506129838284612941565b602082019150819050949350505050565b5f61299e82611d79565b9050919050565b6129ae81612994565b81146129b8575f80fd5b50565b5f813590506129c9816129a5565b92915050565b5f805f606084860312156129e6576129e5611c38565b5b5f6129f3868287016129bb565b9350506020612a0486828701611d3a565b9250506040612a1586828701611d3a565b9150509250925092565b612a2881611cf3565b82525050565b602082015f820151612a425f850182612a1f565b50505050565b5f602082019050612a5b5f830184612a2e565b92915050565b60038110612a7257612a71612117565b5b50565b5f819050612a8282612a61565b919050565b5f612a9182612a75565b9050919050565b612aa181612a87565b82525050565b5f82825260208201905092915050565b5f612ac182612087565b612acb8185612aa7565b9350612adb8185602086016120a1565b612ae4816120af565b840191505092915050565b5f608083015f830151612b045f860182612a98565b506020830151612b17602086018261222d565b506040830151612b2a604086018261222d565b5060608301518482036060860152612b428282612ab7565b9150508091505092915050565b5f6020820190508181035f830152612b678184612aef565b905092915050565b5f60408284031215612b8457612b8361245a565b5b612b8e60406124bc565b90505f82013567ffffffffffffffff811115612bad57612bac6124d6565b5b612bb984828501612777565b5f83015250602082013567ffffffffffffffff811115612bdc57612bdb6124d6565b5b612be884828501612777565b60208301525092915050565b5f60208284031215612c0957612c08611c38565b5b5f82013567ffffffffffffffff811115612c2657612c25611c3c565b5b612c3284828501612b6f565b91505092915050565b5f612c4582611cf3565b9150612c5083611cf3565b9250828202612c5e81611cf3565b91508282048414831517612c7557612c74612893565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612cb382611cf3565b9150612cbe83611cf3565b925082612cce57612ccd612c7c565b5b828204905092915050565b5f612ce382611cf3565b9150612cee83611cf3565b9250828201905080821115612d0657612d05612893565b5b9291505056fea2646970667358221220d4c0d57f1e9fa107af113ee797193e2a4eb6e337829af8477cc95d77b9c8be6864736f6c634300081a0033",l=class l extends I.ERC20VariableIncentive{constructor(){super(...arguments),this.abi=s.y}async getIncentiveCriteria(b){try{return await s.yh(this._config,{...b,address:this.assertValidAddress()})}catch(e){throw new c.IncentiveCriteriaNotFoundError(e)}}async getMaxReward(b){return await s.dh(this._config,{...b,address:this.assertValidAddress()})}async getIncentiveScalar({chainId:b,hash:e,knownSignatures:r},a){var y;const f=await this.getIncentiveCriteria(a);if(f.criteriaType===u.SignatureType.EVENT){const d=await h.getTransactionReceipt(this._config,{chainId:b,hash:e});if(f.fieldIndex===E.CheatCodes.GAS_REBATE_INCENTIVE)return d.gasUsed*d.effectiveGasPrice+(d.blobGasUsed??0n)*(d.blobGasPrice??0n);const n=d.logs;if(n.length===0)throw new c.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);try{const i=r[f.signature],t=o.parseEventLogs({abi:[i],logs:n});if(t==null||t.length===0)throw new c.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);const p=((y=t[0])==null?void 0:y.args)[f.fieldIndex];if(p===void 0)throw new c.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(p)}catch(i){throw new c.DecodedArgsError(`Failed to decode event log for signature ${f.signature}: ${i.message}`)}}else if(f.criteriaType===u.SignatureType.FUNC){const d=await h.getTransaction(this._config,{chainId:b,hash:e});try{const n=r[f.signature],t=o.decodeFunctionData({abi:[n],data:d.input}).args[f.fieldIndex];if(t==null)throw new c.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(t)}catch(n){throw new c.DecodedArgsError(`Failed to decode function data for signature ${f.signature}: ${n.message}`)}}else throw new c.InvalidCriteriaTypeError(`Invalid criteria type ${f.criteriaType}`)}buildParameters(b,e){const[r,a]=this.validateDeploymentConfig(b,e);return{abi:s.y,bytecode:w,args:[m(r)],...this.optionallyAttachAccount(a.account)}}};l.bases={31337:void 0,...C.ERC20VariableCriteriaIncentive};let g=l;function T(){return{criteriaType:u.SignatureType.EVENT,signature:o.zeroHash,fieldIndex:E.CheatCodes.GAS_REBATE_INCENTIVE,targetContract:o.zeroAddress}}function m({asset:v,reward:b,limit:e,maxReward:r=0n,criteria:a}){return o.encodeAbiParameters([{type:"tuple",name:"initPayloadExtended",components:[{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"uint256",name:"maxReward"},{type:"tuple",name:"criteria",components:[{type:"uint8",name:"criteriaType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"}]}]}],[{asset:v,reward:b,limit:e,maxReward:r,criteria:{criteriaType:a.criteriaType,signature:a.signature,fieldIndex:a.fieldIndex,targetContract:a.targetContract}}])}exports.erc20VariableCriteriaIncentiveAbi=s.y;exports.ERC20VariableCriteriaIncentive=g;exports.gasRebateIncentiveCriteria=T;exports.prepareERC20VariableCriteriaIncentivePayload=m;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-CRD9XfOT.cjs"),E=require("@wagmi/core"),o=require("viem"),C=require("../deployments-BNFI9vnc.cjs"),u=require("../Actions/EventAction.cjs"),a=require("../errors.cjs"),h=require("../utils.cjs"),I=require("./ERC20VariableIncentive.cjs"),w="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612d1b806100bd5f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c6e565b61084b565b6040516102509190611cb3565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611ce4565b60405180910390f35b61029d60048036038101906102989190611d27565b6108cc565b005b6102b960048036038101906102b49190611dac565b6108d9565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611dac565b6108ef565b6040516102ee9190611cb3565b60405180910390f35b348015610302575f80fd5b5061030b610905565b6040516103189190611ce4565b60405180910390f35b61032961090a565b005b348015610336575f80fd5b5061033f61095b565b60405161034c9190611df9565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611e12565b610982565b6040516103889190611ce4565b60405180910390f35b34801561039c575f80fd5b506103a561099b565b6040516103b29190611e4c565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611f1b565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190611fee565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190611fee565b610d9c565b60405161043f929190612039565b60405180910390f35b610462600480360381019061045d9190611dac565b610f06565b005b34801561046f575f80fd5b5061048a60048036038101906104859190611fee565b610f1c565b60405161049791906120d0565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611dac565b610fea565b6040516104d39190611cb3565b60405180910390f35b6104e4611001565b005b3480156104f1575f80fd5b506104fa61103a565b6040516105079190611ce4565b60405180910390f35b610518611040565b005b348015610525575f80fd5b5061052e611053565b60405161053b9190611ce4565b60405180910390f35b34801561054f575f80fd5b50610558611058565b6040516105689493929190612196565b60405180910390f35b34801561057c575f80fd5b506105856110ad565b6040516105929190611e4c565b60405180910390f35b3480156105a6575f80fd5b506105af6110d5565b6040516105bc9190611ce4565b60405180910390f35b3480156105d0575f80fd5b506105d96110db565b6040516105e69190612268565b60405180910390f35b3480156105fa575f80fd5b5061061560048036038101906106109190612281565b6111aa565b6040516106229190611cb3565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c9190612333565b6113d7565b005b34801561065e575f80fd5b5061066761148d565b6040516106749190611ce4565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611e12565b611496565b6040516106b09190611cb3565b60405180910390f35b3480156106c4575f80fd5b506106cd6114b3565b6040516106da9190611ce4565b60405180910390f35b3480156106ee575f80fd5b5061070960048036038101906107049190612281565b6114b9565b6040516107169190611cb3565b60405180910390f35b34801561072a575f80fd5b5061074560048036038101906107409190612333565b6114cc565b005b348015610752575f80fd5b5061075b611582565b6040516107689190611ce4565b60405180910390f35b34801561077c575f80fd5b50610785611588565b6040516107929190611ce4565b60405180910390f35b6107b560048036038101906107b09190611e12565b61158d565b005b6107d160048036038101906107cc9190611e12565b6115cb565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611e12565b6115f4565b6040516108069190611cb3565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611e12565b611647565b6040516108429190611ce4565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc82611660565b5b9050919050565b5f8054905090565b6108d633826116d9565b50565b6108e16116e8565b6108eb828261171f565b5050565b5f81826108fb85610982565b1614905092915050565b5f5481565b5f61091361172f565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb81611739565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a6123b1565b5b9050602002016020810190610a409190612408565b90506001151581151503610a8557610a80878784818110610a6457610a636123b1565b5b9050602002016020810190610a799190611e12565b600161171f565b610ab8565b610ab7878784818110610a9b57610a9a6123b1565b5b9050602002016020810190610ab09190611e12565b60016116d9565b5b508080600101915050610a0c565b505050505050565b5f610ad761176e565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a9190612629565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661179790919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb93929190612655565b60405180910390fd5b8560035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550845f8190555083600281905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c796120f0565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc336117ca565b610d073360016118a0565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610d53949392919061268a565b60405180910390a2505050505050508015610d97576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610da981611739565b5f8585810190610db991906127e6565b90505f8160200151806020019051810190610dd49190612841565b90508060025f828254610de79190612899565b92505081905550610e3d825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118e19092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610eb193929190612931565b604051602081830303815290604052604051610ecd91906120d0565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610f0e6116e8565b610f1882826116d9565b5050565b60605f808484810190610f2f91906129a8565b9250509150604051806080016040528060016002811115610f5357610f526120f0565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610faf9190612a21565b604051602081830303815290604052815250604051602001610fd19190612b28565b6040516020818303038152906040529250505092915050565b5f8082610ff685610982565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b6110486116e8565b6110515f61192a565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b6110e3611bb6565b60076040518060800160405290815f82015f9054906101000a900460ff166001811115611113576111126120f0565b5b6001811115611125576111246120f0565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f6111b36116e8565b5f83838101906111c39190612bcd565b90505f81602001518060200190518101906111de9190612841565b90505f6111ea876119f0565b611220576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80540361123057819050611253565b670de0b6b3a7640000825f546112469190612c14565b6112509190612c82565b90505b5f60065414158015611266575060065481115b156112715760065490505b600254816005546112829190612cb2565b11156112ba576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112cb9190612cb2565b92505081905550600160045f8282546112e49190612cb2565b92505081905550611337878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118e19092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689846040516020016113a593929190612931565b6040516020818303038152906040526040516113c191906120d0565b60405180910390a2600193505050509392505050565b60026113e281611739565b828290508585905014611421576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561148557611478868683818110611444576114436123b1565b5b90506020020160208101906114599190611e12565b85858481811061146c5761146b6123b1565b5b9050602002013561171f565b8080600101915050611423565b505050505050565b5f600654905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f6114c3846119f0565b90509392505050565b60026114d781611739565b828290508585905014611516576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561157a5761156d868683818110611539576115386123b1565b5b905060200201602081019061154e9190611e12565b858584818110611561576115606123b1565b5b905060200201356116d9565b8080600101915050611518565b505050505050565b60045481565b600181565b6115956116e8565b63389a75e1600c52805f526020600c2080544211156115bb57636f5e88185f526004601cfd5b5f8155506115c88161192a565b50565b6115d36116e8565b8060601b6115e857637448fbae5f526004601cfd5b6115f18161192a565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166116146110ad565b73ffffffffffffffffffffffffffffffffffffffff161480611640575061163f826002600117610fea565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806116d257506116d1826119ff565b5b9050919050565b6116e482825f611a78565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461171d576382b429005f526004601cfd5b565b61172b82826001611a78565b5050565b5f6202a300905090565b638b78c6d81954331461176b57638b78c6d8600c52335f52806020600c20541661176a576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6117d2611ad0565b1561184a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561180c57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061189d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611921576390b8ec185f526004601cfd5b5f603452505050565b611932611ad0565b15611997577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506119ed565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a715750611a7082611ad4565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611a9a57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b465750611b4582611b4d565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611bd457611bd36120f0565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c4d81611c19565b8114611c57575f80fd5b50565b5f81359050611c6881611c44565b92915050565b5f60208284031215611c8357611c82611c11565b5b5f611c9084828501611c5a565b91505092915050565b5f8115159050919050565b611cad81611c99565b82525050565b5f602082019050611cc65f830184611ca4565b92915050565b5f819050919050565b611cde81611ccc565b82525050565b5f602082019050611cf75f830184611cd5565b92915050565b611d0681611ccc565b8114611d10575f80fd5b50565b5f81359050611d2181611cfd565b92915050565b5f60208284031215611d3c57611d3b611c11565b5b5f611d4984828501611d13565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611d7b82611d52565b9050919050565b611d8b81611d71565b8114611d95575f80fd5b50565b5f81359050611da681611d82565b92915050565b5f8060408385031215611dc257611dc1611c11565b5b5f611dcf85828601611d98565b9250506020611de085828601611d13565b9150509250929050565b611df381611c19565b82525050565b5f602082019050611e0c5f830184611dea565b92915050565b5f60208284031215611e2757611e26611c11565b5b5f611e3484828501611d98565b91505092915050565b611e4681611d71565b82525050565b5f602082019050611e5f5f830184611e3d565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611e8657611e85611e65565b5b8235905067ffffffffffffffff811115611ea357611ea2611e69565b5b602083019150836020820283011115611ebf57611ebe611e6d565b5b9250929050565b5f8083601f840112611edb57611eda611e65565b5b8235905067ffffffffffffffff811115611ef857611ef7611e69565b5b602083019150836020820283011115611f1457611f13611e6d565b5b9250929050565b5f805f8060408587031215611f3357611f32611c11565b5b5f85013567ffffffffffffffff811115611f5057611f4f611c15565b5b611f5c87828801611e71565b9450945050602085013567ffffffffffffffff811115611f7f57611f7e611c15565b5b611f8b87828801611ec6565b925092505092959194509250565b5f8083601f840112611fae57611fad611e65565b5b8235905067ffffffffffffffff811115611fcb57611fca611e69565b5b602083019150836001820283011115611fe757611fe6611e6d565b5b9250929050565b5f806020838503121561200457612003611c11565b5b5f83013567ffffffffffffffff81111561202157612020611c15565b5b61202d85828601611f99565b92509250509250929050565b5f60408201905061204c5f830185611cd5565b6120596020830184611e3d565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6120a282612060565b6120ac818561206a565b93506120bc81856020860161207a565b6120c581612088565b840191505092915050565b5f6020820190508181035f8301526120e88184612098565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061212e5761212d6120f0565b5b50565b5f81905061213e8261211d565b919050565b5f61214d82612131565b9050919050565b61215d81612143565b82525050565b5f819050919050565b61217581612163565b82525050565b5f60ff82169050919050565b6121908161217b565b82525050565b5f6080820190506121a95f830187612154565b6121b6602083018661216c565b6121c36040830185612187565b6121d06060830184611e3d565b95945050505050565b6121e281612143565b82525050565b6121f181612163565b82525050565b6122008161217b565b82525050565b61220f81611d71565b82525050565b608082015f8201516122295f8501826121d9565b50602082015161223c60208501826121e8565b50604082015161224f60408501826121f7565b5060608201516122626060850182612206565b50505050565b5f60808201905061227b5f830184612215565b92915050565b5f805f6040848603121561229857612297611c11565b5b5f6122a586828701611d98565b935050602084013567ffffffffffffffff8111156122c6576122c5611c15565b5b6122d286828701611f99565b92509250509250925092565b5f8083601f8401126122f3576122f2611e65565b5b8235905067ffffffffffffffff8111156123105761230f611e69565b5b60208301915083602082028301111561232c5761232b611e6d565b5b9250929050565b5f805f806040858703121561234b5761234a611c11565b5b5f85013567ffffffffffffffff81111561236857612367611c15565b5b61237487828801611e71565b9450945050602085013567ffffffffffffffff81111561239757612396611c15565b5b6123a3878288016122de565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6123e781611c99565b81146123f1575f80fd5b50565b5f81359050612402816123de565b92915050565b5f6020828403121561241d5761241c611c11565b5b5f61242a848285016123f4565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61246d82612088565b810181811067ffffffffffffffff8211171561248c5761248b612437565b5b80604052505050565b5f61249e611c08565b90506124aa8282612464565b919050565b5f80fd5b600281106124bf575f80fd5b50565b5f813590506124d0816124b3565b92915050565b6124df81612163565b81146124e9575f80fd5b50565b5f813590506124fa816124d6565b92915050565b6125098161217b565b8114612513575f80fd5b50565b5f8135905061252481612500565b92915050565b5f6080828403121561253f5761253e612433565b5b6125496080612495565b90505f612558848285016124c2565b5f83015250602061256b848285016124ec565b602083015250604061257f84828501612516565b604083015250606061259384828501611d98565b60608301525092915050565b5f61010082840312156125b5576125b4612433565b5b6125bf60a0612495565b90505f6125ce84828501611d98565b5f8301525060206125e184828501611d13565b60208301525060406125f584828501611d13565b604083015250606061260984828501611d13565b606083015250608061261d8482850161252a565b60808301525092915050565b5f610100828403121561263f5761263e611c11565b5b5f61264c8482850161259f565b91505092915050565b5f6060820190506126685f830186611e3d565b6126756020830185611cd5565b6126826040830184611cd5565b949350505050565b5f60e08201905061269d5f830187611cd5565b6126aa6020830186611cd5565b6126b76040830185611cd5565b6126c46060830184612215565b95945050505050565b5f80fd5b5f67ffffffffffffffff8211156126eb576126ea612437565b5b6126f482612088565b9050602081019050919050565b828183375f83830152505050565b5f61272161271c846126d1565b612495565b90508281526020810184848401111561273d5761273c6126cd565b5b612748848285612701565b509392505050565b5f82601f83011261276457612763611e65565b5b813561277484826020860161270f565b91505092915050565b5f6040828403121561279257612791612433565b5b61279c6040612495565b90505f6127ab84828501611d98565b5f83015250602082013567ffffffffffffffff8111156127ce576127cd6124af565b5b6127da84828501612750565b60208301525092915050565b5f602082840312156127fb576127fa611c11565b5b5f82013567ffffffffffffffff81111561281857612817611c15565b5b6128248482850161277d565b91505092915050565b5f8151905061283b81611cfd565b92915050565b5f6020828403121561285657612855611c11565b5b5f6128638482850161282d565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6128a382611ccc565b91506128ae83611ccc565b92508282039050818111156128c6576128c561286c565b5b92915050565b5f8160601b9050919050565b5f6128e2826128cc565b9050919050565b5f6128f3826128d8565b9050919050565b61290b61290682611d71565b6128e9565b82525050565b5f819050919050565b61292b61292682611ccc565b612911565b82525050565b5f61293c82866128fa565b60148201915061294c82856128fa565b60148201915061295c828461291a565b602082019150819050949350505050565b5f61297782611d52565b9050919050565b6129878161296d565b8114612991575f80fd5b50565b5f813590506129a28161297e565b92915050565b5f805f606084860312156129bf576129be611c11565b5b5f6129cc86828701612994565b93505060206129dd86828701611d13565b92505060406129ee86828701611d13565b9150509250925092565b612a0181611ccc565b82525050565b602082015f820151612a1b5f8501826129f8565b50505050565b5f602082019050612a345f830184612a07565b92915050565b60038110612a4b57612a4a6120f0565b5b50565b5f819050612a5b82612a3a565b919050565b5f612a6a82612a4e565b9050919050565b612a7a81612a60565b82525050565b5f82825260208201905092915050565b5f612a9a82612060565b612aa48185612a80565b9350612ab481856020860161207a565b612abd81612088565b840191505092915050565b5f608083015f830151612add5f860182612a71565b506020830151612af06020860182612206565b506040830151612b036040860182612206565b5060608301518482036060860152612b1b8282612a90565b9150508091505092915050565b5f6020820190508181035f830152612b408184612ac8565b905092915050565b5f60408284031215612b5d57612b5c612433565b5b612b676040612495565b90505f82013567ffffffffffffffff811115612b8657612b856124af565b5b612b9284828501612750565b5f83015250602082013567ffffffffffffffff811115612bb557612bb46124af565b5b612bc184828501612750565b60208301525092915050565b5f60208284031215612be257612be1611c11565b5b5f82013567ffffffffffffffff811115612bff57612bfe611c15565b5b612c0b84828501612b48565b91505092915050565b5f612c1e82611ccc565b9150612c2983611ccc565b9250828202612c3781611ccc565b91508282048414831517612c4e57612c4d61286c565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612c8c82611ccc565b9150612c9783611ccc565b925082612ca757612ca6612c55565b5b828204905092915050565b5f612cbc82611ccc565b9150612cc783611ccc565b9250828201905080821115612cdf57612cde61286c565b5b9291505056fea2646970667358221220238a2694ac11aa8bece7145721bd76ab9cc7b07442e8c97be4bdd87624df868664736f6c634300081a0033",l=class l extends I.ERC20VariableIncentive{constructor(){super(...arguments),this.abi=s.d}async getIncentiveCriteria(b){try{return await s.YN(this._config,{...b,address:this.assertValidAddress()})}catch(e){throw new a.IncentiveCriteriaNotFoundError(e)}}async getMaxReward(b){return await s.e5(this._config,{...b,address:this.assertValidAddress()})}async getIncentiveScalar({chainId:b,hash:e,knownSignatures:r},c){var p;const f=await this.getIncentiveCriteria(c);if(f.criteriaType===u.SignatureType.EVENT){const d=await E.getTransactionReceipt(this._config,{chainId:b,hash:e});if(f.fieldIndex===h.CheatCodes.GAS_REBATE_INCENTIVE)return d.gasUsed*d.effectiveGasPrice+(d.blobGasUsed??0n)*(d.blobGasPrice??0n);const n=d.logs;if(n.length===0)throw new a.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);try{const i=r[f.signature],t=o.parseEventLogs({abi:[i],logs:n});if(t==null||t.length===0)throw new a.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);const y=((p=t[0])==null?void 0:p.args)[f.fieldIndex];if(y===void 0)throw new a.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(y)}catch(i){throw new a.DecodedArgsError(`Failed to decode event log for signature ${f.signature}: ${i.message}`)}}else if(f.criteriaType===u.SignatureType.FUNC){const d=await E.getTransaction(this._config,{chainId:b,hash:e});try{const n=r[f.signature],t=o.decodeFunctionData({abi:[n],data:d.input}).args[f.fieldIndex];if(t==null)throw new a.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(t)}catch(n){throw new a.DecodedArgsError(`Failed to decode function data for signature ${f.signature}: ${n.message}`)}}else throw new a.InvalidCriteriaTypeError(`Invalid criteria type ${f.criteriaType}`)}buildParameters(b,e){const[r,c]=this.validateDeploymentConfig(b,e);return{abi:s.d,bytecode:w,args:[m(r)],...this.optionallyAttachAccount(c.account)}}};l.bases={31337:void 0,...C.ERC20VariableCriteriaIncentive};let g=l;function T(){return{criteriaType:u.SignatureType.EVENT,signature:o.zeroHash,fieldIndex:h.CheatCodes.GAS_REBATE_INCENTIVE,targetContract:o.zeroAddress}}function m({asset:v,reward:b,limit:e,maxReward:r=0n,criteria:c}){return o.encodeAbiParameters([{type:"tuple",name:"initPayloadExtended",components:[{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"uint256",name:"maxReward"},{type:"tuple",name:"criteria",components:[{type:"uint8",name:"criteriaType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"}]}]}],[{asset:v,reward:b,limit:e,maxReward:r,criteria:{criteriaType:c.criteriaType,signature:c.signature,fieldIndex:c.fieldIndex,targetContract:c.targetContract}}])}exports.erc20VariableCriteriaIncentiveAbi=s.d;exports.ERC20VariableCriteriaIncentive=g;exports.gasRebateIncentiveCriteria=T;exports.prepareERC20VariableCriteriaIncentivePayload=m;
|
|
2
2
|
//# sourceMappingURL=ERC20VariableCriteriaIncentive.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20VariableCriteriaIncentive.cjs","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":"61uBAgHaA,EAAN,MAAMA,UAAuCC,EAAAA,sBAGlD,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAKL,KAAyB,IAAMC,GAAA,CAwB/B,MAAa,qBACXC,EAC4B,CACxB,GAAA,CAUK,OARL,MAAMC,EAAA,GACJ,KAAK,QACL,CACE,GAAGD,EACH,QAAS,KAAK,mBAAmB,CACnC,CAAA,QAIG,EAAG,CACJ,MAAA,IAAIE,EAAAA,+BAA+B,CAAU,CACrD,CACF,CASA,MAAa,aAAaF,EAAsC,CASvD,OARW,MAAMG,EAAA,GACtB,KAAK,QACL,CACE,GAAGH,EACH,QAAS,KAAK,mBAAmB,CACnC,CAAA,CAIJ,CAUA,MAAa,mBACX,CAAE,QAAAI,EAAS,KAAAC,EAAM,gBAAAC,CAAA,E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B,CAC5C,CACF,CACF,CACF,CACF,EACA,CACE,CACE,MAAAJ,EACA,OAAAC,EACA,MAAAC,EACA,UAAAC,EACA,SAAU,CACR,aAAcjC,EAAS,aACvB,UAAWA,EAAS,UACpB,WAAYA,EAAS,WACrB,eAAgBA,EAAS,cAC3B,CACF,CACF,CAAA,CAEJ"}
|
|
1
|
+
{"version":3,"file":"ERC20VariableCriteriaIncentive.cjs","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":"+wuBAgHaA,EAAN,MAAMA,UAAuCC,EAAAA,sBAGlD,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAKL,KAAyB,IAAMC,GAAA,CAwB/B,MAAa,qBACXC,EAC4B,CACxB,GAAA,CAUK,OARL,MAAMC,EAAA,GACJ,KAAK,QACL,CACE,GAAGD,EACH,QAAS,KAAK,mBAAmB,CACnC,CAAA,QAIG,EAAG,CACJ,MAAA,IAAIE,EAAAA,+BAA+B,CAAU,CACrD,CACF,CASA,MAAa,aAAaF,EAAsC,CASvD,OARW,MAAMG,EAAA,GACtB,KAAK,QACL,CACE,GAAGH,EACH,QAAS,KAAK,mBAAmB,CACnC,CAAA,CAIJ,CAUA,MAAa,mBACX,CAAE,QAAAI,EAAS,KAAAC,EAAM,gBAAAC,CAAA,EACjBN,EACiB,OACjB,MAAMO,EAAW,M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,CACE,CACE,MAAAJ,EACA,OAAAC,EACA,MAAAC,EACA,UAAAC,EACA,SAAU,CACR,aAAcjC,EAAS,aACvB,UAAWA,EAAS,UACpB,WAAYA,EAAS,WACrB,eAAgBA,EAAS,cAC3B,CACF,CACF,CAAA,CAEJ"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as l, b0 as w, b1 as I } from "../generated-ClbO_ULI.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
|
|
4
|
+
import { b as R } from "../deployments-D68FgefY.js";
|
|
5
5
|
import { SignatureType as o } from "../Actions/EventAction.js";
|
|
6
|
-
import { IncentiveCriteriaNotFoundError as
|
|
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 _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612d42806100bd5f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c95565b61084b565b6040516102509190611cda565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611d0b565b60405180910390f35b61029d60048036038101906102989190611d4e565b6108cc565b005b6102b960048036038101906102b49190611dd3565b6108d9565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611dd3565b6108ef565b6040516102ee9190611cda565b60405180910390f35b348015610302575f80fd5b5061030b610905565b6040516103189190611d0b565b60405180910390f35b61032961090a565b005b348015610336575f80fd5b5061033f61095b565b60405161034c9190611e20565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611e39565b610982565b6040516103889190611d0b565b60405180910390f35b34801561039c575f80fd5b506103a561099b565b6040516103b29190611e73565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611f42565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190612015565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190612015565b610d9c565b60405161043f929190612060565b60405180910390f35b610462600480360381019061045d9190611dd3565b610f06565b005b34801561046f575f80fd5b5061048a60048036038101906104859190612015565b610f1c565b60405161049791906120f7565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611dd3565b610fea565b6040516104d39190611cda565b60405180910390f35b6104e4611001565b005b3480156104f1575f80fd5b506104fa61103a565b6040516105079190611d0b565b60405180910390f35b610518611040565b005b348015610525575f80fd5b5061052e611053565b60405161053b9190611d0b565b60405180910390f35b34801561054f575f80fd5b50610558611058565b60405161056894939291906121bd565b60405180910390f35b34801561057c575f80fd5b506105856110ad565b6040516105929190611e73565b60405180910390f35b3480156105a6575f80fd5b506105af6110d5565b6040516105bc9190611d0b565b60405180910390f35b3480156105d0575f80fd5b506105d96110db565b6040516105e6919061228f565b60405180910390f35b3480156105fa575f80fd5b50610615600480360381019061061091906122a8565b6111aa565b6040516106229190611cda565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c919061235a565b6113d7565b005b34801561065e575f80fd5b5061066761148d565b6040516106749190611d0b565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611e39565b611496565b6040516106b09190611cda565b60405180910390f35b3480156106c4575f80fd5b506106cd6114b3565b6040516106da9190611d0b565b60405180910390f35b3480156106ee575f80fd5b50610709600480360381019061070491906122a8565b6114b9565b6040516107169190611cda565b60405180910390f35b34801561072a575f80fd5b506107456004803603810190610740919061235a565b6114cc565b005b348015610752575f80fd5b5061075b611582565b6040516107689190611d0b565b60405180910390f35b34801561077c575f80fd5b50610785611588565b6040516107929190611d0b565b60405180910390f35b6107b560048036038101906107b09190611e39565b61158d565b005b6107d160048036038101906107cc9190611e39565b6115cb565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611e39565b6115f4565b6040516108069190611cda565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611e39565b611647565b6040516108429190611d0b565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc82611660565b5b9050919050565b5f8054905090565b6108d633826116d9565b50565b6108e16116e8565b6108eb828261171f565b5050565b5f81826108fb85610982565b1614905092915050565b5f5481565b5f61091361172f565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb81611739565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a6123d8565b5b9050602002016020810190610a40919061242f565b90506001151581151503610a8557610a80878784818110610a6457610a636123d8565b5b9050602002016020810190610a799190611e39565b600161171f565b610ab8565b610ab7878784818110610a9b57610a9a6123d8565b5b9050602002016020810190610ab09190611e39565b60016116d9565b5b508080600101915050610a0c565b505050505050565b5f610ad761176e565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a9190612650565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661179790919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb9392919061267c565b60405180910390fd5b8560035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550845f8190555083600281905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c79612117565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc336117ca565b610d073360016118a0565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610d5394939291906126b1565b60405180910390a2505050505050508015610d97576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610da9816118e1565b5f8585810190610db9919061280d565b90505f8160200151806020019051810190610dd49190612868565b90508060025f828254610de791906128c0565b92505081905550610e3d825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119089092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610eb193929190612958565b604051602081830303815290604052604051610ecd91906120f7565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610f0e6116e8565b610f1882826116d9565b5050565b60605f808484810190610f2f91906129cf565b9250509150604051806080016040528060016002811115610f5357610f52612117565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610faf9190612a48565b604051602081830303815290604052815250604051602001610fd19190612b4f565b6040516020818303038152906040529250505092915050565b5f8082610ff685610982565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b6110486116e8565b6110515f611951565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b6110e3611bdd565b60076040518060800160405290815f82015f9054906101000a900460ff16600181111561111357611112612117565b5b600181111561112557611124612117565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f6111b36116e8565b5f83838101906111c39190612bf4565b90505f81602001518060200190518101906111de9190612868565b90505f6111ea87611a17565b611220576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80540361123057819050611253565b670de0b6b3a7640000825f546112469190612c3b565b6112509190612ca9565b90505b5f60065414158015611266575060065481115b156112715760065490505b600254816005546112829190612cd9565b11156112ba576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112cb9190612cd9565b92505081905550600160045f8282546112e49190612cd9565b92505081905550611337878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119089092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689846040516020016113a593929190612958565b6040516020818303038152906040526040516113c191906120f7565b60405180910390a2600193505050509392505050565b60026113e281611739565b828290508585905014611421576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561148557611478868683818110611444576114436123d8565b5b90506020020160208101906114599190611e39565b85858481811061146c5761146b6123d8565b5b9050602002013561171f565b8080600101915050611423565b505050505050565b5f600654905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f6114c384611a17565b90509392505050565b60026114d781611739565b828290508585905014611516576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561157a5761156d868683818110611539576115386123d8565b5b905060200201602081019061154e9190611e39565b858584818110611561576115606123d8565b5b905060200201356116d9565b8080600101915050611518565b505050505050565b60045481565b600181565b6115956116e8565b63389a75e1600c52805f526020600c2080544211156115bb57636f5e88185f526004601cfd5b5f8155506115c881611951565b50565b6115d36116e8565b8060601b6115e857637448fbae5f526004601cfd5b6115f181611951565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166116146110ad565b73ffffffffffffffffffffffffffffffffffffffff161480611640575061163f826002600117610fea565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806116d257506116d182611a26565b5b9050919050565b6116e482825f611a9f565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461171d576382b429005f526004601cfd5b565b61172b82826001611a9f565b5050565b5f6202a300905090565b638b78c6d81954331461176b57638b78c6d8600c52335f52806020600c20541661176a576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6117d2611af7565b1561184a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561180c57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061189d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c205416611905576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611948576390b8ec185f526004601cfd5b5f603452505050565b611959611af7565b156119be577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611a14565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a985750611a9782611afb565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611ac157848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b6d5750611b6c82611b74565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611bfb57611bfa612117565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c7481611c40565b8114611c7e575f80fd5b50565b5f81359050611c8f81611c6b565b92915050565b5f60208284031215611caa57611ca9611c38565b5b5f611cb784828501611c81565b91505092915050565b5f8115159050919050565b611cd481611cc0565b82525050565b5f602082019050611ced5f830184611ccb565b92915050565b5f819050919050565b611d0581611cf3565b82525050565b5f602082019050611d1e5f830184611cfc565b92915050565b611d2d81611cf3565b8114611d37575f80fd5b50565b5f81359050611d4881611d24565b92915050565b5f60208284031215611d6357611d62611c38565b5b5f611d7084828501611d3a565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611da282611d79565b9050919050565b611db281611d98565b8114611dbc575f80fd5b50565b5f81359050611dcd81611da9565b92915050565b5f8060408385031215611de957611de8611c38565b5b5f611df685828601611dbf565b9250506020611e0785828601611d3a565b9150509250929050565b611e1a81611c40565b82525050565b5f602082019050611e335f830184611e11565b92915050565b5f60208284031215611e4e57611e4d611c38565b5b5f611e5b84828501611dbf565b91505092915050565b611e6d81611d98565b82525050565b5f602082019050611e865f830184611e64565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611ead57611eac611e8c565b5b8235905067ffffffffffffffff811115611eca57611ec9611e90565b5b602083019150836020820283011115611ee657611ee5611e94565b5b9250929050565b5f8083601f840112611f0257611f01611e8c565b5b8235905067ffffffffffffffff811115611f1f57611f1e611e90565b5b602083019150836020820283011115611f3b57611f3a611e94565b5b9250929050565b5f805f8060408587031215611f5a57611f59611c38565b5b5f85013567ffffffffffffffff811115611f7757611f76611c3c565b5b611f8387828801611e98565b9450945050602085013567ffffffffffffffff811115611fa657611fa5611c3c565b5b611fb287828801611eed565b925092505092959194509250565b5f8083601f840112611fd557611fd4611e8c565b5b8235905067ffffffffffffffff811115611ff257611ff1611e90565b5b60208301915083600182028301111561200e5761200d611e94565b5b9250929050565b5f806020838503121561202b5761202a611c38565b5b5f83013567ffffffffffffffff81111561204857612047611c3c565b5b61205485828601611fc0565b92509250509250929050565b5f6040820190506120735f830185611cfc565b6120806020830184611e64565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6120c982612087565b6120d38185612091565b93506120e38185602086016120a1565b6120ec816120af565b840191505092915050565b5f6020820190508181035f83015261210f81846120bf565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061215557612154612117565b5b50565b5f81905061216582612144565b919050565b5f61217482612158565b9050919050565b6121848161216a565b82525050565b5f819050919050565b61219c8161218a565b82525050565b5f60ff82169050919050565b6121b7816121a2565b82525050565b5f6080820190506121d05f83018761217b565b6121dd6020830186612193565b6121ea60408301856121ae565b6121f76060830184611e64565b95945050505050565b6122098161216a565b82525050565b6122188161218a565b82525050565b612227816121a2565b82525050565b61223681611d98565b82525050565b608082015f8201516122505f850182612200565b506020820151612263602085018261220f565b506040820151612276604085018261221e565b506060820151612289606085018261222d565b50505050565b5f6080820190506122a25f83018461223c565b92915050565b5f805f604084860312156122bf576122be611c38565b5b5f6122cc86828701611dbf565b935050602084013567ffffffffffffffff8111156122ed576122ec611c3c565b5b6122f986828701611fc0565b92509250509250925092565b5f8083601f84011261231a57612319611e8c565b5b8235905067ffffffffffffffff81111561233757612336611e90565b5b60208301915083602082028301111561235357612352611e94565b5b9250929050565b5f805f806040858703121561237257612371611c38565b5b5f85013567ffffffffffffffff81111561238f5761238e611c3c565b5b61239b87828801611e98565b9450945050602085013567ffffffffffffffff8111156123be576123bd611c3c565b5b6123ca87828801612305565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61240e81611cc0565b8114612418575f80fd5b50565b5f8135905061242981612405565b92915050565b5f6020828403121561244457612443611c38565b5b5f6124518482850161241b565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612494826120af565b810181811067ffffffffffffffff821117156124b3576124b261245e565b5b80604052505050565b5f6124c5611c2f565b90506124d1828261248b565b919050565b5f80fd5b600281106124e6575f80fd5b50565b5f813590506124f7816124da565b92915050565b6125068161218a565b8114612510575f80fd5b50565b5f81359050612521816124fd565b92915050565b612530816121a2565b811461253a575f80fd5b50565b5f8135905061254b81612527565b92915050565b5f608082840312156125665761256561245a565b5b61257060806124bc565b90505f61257f848285016124e9565b5f83015250602061259284828501612513565b60208301525060406125a68482850161253d565b60408301525060606125ba84828501611dbf565b60608301525092915050565b5f61010082840312156125dc576125db61245a565b5b6125e660a06124bc565b90505f6125f584828501611dbf565b5f83015250602061260884828501611d3a565b602083015250604061261c84828501611d3a565b604083015250606061263084828501611d3a565b606083015250608061264484828501612551565b60808301525092915050565b5f610100828403121561266657612665611c38565b5b5f612673848285016125c6565b91505092915050565b5f60608201905061268f5f830186611e64565b61269c6020830185611cfc565b6126a96040830184611cfc565b949350505050565b5f60e0820190506126c45f830187611cfc565b6126d16020830186611cfc565b6126de6040830185611cfc565b6126eb606083018461223c565b95945050505050565b5f80fd5b5f67ffffffffffffffff8211156127125761271161245e565b5b61271b826120af565b9050602081019050919050565b828183375f83830152505050565b5f612748612743846126f8565b6124bc565b905082815260208101848484011115612764576127636126f4565b5b61276f848285612728565b509392505050565b5f82601f83011261278b5761278a611e8c565b5b813561279b848260208601612736565b91505092915050565b5f604082840312156127b9576127b861245a565b5b6127c360406124bc565b90505f6127d284828501611dbf565b5f83015250602082013567ffffffffffffffff8111156127f5576127f46124d6565b5b61280184828501612777565b60208301525092915050565b5f6020828403121561282257612821611c38565b5b5f82013567ffffffffffffffff81111561283f5761283e611c3c565b5b61284b848285016127a4565b91505092915050565b5f8151905061286281611d24565b92915050565b5f6020828403121561287d5761287c611c38565b5b5f61288a84828501612854565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6128ca82611cf3565b91506128d583611cf3565b92508282039050818111156128ed576128ec612893565b5b92915050565b5f8160601b9050919050565b5f612909826128f3565b9050919050565b5f61291a826128ff565b9050919050565b61293261292d82611d98565b612910565b82525050565b5f819050919050565b61295261294d82611cf3565b612938565b82525050565b5f6129638286612921565b6014820191506129738285612921565b6014820191506129838284612941565b602082019150819050949350505050565b5f61299e82611d79565b9050919050565b6129ae81612994565b81146129b8575f80fd5b50565b5f813590506129c9816129a5565b92915050565b5f805f606084860312156129e6576129e5611c38565b5b5f6129f3868287016129bb565b9350506020612a0486828701611d3a565b9250506040612a1586828701611d3a565b9150509250925092565b612a2881611cf3565b82525050565b602082015f820151612a425f850182612a1f565b50505050565b5f602082019050612a5b5f830184612a2e565b92915050565b60038110612a7257612a71612117565b5b50565b5f819050612a8282612a61565b919050565b5f612a9182612a75565b9050919050565b612aa181612a87565b82525050565b5f82825260208201905092915050565b5f612ac182612087565b612acb8185612aa7565b9350612adb8185602086016120a1565b612ae4816120af565b840191505092915050565b5f608083015f830151612b045f860182612a98565b506020830151612b17602086018261222d565b506040830151612b2a604086018261222d565b5060608301518482036060860152612b428282612ab7565b9150508091505092915050565b5f6020820190508181035f830152612b678184612aef565b905092915050565b5f60408284031215612b8457612b8361245a565b5b612b8e60406124bc565b90505f82013567ffffffffffffffff811115612bad57612bac6124d6565b5b612bb984828501612777565b5f83015250602082013567ffffffffffffffff811115612bdc57612bdb6124d6565b5b612be884828501612777565b60208301525092915050565b5f60208284031215612c0957612c08611c38565b5b5f82013567ffffffffffffffff811115612c2657612c25611c3c565b5b612c3284828501612b6f565b91505092915050565b5f612c4582611cf3565b9150612c5083611cf3565b9250828202612c5e81611cf3565b91508282048414831517612c7557612c74612893565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612cb382611cf3565b9150612cbe83611cf3565b925082612cce57612ccd612c7c565b5b828204905092915050565b5f612ce382611cf3565b9150612cee83611cf3565b9250828201905080821115612d0657612d05612893565b5b9291505056fea2646970667358221220d4c0d57f1e9fa107af113ee797193e2a4eb6e337829af8477cc95d77b9c8be6864736f6c634300081a0033", s = class s extends F {
|
|
9
|
+
const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612d1b806100bd5f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c6e565b61084b565b6040516102509190611cb3565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611ce4565b60405180910390f35b61029d60048036038101906102989190611d27565b6108cc565b005b6102b960048036038101906102b49190611dac565b6108d9565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611dac565b6108ef565b6040516102ee9190611cb3565b60405180910390f35b348015610302575f80fd5b5061030b610905565b6040516103189190611ce4565b60405180910390f35b61032961090a565b005b348015610336575f80fd5b5061033f61095b565b60405161034c9190611df9565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611e12565b610982565b6040516103889190611ce4565b60405180910390f35b34801561039c575f80fd5b506103a561099b565b6040516103b29190611e4c565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611f1b565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190611fee565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190611fee565b610d9c565b60405161043f929190612039565b60405180910390f35b610462600480360381019061045d9190611dac565b610f06565b005b34801561046f575f80fd5b5061048a60048036038101906104859190611fee565b610f1c565b60405161049791906120d0565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611dac565b610fea565b6040516104d39190611cb3565b60405180910390f35b6104e4611001565b005b3480156104f1575f80fd5b506104fa61103a565b6040516105079190611ce4565b60405180910390f35b610518611040565b005b348015610525575f80fd5b5061052e611053565b60405161053b9190611ce4565b60405180910390f35b34801561054f575f80fd5b50610558611058565b6040516105689493929190612196565b60405180910390f35b34801561057c575f80fd5b506105856110ad565b6040516105929190611e4c565b60405180910390f35b3480156105a6575f80fd5b506105af6110d5565b6040516105bc9190611ce4565b60405180910390f35b3480156105d0575f80fd5b506105d96110db565b6040516105e69190612268565b60405180910390f35b3480156105fa575f80fd5b5061061560048036038101906106109190612281565b6111aa565b6040516106229190611cb3565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c9190612333565b6113d7565b005b34801561065e575f80fd5b5061066761148d565b6040516106749190611ce4565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611e12565b611496565b6040516106b09190611cb3565b60405180910390f35b3480156106c4575f80fd5b506106cd6114b3565b6040516106da9190611ce4565b60405180910390f35b3480156106ee575f80fd5b5061070960048036038101906107049190612281565b6114b9565b6040516107169190611cb3565b60405180910390f35b34801561072a575f80fd5b5061074560048036038101906107409190612333565b6114cc565b005b348015610752575f80fd5b5061075b611582565b6040516107689190611ce4565b60405180910390f35b34801561077c575f80fd5b50610785611588565b6040516107929190611ce4565b60405180910390f35b6107b560048036038101906107b09190611e12565b61158d565b005b6107d160048036038101906107cc9190611e12565b6115cb565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611e12565b6115f4565b6040516108069190611cb3565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611e12565b611647565b6040516108429190611ce4565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc82611660565b5b9050919050565b5f8054905090565b6108d633826116d9565b50565b6108e16116e8565b6108eb828261171f565b5050565b5f81826108fb85610982565b1614905092915050565b5f5481565b5f61091361172f565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb81611739565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a6123b1565b5b9050602002016020810190610a409190612408565b90506001151581151503610a8557610a80878784818110610a6457610a636123b1565b5b9050602002016020810190610a799190611e12565b600161171f565b610ab8565b610ab7878784818110610a9b57610a9a6123b1565b5b9050602002016020810190610ab09190611e12565b60016116d9565b5b508080600101915050610a0c565b505050505050565b5f610ad761176e565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a9190612629565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661179790919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb93929190612655565b60405180910390fd5b8560035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550845f8190555083600281905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c796120f0565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc336117ca565b610d073360016118a0565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610d53949392919061268a565b60405180910390a2505050505050508015610d97576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610da981611739565b5f8585810190610db991906127e6565b90505f8160200151806020019051810190610dd49190612841565b90508060025f828254610de79190612899565b92505081905550610e3d825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118e19092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610eb193929190612931565b604051602081830303815290604052604051610ecd91906120d0565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610f0e6116e8565b610f1882826116d9565b5050565b60605f808484810190610f2f91906129a8565b9250509150604051806080016040528060016002811115610f5357610f526120f0565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610faf9190612a21565b604051602081830303815290604052815250604051602001610fd19190612b28565b6040516020818303038152906040529250505092915050565b5f8082610ff685610982565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b6110486116e8565b6110515f61192a565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b6110e3611bb6565b60076040518060800160405290815f82015f9054906101000a900460ff166001811115611113576111126120f0565b5b6001811115611125576111246120f0565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f6111b36116e8565b5f83838101906111c39190612bcd565b90505f81602001518060200190518101906111de9190612841565b90505f6111ea876119f0565b611220576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80540361123057819050611253565b670de0b6b3a7640000825f546112469190612c14565b6112509190612c82565b90505b5f60065414158015611266575060065481115b156112715760065490505b600254816005546112829190612cb2565b11156112ba576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112cb9190612cb2565b92505081905550600160045f8282546112e49190612cb2565b92505081905550611337878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118e19092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689846040516020016113a593929190612931565b6040516020818303038152906040526040516113c191906120d0565b60405180910390a2600193505050509392505050565b60026113e281611739565b828290508585905014611421576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561148557611478868683818110611444576114436123b1565b5b90506020020160208101906114599190611e12565b85858481811061146c5761146b6123b1565b5b9050602002013561171f565b8080600101915050611423565b505050505050565b5f600654905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f6114c3846119f0565b90509392505050565b60026114d781611739565b828290508585905014611516576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561157a5761156d868683818110611539576115386123b1565b5b905060200201602081019061154e9190611e12565b858584818110611561576115606123b1565b5b905060200201356116d9565b8080600101915050611518565b505050505050565b60045481565b600181565b6115956116e8565b63389a75e1600c52805f526020600c2080544211156115bb57636f5e88185f526004601cfd5b5f8155506115c88161192a565b50565b6115d36116e8565b8060601b6115e857637448fbae5f526004601cfd5b6115f18161192a565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166116146110ad565b73ffffffffffffffffffffffffffffffffffffffff161480611640575061163f826002600117610fea565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806116d257506116d1826119ff565b5b9050919050565b6116e482825f611a78565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461171d576382b429005f526004601cfd5b565b61172b82826001611a78565b5050565b5f6202a300905090565b638b78c6d81954331461176b57638b78c6d8600c52335f52806020600c20541661176a576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6117d2611ad0565b1561184a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561180c57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061189d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611921576390b8ec185f526004601cfd5b5f603452505050565b611932611ad0565b15611997577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506119ed565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a715750611a7082611ad4565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611a9a57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b465750611b4582611b4d565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611bd457611bd36120f0565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c4d81611c19565b8114611c57575f80fd5b50565b5f81359050611c6881611c44565b92915050565b5f60208284031215611c8357611c82611c11565b5b5f611c9084828501611c5a565b91505092915050565b5f8115159050919050565b611cad81611c99565b82525050565b5f602082019050611cc65f830184611ca4565b92915050565b5f819050919050565b611cde81611ccc565b82525050565b5f602082019050611cf75f830184611cd5565b92915050565b611d0681611ccc565b8114611d10575f80fd5b50565b5f81359050611d2181611cfd565b92915050565b5f60208284031215611d3c57611d3b611c11565b5b5f611d4984828501611d13565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611d7b82611d52565b9050919050565b611d8b81611d71565b8114611d95575f80fd5b50565b5f81359050611da681611d82565b92915050565b5f8060408385031215611dc257611dc1611c11565b5b5f611dcf85828601611d98565b9250506020611de085828601611d13565b9150509250929050565b611df381611c19565b82525050565b5f602082019050611e0c5f830184611dea565b92915050565b5f60208284031215611e2757611e26611c11565b5b5f611e3484828501611d98565b91505092915050565b611e4681611d71565b82525050565b5f602082019050611e5f5f830184611e3d565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611e8657611e85611e65565b5b8235905067ffffffffffffffff811115611ea357611ea2611e69565b5b602083019150836020820283011115611ebf57611ebe611e6d565b5b9250929050565b5f8083601f840112611edb57611eda611e65565b5b8235905067ffffffffffffffff811115611ef857611ef7611e69565b5b602083019150836020820283011115611f1457611f13611e6d565b5b9250929050565b5f805f8060408587031215611f3357611f32611c11565b5b5f85013567ffffffffffffffff811115611f5057611f4f611c15565b5b611f5c87828801611e71565b9450945050602085013567ffffffffffffffff811115611f7f57611f7e611c15565b5b611f8b87828801611ec6565b925092505092959194509250565b5f8083601f840112611fae57611fad611e65565b5b8235905067ffffffffffffffff811115611fcb57611fca611e69565b5b602083019150836001820283011115611fe757611fe6611e6d565b5b9250929050565b5f806020838503121561200457612003611c11565b5b5f83013567ffffffffffffffff81111561202157612020611c15565b5b61202d85828601611f99565b92509250509250929050565b5f60408201905061204c5f830185611cd5565b6120596020830184611e3d565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6120a282612060565b6120ac818561206a565b93506120bc81856020860161207a565b6120c581612088565b840191505092915050565b5f6020820190508181035f8301526120e88184612098565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061212e5761212d6120f0565b5b50565b5f81905061213e8261211d565b919050565b5f61214d82612131565b9050919050565b61215d81612143565b82525050565b5f819050919050565b61217581612163565b82525050565b5f60ff82169050919050565b6121908161217b565b82525050565b5f6080820190506121a95f830187612154565b6121b6602083018661216c565b6121c36040830185612187565b6121d06060830184611e3d565b95945050505050565b6121e281612143565b82525050565b6121f181612163565b82525050565b6122008161217b565b82525050565b61220f81611d71565b82525050565b608082015f8201516122295f8501826121d9565b50602082015161223c60208501826121e8565b50604082015161224f60408501826121f7565b5060608201516122626060850182612206565b50505050565b5f60808201905061227b5f830184612215565b92915050565b5f805f6040848603121561229857612297611c11565b5b5f6122a586828701611d98565b935050602084013567ffffffffffffffff8111156122c6576122c5611c15565b5b6122d286828701611f99565b92509250509250925092565b5f8083601f8401126122f3576122f2611e65565b5b8235905067ffffffffffffffff8111156123105761230f611e69565b5b60208301915083602082028301111561232c5761232b611e6d565b5b9250929050565b5f805f806040858703121561234b5761234a611c11565b5b5f85013567ffffffffffffffff81111561236857612367611c15565b5b61237487828801611e71565b9450945050602085013567ffffffffffffffff81111561239757612396611c15565b5b6123a3878288016122de565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6123e781611c99565b81146123f1575f80fd5b50565b5f81359050612402816123de565b92915050565b5f6020828403121561241d5761241c611c11565b5b5f61242a848285016123f4565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61246d82612088565b810181811067ffffffffffffffff8211171561248c5761248b612437565b5b80604052505050565b5f61249e611c08565b90506124aa8282612464565b919050565b5f80fd5b600281106124bf575f80fd5b50565b5f813590506124d0816124b3565b92915050565b6124df81612163565b81146124e9575f80fd5b50565b5f813590506124fa816124d6565b92915050565b6125098161217b565b8114612513575f80fd5b50565b5f8135905061252481612500565b92915050565b5f6080828403121561253f5761253e612433565b5b6125496080612495565b90505f612558848285016124c2565b5f83015250602061256b848285016124ec565b602083015250604061257f84828501612516565b604083015250606061259384828501611d98565b60608301525092915050565b5f61010082840312156125b5576125b4612433565b5b6125bf60a0612495565b90505f6125ce84828501611d98565b5f8301525060206125e184828501611d13565b60208301525060406125f584828501611d13565b604083015250606061260984828501611d13565b606083015250608061261d8482850161252a565b60808301525092915050565b5f610100828403121561263f5761263e611c11565b5b5f61264c8482850161259f565b91505092915050565b5f6060820190506126685f830186611e3d565b6126756020830185611cd5565b6126826040830184611cd5565b949350505050565b5f60e08201905061269d5f830187611cd5565b6126aa6020830186611cd5565b6126b76040830185611cd5565b6126c46060830184612215565b95945050505050565b5f80fd5b5f67ffffffffffffffff8211156126eb576126ea612437565b5b6126f482612088565b9050602081019050919050565b828183375f83830152505050565b5f61272161271c846126d1565b612495565b90508281526020810184848401111561273d5761273c6126cd565b5b612748848285612701565b509392505050565b5f82601f83011261276457612763611e65565b5b813561277484826020860161270f565b91505092915050565b5f6040828403121561279257612791612433565b5b61279c6040612495565b90505f6127ab84828501611d98565b5f83015250602082013567ffffffffffffffff8111156127ce576127cd6124af565b5b6127da84828501612750565b60208301525092915050565b5f602082840312156127fb576127fa611c11565b5b5f82013567ffffffffffffffff81111561281857612817611c15565b5b6128248482850161277d565b91505092915050565b5f8151905061283b81611cfd565b92915050565b5f6020828403121561285657612855611c11565b5b5f6128638482850161282d565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6128a382611ccc565b91506128ae83611ccc565b92508282039050818111156128c6576128c561286c565b5b92915050565b5f8160601b9050919050565b5f6128e2826128cc565b9050919050565b5f6128f3826128d8565b9050919050565b61290b61290682611d71565b6128e9565b82525050565b5f819050919050565b61292b61292682611ccc565b612911565b82525050565b5f61293c82866128fa565b60148201915061294c82856128fa565b60148201915061295c828461291a565b602082019150819050949350505050565b5f61297782611d52565b9050919050565b6129878161296d565b8114612991575f80fd5b50565b5f813590506129a28161297e565b92915050565b5f805f606084860312156129bf576129be611c11565b5b5f6129cc86828701612994565b93505060206129dd86828701611d13565b92505060406129ee86828701611d13565b9150509250925092565b612a0181611ccc565b82525050565b602082015f820151612a1b5f8501826129f8565b50505050565b5f602082019050612a345f830184612a07565b92915050565b60038110612a4b57612a4a6120f0565b5b50565b5f819050612a5b82612a3a565b919050565b5f612a6a82612a4e565b9050919050565b612a7a81612a60565b82525050565b5f82825260208201905092915050565b5f612a9a82612060565b612aa48185612a80565b9350612ab481856020860161207a565b612abd81612088565b840191505092915050565b5f608083015f830151612add5f860182612a71565b506020830151612af06020860182612206565b506040830151612b036040860182612206565b5060608301518482036060860152612b1b8282612a90565b9150508091505092915050565b5f6020820190508181035f830152612b408184612ac8565b905092915050565b5f60408284031215612b5d57612b5c612433565b5b612b676040612495565b90505f82013567ffffffffffffffff811115612b8657612b856124af565b5b612b9284828501612750565b5f83015250602082013567ffffffffffffffff811115612bb557612bb46124af565b5b612bc184828501612750565b60208301525092915050565b5f60208284031215612be257612be1611c11565b5b5f82013567ffffffffffffffff811115612bff57612bfe611c15565b5b612c0b84828501612b48565b91505092915050565b5f612c1e82611ccc565b9150612c2983611ccc565b9250828202612c3781611ccc565b91508282048414831517612c4e57612c4d61286c565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612c8c82611ccc565b9150612c9783611ccc565b925082612ca757612ca6612c55565b5b828204905092915050565b5f612cbc82611ccc565b9150612cc783611ccc565b9250828201905080821115612cdf57612cde61286c565b5b9291505056fea2646970667358221220238a2694ac11aa8bece7145721bd76ab9cc7b07442e8c97be4bdd87624df868664736f6c634300081a0033", s = class s extends F {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments), this.abi = l;
|
|
12
12
|
}
|
|
@@ -30,7 +30,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
} catch (e) {
|
|
33
|
-
throw new
|
|
33
|
+
throw new V(e);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -61,28 +61,28 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
61
61
|
var u;
|
|
62
62
|
const f = await this.getIncentiveCriteria(a);
|
|
63
63
|
if (f.criteriaType === o.EVENT) {
|
|
64
|
-
const
|
|
64
|
+
const c = 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 c.gasUsed * c.effectiveGasPrice + // Normal gas cost
|
|
70
|
+
(c.blobGasUsed ?? 0n) * (c.blobGasPrice ?? 0n);
|
|
71
|
+
const r = c.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], d = x({
|
|
78
78
|
abi: [n],
|
|
79
79
|
logs: r
|
|
80
80
|
});
|
|
81
|
-
if (
|
|
81
|
+
if (d == null || d.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 = d[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,27 +94,27 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
} else if (f.criteriaType === o.FUNC) {
|
|
97
|
-
const
|
|
97
|
+
const c = 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], d = C({
|
|
103
103
|
abi: [r],
|
|
104
|
-
data:
|
|
104
|
+
data: c.input
|
|
105
105
|
}).args[f.fieldIndex];
|
|
106
|
-
if (
|
|
106
|
+
if (d == null)
|
|
107
107
|
throw new i(
|
|
108
108
|
`Decoded argument at index ${f.fieldIndex} is undefined`
|
|
109
109
|
);
|
|
110
|
-
return BigInt(
|
|
110
|
+
return BigInt(d);
|
|
111
111
|
} catch (r) {
|
|
112
112
|
throw new i(
|
|
113
113
|
`Failed to decode function data for signature ${f.signature}: ${r.message}`
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
} else
|
|
117
|
-
throw new
|
|
117
|
+
throw new $(
|
|
118
118
|
`Invalid criteria type ${f.criteriaType}`
|
|
119
119
|
);
|
|
120
120
|
}
|
|
@@ -141,7 +141,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
141
141
|
};
|
|
142
142
|
s.bases = {
|
|
143
143
|
31337: void 0,
|
|
144
|
-
|
|
144
|
+
...R
|
|
145
145
|
};
|
|
146
146
|
let m = s;
|
|
147
147
|
function H() {
|
|
@@ -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":";;;;;;;;8guBAgHaA,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;AA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A,EAC3D,OAAAM;AAAA,EACA,QAAAC;AAAA,EACA,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
|
+
{"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,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,GAAGH;AAAA,QACH,SAAS,KAAK,mBAAmB;AAAA,MACnC;AAAA,IAAA;AAAA,EAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,mBACX,EAAE,SAAAI,GAAS,MAAAC,GAAM,iBAAAC,EAAA,GACjBN,GACiB;;AACjB,UAAMO,IAAW,MAAM,KAAK,qBAAqBP,CAAM;AACnD,QAAAO,EAAS,iBAAiBC,EAAc,OAAO;AACjD,YAAMC,IAAqB,MAAMC,EAAsB,KAAK,SAAS;AAAA,QACnE,SAAAN;AAAA,QACA,MAAAC;AAAA,MAAA,CACD;AACG,UAAAE,EAAS,eAAeI,EAAW;AAK9B,eAHLF,EAAmB,UAAUA,EAAmB;AAAA,SAC/CA,EAAm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