@boostxyz/sdk 6.1.3 → 7.0.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +7 -7
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +10 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +77 -76
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +5 -5
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +17 -17
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +1894 -267
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +831 -520
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +48 -48
- package/dist/Budget-BgGihcwx.js +1124 -0
- package/dist/Budget-BgGihcwx.js.map +1 -0
- package/dist/Budget-DYlTLLwg.cjs +2 -0
- package/dist/Budget-DYlTLLwg.cjs.map +1 -0
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.d.ts +5 -4
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +9 -6
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +4 -0
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +22 -22
- package/dist/Budgets/ManagedBudgetWithFees.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -1
- package/dist/Budgets/TransparentBudget.d.ts +944 -0
- package/dist/Budgets/TransparentBudget.d.ts.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +4 -0
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +1 -1
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +20 -20
- package/dist/Incentive-BDqkFt0J.cjs +2 -0
- package/dist/Incentive-BDqkFt0J.cjs.map +1 -0
- package/dist/Incentive-DPOADY1f.js +449 -0
- package/dist/Incentive-DPOADY1f.js.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +14 -14
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +11 -11
- 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 +14 -14
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedIncentive.d.ts +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs +2 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +3 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js +604 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts +1103 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +625 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +11 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +112 -80
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts +903 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +242 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +3 -3
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +22 -22
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +8 -6
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +19 -14
- package/dist/Incentives/Incentive.js.map +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.js +9 -9
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-B_AcmgYq.cjs +2 -0
- package/dist/{SimpleDenyList-DgjVf7FK.cjs.map → SimpleDenyList-B_AcmgYq.cjs.map} +1 -1
- package/dist/SimpleDenyList-BbDLzRw7.js +133 -0
- package/dist/{SimpleDenyList-BKfPoTo1.js.map → SimpleDenyList-BbDLzRw7.js.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.js +13 -13
- package/dist/Validators/LimitedSignerValidator.js.map +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.js +52 -52
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/componentInterfaces-C5ig8mCK.cjs +2 -0
- package/dist/componentInterfaces-C5ig8mCK.cjs.map +1 -0
- package/dist/componentInterfaces-Ddus5rIA.js +23 -0
- package/dist/componentInterfaces-Ddus5rIA.js.map +1 -0
- package/dist/deployments-C17nvui-.cjs +2 -0
- package/dist/deployments-C17nvui-.cjs.map +1 -0
- package/dist/deployments-CH4Xmkbv.js +132 -0
- package/dist/{deployments-W_LUj833.js.map → deployments-CH4Xmkbv.js.map} +1 -1
- package/dist/deployments.json +63 -48
- package/dist/{generated-CElkFqkY.js → generated-CINzoGbl.js} +2611 -955
- package/dist/generated-CINzoGbl.js.map +1 -0
- package/dist/generated-C_JEoLDO.cjs +3 -0
- package/dist/generated-C_JEoLDO.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +167 -154
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +20 -2
- package/src/Actions/EventAction.ts +11 -0
- package/src/BoostCore.test.ts +14 -9
- package/src/BoostCore.ts +428 -26
- package/src/Budgets/Budget.ts +8 -1
- package/src/Budgets/TransparentBudget.test.ts +70 -0
- package/src/Budgets/TransparentBudget.ts +334 -0
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Incentives/ERC20PeggedIncentive.ts +1 -1
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +3 -1
- package/src/Incentives/{ERC20PeggedVariableCriteriaIncentive.test.ts → ERC20PeggedVariableCriteriaIncentiveV2.test.ts} +20 -16
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts +872 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +50 -1
- package/src/Incentives/{ERC20VariableCriteriaIncentive.test.ts → ERC20VariableCriteriaIncentiveV2.test.ts} +24 -19
- package/src/Incentives/ERC20VariableCriteriaIncentiveV2.ts +447 -0
- package/src/Incentives/ERC20VariableIncentive.ts +4 -2
- package/src/Incentives/Incentive.ts +13 -2
- package/src/index.test.ts +2 -2
- package/src/index.ts +3 -0
- package/src/utils.ts +1 -1
- package/dist/Budget-BjfL8dVX.cjs +0 -2
- package/dist/Budget-BjfL8dVX.cjs.map +0 -1
- package/dist/Budget-DD7IPuDx.js +0 -922
- package/dist/Budget-DD7IPuDx.js.map +0 -1
- package/dist/Incentive-V1RjH38L.js +0 -1036
- package/dist/Incentive-V1RjH38L.js.map +0 -1
- package/dist/Incentive-gVTfsnMB.cjs +0 -2
- package/dist/Incentive-gVTfsnMB.cjs.map +0 -1
- package/dist/SimpleDenyList-BKfPoTo1.js +0 -133
- package/dist/SimpleDenyList-DgjVf7FK.cjs +0 -2
- package/dist/componentInterfaces-CA1UIqWL.js +0 -20
- package/dist/componentInterfaces-CA1UIqWL.js.map +0 -1
- package/dist/componentInterfaces-aBgBbB7r.cjs +0 -2
- package/dist/componentInterfaces-aBgBbB7r.cjs.map +0 -1
- package/dist/deployments-CwTZr-cK.cjs +0 -2
- package/dist/deployments-CwTZr-cK.cjs.map +0 -1
- package/dist/deployments-W_LUj833.js +0 -117
- package/dist/generated-BPiHi7W2.cjs +0 -3
- package/dist/generated-BPiHi7W2.cjs.map +0 -1
- package/dist/generated-CElkFqkY.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { zeroAddress as P, encodeAbiParameters as c, decodeAbiParameters as
|
|
3
|
-
import {
|
|
4
|
-
import { DeployableTarget as
|
|
5
|
-
import { prepareClaimPayload as
|
|
6
|
-
import { RegistryType as
|
|
7
|
-
const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b611c6d806100855f395ff3fe60806040526004361061020f575f3560e01c806354d1f13d11610117578063d54ad2a1116100ac578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146105ff578063fe9fbb8014610612578063fee81cf414610631575f80fd5b8063ec87621c146105d8578063f04e283e146105ec575f80fd5b8063d54ad2a114610570578063db09da1214610585578063dcc21361146105a4578063dcc59b6f146105c3575f80fd5b8063a4d66daf116100e7578063a4d66daf146104ef578063bb1757cf14610504578063be4994f814610523578063c884ef8314610542575f80fd5b806354d1f13d146104b3578063715018a6146104bb57806375b238fc146104c35780638da5cb5b146104d7575f80fd5b80632de94807116101a7578063439fab91116101775780634a4ee7b11161015d5780634a4ee7b11461043f5780634e7165a214610452578063514e62fc1461047e575f80fd5b8063439fab91146103d7578063474f5a44146103f6575f80fd5b80632de948071461031757806330db555f1461034857806338d52e0f146103675780634359d28a146103b8575f80fd5b80631cd64df4116101e25780631cd64df41461028c578063228cb733146102c157806325692962146102d557806328d6183b146102dd575f80fd5b806301ffc9a71461021357806307621eca14610247578063183a4f6e146102645780631c10893f14610279575b5f80fd5b34801561021e575f80fd5b5061023261022d366004611527565b610662565b60405190151581526020015b60405180910390f35b348015610252575f80fd5b505f545b60405190815260200161023e565b61027761027236600461156d565b6106bd565b005b6102776102873660046115a5565b6106ca565b348015610297575f80fd5b506102326102a63660046115a5565b638b78c6d8600c9081525f9290925260209091205481161490565b3480156102cc575f80fd5b506102565f5481565b6102776106e0565b3480156102e8575f80fd5b506040517f9031811100000000000000000000000000000000000000000000000000000000815260200161023e565b348015610322575f80fd5b506102566103313660046115cf565b638b78c6d8600c9081525f91909152602090205490565b348015610353575f80fd5b5061027761036236600461156d565b61072d565b348015610372575f80fd5b506003546103939073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161023e565b3480156103c3575f80fd5b506102776103d2366004611632565b6107e9565b3480156103e2575f80fd5b506102776103f13660046116dc565b6108e3565b348015610401575f80fd5b506104156104103660046116dc565b610b0d565b6040805192835273ffffffffffffffffffffffffffffffffffffffff90911660208301520161023e565b61027761044d3660046115a5565b610c6f565b34801561045d575f80fd5b5061047161046c3660046116dc565b610c81565b60405161023e9190611767565b348015610489575f80fd5b506102326104983660046115a5565b638b78c6d8600c9081525f9290925260209091205416151590565b610277610d6a565b610277610da3565b3480156104ce575f80fd5b50610256600281565b3480156104e2575f80fd5b50638b78c6d81954610393565b3480156104fa575f80fd5b5061025660025481565b34801561050f575f80fd5b5061023261051e366004611779565b610db6565b34801561052e575f80fd5b5061027761053d366004611632565b610fcb565b34801561054d575f80fd5b5061023261055c3660046115cf565b60016020525f908152604090205460ff1681565b34801561057b575f80fd5b5061025660055481565b348015610590575f80fd5b5061023261059f366004611779565b611069565b3480156105af575f80fd5b506102776105be366004611632565b61107f565b3480156105ce575f80fd5b5061025660045481565b3480156105e3575f80fd5b50610256600181565b6102776105fa3660046115cf565b61111d565b61027761060d3660046115cf565b611157565b34801561061d575f80fd5b5061023261062c3660046115cf565b61117d565b34801561063c575f80fd5b5061025661064b3660046115cf565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f903181110000000000000000000000000000000000000000000000000000000014806106b757506106b7826111dc565b92915050565b6106c73382611231565b50565b6106d261123c565b6106dc8282611256565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161073881611262565b815f03610771576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003546107969073ffffffffffffffffffffffffffffffffffffffff16333085611293565b8160025f8282546107a791906117f7565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026107f481611262565b83821461082d576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156108db575f84848381811061084a5761084a61180a565b905060200201602081019061085f9190611837565b90508015156001036108a15761089c8787848181106108805761088061180a565b905060200201602081019061089591906115cf565b6001611256565b6108d2565b6108d28787848181106108b6576108b661180a565b90506020020160208101906108cb91906115cf565b6001611231565b5060010161082f565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156109345760018160011c14303b1061092b5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610942838501856118ac565b80516020820151604083015192935090915f81900361098d576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6109ae73ffffffffffffffffffffffffffffffffffffffff8516306112eb565b905081811015610a175784516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86161790555f8381556002839055600555610a6c3361131e565b6060850151610a7c816001611366565b604080518581526020810185905273ffffffffffffffffffffffffffffffffffffffff8716917fac711f624f923566afa4d63e74d67927870a724791c9569f0143ddea22657a0d910160405180910390a25050505050508015610b08576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610b1a81611262565b5f610b27858701876119c8565b90505f8160200151806020019051810190610b429190611a47565b90508060025f828254610b559190611a5e565b90915550508151600354610b829173ffffffffffffffffffffffffffffffffffffffff90911690836113a7565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610c4091611767565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610c7761123c565b6106dc8282611231565b60605f80610c9184860186611a71565b9250509150604051806080016040528060016002811115610cb457610cb4611aa3565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610d139151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610d519190602001611ad0565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610dab61123c565b610db45f6113f0565b565b5f610dbf61123c565b5f610dcc83850185611b6b565b90505f8160200151806020019051810190610de79190611a47565b90505f610df76002546005541090565b610e2d576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f545f03610e3c575080610e5f565b670de0b6b3a7640000825f54610e529190611be8565b610e5c9190611bff565b90505b60025481600554610e7091906117f7565b1115610ea8576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f828254610eb991906117f7565b92505081905550600160045f828254610ed291906117f7565b9091555050600354610efb9073ffffffffffffffffffffffffffffffffffffffff1688836113a7565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610fb691611767565b60405180910390a25060019695505050505050565b6002610fd681611262565b83821461100f576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156108db5761106186868381811061102e5761102e61180a565b905060200201602081019061104391906115cf565b8585848181106110555761105561180a565b90506020020135611256565b600101611011565b5f6110776002546005541090565b949350505050565b600261108a81611262565b8382146110c3576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156108db576111158686838181106110e2576110e261180a565b90506020020160208101906110f791906115cf565b8585848181106111095761110961180a565b90506020020135611231565b6001016110c5565b61112561123c565b63389a75e1600c52805f526020600c20805442111561114b57636f5e88185f526004601cfd5b5f90556106c7816113f0565b61115f61123c565b8060601b61117457637448fbae5f526004601cfd5b6106c7816113f0565b5f8173ffffffffffffffffffffffffffffffffffffffff166111a2638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806106b75750638b78c6d8600c9081525f839052602090205460031615156106b7565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa92167050000000000000000000000000000000000000000000000000000000014806106b757506106b78261143a565b6106dc82825f6114d0565b638b78c6d819543314610db4576382b429005f526004601cfd5b6106dc828260016114d0565b638b78c6d8195433146106c757638b78c6d8600c52335f52806020600c2054166106c7576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f511417166112de57637939f4245f526004601cfd5b5f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166113e7576390b8ec185f526004601cfd5b5f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806106b757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146106b7565b638b78c6d8600c52825f526020600c208054838117836114f1575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f60208284031215611537575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611566575f80fd5b9392505050565b5f6020828403121561157d575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146106c7575f80fd5b5f80604083850312156115b6575f80fd5b82356115c181611584565b946020939093013593505050565b5f602082840312156115df575f80fd5b813561156681611584565b5f8083601f8401126115fa575f80fd5b50813567ffffffffffffffff811115611611575f80fd5b6020830191508360208260051b850101111561162b575f80fd5b9250929050565b5f805f8060408587031215611645575f80fd5b843567ffffffffffffffff81111561165b575f80fd5b611667878288016115ea565b909550935050602085013567ffffffffffffffff811115611686575f80fd5b611692878288016115ea565b95989497509550505050565b5f8083601f8401126116ae575f80fd5b50813567ffffffffffffffff8111156116c5575f80fd5b60208301915083602082850101111561162b575f80fd5b5f80602083850312156116ed575f80fd5b823567ffffffffffffffff811115611703575f80fd5b61170f8582860161169e565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f611566602083018461171b565b5f805f6040848603121561178b575f80fd5b833561179681611584565b9250602084013567ffffffffffffffff8111156117b1575f80fd5b6117bd8682870161169e565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156106b7576106b76117ca565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611847575f80fd5b81358015158114611566575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff811182821017156118a6576118a6611856565b60405290565b5f60808284031280156118bd575f80fd5b506040516080810167ffffffffffffffff811182821017156118e1576118e1611856565b60405282356118ef81611584565b81526020838101359082015260408084013590820152606083013561191381611584565b60608201529392505050565b5f82601f83011261192e575f80fd5b813567ffffffffffffffff81111561194857611948611856565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff8111828210171561199557611995611856565b6040528181528382016020018510156119ac575f80fd5b816020850160208301375f918101602001919091529392505050565b5f602082840312156119d8575f80fd5b813567ffffffffffffffff8111156119ee575f80fd5b8201604081850312156119ff575f80fd5b611a07611883565b8135611a1281611584565b8152602082013567ffffffffffffffff811115611a2d575f80fd5b611a398682850161191f565b602083015250949350505050565b5f60208284031215611a57575f80fd5b5051919050565b818103818111156106b7576106b76117ca565b5f805f60608486031215611a83575f80fd5b8335611a8e81611584565b95602085013595506040909401359392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b602081525f825160038110611b0c577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff6040840151166060830152606083015160808084015261107760a084018261171b565b5f60208284031215611b7b575f80fd5b813567ffffffffffffffff811115611b91575f80fd5b820160408185031215611ba2575f80fd5b611baa611883565b813567ffffffffffffffff811115611bc0575f80fd5b611bcc8682850161191f565b825250602082013567ffffffffffffffff811115611a2d575f80fd5b80820281158282048414176106b7576106b76117ca565b5f82611c32577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220359b85089605758f3c64773e6f7fe7639dfc5ac1adb7a4578b2b6a3ca7f4a83864736f6c634300081a0033", e = class e extends k {
|
|
1
|
+
import { R as s, b8 as l, b9 as h, ba as u, bb as m, bc as g, bd as y, be as w, bf as p, bg as A, bh as z, bi as V, bj as C, bk as _ } from "../generated-CINzoGbl.js";
|
|
2
|
+
import { zeroAddress as P, encodeAbiParameters as c, decodeAbiParameters as R } from "viem";
|
|
3
|
+
import { d as k } from "../deployments-CH4Xmkbv.js";
|
|
4
|
+
import { DeployableTarget as D } from "../Deployable/DeployableTarget.js";
|
|
5
|
+
import { prepareClaimPayload as t } from "../claiming.js";
|
|
6
|
+
import { RegistryType as T } from "../utils.js";
|
|
7
|
+
const B = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b611c81806100895f395ff3fe60806040526004361061020f575f3560e01c806354d1f13d11610117578063d54ad2a1116100ac578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146105ff578063fe9fbb8014610612578063fee81cf414610631575f80fd5b8063ec87621c146105d8578063f04e283e146105ec575f80fd5b8063d54ad2a114610570578063db09da1214610585578063dcc21361146105a4578063dcc59b6f146105c3575f80fd5b8063a4d66daf116100e7578063a4d66daf146104ef578063bb1757cf14610504578063be4994f814610523578063c884ef8314610542575f80fd5b806354d1f13d146104b3578063715018a6146104bb57806375b238fc146104c35780638da5cb5b146104d7575f80fd5b80632de94807116101a7578063439fab91116101775780634a4ee7b11161015d5780634a4ee7b11461043f5780634e7165a214610452578063514e62fc1461047e575f80fd5b8063439fab91146103d7578063474f5a44146103f6575f80fd5b80632de948071461031757806330db555f1461034857806338d52e0f146103675780634359d28a146103b8575f80fd5b80631cd64df4116101e25780631cd64df41461028c578063228cb733146102c157806325692962146102d557806328d6183b146102dd575f80fd5b806301ffc9a71461021357806307621eca14610247578063183a4f6e146102645780631c10893f14610279575b5f80fd5b34801561021e575f80fd5b5061023261022d36600461153b565b610662565b60405190151581526020015b60405180910390f35b348015610252575f80fd5b505f545b60405190815260200161023e565b610277610272366004611581565b6106bd565b005b6102776102873660046115b9565b6106ca565b348015610297575f80fd5b506102326102a63660046115b9565b638b78c6d8600c9081525f9290925260209091205481161490565b3480156102cc575f80fd5b506102565f5481565b6102776106e0565b3480156102e8575f80fd5b506040517f9031811100000000000000000000000000000000000000000000000000000000815260200161023e565b348015610322575f80fd5b506102566103313660046115e3565b638b78c6d8600c9081525f91909152602090205490565b348015610353575f80fd5b50610277610362366004611581565b61072d565b348015610372575f80fd5b506003546103939073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161023e565b3480156103c3575f80fd5b506102776103d2366004611646565b6107e9565b3480156103e2575f80fd5b506102776103f13660046116f0565b6108e3565b348015610401575f80fd5b506104156104103660046116f0565b610b0d565b6040805192835273ffffffffffffffffffffffffffffffffffffffff90911660208301520161023e565b61027761044d3660046115b9565b610c6f565b34801561045d575f80fd5b5061047161046c3660046116f0565b610c81565b60405161023e919061177b565b348015610489575f80fd5b506102326104983660046115b9565b638b78c6d8600c9081525f9290925260209091205416151590565b610277610d6a565b610277610da3565b3480156104ce575f80fd5b50610256600281565b3480156104e2575f80fd5b50638b78c6d81954610393565b3480156104fa575f80fd5b5061025660025481565b34801561050f575f80fd5b5061023261051e36600461178d565b610db6565b34801561052e575f80fd5b5061027761053d366004611646565b610fcb565b34801561054d575f80fd5b5061023261055c3660046115e3565b60016020525f908152604090205460ff1681565b34801561057b575f80fd5b5061025660055481565b348015610590575f80fd5b5061023261059f36600461178d565b611069565b3480156105af575f80fd5b506102776105be366004611646565b61107f565b3480156105ce575f80fd5b5061025660045481565b3480156105e3575f80fd5b50610256600181565b6102776105fa3660046115e3565b61111d565b61027761060d3660046115e3565b611157565b34801561061d575f80fd5b5061023261062c3660046115e3565b61117d565b34801561063c575f80fd5b5061025661064b3660046115e3565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f903181110000000000000000000000000000000000000000000000000000000014806106b757506106b7826111dc565b92915050565b6106c73382611231565b50565b6106d261123c565b6106dc8282611256565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161073881611262565b815f03610771576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003546107969073ffffffffffffffffffffffffffffffffffffffff16333085611293565b8160025f8282546107a7919061180b565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026107f481611262565b83821461082d576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156108db575f84848381811061084a5761084a61181e565b905060200201602081019061085f919061184b565b90508015156001036108a15761089c8787848181106108805761088061181e565b905060200201602081019061089591906115e3565b6001611256565b6108d2565b6108d28787848181106108b6576108b661181e565b90506020020160208101906108cb91906115e3565b6001611231565b5060010161082f565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156109345760018160011c14303b1061092b5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610942838501856118c0565b80516020820151604083015192935090915f81900361098d576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6109ae73ffffffffffffffffffffffffffffffffffffffff8516306112f5565b905081811015610a175784516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86161790555f8381556002839055600555610a6c33611328565b6060850151610a7c816001611370565b604080518581526020810185905273ffffffffffffffffffffffffffffffffffffffff8716917fac711f624f923566afa4d63e74d67927870a724791c9569f0143ddea22657a0d910160405180910390a25050505050508015610b08576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610b1a81611262565b5f610b27858701876119dc565b90505f8160200151806020019051810190610b429190611a5b565b90508060025f828254610b559190611a72565b90915550508151600354610b829173ffffffffffffffffffffffffffffffffffffffff90911690836113b1565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610c409161177b565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610c7761123c565b6106dc8282611231565b60605f80610c9184860186611a85565b9250509150604051806080016040528060016002811115610cb457610cb4611ab7565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610d139151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610d519190602001611ae4565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610dab61123c565b610db45f611404565b565b5f610dbf61123c565b5f610dcc83850185611b7f565b90505f8160200151806020019051810190610de79190611a5b565b90505f610df76002546005541090565b610e2d576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f545f03610e3c575080610e5f565b670de0b6b3a7640000825f54610e529190611bfc565b610e5c9190611c13565b90505b60025481600554610e70919061180b565b1115610ea8576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f828254610eb9919061180b565b92505081905550600160045f828254610ed2919061180b565b9091555050600354610efb9073ffffffffffffffffffffffffffffffffffffffff1688836113b1565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610fb69161177b565b60405180910390a25060019695505050505050565b6002610fd681611262565b83821461100f576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156108db5761106186868381811061102e5761102e61181e565b905060200201602081019061104391906115e3565b8585848181106110555761105561181e565b90506020020135611256565b600101611011565b5f6110776002546005541090565b949350505050565b600261108a81611262565b8382146110c3576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156108db576111158686838181106110e2576110e261181e565b90506020020160208101906110f791906115e3565b8585848181106111095761110961181e565b90506020020135611231565b6001016110c5565b61112561123c565b63389a75e1600c52805f526020600c20805442111561114b57636f5e88185f526004601cfd5b5f90556106c781611404565b61115f61123c565b8060601b61117457637448fbae5f526004601cfd5b6106c781611404565b5f8173ffffffffffffffffffffffffffffffffffffffff166111a2638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806106b75750638b78c6d8600c9081525f839052602090205460031615156106b7565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa92167050000000000000000000000000000000000000000000000000000000014806106b757506106b78261144e565b6106dc82825f6114e4565b638b78c6d819543314610db4576382b429005f526004601cfd5b6106dc828260016114e4565b638b78c6d8195433146106c757638b78c6d8600c52335f52806020600c2054166106c7576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f5114166112e757803d873b1517106112e757637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f5114166113fa57803d853b1517106113fa576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806106b757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146106b7565b638b78c6d8600c52825f526020600c20805483811783611505575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f6020828403121561154b575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461157a575f80fd5b9392505050565b5f60208284031215611591575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146106c7575f80fd5b5f80604083850312156115ca575f80fd5b82356115d581611598565b946020939093013593505050565b5f602082840312156115f3575f80fd5b813561157a81611598565b5f8083601f84011261160e575f80fd5b50813567ffffffffffffffff811115611625575f80fd5b6020830191508360208260051b850101111561163f575f80fd5b9250929050565b5f805f8060408587031215611659575f80fd5b843567ffffffffffffffff81111561166f575f80fd5b61167b878288016115fe565b909550935050602085013567ffffffffffffffff81111561169a575f80fd5b6116a6878288016115fe565b95989497509550505050565b5f8083601f8401126116c2575f80fd5b50813567ffffffffffffffff8111156116d9575f80fd5b60208301915083602082850101111561163f575f80fd5b5f8060208385031215611701575f80fd5b823567ffffffffffffffff811115611717575f80fd5b611723858286016116b2565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f61157a602083018461172f565b5f805f6040848603121561179f575f80fd5b83356117aa81611598565b9250602084013567ffffffffffffffff8111156117c5575f80fd5b6117d1868287016116b2565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156106b7576106b76117de565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f6020828403121561185b575f80fd5b8135801515811461157a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff811182821017156118ba576118ba61186a565b60405290565b5f60808284031280156118d1575f80fd5b506040516080810167ffffffffffffffff811182821017156118f5576118f561186a565b604052823561190381611598565b81526020838101359082015260408084013590820152606083013561192781611598565b60608201529392505050565b5f82601f830112611942575f80fd5b813567ffffffffffffffff81111561195c5761195c61186a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff811182821017156119a9576119a961186a565b6040528181528382016020018510156119c0575f80fd5b816020850160208301375f918101602001919091529392505050565b5f602082840312156119ec575f80fd5b813567ffffffffffffffff811115611a02575f80fd5b820160408185031215611a13575f80fd5b611a1b611897565b8135611a2681611598565b8152602082013567ffffffffffffffff811115611a41575f80fd5b611a4d86828501611933565b602083015250949350505050565b5f60208284031215611a6b575f80fd5b5051919050565b818103818111156106b7576106b76117de565b5f805f60608486031215611a97575f80fd5b8335611aa281611598565b95602085013595506040909401359392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b602081525f825160038110611b20577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff6040840151166060830152606083015160808084015261107760a084018261172f565b5f60208284031215611b8f575f80fd5b813567ffffffffffffffff811115611ba5575f80fd5b820160408185031215611bb6575f80fd5b611bbe611897565b813567ffffffffffffffff811115611bd4575f80fd5b611be086828501611933565b825250602082013567ffffffffffffffff811115611a41575f80fd5b80820281158282048414176106b7576106b76117de565b5f82611c46577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea26469706673582212205e41329b8669298aefff890a8927080492625f551d3bee91b84e42a63b00ed0664736f6c634300081a0033", e = class e extends D {
|
|
8
8
|
constructor() {
|
|
9
|
-
super(...arguments), this.abi =
|
|
9
|
+
super(...arguments), this.abi = s;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* The owner of the incentive
|
|
@@ -49,7 +49,7 @@ const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
49
49
|
* @returns {Promise<bigint>} - The current reward
|
|
50
50
|
*/
|
|
51
51
|
async currentReward(f) {
|
|
52
|
-
return await
|
|
52
|
+
return await u(this._config, {
|
|
53
53
|
address: this.assertValidAddress(),
|
|
54
54
|
args: [],
|
|
55
55
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -65,7 +65,7 @@ const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
65
65
|
* @returns {Promise<bigint>}
|
|
66
66
|
*/
|
|
67
67
|
async claims(f) {
|
|
68
|
-
return await
|
|
68
|
+
return await m(this._config, {
|
|
69
69
|
address: this.assertValidAddress(),
|
|
70
70
|
args: [],
|
|
71
71
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -82,7 +82,7 @@ const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
82
82
|
* @returns {Promise<boolean>}
|
|
83
83
|
*/
|
|
84
84
|
async claimed(f, b) {
|
|
85
|
-
return await
|
|
85
|
+
return await g(this._config, {
|
|
86
86
|
address: this.assertValidAddress(),
|
|
87
87
|
args: [f],
|
|
88
88
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -98,7 +98,7 @@ const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
98
98
|
* @returns {Promise<Address>}
|
|
99
99
|
*/
|
|
100
100
|
async asset(f) {
|
|
101
|
-
return await
|
|
101
|
+
return await y(this._config, {
|
|
102
102
|
address: this.assertValidAddress(),
|
|
103
103
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
104
104
|
...f
|
|
@@ -160,13 +160,13 @@ const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
160
160
|
this._config,
|
|
161
161
|
{
|
|
162
162
|
address: this.assertValidAddress(),
|
|
163
|
-
args: [
|
|
163
|
+
args: [t(f)],
|
|
164
164
|
...this.optionallyAttachAccount(),
|
|
165
165
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
166
166
|
...b
|
|
167
167
|
}
|
|
168
168
|
);
|
|
169
|
-
return { hash: await
|
|
169
|
+
return { hash: await z(this._config, a), result: d };
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* Clawback assets from the incentive
|
|
@@ -194,7 +194,7 @@ const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
194
194
|
this._config,
|
|
195
195
|
{
|
|
196
196
|
address: this.assertValidAddress(),
|
|
197
|
-
args: [
|
|
197
|
+
args: [t(f)],
|
|
198
198
|
...this.optionallyAttachAccount(),
|
|
199
199
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
200
200
|
...b
|
|
@@ -297,10 +297,10 @@ const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
297
297
|
*
|
|
298
298
|
* @public
|
|
299
299
|
* @param {Hex} claimData
|
|
300
|
-
* @returns {
|
|
300
|
+
* @returns {bigint} Returns the reward amount from a claim data payload
|
|
301
301
|
*/
|
|
302
302
|
decodeClaimData(f) {
|
|
303
|
-
return BigInt(
|
|
303
|
+
return BigInt(R([{ type: "uint256" }], f)[0]);
|
|
304
304
|
}
|
|
305
305
|
/**
|
|
306
306
|
* Encodes an amount to clawback from the incentive
|
|
@@ -326,8 +326,8 @@ const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
326
326
|
b
|
|
327
327
|
);
|
|
328
328
|
return {
|
|
329
|
-
abi:
|
|
330
|
-
bytecode:
|
|
329
|
+
abi: s,
|
|
330
|
+
bytecode: B,
|
|
331
331
|
args: [
|
|
332
332
|
r(
|
|
333
333
|
a
|
|
@@ -339,8 +339,8 @@ const x = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
339
339
|
};
|
|
340
340
|
e.bases = {
|
|
341
341
|
31337: void 0,
|
|
342
|
-
...
|
|
343
|
-
}, e.registryType =
|
|
342
|
+
...k
|
|
343
|
+
}, e.registryType = T.INCENTIVE;
|
|
344
344
|
let i = e;
|
|
345
345
|
function r({
|
|
346
346
|
asset: n,
|
|
@@ -360,7 +360,7 @@ function r({
|
|
|
360
360
|
}
|
|
361
361
|
export {
|
|
362
362
|
i as ERC20VariableIncentive,
|
|
363
|
-
|
|
363
|
+
s as erc20VariableIncentiveAbi,
|
|
364
364
|
r as prepareERC20VariableIncentivePayload
|
|
365
365
|
};
|
|
366
366
|
//# sourceMappingURL=ERC20VariableIncentive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20VariableIncentive.js","sources":["../../src/Incentives/ERC20VariableIncentive.ts"],"sourcesContent":["import {\n erc20VariableIncentiveAbi,\n readErc20VariableIncentiveAsset,\n readErc20VariableIncentiveClaimed,\n readErc20VariableIncentiveClaims,\n readErc20VariableIncentiveCurrentReward,\n readErc20VariableIncentiveIsClaimable,\n readErc20VariableIncentiveLimit,\n readErc20VariableIncentiveOwner,\n readErc20VariableIncentiveReward,\n readErc20VariableIncentiveTotalClaimed,\n simulateErc20VariableIncentiveClaim,\n simulateErc20VariableIncentiveClawback,\n writeErc20VariableIncentiveClaim,\n writeErc20VariableIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableIncentive.sol/ERC20VariableIncentive.json';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n encodeAbiParameters,\n zeroAddress,\n} from 'viem';\nimport { ERC20VariableIncentive as ERC20VariableIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20VariableIncentiveAbi };\n/**\n * The object representation of a `ERC20VariableIncentivePayload.InitPayload`\n *\n * @export\n * @interface ERC20VariableIncentivePayload\n * @typedef {ERC20VariableIncentivePayload}\n */\nexport interface ERC20VariableIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The reward multiplier. If 0, the signed amount from the claim payload is used directly. Variable amount (in ETH decimal format) will by multiplied by this value.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The entity that can `clawback` funds\n *\n * @type {Address}\n */\n manager: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20VariableIncentive` event types.\n *\n * @export\n * @typedef {ERC20VariableIncentiveLog}\n * @template {ContractEventName<typeof erc20VariableIncentiveAbi>} [event=ContractEventName<\n * typeof erc20VariableIncentiveAbi\n * >]\n */\nexport type ERC20VariableIncentiveLog<\n event extends ContractEventName<\n typeof erc20VariableIncentiveAbi\n > = ContractEventName<typeof erc20VariableIncentiveAbi>,\n> = GenericLog<typeof erc20VariableIncentiveAbi, event>;\n\n/**\n * A modified ERC20 incentive implementation that allows claiming of variable token amounts with a spending limit\n *\n * @export\n * @class ERC20VariableIncentive\n * @typedef {ERC20VariableIncentive}\n * @template [Payload=ERC20VariableIncentivePayload | undefined]\n * @template {Abi} [ABI=typeof erc20VariableIncentiveAbi]\n * @extends {DeployableTarget<ERC20VariableIncentivePayload, ABI>}\n */\nexport class ERC20VariableIncentive<\n Payload = ERC20VariableIncentivePayload | undefined,\n ABI extends Abi = typeof erc20VariableIncentiveAbi,\n> extends DeployableTarget<Payload, ABI> {\n //@ts-expect-error it is instantiated correctly\n public override readonly abi = erc20VariableIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_ERC20_VARIABLE_INCENTIVE_BASE,\n ...(ERC20VariableIncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20VariableIncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20VariableIncentiveTotalClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20VariableIncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20VariableIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20VariableIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20VariableIncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20VariableIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20VariableIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20VariableIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20VariableIncentiveClawback(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20VariableIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n if ((this.payload as ERC20VariableIncentivePayload)?.limit !== undefined) {\n return (this.payload as ERC20VariableIncentivePayload).limit;\n }\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claimed amount against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if limit minus total claimed is greater than 0\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how much of the underlying asset remains by comparing the the limit against the total amount claimed. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - Limit minus total claimed\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n /**\n * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing\n * the existing `limit` field by `netAmount`. The entire payload is then re-encoded\n * via `prepareERC20PeggedIncentivePayload(...)`.\n *\n * @public\n * @param {bigint} netAmount - The additional limit to add to this incentive.\n * @returns {Hex} The ABI-encoded payload with the updated `limit`.\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n return prepareERC20VariableIncentivePayload({\n asset: (await this.asset()) as Address,\n reward: netAmount,\n manager: zeroAddress,\n limit: 1n,\n });\n }\n\n /**\n * Builds the claim data for the ERC20VariableIncentive.\n *\n * @public\n * @param {bigint} rewardAmount\n * @returns {Hex} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20VariableIncentive.\n */\n public buildClaimData(rewardAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'rewardAmount' }],\n [rewardAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20VariableIncentive, returning the encoded claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimData(data: Hex) {\n return BigInt(decodeAbiParameters([{ type: 'uint256' }], data)[0]);\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [\n prepareERC20VariableIncentivePayload(\n payload as ERC20VariableIncentivePayload,\n ),\n ],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link ERC20VariableIncentivePayload}, properly encode a ` ERC20VariableIncentive.InitPayload` for use with {@link ERC20VariableIncentive} initialization.\n *\n * @param {ERC20VariableIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @returns {Hex}\n */\nexport function prepareERC20VariableIncentivePayload({\n asset,\n reward,\n limit,\n manager,\n}: ERC20VariableIncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [asset, reward, limit, manager],\n );\n}\n"],"names":["_ERC20VariableIncentive","DeployableTarget","erc20VariableIncentiveAbi","params","readErc20VariableIncentiveOwner","readErc20VariableIncentiveTotalClaimed","readErc20VariableIncentiveCurrentReward","readErc20VariableIncentiveClaims","address","readErc20VariableIncentiveClaimed","readErc20VariableIncentiveAsset","readErc20VariableIncentiveReward","readErc20VariableIncentiveLimit","payload","request","result","simulateErc20VariableIncentiveClaim","prepareClaimPayload","writeErc20VariableIncentiveClaim","simulateErc20VariableIncentiveClawback","writeErc20VariableIncentiveClawback","readErc20VariableIncentiveIsClaimable","_a","totalClaimed","limit","netAmount","prepareERC20VariableIncentivePayload","zeroAddress","rewardAmount","encodeAbiParameters","data","decodeAbiParameters","amount","_payload","_options","options","bytecode","ERC20VariableIncentiveBases","RegistryType","ERC20VariableIncentive","asset","reward","manager"],"mappings":";;;;;;o/cAoGaA,IAAN,MAAMA,UAGHC,EAA+B;AAAA,EAHlC,cAAA;AAAA,UAAA,GAAA,SAAA,GAKL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAgC,KAAK,SAAS;AAAA,MACzD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,aAAaA,GAAqB;AACtC,WAAA,MAAME,EAAuC,KAAK,SAAS;AAAA,MAChE,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cAAcA,GAAqB;AACvC,WAAA,MAAMG,EAAwC,KAAK,SAAS;AAAA,MACjE,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIH;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,OAAOA,GAAqB;AAChC,WAAA,MAAMI,EAAiC,KAAK,SAA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ASO,kBAAkBE,GAAgB;AAChC,WAAAH,EAAoB,CAAC,EAAE,MAAM,WAAW,GAAG,CAACG,CAAM,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdC,GACAC,GACyB;AACzB,UAAM,CAACrB,GAASsB,CAAO,IAAI,KAAK;AAAA,MAC9BF;AAAA,MACAC;AAAA,IAAA;AAEK,WAAA;AAAA,MACL,KAAKhC;AAAAA,MACL,UAAAkC;AAAA,MACA,MAAM;AAAA,QACJV;AAAA,UACEb;AAAA,QACF;AAAA,MACF;AAAA,MACA,GAAG,KAAK,wBAAwBsB,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;AA/WEnC,EAAuB,QAAiC;AAAA,EACtD,OAAO;AAAA,EACP,GAAIqC;AAAA,GASNrC,EAAuB,eAA6BsC,EAAa;AAxB5D,IAAMC,IAANvC;AAuYA,SAAS0B,EAAqC;AAAA,EACnD,OAAAc;AAAA,EACA,QAAAC;AAAA,EACA,OAAAjB;AAAA,EACA,SAAAkB;AACF,GAAkC;AACzB,SAAAb;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,MAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,WAAW,MAAM,UAAU;AAAA,IACrC;AAAA,IACA,CAACW,GAAOC,GAAQjB,GAAOkB,CAAO;AAAA,EAAA;AAElC;"}
|
|
1
|
+
{"version":3,"file":"ERC20VariableIncentive.js","sources":["../../src/Incentives/ERC20VariableIncentive.ts"],"sourcesContent":["import {\n erc20VariableIncentiveAbi,\n readErc20VariableIncentiveAsset,\n readErc20VariableIncentiveClaimed,\n readErc20VariableIncentiveClaims,\n readErc20VariableIncentiveCurrentReward,\n readErc20VariableIncentiveIsClaimable,\n readErc20VariableIncentiveLimit,\n readErc20VariableIncentiveOwner,\n readErc20VariableIncentiveReward,\n readErc20VariableIncentiveTotalClaimed,\n simulateErc20VariableIncentiveClaim,\n simulateErc20VariableIncentiveClawback,\n writeErc20VariableIncentiveClaim,\n writeErc20VariableIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableIncentive.sol/ERC20VariableIncentive.json';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n encodeAbiParameters,\n zeroAddress,\n} from 'viem';\nimport { ERC20VariableIncentive as ERC20VariableIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20VariableIncentiveAbi };\n/**\n * The object representation of a `ERC20VariableIncentivePayload.InitPayload`\n *\n * @export\n * @interface ERC20VariableIncentivePayload\n * @typedef {ERC20VariableIncentivePayload}\n */\nexport interface ERC20VariableIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The reward multiplier. If 0, the signed amount from the claim payload is used directly. Variable amount (in ETH decimal format) will by multiplied by this value.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The entity that can `clawback` funds\n *\n * @type {Address}\n */\n manager: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20VariableIncentive` event types.\n *\n * @export\n * @typedef {ERC20VariableIncentiveLog}\n * @template {ContractEventName<typeof erc20VariableIncentiveAbi>} [event=ContractEventName<\n * typeof erc20VariableIncentiveAbi\n * >]\n */\nexport type ERC20VariableIncentiveLog<\n event extends ContractEventName<\n typeof erc20VariableIncentiveAbi\n > = ContractEventName<typeof erc20VariableIncentiveAbi>,\n> = GenericLog<typeof erc20VariableIncentiveAbi, event>;\n\n/**\n * A modified ERC20 incentive implementation that allows claiming of variable token amounts with a spending limit\n *\n * @export\n * @class ERC20VariableIncentive\n * @typedef {ERC20VariableIncentive}\n * @template [Payload=ERC20VariableIncentivePayload | undefined]\n * @template {Abi} [ABI=typeof erc20VariableIncentiveAbi]\n * @extends {DeployableTarget<ERC20VariableIncentivePayload, ABI>}\n */\nexport class ERC20VariableIncentive<\n Payload = ERC20VariableIncentivePayload | undefined,\n ABI extends Abi = typeof erc20VariableIncentiveAbi,\n DecodedClaimPayload = bigint,\n> extends DeployableTarget<Payload, ABI> {\n //@ts-expect-error it is instantiated correctly\n public override readonly abi = erc20VariableIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_ERC20_VARIABLE_INCENTIVE_BASE,\n ...(ERC20VariableIncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20VariableIncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20VariableIncentiveTotalClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20VariableIncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20VariableIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20VariableIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20VariableIncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20VariableIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20VariableIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20VariableIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20VariableIncentiveClawback(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20VariableIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n if ((this.payload as ERC20VariableIncentivePayload)?.limit !== undefined) {\n return (this.payload as ERC20VariableIncentivePayload).limit;\n }\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claimed amount against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if limit minus total claimed is greater than 0\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how much of the underlying asset remains by comparing the the limit against the total amount claimed. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - Limit minus total claimed\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n /**\n * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing\n * the existing `limit` field by `netAmount`. The entire payload is then re-encoded\n * via `prepareERC20PeggedIncentivePayload(...)`.\n *\n * @public\n * @param {bigint} netAmount - The additional limit to add to this incentive.\n * @returns {Hex} The ABI-encoded payload with the updated `limit`.\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n return prepareERC20VariableIncentivePayload({\n asset: (await this.asset()) as Address,\n reward: netAmount,\n manager: zeroAddress,\n limit: 1n,\n });\n }\n\n /**\n * Builds the claim data for the ERC20VariableIncentive.\n *\n * @public\n * @param {bigint} rewardAmount\n * @returns {Hex} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20VariableIncentive.\n */\n public buildClaimData(rewardAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'rewardAmount' }],\n [rewardAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20VariableIncentive, returning the encoded claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {bigint} Returns the reward amount from a claim data payload\n */\n public decodeClaimData(data: Hex): DecodedClaimPayload {\n //@ts-expect-error making this generic to prevent major version\n return BigInt(decodeAbiParameters([{ type: 'uint256' }], data)[0]);\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [\n prepareERC20VariableIncentivePayload(\n payload as ERC20VariableIncentivePayload,\n ),\n ],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link ERC20VariableIncentivePayload}, properly encode a ` ERC20VariableIncentive.InitPayload` for use with {@link ERC20VariableIncentive} initialization.\n *\n * @param {ERC20VariableIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @returns {Hex}\n */\nexport function prepareERC20VariableIncentivePayload({\n asset,\n reward,\n limit,\n manager,\n}: ERC20VariableIncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [asset, reward, limit, manager],\n );\n}\n"],"names":["_ERC20VariableIncentive","DeployableTarget","erc20VariableIncentiveAbi","params","readErc20VariableIncentiveOwner","readErc20VariableIncentiveTotalClaimed","readErc20VariableIncentiveCurrentReward","readErc20VariableIncentiveClaims","address","readErc20VariableIncentiveClaimed","readErc20VariableIncentiveAsset","readErc20VariableIncentiveReward","readErc20VariableIncentiveLimit","payload","request","result","simulateErc20VariableIncentiveClaim","prepareClaimPayload","writeErc20VariableIncentiveClaim","simulateErc20VariableIncentiveClawback","writeErc20VariableIncentiveClawback","readErc20VariableIncentiveIsClaimable","_a","totalClaimed","limit","netAmount","prepareERC20VariableIncentivePayload","zeroAddress","rewardAmount","encodeAbiParameters","data","decodeAbiParameters","amount","_payload","_options","options","bytecode","ERC20VariableIncentiveBases","RegistryType","ERC20VariableIncentive","asset","reward","manager"],"mappings":";;;;;;oidAoGaA,IAAN,MAAMA,UAIHC,EAA+B;AAAA,EAJlC,cAAA;AAAA,UAAA,GAAA,SAAA,GAML,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAA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EnD;AACF;AAhXEnC,EAAuB,QAAiC;AAAA,EACtD,OAAO;AAAA,EACP,GAAIqC;AAAA,GASNrC,EAAuB,eAA6BsC,EAAa;AAzB5D,IAAMC,IAANvC;AAyYA,SAAS0B,EAAqC;AAAA,EACnD,OAAAc;AAAA,EACA,QAAAC;AAAA,EACA,OAAAjB;AAAA,EACA,SAAAkB;AACF,GAAkC;AACzB,SAAAb;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,MAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,WAAW,MAAM,UAAU;AAAA,IACrC;AAAA,IACA,CAACW,GAAOC,GAAQjB,GAAOkB,CAAO;AAAA,EAAA;AAElC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../generated-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../generated-C_JEoLDO.cjs");require("../componentInterfaces-C5ig8mCK.cjs");require("@wagmi/core");require("../errors.cjs");const i=require("./AllowListIncentive.cjs"),n=require("./CGDAIncentive.cjs"),r=require("./ERC20Incentive.cjs"),e=require("../Incentive-BDqkFt0J.cjs"),t=require("./ERC20PeggedVariableCriteriaIncentive.cjs"),c=require("./ERC20PeggedVariableCriteriaIncentiveV2.cjs"),a=require("./ERC20VariableCriteriaIncentive.cjs"),C=require("./ERC20VariableCriteriaIncentiveV2.cjs"),v=require("./ERC20VariableIncentive.cjs"),I=require("./PointsIncentive.cjs");exports.AllowListIncentive=i.AllowListIncentive;exports.CGDAIncentive=n.CGDAIncentive;exports.ERC20Incentive=r.ERC20Incentive;exports.ERC20PeggedIncentive=e.ERC20PeggedIncentive;exports.IncentiveByComponentInterface=e.IncentiveByComponentInterface;exports.incentiveFromAddress=e.incentiveFromAddress;exports.ERC20PeggedVariableCriteriaIncentive=t.ERC20PeggedVariableCriteriaIncentive;exports.ERC20PeggedVariableCriteriaIncentiveV2=c.ERC20PeggedVariableCriteriaIncentiveV2;exports.ERC20VariableCriteriaIncentive=a.ERC20VariableCriteriaIncentive;exports.ERC20VariableCriteriaIncentiveV2=C.ERC20VariableCriteriaIncentiveV2;exports.ERC20VariableIncentive=v.ERC20VariableIncentive;exports.PointsIncentive=I.PointsIncentive;
|
|
2
2
|
//# sourceMappingURL=Incentive.cjs.map
|
|
@@ -6,24 +6,26 @@ import { CGDAIncentive } from './CGDAIncentive';
|
|
|
6
6
|
import { ERC20Incentive } from './ERC20Incentive';
|
|
7
7
|
import { ERC20PeggedIncentive } from './ERC20PeggedIncentive';
|
|
8
8
|
import { ERC20PeggedVariableCriteriaIncentive } from './ERC20PeggedVariableCriteriaIncentive';
|
|
9
|
+
import { ERC20PeggedVariableCriteriaIncentiveV2 } from './ERC20PeggedVariableCriteriaIncentiveV2';
|
|
9
10
|
import { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';
|
|
11
|
+
import { ERC20VariableCriteriaIncentiveV2 } from './ERC20VariableCriteriaIncentiveV2';
|
|
10
12
|
import { ERC20VariableIncentive } from './ERC20VariableIncentive';
|
|
11
13
|
import { PointsIncentive } from './PointsIncentive';
|
|
12
|
-
export { AllowListIncentive, CGDAIncentive, ERC20Incentive, ERC20PeggedIncentive, ERC20PeggedVariableCriteriaIncentive, PointsIncentive, ERC20VariableIncentive, ERC20VariableCriteriaIncentive, };
|
|
14
|
+
export { AllowListIncentive, CGDAIncentive, ERC20Incentive, ERC20PeggedIncentive, ERC20PeggedVariableCriteriaIncentive, ERC20PeggedVariableCriteriaIncentiveV2, PointsIncentive, ERC20VariableIncentive, ERC20VariableCriteriaIncentive, ERC20VariableCriteriaIncentiveV2, };
|
|
13
15
|
/**
|
|
14
16
|
* A union type representing all valid protocol Incentive implementations
|
|
15
17
|
*
|
|
16
18
|
* @export
|
|
17
19
|
* @typedef {Incentive}
|
|
18
20
|
*/
|
|
19
|
-
export type Incentive = AllowListIncentive | CGDAIncentive | ERC20Incentive | ERC20PeggedIncentive | ERC20PeggedVariableCriteriaIncentive | PointsIncentive | ERC20VariableIncentive | ERC20VariableCriteriaIncentive;
|
|
21
|
+
export type Incentive = AllowListIncentive | CGDAIncentive | ERC20Incentive | ERC20PeggedIncentive | ERC20PeggedVariableCriteriaIncentive | ERC20PeggedVariableCriteriaIncentiveV2 | PointsIncentive | ERC20VariableIncentive | ERC20VariableCriteriaIncentive | ERC20VariableCriteriaIncentiveV2;
|
|
20
22
|
/**
|
|
21
23
|
* A map of Incentive component interfaces to their constructors.
|
|
22
24
|
*
|
|
23
|
-
* @type {{ "0xc5b24b8e": typeof PointsIncentive; "0x8c901437": typeof ERC20Incentive; "0x4414fbb4": typeof ERC20PeggedIncentive; "0xf60c99c9": typeof
|
|
25
|
+
* @type {{ "0xc5b24b8e": typeof PointsIncentive; "0x8c901437": typeof ERC20Incentive; "0x4414fbb4": typeof ERC20PeggedIncentive; "0xf60c99c9": typeof ERC20PeggedVariableCriteriaIncentiveV2; "0x56586338": typeof AllowListIncentive; "0xa39e44d9": typeof CGDAIncentive; "0xa8e4af1e": typeof ERC20VariableIncentive; "0x90318111": typeof ERC20VariableCriteriaIncentiveV2 }}
|
|
24
26
|
*/
|
|
25
27
|
export declare const IncentiveByComponentInterface: {
|
|
26
|
-
[x: string]: typeof AllowListIncentive | typeof CGDAIncentive | typeof ERC20Incentive | typeof ERC20PeggedIncentive | typeof ERC20VariableIncentive | typeof ERC20VariableCriteriaIncentive | typeof ERC20PeggedVariableCriteriaIncentive | typeof PointsIncentive;
|
|
28
|
+
[x: string]: typeof AllowListIncentive | typeof CGDAIncentive | typeof ERC20Incentive | typeof ERC20PeggedIncentive | typeof ERC20VariableIncentive | typeof ERC20VariableCriteriaIncentive | typeof ERC20PeggedVariableCriteriaIncentive | typeof ERC20VariableCriteriaIncentiveV2 | typeof ERC20PeggedVariableCriteriaIncentiveV2 | typeof PointsIncentive;
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
29
31
|
* A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.
|
|
@@ -35,7 +37,7 @@ export declare const IncentiveByComponentInterface: {
|
|
|
35
37
|
* @returns {Incentive}
|
|
36
38
|
* @throws {@link InvalidComponentInterfaceError}
|
|
37
39
|
*/
|
|
38
|
-
export declare function incentiveFromAddress(options: DeployableOptions, address: Address, params?: ReadParams): Promise<AllowListIncentive | CGDAIncentive | ERC20Incentive | ERC20PeggedIncentive | ERC20VariableCriteriaIncentive | ERC20PeggedVariableCriteriaIncentive | PointsIncentive | ERC20VariableIncentive<`0x${string}`, readonly [{
|
|
40
|
+
export declare function incentiveFromAddress(options: DeployableOptions, address: Address, params?: ReadParams): Promise<AllowListIncentive | CGDAIncentive | ERC20Incentive | ERC20PeggedIncentive | ERC20VariableCriteriaIncentive | ERC20PeggedVariableCriteriaIncentive | ERC20VariableCriteriaIncentiveV2 | ERC20PeggedVariableCriteriaIncentiveV2 | PointsIncentive | ERC20VariableIncentive<`0x${string}`, readonly [{
|
|
39
41
|
readonly type: "constructor";
|
|
40
42
|
readonly inputs: readonly [];
|
|
41
43
|
readonly stateMutability: "nonpayable";
|
|
@@ -629,5 +631,5 @@ export declare function incentiveFromAddress(options: DeployableOptions, address
|
|
|
629
631
|
readonly name: "transferOwnership";
|
|
630
632
|
readonly outputs: readonly [];
|
|
631
633
|
readonly stateMutability: "payable";
|
|
632
|
-
}]>>;
|
|
634
|
+
}], bigint>>;
|
|
633
635
|
//# sourceMappingURL=Incentive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Incentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/Incentive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Incentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/Incentive.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAgBpB"}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import "../generated-
|
|
2
|
-
import "../componentInterfaces-
|
|
1
|
+
import "../generated-CINzoGbl.js";
|
|
2
|
+
import "../componentInterfaces-Ddus5rIA.js";
|
|
3
3
|
import "@wagmi/core";
|
|
4
4
|
import "../errors.js";
|
|
5
5
|
import { AllowListIncentive as a } from "./AllowListIncentive.js";
|
|
6
6
|
import { CGDAIncentive as p } from "./CGDAIncentive.js";
|
|
7
|
-
import { ERC20Incentive as
|
|
8
|
-
import { E as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { ERC20Incentive as C } from "./ERC20Incentive.js";
|
|
8
|
+
import { E as v, I as f, i as x } from "../Incentive-DPOADY1f.js";
|
|
9
|
+
import { ERC20PeggedVariableCriteriaIncentive as l } from "./ERC20PeggedVariableCriteriaIncentive.js";
|
|
10
|
+
import { ERC20PeggedVariableCriteriaIncentiveV2 as R } from "./ERC20PeggedVariableCriteriaIncentiveV2.js";
|
|
11
|
+
import { ERC20VariableCriteriaIncentive as g } from "./ERC20VariableCriteriaIncentive.js";
|
|
12
|
+
import { ERC20VariableCriteriaIncentiveV2 as d } from "./ERC20VariableCriteriaIncentiveV2.js";
|
|
13
|
+
import { ERC20VariableIncentive as A } from "./ERC20VariableIncentive.js";
|
|
14
|
+
import { PointsIncentive as y } from "./PointsIncentive.js";
|
|
12
15
|
export {
|
|
13
16
|
a as AllowListIncentive,
|
|
14
17
|
p as CGDAIncentive,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
C as ERC20Incentive,
|
|
19
|
+
v as ERC20PeggedIncentive,
|
|
20
|
+
l as ERC20PeggedVariableCriteriaIncentive,
|
|
21
|
+
R as ERC20PeggedVariableCriteriaIncentiveV2,
|
|
22
|
+
g as ERC20VariableCriteriaIncentive,
|
|
23
|
+
d as ERC20VariableCriteriaIncentiveV2,
|
|
24
|
+
A as ERC20VariableIncentive,
|
|
25
|
+
f as IncentiveByComponentInterface,
|
|
26
|
+
y as PointsIncentive,
|
|
22
27
|
x as incentiveFromAddress
|
|
23
28
|
};
|
|
24
29
|
//# sourceMappingURL=Incentive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Incentive.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Incentive.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-BPiHi7W2.cjs"),d=require("viem"),n=require("../deployments-CwTZr-cK.cjs"),o=require("../Deployable/DeployableTarget.cjs"),l=require("../claiming.cjs"),u=require("../utils.cjs"),y="0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6113ca806100855f395ff3fe6080604052600436106101af575f3560e01c8063514e62fc116100e7578063c884ef8311610087578063ea3d508a11610062578063ea3d508a14610543578063f04e283e1461055c578063f2fde38b1461056f578063fee81cf414610582575f80fd5b8063c884ef83146104e1578063db09da121461050f578063dcc59b6f1461052e575f80fd5b80638da5cb5b116100c25780638da5cb5b1461044e578063a270a73714610481578063a4d66daf146104ad578063bb1757cf146104c2575f80fd5b8063514e62fc1461040957806354d1f13d1461043e578063715018a614610446575f80fd5b806328d6183b11610152578063439fab911161012d578063439fab9114610354578063474f5a44146103735780634a4ee7b1146103bc5780634e7165a2146103cf575f80fd5b806328d6183b1461027d5780632de94807146102dc57806338d52e0f1461030d575f80fd5b80631c10893f1161018d5780631c10893f146102195780631cd64df41461022c578063228cb733146102615780632569296214610275575f80fd5b806301ffc9a7146101b357806307621eca146101e7578063183a4f6e14610204575b5f80fd5b3480156101be575f80fd5b506101d26101cd36600461108b565b6105b3565b60405190151581526020015b60405180910390f35b3480156101f2575f80fd5b505f545b6040519081526020016101de565b6102176102123660046110ab565b61060e565b005b6102176102273660046110e3565b61061b565b348015610237575f80fd5b506101d26102463660046110e3565b638b78c6d8600c9081525f9290925260209091205481161490565b34801561026c575f80fd5b506101f65f5481565b610217610631565b348015610288575f80fd5b507f0d36a40d000000000000000000000000000000000000000000000000000000005b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101de565b3480156102e7575f80fd5b506101f66102f636600461110d565b638b78c6d8600c9081525f91909152602090205490565b348015610318575f80fd5b5073deaddeaddeaddeaddeaddeaddeaddeaddeaddead5b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101de565b34801561035f575f80fd5b5061021761036e36600461116d565b61067e565b34801561037e575f80fd5b5061039261038d36600461116d565b610890565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016101de565b6102176103ca3660046110e3565b6108c4565b3480156103da575f80fd5b506103fc6103e936600461116d565b5050604080515f81526020810190915290565b6040516101de91906111ac565b348015610414575f80fd5b506101d26104233660046110e3565b638b78c6d8600c9081525f9290925260209091205416151590565b6102176108d6565b61021761090f565b348015610459575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275461032f565b34801561048c575f80fd5b5060025461032f9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156104b8575f80fd5b506101f660035481565b3480156104cd575f80fd5b506101d26104dc3660046111ff565b610922565b3480156104ec575f80fd5b506101d26104fb36600461110d565b60016020525f908152604090205460ff1681565b34801561051a575f80fd5b506101d26105293660046111ff565b610d52565b348015610539575f80fd5b506101f660055481565b34801561054e575f80fd5b506004546102ab9060e01b81565b61021761056a36600461110d565b610d64565b61021761057d36600461110d565b610d9e565b34801561058d575f80fd5b506101f661059c36600461110d565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f0d36a40d000000000000000000000000000000000000000000000000000000001480610608575061060882610dc4565b92915050565b6106183382610e19565b50565b610623610e24565b61062d8282610e59565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156106cf5760018160011c14303b106106c65763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f6106dd83850185611250565b905080604001515f14806106f357506060810151155b1561072a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790556020810151600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001660e09290921c91909117905560408101515f5560608101516003556107bf33610e65565b805f015173ffffffffffffffffffffffffffffffffffffffff167fef49c8fd80435c15980f0f55660ffaac9417e5843768f7f21566cfad2d19bfe782602001518360400151846060015160405161084d939291907fffffffff000000000000000000000000000000000000000000000000000000009390931683526020830191909152604082015260600190565b60405180910390a250801561088b576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108cc610e24565b61062d8282610e19565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610917610e24565b6109205f610ec8565b565b5f61092b610e24565b600254604080517f8da5cb5b000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169130918391638da5cb5b916004808201926020929091908290030181865afa15801561099d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109c191906112e8565b73ffffffffffffffffffffffffffffffffffffffff1614158015610a7a57506040517f514e62fc0000000000000000000000000000000000000000000000000000000081523060048201526002602482015273ffffffffffffffffffffffffffffffffffffffff82169063514e62fc90604401602060405180830381865afa158015610a4f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a739190611303565b1515600114155b15610ab1576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610aba85610f2d565b610af0576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60058054905f610aff83611322565b909155505073ffffffffffffffffffffffffffffffffffffffff8581165f81815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690921790915560025460045483549251602481019590955260448501929092529193919091169160e09190911b90606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051610c0a919061137e565b5f604051808303815f865af19150503d805f8114610c43576040519150601f19603f3d011682016040523d82523d5f602084013e610c48565b606091505b5050905080610c83576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529289901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8716907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610d3e916111ac565b60405180910390a250600195945050505050565b5f610d5c84610f2d565b949350505050565b610d6c610e24565b63389a75e1600c52805f526020600c208054421115610d9257636f5e88185f526004601cfd5b5f905561061881610ec8565b610da6610e24565b8060601b610dbb57637448fbae5f526004601cfd5b61061881610ec8565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa9216705000000000000000000000000000000000000000000000000000000001480610608575061060882610f6a565b61062d82825f611000565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610920576382b429005f526004601cfd5b61062d82826001611000565b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001602052604081205460ff1615801561060857506003546005541092915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061060857507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610608565b638b78c6d8600c52825f526020600c20805483811783611021575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b80357fffffffff0000000000000000000000000000000000000000000000000000000081168114611086575f80fd5b919050565b5f6020828403121561109b575f80fd5b6110a482611057565b9392505050565b5f602082840312156110bb575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610618575f80fd5b5f80604083850312156110f4575f80fd5b82356110ff816110c2565b946020939093013593505050565b5f6020828403121561111d575f80fd5b81356110a4816110c2565b5f8083601f840112611138575f80fd5b50813567ffffffffffffffff81111561114f575f80fd5b602083019150836020828501011115611166575f80fd5b9250929050565b5f806020838503121561117e575f80fd5b823567ffffffffffffffff811115611194575f80fd5b6111a085828601611128565b90969095509350505050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b5f805f60408486031215611211575f80fd5b833561121c816110c2565b9250602084013567ffffffffffffffff811115611237575f80fd5b61124386828701611128565b9497909650939450505050565b5f6080828403128015611261575f80fd5b506040516080810167ffffffffffffffff811182821017156112aa577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405282356112b8816110c2565b81526112c660208401611057565b6020820152604083810135908201526060928301359281019290925250919050565b5f602082840312156112f8575f80fd5b81516110a4816110c2565b5f60208284031215611313575f80fd5b815180151581146110a4575f80fd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611377577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5060010190565b5f82518060208501845e5f92019182525091905056fea264697066735822122079bb08e80a9bd9117e174b7d6f5a63383597f9fcb4a121e18bc1685a513d4f3f64736f6c634300081a0033",c=class c extends o.DeployableTarget{constructor(){super(...arguments),this.abi=a.R}async claims(f){return await a.t0(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.a0(this._config,{address:this.assertValidAddress(),args:[],...f})}async reward(f){return await a.d0(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,e){return await a.e0(this._config,{address:this.assertValidAddress(),args:[f],...e})}async venue(f){return await a.f0(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.p0(this._config,{address:this.assertValidAddress(),...f})}async selector(f){return await a.m0(this._config,{address:this.assertValidAddress(),...f})}async claim(f,e){return await this.awaitResult(this.claimRaw(f,e))}async claimRaw(f,e){const{request:b,result:s}=await a.z0(this._config,{address:this.assertValidAddress(),args:[l.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...e});return{hash:await a.T0(this._config,b),result:s}}async isClaimable(f,e){return await a.o0(this._config,{address:this.assertValidAddress(),args:[f.target,f.data],...e})}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[e,b]=await Promise.all([this.claims(f),this.limit(f)]);return b-e}buildParameters(f,e){const[b,s]=this.validateDeploymentConfig(f,e);return{abi:a.R,bytecode:y,args:[i(b)],...this.optionallyAttachAccount(s.account)}}getTopupPayload(f){var e,b;return d.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"amount"}],[((e=this.payload)==null?void 0:e.venue)??d.zeroAddress,((b=this.payload)==null?void 0:b.selector)??"0x00000000",f])}buildClaimData(){return d.zeroHash}};c.bases={31337:void 0,...n.PointsIncentive},c.registryType=u.RegistryType.INCENTIVE;let t=c;const i=({venue:r,selector:f,reward:e,limit:b})=>d.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[r,f,e,b]);exports.pointsIncentiveAbi=a.R;exports.PointsIncentive=t;exports.preparePointsIncentivePayload=i;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../generated-C_JEoLDO.cjs"),d=require("viem"),n=require("../deployments-C17nvui-.cjs"),o=require("../Deployable/DeployableTarget.cjs"),l=require("../claiming.cjs"),u=require("../utils.cjs"),y="0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6113ca806100895f395ff3fe6080604052600436106101af575f3560e01c8063514e62fc116100e7578063c884ef8311610087578063ea3d508a11610062578063ea3d508a14610543578063f04e283e1461055c578063f2fde38b1461056f578063fee81cf414610582575f80fd5b8063c884ef83146104e1578063db09da121461050f578063dcc59b6f1461052e575f80fd5b80638da5cb5b116100c25780638da5cb5b1461044e578063a270a73714610481578063a4d66daf146104ad578063bb1757cf146104c2575f80fd5b8063514e62fc1461040957806354d1f13d1461043e578063715018a614610446575f80fd5b806328d6183b11610152578063439fab911161012d578063439fab9114610354578063474f5a44146103735780634a4ee7b1146103bc5780634e7165a2146103cf575f80fd5b806328d6183b1461027d5780632de94807146102dc57806338d52e0f1461030d575f80fd5b80631c10893f1161018d5780631c10893f146102195780631cd64df41461022c578063228cb733146102615780632569296214610275575f80fd5b806301ffc9a7146101b357806307621eca146101e7578063183a4f6e14610204575b5f80fd5b3480156101be575f80fd5b506101d26101cd36600461108b565b6105b3565b60405190151581526020015b60405180910390f35b3480156101f2575f80fd5b505f545b6040519081526020016101de565b6102176102123660046110ab565b61060e565b005b6102176102273660046110e3565b61061b565b348015610237575f80fd5b506101d26102463660046110e3565b638b78c6d8600c9081525f9290925260209091205481161490565b34801561026c575f80fd5b506101f65f5481565b610217610631565b348015610288575f80fd5b507f0d36a40d000000000000000000000000000000000000000000000000000000005b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101de565b3480156102e7575f80fd5b506101f66102f636600461110d565b638b78c6d8600c9081525f91909152602090205490565b348015610318575f80fd5b5073deaddeaddeaddeaddeaddeaddeaddeaddeaddead5b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101de565b34801561035f575f80fd5b5061021761036e36600461116d565b61067e565b34801561037e575f80fd5b5061039261038d36600461116d565b610890565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016101de565b6102176103ca3660046110e3565b6108c4565b3480156103da575f80fd5b506103fc6103e936600461116d565b5050604080515f81526020810190915290565b6040516101de91906111ac565b348015610414575f80fd5b506101d26104233660046110e3565b638b78c6d8600c9081525f9290925260209091205416151590565b6102176108d6565b61021761090f565b348015610459575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275461032f565b34801561048c575f80fd5b5060025461032f9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156104b8575f80fd5b506101f660035481565b3480156104cd575f80fd5b506101d26104dc3660046111ff565b610922565b3480156104ec575f80fd5b506101d26104fb36600461110d565b60016020525f908152604090205460ff1681565b34801561051a575f80fd5b506101d26105293660046111ff565b610d52565b348015610539575f80fd5b506101f660055481565b34801561054e575f80fd5b506004546102ab9060e01b81565b61021761056a36600461110d565b610d64565b61021761057d36600461110d565b610d9e565b34801561058d575f80fd5b506101f661059c36600461110d565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f0d36a40d000000000000000000000000000000000000000000000000000000001480610608575061060882610dc4565b92915050565b6106183382610e19565b50565b610623610e24565b61062d8282610e59565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156106cf5760018160011c14303b106106c65763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f6106dd83850185611250565b905080604001515f14806106f357506060810151155b1561072a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790556020810151600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001660e09290921c91909117905560408101515f5560608101516003556107bf33610e65565b805f015173ffffffffffffffffffffffffffffffffffffffff167fef49c8fd80435c15980f0f55660ffaac9417e5843768f7f21566cfad2d19bfe782602001518360400151846060015160405161084d939291907fffffffff000000000000000000000000000000000000000000000000000000009390931683526020830191909152604082015260600190565b60405180910390a250801561088b576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108cc610e24565b61062d8282610e19565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610917610e24565b6109205f610ec8565b565b5f61092b610e24565b600254604080517f8da5cb5b000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169130918391638da5cb5b916004808201926020929091908290030181865afa15801561099d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109c191906112e8565b73ffffffffffffffffffffffffffffffffffffffff1614158015610a7a57506040517f514e62fc0000000000000000000000000000000000000000000000000000000081523060048201526002602482015273ffffffffffffffffffffffffffffffffffffffff82169063514e62fc90604401602060405180830381865afa158015610a4f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a739190611303565b1515600114155b15610ab1576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610aba85610f2d565b610af0576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60058054905f610aff83611322565b909155505073ffffffffffffffffffffffffffffffffffffffff8581165f81815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690921790915560025460045483549251602481019590955260448501929092529193919091169160e09190911b90606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051610c0a919061137e565b5f604051808303815f865af19150503d805f8114610c43576040519150601f19603f3d011682016040523d82523d5f602084013e610c48565b606091505b5050905080610c83576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529289901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8716907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610d3e916111ac565b60405180910390a250600195945050505050565b5f610d5c84610f2d565b949350505050565b610d6c610e24565b63389a75e1600c52805f526020600c208054421115610d9257636f5e88185f526004601cfd5b5f905561061881610ec8565b610da6610e24565b8060601b610dbb57637448fbae5f526004601cfd5b61061881610ec8565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa9216705000000000000000000000000000000000000000000000000000000001480610608575061060882610f6a565b61062d82825f611000565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610920576382b429005f526004601cfd5b61062d82826001611000565b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001602052604081205460ff1615801561060857506003546005541092915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061060857507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610608565b638b78c6d8600c52825f526020600c20805483811783611021575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b80357fffffffff0000000000000000000000000000000000000000000000000000000081168114611086575f80fd5b919050565b5f6020828403121561109b575f80fd5b6110a482611057565b9392505050565b5f602082840312156110bb575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610618575f80fd5b5f80604083850312156110f4575f80fd5b82356110ff816110c2565b946020939093013593505050565b5f6020828403121561111d575f80fd5b81356110a4816110c2565b5f8083601f840112611138575f80fd5b50813567ffffffffffffffff81111561114f575f80fd5b602083019150836020828501011115611166575f80fd5b9250929050565b5f806020838503121561117e575f80fd5b823567ffffffffffffffff811115611194575f80fd5b6111a085828601611128565b90969095509350505050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b5f805f60408486031215611211575f80fd5b833561121c816110c2565b9250602084013567ffffffffffffffff811115611237575f80fd5b61124386828701611128565b9497909650939450505050565b5f6080828403128015611261575f80fd5b506040516080810167ffffffffffffffff811182821017156112aa577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405282356112b8816110c2565b81526112c660208401611057565b6020820152604083810135908201526060928301359281019290925250919050565b5f602082840312156112f8575f80fd5b81516110a4816110c2565b5f60208284031215611313575f80fd5b815180151581146110a4575f80fd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611377577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5060010190565b5f82518060208501845e5f92019182525091905056fea2646970667358221220ffbdb425e855f60328c6ebf81b28965fc1d20a52c81e723566d80b77f491fc3964736f6c634300081a0033",c=class c extends o.DeployableTarget{constructor(){super(...arguments),this.abi=b.z}async claims(f){return await b.y4(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await b.c4(this._config,{address:this.assertValidAddress(),args:[],...f})}async reward(f){return await b.A4(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,e){return await b.l4(this._config,{address:this.assertValidAddress(),args:[f],...e})}async venue(f){return await b.R4(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await b.T4(this._config,{address:this.assertValidAddress(),...f})}async selector(f){return await b.N4(this._config,{address:this.assertValidAddress(),...f})}async claim(f,e){return await this.awaitResult(this.claimRaw(f,e))}async claimRaw(f,e){const{request:a,result:s}=await b.L4(this._config,{address:this.assertValidAddress(),args:[l.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...e});return{hash:await b.E4(this._config,a),result:s}}async isClaimable(f,e){return await b.v4(this._config,{address:this.assertValidAddress(),args:[f.target,f.data],...e})}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[e,a]=await Promise.all([this.claims(f),this.limit(f)]);return a-e}buildParameters(f,e){const[a,s]=this.validateDeploymentConfig(f,e);return{abi:b.z,bytecode:y,args:[i(a)],...this.optionallyAttachAccount(s.account)}}getTopupPayload(f){var e,a;return d.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"amount"}],[((e=this.payload)==null?void 0:e.venue)??d.zeroAddress,((a=this.payload)==null?void 0:a.selector)??"0x00000000",f])}buildClaimData(){return d.zeroHash}};c.bases={31337:void 0,...n.PointsIncentive},c.registryType=u.RegistryType.INCENTIVE;let t=c;const i=({venue:r,selector:f,reward:e,limit:a})=>d.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[r,f,e,a]);exports.pointsIncentiveAbi=b.z;exports.PointsIncentive=t;exports.preparePointsIncentivePayload=i;
|
|
2
2
|
//# sourceMappingURL=PointsIncentive.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointsIncentive.cjs","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\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_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readPointsIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readPointsIncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readPointsIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the incentive was successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readPointsIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Generates a top-up payload for the PointsIncentive contract.\n *\n * @public\n * @param {bigint} netAmount The net reward amount to be added to the incentive.\n * @returns {Hex} The ABI-encoded top-up payload.\n */\n public getTopupPayload(netAmount: bigint): Hex {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'amount' },\n ],\n [\n this.payload?.venue ?? zeroAddress,\n this.payload?.selector ?? '0x00000000',\n netAmount,\n ],\n );\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","claims","limit","_payload","_options","options","bytecode","preparePointsIncentivePayload","netAmount","encodeAbiParameters","_a","zeroAddress","_b","zeroHash","PointsIncentiveBases","RegistryType","P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A,EAAc,WAAY,aAC1BJ,CACF,CAAA,CAEJ,CASO,gBAAiB,CACf,OAAAK,UACT,CACF,EA/QE/B,EAAuB,MAAiC,CACtD,MAAO,OACP,GAAIgC,EAAA,eAAA,EASNhC,EAAuB,aAA6BiC,EAAa,aAAA,UAvB5D,IAAMC,EAANlC,EAuSA,MAAMyB,EAAgC,CAAC,CAC5C,MAAAU,EACA,SAAAC,EACA,OAAAC,EACA,MAAAjB,CACF,IACSO,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,SAAU,KAAM,UAAW,EACnC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,CACnC,EACA,CAACQ,EAAOC,EAAUC,EAAQjB,CAAK,CAAA"}
|
|
1
|
+
{"version":3,"file":"PointsIncentive.cjs","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\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_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readPointsIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readPointsIncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readPointsIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the incentive was successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readPointsIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Generates a top-up payload for the PointsIncentive contract.\n *\n * @public\n * @param {bigint} netAmount The net reward amount to be added to the incentive.\n * @returns {Hex} The ABI-encoded top-up payload.\n */\n public getTopupPayload(netAmount: bigint): Hex {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'amount' },\n ],\n [\n this.payload?.venue ?? zeroAddress,\n this.payload?.selector ?? '0x00000000',\n netAmount,\n ],\n );\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","claims","limit","_payload","_options","options","bytecode","preparePointsIncentivePayload","netAmount","encodeAbiParameters","_a","zeroAddress","_b","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward"],"mappings":"48UAoGaA,EAAN,MAAMA,UAAwBC,EAAAA,gBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,OAAOC,EAAqB,CAChC,OAAA,MAAMC,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cAAcA,EAAqB,CACvC,OAAA,MAAME,EAAAA,GAAiC,KAAK,QAAS,CAC1D,QAAS,KAAK,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