@boostxyz/sdk 2.0.0-alpha.34 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  2. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  3. package/dist/Incentives/AllowListIncentive.d.ts +18 -0
  4. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  5. package/dist/Incentives/AllowListIncentive.js +46 -20
  6. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  7. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  8. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  9. package/dist/Incentives/CGDAIncentive.d.ts +18 -0
  10. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  11. package/dist/Incentives/CGDAIncentive.js +55 -24
  12. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  13. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  14. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  15. package/dist/Incentives/ERC20Incentive.d.ts +18 -0
  16. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  17. package/dist/Incentives/ERC20Incentive.js +46 -20
  18. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  19. package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
  20. package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
  21. package/dist/Incentives/ERC20VariableIncentive.d.ts +28 -1
  22. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  23. package/dist/Incentives/ERC20VariableIncentive.js +45 -8
  24. package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
  25. package/dist/Incentives/PointsIncentive.cjs +1 -1
  26. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  27. package/dist/Incentives/PointsIncentive.d.ts +18 -0
  28. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  29. package/dist/Incentives/PointsIncentive.js +41 -15
  30. package/dist/Incentives/PointsIncentive.js.map +1 -1
  31. package/dist/Validators/SignerValidator.cjs.map +1 -1
  32. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  33. package/dist/Validators/SignerValidator.js.map +1 -1
  34. package/dist/Validators/Validator.cjs +1 -1
  35. package/dist/Validators/Validator.cjs.map +1 -1
  36. package/dist/Validators/Validator.d.ts +12 -1
  37. package/dist/Validators/Validator.d.ts.map +1 -1
  38. package/dist/Validators/Validator.js +37 -20
  39. package/dist/Validators/Validator.js.map +1 -1
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.js +80 -78
  42. package/dist/utils.cjs +1 -1
  43. package/dist/utils.cjs.map +1 -1
  44. package/dist/utils.d.ts +12 -0
  45. package/dist/utils.d.ts.map +1 -1
  46. package/dist/utils.js +64 -35
  47. package/dist/utils.js.map +1 -1
  48. package/package.json +1 -1
  49. package/src/Incentives/AllowListIncentive.test.ts +52 -4
  50. package/src/Incentives/AllowListIncentive.ts +28 -0
  51. package/src/Incentives/CGDAIncentive.test.ts +48 -3
  52. package/src/Incentives/CGDAIncentive.ts +34 -0
  53. package/src/Incentives/ERC20Incentive.test.ts +42 -0
  54. package/src/Incentives/ERC20Incentive.ts +28 -0
  55. package/src/Incentives/ERC20VariableIncentive.test.ts +74 -0
  56. package/src/Incentives/ERC20VariableIncentive.ts +41 -0
  57. package/src/Incentives/PointsIncentive.test.ts +47 -3
  58. package/src/Incentives/PointsIncentive.ts +28 -0
  59. package/src/Validators/SignerValidator.ts +0 -1
  60. package/src/Validators/Validator.ts +24 -1
  61. package/src/utils.ts +46 -0
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../generated-D3DE5TfH.cjs"),r=require("viem"),o=require("../deployments--f75Pthq.cjs"),l=require("../Deployable/DeployableTarget.cjs"),t=require("../claiming.cjs"),u=require("../utils.cjs"),h="0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b99806101185f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db9190611407565b61065f565b6040516101ed919061144c565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061147d565b60405180910390f35b61023a600480360381019061023591906114c0565b6106e1565b005b61025660048036038101906102519190611545565b6106ee565b005b348015610263575f80fd5b5061027e60048036038101906102799190611545565b610704565b60405161028b919061144c565b60405180910390f35b34801561029f575f80fd5b506102a861071a565b6040516102b5919061147d565b60405180910390f35b6102c6610720565b005b3480156102d3575f80fd5b506102dc610771565b6040516102e99190611592565b60405180910390f35b3480156102fd575f80fd5b50610318600480360381019061031391906115ab565b610798565b604051610325919061147d565b60405180910390f35b348015610339575f80fd5b506103426107b1565b60405161034f91906115e5565b60405180910390f35b348015610363575f80fd5b5061037e6004803603810190610379919061165f565b6107d4565b005b34801561038b575f80fd5b506103a660048036038101906103a1919061165f565b61092c565b6040516103b49291906116aa565b60405180910390f35b6103d760048036038101906103d29190611545565b610960565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa919061165f565b610976565b60405161040c9190611741565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611545565b6109cd565b604051610448919061144c565b60405180910390f35b6104596109e4565b005b610463610a1d565b005b348015610470575f80fd5b50610479610a30565b60405161048691906115e5565b60405180910390f35b34801561049a575f80fd5b506104a3610a58565b6040516104b091906115e5565b60405180910390f35b3480156104c4575f80fd5b506104cd610a7d565b6040516104da919061147d565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611761565b610a83565b604051610516919061144c565b60405180910390f35b34801561052a575f80fd5b50610545600480360381019061054091906115ab565b610e9b565b604051610552919061144c565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611761565b610eb8565b60405161058e919061144c565b60405180910390f35b3480156105a2575f80fd5b506105ab610ecb565b6040516105b8919061147d565b60405180910390f35b3480156105cc575f80fd5b506105d5610ed1565b6040516105e29190611592565b60405180910390f35b610605600480360381019061060091906115ab565b610ee3565b005b610621600480360381019061061c91906115ab565b610f21565b005b34801561062e575f80fd5b50610649600480360381019061064491906115ab565b610f4a565b604051610656919061147d565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f63565b5b9050919050565b5f600254905090565b6106eb3382610fdc565b50565b6106f6610feb565b6107008282611022565b5050565b5f818261071085610798565b1614905092915050565b60025481565b5f610729611032565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f6107dd61103c565b9050805460038255801561080f5760018160011c14303b106108065763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061082091906118af565b90505f8160400151148061083757505f8160600151145b1561086e576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160065f6101000a81548163ffffffff021916908360e01c0217905550806040015160028190555080606001516005819055506108f133611065565b508015610927576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610968610feb565b6109728282610fdc565b5050565b60605f67ffffffffffffffff811115610992576109916117c2565b5b6040519080825280601f01601f1916602001820160405280156109c45781602001600182028036833780820191505090505b50905092915050565b5f80826109d985610798565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a25610feb565b610a2e5f61113b565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b5f610a8c610feb565b5f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b3591906118ee565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bd85750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b9492919061195b565b602060405180830381865afa158015610baf573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bd391906119ac565b151514155b15610c0f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c1885611201565b610c4e576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015f815480929190610c6090611a04565b9190505550600160035f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900460e01b87600254604051602401610d17929190611a4b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d819190611aac565b5f604051808303815f865af19150503d805f8114610dba576040519150601f19603f3d011682016040523d82523d5f602084013e610dbf565b606091505b5050905080610dfa576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600254604051602001610e6a93929190611b27565b604051602081830303815290604052604051610e869190611741565b60405180910390a26001925050509392505050565b6003602052805f5260405f205f915054906101000a900460ff1681565b5f610ec284611201565b90509392505050565b60015481565b60065f9054906101000a900460e01b81565b610eeb610feb565b63389a75e1600c52805f526020600c208054421115610f1157636f5e88185f526004601cfd5b5f815550610f1e8161113b565b50565b610f29610feb565b8060601b610f3e57637448fbae5f526004601cfd5b610f478161113b565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fd55750610fd482611263565b5b9050919050565b610fe782825f6112dc565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611020576382b429005f526004601cfd5b565b61102e828260016112dc565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61106d611334565b156110e5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156110a757630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611138565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611143611334565b156111a8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111fe565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561125c5750600554600154105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112d557506112d482611338565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112fe57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113e6816113b2565b81146113f0575f80fd5b50565b5f81359050611401816113dd565b92915050565b5f6020828403121561141c5761141b6113aa565b5b5f611429848285016113f3565b91505092915050565b5f8115159050919050565b61144681611432565b82525050565b5f60208201905061145f5f83018461143d565b92915050565b5f819050919050565b61147781611465565b82525050565b5f6020820190506114905f83018461146e565b92915050565b61149f81611465565b81146114a9575f80fd5b50565b5f813590506114ba81611496565b92915050565b5f602082840312156114d5576114d46113aa565b5b5f6114e2848285016114ac565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611514826114eb565b9050919050565b6115248161150a565b811461152e575f80fd5b50565b5f8135905061153f8161151b565b92915050565b5f806040838503121561155b5761155a6113aa565b5b5f61156885828601611531565b9250506020611579858286016114ac565b9150509250929050565b61158c816113b2565b82525050565b5f6020820190506115a55f830184611583565b92915050565b5f602082840312156115c0576115bf6113aa565b5b5f6115cd84828501611531565b91505092915050565b6115df8161150a565b82525050565b5f6020820190506115f85f8301846115d6565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261161f5761161e6115fe565b5b8235905067ffffffffffffffff81111561163c5761163b611602565b5b60208301915083600182028301111561165857611657611606565b5b9250929050565b5f8060208385031215611675576116746113aa565b5b5f83013567ffffffffffffffff811115611692576116916113ae565b5b61169e8582860161160a565b92509250509250929050565b5f6040820190506116bd5f83018561146e565b6116ca60208301846115d6565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611713826116d1565b61171d81856116db565b935061172d8185602086016116eb565b611736816116f9565b840191505092915050565b5f6020820190508181035f8301526117598184611709565b905092915050565b5f805f60408486031215611778576117776113aa565b5b5f61178586828701611531565b935050602084013567ffffffffffffffff8111156117a6576117a56113ae565b5b6117b28682870161160a565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117f8826116f9565b810181811067ffffffffffffffff82111715611817576118166117c2565b5b80604052505050565b5f6118296113a1565b905061183582826117ef565b919050565b5f6080828403121561184f5761184e6117be565b5b6118596080611820565b90505f61186884828501611531565b5f83015250602061187b848285016113f3565b602083015250604061188f848285016114ac565b60408301525060606118a3848285016114ac565b60608301525092915050565b5f608082840312156118c4576118c36113aa565b5b5f6118d18482850161183a565b91505092915050565b5f815190506118e88161151b565b92915050565b5f60208284031215611903576119026113aa565b5b5f611910848285016118da565b91505092915050565b5f819050919050565b5f819050919050565b5f61194561194061193b84611919565b611922565b611465565b9050919050565b6119558161192b565b82525050565b5f60408201905061196e5f8301856115d6565b61197b602083018461194c565b9392505050565b61198b81611432565b8114611995575f80fd5b50565b5f815190506119a681611982565b92915050565b5f602082840312156119c1576119c06113aa565b5b5f6119ce84828501611998565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0e82611465565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a4057611a3f6119d7565b5b600182019050919050565b5f604082019050611a5e5f8301856115d6565b611a6b602083018461146e565b9392505050565b5f81905092915050565b5f611a86826116d1565b611a908185611a72565b9350611aa08185602086016116eb565b80840191505092915050565b5f611ab78284611a7c565b915081905092915050565b5f8160601b9050919050565b5f611ad882611ac2565b9050919050565b5f611ae982611ace565b9050919050565b611b01611afc8261150a565b611adf565b82525050565b5f819050919050565b611b21611b1c82611465565b611b07565b82525050565b5f611b328286611af0565b601482019150611b428285611af0565b601482019150611b528284611b10565b60208201915081905094935050505056fea2646970667358221220e1ce7f1c57a6d62d7c8e566241c04213bed868c0967ce7c24b4cc5c5f5d63e4364736f6c634300081a0033",d=class d extends l.DeployableTarget{constructor(){super(...arguments),this.abi=b.T}async claims(f){return await b.vO(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await b.TO(this._config,{address:this.assertValidAddress(),args:[],...f})}async reward(f){return await b.CO(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,a){return await b.fO(this._config,{address:this.assertValidAddress(),args:[f],...a})}async venue(f){return await b.xO(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await b.gO(this._config,{address:this.assertValidAddress(),...f})}async selector(f){return await b.zO(this._config,{address:this.assertValidAddress(),...f})}async claim(f,a){return await this.awaitResult(this.claimRaw(f,a))}async claimRaw(f,a){const{request:e,result:c}=await b.jO(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...a});return{hash:await b.VO(this._config,e),result:c}}async isClaimable(f,a){return await b.hO(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...a})}buildParameters(f,a){const[e,c]=this.validateDeploymentConfig(f,a);return{abi:b.T,bytecode:h,args:[i(e)],...this.optionallyAttachAccount(c.account)}}buildClaimData(){return r.zeroHash}};d.bases={31337:void 0,...o.PointsIncentive},d.registryType=u.RegistryType.INCENTIVE;let s=d;const i=({venue:n,selector:f,reward:a,limit:e})=>r.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[n,f,a,e]);exports.pointsIncentiveAbi=b.T;exports.PointsIncentive=s;exports.preparePointsIncentivePayload=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-D3DE5TfH.cjs"),i=require("viem"),l=require("../deployments--f75Pthq.cjs"),o=require("../Deployable/DeployableTarget.cjs"),t=require("../claiming.cjs"),u=require("../utils.cjs"),h="0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b99806101185f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db9190611407565b61065f565b6040516101ed919061144c565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061147d565b60405180910390f35b61023a600480360381019061023591906114c0565b6106e1565b005b61025660048036038101906102519190611545565b6106ee565b005b348015610263575f80fd5b5061027e60048036038101906102799190611545565b610704565b60405161028b919061144c565b60405180910390f35b34801561029f575f80fd5b506102a861071a565b6040516102b5919061147d565b60405180910390f35b6102c6610720565b005b3480156102d3575f80fd5b506102dc610771565b6040516102e99190611592565b60405180910390f35b3480156102fd575f80fd5b50610318600480360381019061031391906115ab565b610798565b604051610325919061147d565b60405180910390f35b348015610339575f80fd5b506103426107b1565b60405161034f91906115e5565b60405180910390f35b348015610363575f80fd5b5061037e6004803603810190610379919061165f565b6107d4565b005b34801561038b575f80fd5b506103a660048036038101906103a1919061165f565b61092c565b6040516103b49291906116aa565b60405180910390f35b6103d760048036038101906103d29190611545565b610960565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa919061165f565b610976565b60405161040c9190611741565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611545565b6109cd565b604051610448919061144c565b60405180910390f35b6104596109e4565b005b610463610a1d565b005b348015610470575f80fd5b50610479610a30565b60405161048691906115e5565b60405180910390f35b34801561049a575f80fd5b506104a3610a58565b6040516104b091906115e5565b60405180910390f35b3480156104c4575f80fd5b506104cd610a7d565b6040516104da919061147d565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611761565b610a83565b604051610516919061144c565b60405180910390f35b34801561052a575f80fd5b50610545600480360381019061054091906115ab565b610e9b565b604051610552919061144c565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611761565b610eb8565b60405161058e919061144c565b60405180910390f35b3480156105a2575f80fd5b506105ab610ecb565b6040516105b8919061147d565b60405180910390f35b3480156105cc575f80fd5b506105d5610ed1565b6040516105e29190611592565b60405180910390f35b610605600480360381019061060091906115ab565b610ee3565b005b610621600480360381019061061c91906115ab565b610f21565b005b34801561062e575f80fd5b50610649600480360381019061064491906115ab565b610f4a565b604051610656919061147d565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f63565b5b9050919050565b5f600254905090565b6106eb3382610fdc565b50565b6106f6610feb565b6107008282611022565b5050565b5f818261071085610798565b1614905092915050565b60025481565b5f610729611032565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f6107dd61103c565b9050805460038255801561080f5760018160011c14303b106108065763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061082091906118af565b90505f8160400151148061083757505f8160600151145b1561086e576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160065f6101000a81548163ffffffff021916908360e01c0217905550806040015160028190555080606001516005819055506108f133611065565b508015610927576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610968610feb565b6109728282610fdc565b5050565b60605f67ffffffffffffffff811115610992576109916117c2565b5b6040519080825280601f01601f1916602001820160405280156109c45781602001600182028036833780820191505090505b50905092915050565b5f80826109d985610798565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a25610feb565b610a2e5f61113b565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b5f610a8c610feb565b5f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b3591906118ee565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bd85750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b9492919061195b565b602060405180830381865afa158015610baf573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bd391906119ac565b151514155b15610c0f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c1885611201565b610c4e576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015f815480929190610c6090611a04565b9190505550600160035f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900460e01b87600254604051602401610d17929190611a4b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d819190611aac565b5f604051808303815f865af19150503d805f8114610dba576040519150601f19603f3d011682016040523d82523d5f602084013e610dbf565b606091505b5050905080610dfa576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600254604051602001610e6a93929190611b27565b604051602081830303815290604052604051610e869190611741565b60405180910390a26001925050509392505050565b6003602052805f5260405f205f915054906101000a900460ff1681565b5f610ec284611201565b90509392505050565b60015481565b60065f9054906101000a900460e01b81565b610eeb610feb565b63389a75e1600c52805f526020600c208054421115610f1157636f5e88185f526004601cfd5b5f815550610f1e8161113b565b50565b610f29610feb565b8060601b610f3e57637448fbae5f526004601cfd5b610f478161113b565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fd55750610fd482611263565b5b9050919050565b610fe782825f6112dc565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611020576382b429005f526004601cfd5b565b61102e828260016112dc565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61106d611334565b156110e5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156110a757630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611138565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611143611334565b156111a8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111fe565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561125c5750600554600154105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112d557506112d482611338565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112fe57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113e6816113b2565b81146113f0575f80fd5b50565b5f81359050611401816113dd565b92915050565b5f6020828403121561141c5761141b6113aa565b5b5f611429848285016113f3565b91505092915050565b5f8115159050919050565b61144681611432565b82525050565b5f60208201905061145f5f83018461143d565b92915050565b5f819050919050565b61147781611465565b82525050565b5f6020820190506114905f83018461146e565b92915050565b61149f81611465565b81146114a9575f80fd5b50565b5f813590506114ba81611496565b92915050565b5f602082840312156114d5576114d46113aa565b5b5f6114e2848285016114ac565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611514826114eb565b9050919050565b6115248161150a565b811461152e575f80fd5b50565b5f8135905061153f8161151b565b92915050565b5f806040838503121561155b5761155a6113aa565b5b5f61156885828601611531565b9250506020611579858286016114ac565b9150509250929050565b61158c816113b2565b82525050565b5f6020820190506115a55f830184611583565b92915050565b5f602082840312156115c0576115bf6113aa565b5b5f6115cd84828501611531565b91505092915050565b6115df8161150a565b82525050565b5f6020820190506115f85f8301846115d6565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261161f5761161e6115fe565b5b8235905067ffffffffffffffff81111561163c5761163b611602565b5b60208301915083600182028301111561165857611657611606565b5b9250929050565b5f8060208385031215611675576116746113aa565b5b5f83013567ffffffffffffffff811115611692576116916113ae565b5b61169e8582860161160a565b92509250509250929050565b5f6040820190506116bd5f83018561146e565b6116ca60208301846115d6565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611713826116d1565b61171d81856116db565b935061172d8185602086016116eb565b611736816116f9565b840191505092915050565b5f6020820190508181035f8301526117598184611709565b905092915050565b5f805f60408486031215611778576117776113aa565b5b5f61178586828701611531565b935050602084013567ffffffffffffffff8111156117a6576117a56113ae565b5b6117b28682870161160a565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117f8826116f9565b810181811067ffffffffffffffff82111715611817576118166117c2565b5b80604052505050565b5f6118296113a1565b905061183582826117ef565b919050565b5f6080828403121561184f5761184e6117be565b5b6118596080611820565b90505f61186884828501611531565b5f83015250602061187b848285016113f3565b602083015250604061188f848285016114ac565b60408301525060606118a3848285016114ac565b60608301525092915050565b5f608082840312156118c4576118c36113aa565b5b5f6118d18482850161183a565b91505092915050565b5f815190506118e88161151b565b92915050565b5f60208284031215611903576119026113aa565b5b5f611910848285016118da565b91505092915050565b5f819050919050565b5f819050919050565b5f61194561194061193b84611919565b611922565b611465565b9050919050565b6119558161192b565b82525050565b5f60408201905061196e5f8301856115d6565b61197b602083018461194c565b9392505050565b61198b81611432565b8114611995575f80fd5b50565b5f815190506119a681611982565b92915050565b5f602082840312156119c1576119c06113aa565b5b5f6119ce84828501611998565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0e82611465565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a4057611a3f6119d7565b5b600182019050919050565b5f604082019050611a5e5f8301856115d6565b611a6b602083018461146e565b9392505050565b5f81905092915050565b5f611a86826116d1565b611a908185611a72565b9350611aa08185602086016116eb565b80840191505092915050565b5f611ab78284611a7c565b915081905092915050565b5f8160601b9050919050565b5f611ad882611ac2565b9050919050565b5f611ae982611ace565b9050919050565b611b01611afc8261150a565b611adf565b82525050565b5f819050919050565b611b21611b1c82611465565b611b07565b82525050565b5f611b328286611af0565b601482019150611b428285611af0565b601482019150611b528284611b10565b60208201915081905094935050505056fea2646970667358221220e1ce7f1c57a6d62d7c8e566241c04213bed868c0967ce7c24b4cc5c5f5d63e4364736f6c634300081a0033",d=class d extends o.DeployableTarget{constructor(){super(...arguments),this.abi=a.T}async claims(f){return await a.vO(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.TO(this._config,{address:this.assertValidAddress(),args:[],...f})}async reward(f){return await a.CO(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.fO(this._config,{address:this.assertValidAddress(),args:[f],...b})}async venue(f){return await a.xO(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.gO(this._config,{address:this.assertValidAddress(),...f})}async selector(f){return await a.zO(this._config,{address:this.assertValidAddress(),...f})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:c}=await a.jO(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.VO(this._config,e),result:c}}async isClaimable(f,b){return await a.hO(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...b})}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[b,e]=await Promise.all([this.claims(f),this.limit(f)]);return e-b}buildParameters(f,b){const[e,c]=this.validateDeploymentConfig(f,b);return{abi:a.T,bytecode:h,args:[r(e)],...this.optionallyAttachAccount(c.account)}}buildClaimData(){return i.zeroHash}};d.bases={31337:void 0,...l.PointsIncentive},d.registryType=u.RegistryType.INCENTIVE;let s=d;const r=({venue:n,selector:f,reward:b,limit:e})=>i.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[n,f,b,e]);exports.pointsIncentiveAbi=a.T;exports.PointsIncentive=s;exports.preparePointsIncentivePayload=r;
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 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: [prepareClaimPayload(payload)],\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 * @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 * 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","_payload","_options","options","bytecode","preparePointsIncentivePayload","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","limit","encodeAbiParameters"],"mappings":"wodAmGaA,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,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMG,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QAAQI,EAAkBJ,EAAqB,CACnD,OAAA,MAAMK,EAAAA,GAA2B,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMM,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EAEjC,GAAIN,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMO,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EAEjC,GAAIP,CAAA,CACL,CACH,CAUA,MAAa,SAASA,EAAqB,CAClC,OAAA,MAAMQ,EAAAA,GAA4B,KAAK,QAAS,CACrD,QAAS,KAAK,mBAAmB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AE,KAAM,UAAW,KAAM,OAAQ,CACnC,EACA,CAACJ,EAAOC,EAAUC,EAAQC,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 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: [prepareClaimPayload(payload)],\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 * 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","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","encodeAbiParameters"],"mappings":"wodAmGaA,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,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMG,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QAAQI,EAAkBJ,EAAqB,CACnD,OAAA,MAAMK,EAAAA,GAA2B,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMM,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EAEjC,GAAIN,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMO,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EAEjC,GAAIP,CAAA,CACL,CACH,CAUA,MAAa,SAASA,EAAqB,CAClC,OAAA,MAAMQ,EAAAA,GAA4B,KAAK,QAAS,CACrD,QAAS,KAAK,mBAAmB,EAEjC,GAAIR,CAAA,CACL,CACH,CAWA,MA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B,EAiRA,MAAMyB,EAAgC,CAAC,CAC5C,MAAAK,EACA,SAAAC,EACA,OAAAC,EACA,MAAAZ,CACF,IACSa,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,CAACH,EAAOC,EAAUC,EAAQZ,CAAK,CAAA"}
@@ -649,6 +649,24 @@ export declare class PointsIncentive extends DeployableTarget<PointsIncentivePay
649
649
  * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload
650
650
  */
651
651
  isClaimable(payload: ClaimPayload, params?: ReadParams): Promise<boolean>;
652
+ /**
653
+ * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
654
+ *
655
+ * @public
656
+ * @async
657
+ * @param {?ReadParams} [params]
658
+ * @returns {Promise<boolean>} - True if total claims is less than limit
659
+ */
660
+ canBeClaimed(params?: ReadParams): Promise<boolean>;
661
+ /**
662
+ * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
663
+ *
664
+ * @public
665
+ * @async
666
+ * @param {?ReadParams} [params]
667
+ * @returns {Promise<bigint>} - True if total claims is less than limit
668
+ */
669
+ getRemainingClaimPotential(params?: ReadParams): Promise<bigint>;
652
670
  /**
653
671
  * @inheritdoc
654
672
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PointsIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/PointsIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAWnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAGT,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAA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AE,MAAM,CAAC,EAAE,UAAU;IASnE;;;;;;;OAOG;IACU,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU;IAI7C;;;;;;;OAOG;IACU,0BAA0B,CAAC,MAAM,CAAC,EAAE,UAAU;IAQ3D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,sBAAsB,EACjC,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAa1B;;;;;;OAMG;IACI,cAAc;CAGtB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,wCAKvC,sBAAsB,kBAUxB,CAAC"}
@@ -1,10 +1,10 @@
1
- import { T as c, b1 as i, b2 as n, b3 as o, b4 as l, b5 as h, b6 as m, b7 as u, b8 as y, b9 as p, ba as g } from "../generated-CDEDSOGZ.js";
1
+ import { T as c, b1 as r, b2 as n, b3 as o, b4 as l, b5 as m, b6 as h, b7 as u, b8 as y, b9 as g, ba as p } from "../generated-CDEDSOGZ.js";
2
2
  import { zeroHash as w, encodeAbiParameters as A } from "viem";
3
3
  import { P as V } from "../deployments-BdPDIh-i.js";
4
4
  import { DeployableTarget as O } from "../Deployable/DeployableTarget.js";
5
5
  import { prepareClaimPayload as s } from "../claiming.js";
6
- import { RegistryType as _ } from "../utils.js";
7
- const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b99806101185f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db9190611407565b61065f565b6040516101ed919061144c565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061147d565b60405180910390f35b61023a600480360381019061023591906114c0565b6106e1565b005b61025660048036038101906102519190611545565b6106ee565b005b348015610263575f80fd5b5061027e60048036038101906102799190611545565b610704565b60405161028b919061144c565b60405180910390f35b34801561029f575f80fd5b506102a861071a565b6040516102b5919061147d565b60405180910390f35b6102c6610720565b005b3480156102d3575f80fd5b506102dc610771565b6040516102e99190611592565b60405180910390f35b3480156102fd575f80fd5b50610318600480360381019061031391906115ab565b610798565b604051610325919061147d565b60405180910390f35b348015610339575f80fd5b506103426107b1565b60405161034f91906115e5565b60405180910390f35b348015610363575f80fd5b5061037e6004803603810190610379919061165f565b6107d4565b005b34801561038b575f80fd5b506103a660048036038101906103a1919061165f565b61092c565b6040516103b49291906116aa565b60405180910390f35b6103d760048036038101906103d29190611545565b610960565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa919061165f565b610976565b60405161040c9190611741565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611545565b6109cd565b604051610448919061144c565b60405180910390f35b6104596109e4565b005b610463610a1d565b005b348015610470575f80fd5b50610479610a30565b60405161048691906115e5565b60405180910390f35b34801561049a575f80fd5b506104a3610a58565b6040516104b091906115e5565b60405180910390f35b3480156104c4575f80fd5b506104cd610a7d565b6040516104da919061147d565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611761565b610a83565b604051610516919061144c565b60405180910390f35b34801561052a575f80fd5b50610545600480360381019061054091906115ab565b610e9b565b604051610552919061144c565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611761565b610eb8565b60405161058e919061144c565b60405180910390f35b3480156105a2575f80fd5b506105ab610ecb565b6040516105b8919061147d565b60405180910390f35b3480156105cc575f80fd5b506105d5610ed1565b6040516105e29190611592565b60405180910390f35b610605600480360381019061060091906115ab565b610ee3565b005b610621600480360381019061061c91906115ab565b610f21565b005b34801561062e575f80fd5b50610649600480360381019061064491906115ab565b610f4a565b604051610656919061147d565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f63565b5b9050919050565b5f600254905090565b6106eb3382610fdc565b50565b6106f6610feb565b6107008282611022565b5050565b5f818261071085610798565b1614905092915050565b60025481565b5f610729611032565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f6107dd61103c565b9050805460038255801561080f5760018160011c14303b106108065763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061082091906118af565b90505f8160400151148061083757505f8160600151145b1561086e576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160065f6101000a81548163ffffffff021916908360e01c0217905550806040015160028190555080606001516005819055506108f133611065565b508015610927576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610968610feb565b6109728282610fdc565b5050565b60605f67ffffffffffffffff811115610992576109916117c2565b5b6040519080825280601f01601f1916602001820160405280156109c45781602001600182028036833780820191505090505b50905092915050565b5f80826109d985610798565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a25610feb565b610a2e5f61113b565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b5f610a8c610feb565b5f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b3591906118ee565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bd85750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b9492919061195b565b602060405180830381865afa158015610baf573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bd391906119ac565b151514155b15610c0f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c1885611201565b610c4e576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015f815480929190610c6090611a04565b9190505550600160035f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900460e01b87600254604051602401610d17929190611a4b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d819190611aac565b5f604051808303815f865af19150503d805f8114610dba576040519150601f19603f3d011682016040523d82523d5f602084013e610dbf565b606091505b5050905080610dfa576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600254604051602001610e6a93929190611b27565b604051602081830303815290604052604051610e869190611741565b60405180910390a26001925050509392505050565b6003602052805f5260405f205f915054906101000a900460ff1681565b5f610ec284611201565b90509392505050565b60015481565b60065f9054906101000a900460e01b81565b610eeb610feb565b63389a75e1600c52805f526020600c208054421115610f1157636f5e88185f526004601cfd5b5f815550610f1e8161113b565b50565b610f29610feb565b8060601b610f3e57637448fbae5f526004601cfd5b610f478161113b565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fd55750610fd482611263565b5b9050919050565b610fe782825f6112dc565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611020576382b429005f526004601cfd5b565b61102e828260016112dc565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61106d611334565b156110e5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156110a757630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611138565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611143611334565b156111a8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111fe565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561125c5750600554600154105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112d557506112d482611338565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112fe57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113e6816113b2565b81146113f0575f80fd5b50565b5f81359050611401816113dd565b92915050565b5f6020828403121561141c5761141b6113aa565b5b5f611429848285016113f3565b91505092915050565b5f8115159050919050565b61144681611432565b82525050565b5f60208201905061145f5f83018461143d565b92915050565b5f819050919050565b61147781611465565b82525050565b5f6020820190506114905f83018461146e565b92915050565b61149f81611465565b81146114a9575f80fd5b50565b5f813590506114ba81611496565b92915050565b5f602082840312156114d5576114d46113aa565b5b5f6114e2848285016114ac565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611514826114eb565b9050919050565b6115248161150a565b811461152e575f80fd5b50565b5f8135905061153f8161151b565b92915050565b5f806040838503121561155b5761155a6113aa565b5b5f61156885828601611531565b9250506020611579858286016114ac565b9150509250929050565b61158c816113b2565b82525050565b5f6020820190506115a55f830184611583565b92915050565b5f602082840312156115c0576115bf6113aa565b5b5f6115cd84828501611531565b91505092915050565b6115df8161150a565b82525050565b5f6020820190506115f85f8301846115d6565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261161f5761161e6115fe565b5b8235905067ffffffffffffffff81111561163c5761163b611602565b5b60208301915083600182028301111561165857611657611606565b5b9250929050565b5f8060208385031215611675576116746113aa565b5b5f83013567ffffffffffffffff811115611692576116916113ae565b5b61169e8582860161160a565b92509250509250929050565b5f6040820190506116bd5f83018561146e565b6116ca60208301846115d6565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611713826116d1565b61171d81856116db565b935061172d8185602086016116eb565b611736816116f9565b840191505092915050565b5f6020820190508181035f8301526117598184611709565b905092915050565b5f805f60408486031215611778576117776113aa565b5b5f61178586828701611531565b935050602084013567ffffffffffffffff8111156117a6576117a56113ae565b5b6117b28682870161160a565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117f8826116f9565b810181811067ffffffffffffffff82111715611817576118166117c2565b5b80604052505050565b5f6118296113a1565b905061183582826117ef565b919050565b5f6080828403121561184f5761184e6117be565b5b6118596080611820565b90505f61186884828501611531565b5f83015250602061187b848285016113f3565b602083015250604061188f848285016114ac565b60408301525060606118a3848285016114ac565b60608301525092915050565b5f608082840312156118c4576118c36113aa565b5b5f6118d18482850161183a565b91505092915050565b5f815190506118e88161151b565b92915050565b5f60208284031215611903576119026113aa565b5b5f611910848285016118da565b91505092915050565b5f819050919050565b5f819050919050565b5f61194561194061193b84611919565b611922565b611465565b9050919050565b6119558161192b565b82525050565b5f60408201905061196e5f8301856115d6565b61197b602083018461194c565b9392505050565b61198b81611432565b8114611995575f80fd5b50565b5f815190506119a681611982565b92915050565b5f602082840312156119c1576119c06113aa565b5b5f6119ce84828501611998565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0e82611465565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a4057611a3f6119d7565b5b600182019050919050565b5f604082019050611a5e5f8301856115d6565b611a6b602083018461146e565b9392505050565b5f81905092915050565b5f611a86826116d1565b611a908185611a72565b9350611aa08185602086016116eb565b80840191505092915050565b5f611ab78284611a7c565b915081905092915050565b5f8160601b9050919050565b5f611ad882611ac2565b9050919050565b5f611ae982611ace565b9050919050565b611b01611afc8261150a565b611adf565b82525050565b5f819050919050565b611b21611b1c82611465565b611b07565b82525050565b5f611b328286611af0565b601482019150611b428285611af0565b601482019150611b528284611b10565b60208201915081905094935050505056fea2646970667358221220e1ce7f1c57a6d62d7c8e566241c04213bed868c0967ce7c24b4cc5c5f5d63e4364736f6c634300081a0033", e = class e extends O {
6
+ import { RegistryType as C } from "../utils.js";
7
+ const _ = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b99806101185f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db9190611407565b61065f565b6040516101ed919061144c565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061147d565b60405180910390f35b61023a600480360381019061023591906114c0565b6106e1565b005b61025660048036038101906102519190611545565b6106ee565b005b348015610263575f80fd5b5061027e60048036038101906102799190611545565b610704565b60405161028b919061144c565b60405180910390f35b34801561029f575f80fd5b506102a861071a565b6040516102b5919061147d565b60405180910390f35b6102c6610720565b005b3480156102d3575f80fd5b506102dc610771565b6040516102e99190611592565b60405180910390f35b3480156102fd575f80fd5b50610318600480360381019061031391906115ab565b610798565b604051610325919061147d565b60405180910390f35b348015610339575f80fd5b506103426107b1565b60405161034f91906115e5565b60405180910390f35b348015610363575f80fd5b5061037e6004803603810190610379919061165f565b6107d4565b005b34801561038b575f80fd5b506103a660048036038101906103a1919061165f565b61092c565b6040516103b49291906116aa565b60405180910390f35b6103d760048036038101906103d29190611545565b610960565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa919061165f565b610976565b60405161040c9190611741565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611545565b6109cd565b604051610448919061144c565b60405180910390f35b6104596109e4565b005b610463610a1d565b005b348015610470575f80fd5b50610479610a30565b60405161048691906115e5565b60405180910390f35b34801561049a575f80fd5b506104a3610a58565b6040516104b091906115e5565b60405180910390f35b3480156104c4575f80fd5b506104cd610a7d565b6040516104da919061147d565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611761565b610a83565b604051610516919061144c565b60405180910390f35b34801561052a575f80fd5b50610545600480360381019061054091906115ab565b610e9b565b604051610552919061144c565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611761565b610eb8565b60405161058e919061144c565b60405180910390f35b3480156105a2575f80fd5b506105ab610ecb565b6040516105b8919061147d565b60405180910390f35b3480156105cc575f80fd5b506105d5610ed1565b6040516105e29190611592565b60405180910390f35b610605600480360381019061060091906115ab565b610ee3565b005b610621600480360381019061061c91906115ab565b610f21565b005b34801561062e575f80fd5b50610649600480360381019061064491906115ab565b610f4a565b604051610656919061147d565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f63565b5b9050919050565b5f600254905090565b6106eb3382610fdc565b50565b6106f6610feb565b6107008282611022565b5050565b5f818261071085610798565b1614905092915050565b60025481565b5f610729611032565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f6107dd61103c565b9050805460038255801561080f5760018160011c14303b106108065763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061082091906118af565b90505f8160400151148061083757505f8160600151145b1561086e576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160065f6101000a81548163ffffffff021916908360e01c0217905550806040015160028190555080606001516005819055506108f133611065565b508015610927576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610968610feb565b6109728282610fdc565b5050565b60605f67ffffffffffffffff811115610992576109916117c2565b5b6040519080825280601f01601f1916602001820160405280156109c45781602001600182028036833780820191505090505b50905092915050565b5f80826109d985610798565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a25610feb565b610a2e5f61113b565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b5f610a8c610feb565b5f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b3591906118ee565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bd85750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b9492919061195b565b602060405180830381865afa158015610baf573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bd391906119ac565b151514155b15610c0f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c1885611201565b610c4e576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015f815480929190610c6090611a04565b9190505550600160035f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900460e01b87600254604051602401610d17929190611a4b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d819190611aac565b5f604051808303815f865af19150503d805f8114610dba576040519150601f19603f3d011682016040523d82523d5f602084013e610dbf565b606091505b5050905080610dfa576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600254604051602001610e6a93929190611b27565b604051602081830303815290604052604051610e869190611741565b60405180910390a26001925050509392505050565b6003602052805f5260405f205f915054906101000a900460ff1681565b5f610ec284611201565b90509392505050565b60015481565b60065f9054906101000a900460e01b81565b610eeb610feb565b63389a75e1600c52805f526020600c208054421115610f1157636f5e88185f526004601cfd5b5f815550610f1e8161113b565b50565b610f29610feb565b8060601b610f3e57637448fbae5f526004601cfd5b610f478161113b565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fd55750610fd482611263565b5b9050919050565b610fe782825f6112dc565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611020576382b429005f526004601cfd5b565b61102e828260016112dc565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61106d611334565b156110e5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156110a757630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611138565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611143611334565b156111a8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111fe565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561125c5750600554600154105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112d557506112d482611338565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112fe57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113e6816113b2565b81146113f0575f80fd5b50565b5f81359050611401816113dd565b92915050565b5f6020828403121561141c5761141b6113aa565b5b5f611429848285016113f3565b91505092915050565b5f8115159050919050565b61144681611432565b82525050565b5f60208201905061145f5f83018461143d565b92915050565b5f819050919050565b61147781611465565b82525050565b5f6020820190506114905f83018461146e565b92915050565b61149f81611465565b81146114a9575f80fd5b50565b5f813590506114ba81611496565b92915050565b5f602082840312156114d5576114d46113aa565b5b5f6114e2848285016114ac565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611514826114eb565b9050919050565b6115248161150a565b811461152e575f80fd5b50565b5f8135905061153f8161151b565b92915050565b5f806040838503121561155b5761155a6113aa565b5b5f61156885828601611531565b9250506020611579858286016114ac565b9150509250929050565b61158c816113b2565b82525050565b5f6020820190506115a55f830184611583565b92915050565b5f602082840312156115c0576115bf6113aa565b5b5f6115cd84828501611531565b91505092915050565b6115df8161150a565b82525050565b5f6020820190506115f85f8301846115d6565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261161f5761161e6115fe565b5b8235905067ffffffffffffffff81111561163c5761163b611602565b5b60208301915083600182028301111561165857611657611606565b5b9250929050565b5f8060208385031215611675576116746113aa565b5b5f83013567ffffffffffffffff811115611692576116916113ae565b5b61169e8582860161160a565b92509250509250929050565b5f6040820190506116bd5f83018561146e565b6116ca60208301846115d6565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611713826116d1565b61171d81856116db565b935061172d8185602086016116eb565b611736816116f9565b840191505092915050565b5f6020820190508181035f8301526117598184611709565b905092915050565b5f805f60408486031215611778576117776113aa565b5b5f61178586828701611531565b935050602084013567ffffffffffffffff8111156117a6576117a56113ae565b5b6117b28682870161160a565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117f8826116f9565b810181811067ffffffffffffffff82111715611817576118166117c2565b5b80604052505050565b5f6118296113a1565b905061183582826117ef565b919050565b5f6080828403121561184f5761184e6117be565b5b6118596080611820565b90505f61186884828501611531565b5f83015250602061187b848285016113f3565b602083015250604061188f848285016114ac565b60408301525060606118a3848285016114ac565b60608301525092915050565b5f608082840312156118c4576118c36113aa565b5b5f6118d18482850161183a565b91505092915050565b5f815190506118e88161151b565b92915050565b5f60208284031215611903576119026113aa565b5b5f611910848285016118da565b91505092915050565b5f819050919050565b5f819050919050565b5f61194561194061193b84611919565b611922565b611465565b9050919050565b6119558161192b565b82525050565b5f60408201905061196e5f8301856115d6565b61197b602083018461194c565b9392505050565b61198b81611432565b8114611995575f80fd5b50565b5f815190506119a681611982565b92915050565b5f602082840312156119c1576119c06113aa565b5b5f6119ce84828501611998565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0e82611465565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a4057611a3f6119d7565b5b600182019050919050565b5f604082019050611a5e5f8301856115d6565b611a6b602083018461146e565b9392505050565b5f81905092915050565b5f611a86826116d1565b611a908185611a72565b9350611aa08185602086016116eb565b80840191505092915050565b5f611ab78284611a7c565b915081905092915050565b5f8160601b9050919050565b5f611ad882611ac2565b9050919050565b5f611ae982611ace565b9050919050565b611b01611afc8261150a565b611adf565b82525050565b5f819050919050565b611b21611b1c82611465565b611b07565b82525050565b5f611b328286611af0565b601482019150611b428285611af0565b601482019150611b528284611b10565b60208201915081905094935050505056fea2646970667358221220e1ce7f1c57a6d62d7c8e566241c04213bed868c0967ce7c24b4cc5c5f5d63e4364736f6c634300081a0033", e = class e extends O {
8
8
  constructor() {
9
9
  super(...arguments), this.abi = c;
10
10
  }
@@ -17,7 +17,7 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
17
17
  * @returns {Promise<bigint>}
18
18
  */
19
19
  async claims(f) {
20
- return await i(this._config, {
20
+ return await r(this._config, {
21
21
  address: this.assertValidAddress(),
22
22
  args: [],
23
23
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -82,7 +82,7 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
82
82
  * @returns {Promise<Address>}
83
83
  */
84
84
  async venue(f) {
85
- return await h(this._config, {
85
+ return await m(this._config, {
86
86
  address: this.assertValidAddress(),
87
87
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
88
88
  ...f
@@ -97,7 +97,7 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
97
97
  * @returns {Promise<bigint>}
98
98
  */
99
99
  async limit(f) {
100
- return await m(this._config, {
100
+ return await h(this._config, {
101
101
  address: this.assertValidAddress(),
102
102
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
103
103
  ...f
@@ -150,7 +150,7 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
150
150
  ...b
151
151
  }
152
152
  );
153
- return { hash: await p(this._config, a), result: d };
153
+ return { hash: await g(this._config, a), result: d };
154
154
  }
155
155
  /**
156
156
  * Check if an incentive is claimable.
@@ -164,13 +164,39 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
164
164
  * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload
165
165
  */
166
166
  async isClaimable(f, b) {
167
- return await g(this._config, {
167
+ return await p(this._config, {
168
168
  address: this.assertValidAddress(),
169
169
  args: [s(f)],
170
170
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
171
171
  ...b
172
172
  });
173
173
  }
174
+ /**
175
+ * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
176
+ *
177
+ * @public
178
+ * @async
179
+ * @param {?ReadParams} [params]
180
+ * @returns {Promise<boolean>} - True if total claims is less than limit
181
+ */
182
+ async canBeClaimed(f) {
183
+ return await this.getRemainingClaimPotential(f) > 0n;
184
+ }
185
+ /**
186
+ * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
187
+ *
188
+ * @public
189
+ * @async
190
+ * @param {?ReadParams} [params]
191
+ * @returns {Promise<bigint>} - True if total claims is less than limit
192
+ */
193
+ async getRemainingClaimPotential(f) {
194
+ const [b, a] = await Promise.all([
195
+ this.claims(f),
196
+ this.limit(f)
197
+ ]);
198
+ return a - b;
199
+ }
174
200
  /**
175
201
  * @inheritdoc
176
202
  *
@@ -186,8 +212,8 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
186
212
  );
187
213
  return {
188
214
  abi: c,
189
- bytecode: C,
190
- args: [T(a)],
215
+ bytecode: _,
216
+ args: [P(a)],
191
217
  ...this.optionallyAttachAccount(d.account)
192
218
  };
193
219
  }
@@ -205,10 +231,10 @@ const C = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
205
231
  e.bases = {
206
232
  31337: void 0,
207
233
  ...V
208
- }, e.registryType = _.INCENTIVE;
234
+ }, e.registryType = C.INCENTIVE;
209
235
  let t = e;
210
- const T = ({
211
- venue: r,
236
+ const P = ({
237
+ venue: i,
212
238
  selector: f,
213
239
  reward: b,
214
240
  limit: a
@@ -219,11 +245,11 @@ const T = ({
219
245
  { type: "uint256", name: "reward" },
220
246
  { type: "uint256", name: "limit" }
221
247
  ],
222
- [r, f, b, a]
248
+ [i, f, b, a]
223
249
  );
224
250
  export {
225
251
  t as PointsIncentive,
226
252
  c as pointsIncentiveAbi,
227
- T as preparePointsIncentivePayload
253
+ P as preparePointsIncentivePayload
228
254
  };
229
255
  //# sourceMappingURL=PointsIncentive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PointsIncentive.js","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 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: [prepareClaimPayload(payload)],\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 * @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 * 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","_payload","_options","options","bytecode","preparePointsIncentivePayload","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","limit","encodeAbiParameters"],"mappings":";;;;;;k3cAmGaA,IAAN,MAAMA,UAAwBC,EAGnC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,OAAOC,GAAqB;AAChC,WAAA,MAAMC,EAA0B,KAAK,SAAS;AAAA,MACnD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cAAcA,GAAqB;AACvC,WAAA,MAAME,EAAiC,KAAK,SAAS;AAAA,MAC1D,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,OAAOA,GAAqB;AAChC,WAAA,MAAMG,EAA0B,KAAK,SAAS;AAAA,MACnD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIH;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAa,QAAQI,GAAkBJ,GAAqB;AACnD,WAAA,MAAMK,EAA2B,KAAK,SAAS;AAAA,MACpD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACD,CAAO;AAAA;AAAA,MAEd,GAAIJ;A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ncentive.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 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: [prepareClaimPayload(payload)],\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 * 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","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","encodeAbiParameters"],"mappings":";;;;;;k3c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C,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,IAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,EACnC;AAAA,EACA,CAACH,GAAOC,GAAUC,GAAQZ,CAAK;AAAA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SignerValidator.cjs","sources":["../../src/Validators/SignerValidator.ts"],"sourcesContent":["import {\n readSignerValidatorHashSignerData,\n readSignerValidatorSigners,\n signerValidatorAbi,\n simulateSignerValidatorSetAuthorized,\n simulateSignerValidatorSetValidatorCaller,\n simulateSignerValidatorValidate,\n writeSignerValidatorSetAuthorized,\n writeSignerValidatorSetValidatorCaller,\n writeSignerValidatorValidate,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/validators/SignerValidator.sol/SignerValidator.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n type PrivateKeyAccount,\n encodeAbiParameters,\n} from 'viem';\nimport { signTypedData } from 'viem/accounts';\nimport { SignerValidator as SignerValidatorBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { signerValidatorAbi };\n\n/**\n * Object reprentation of a {@link SignerValidator} initialization payload\n *\n * @export\n * @interface SignerValidatorPayload\n * @typedef {SignerValidatorPayload}\n */\nexport interface SignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface SignerValidatorValidatePayload\n * @typedef {SignerValidatorValidatePayload}\n */\nexport interface SignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Object reprentation of a {@link SignerValidator} initialization payload\n *\n * @export\n * @interface SignerValidatorPayload\n * @typedef {SignerValidatorPayload}\n */\nexport interface SignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface SignerValidatorValidatePayload\n * @typedef {SignerValidatorValidatePayload}\n */\nexport interface SignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Signer Validator Claim Data Payload\n *\n * @export\n * @interface SignerValidatorClaimDataParams\n * @typedef {SignerValidatorClaimDataParams}\n */\nexport interface SignerValidatorClaimDataParams {\n /**\n * The signer with which to sign the input\n *\n * @type {{\n * account: Address;\n * key: Hex;\n * privateKey: PrivateKeyAccount;\n * }}\n */\n signer: {\n account: Address;\n key: Hex;\n privateKey: PrivateKeyAccount;\n };\n /**\n * The encoded data to provide the underlying incentive. You can use {@link prepareAllowListIncentivePayload}, {@link prepareCGDAIncentivePayload}, {@link prepareERC20IncentivePayload}, {@link prepareERC1155IncentivePayload}, or {@link preparePointsIncentivePayload}\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n /**\n * The chain id to target\n *\n * @type {number}\n */\n chainId: number;\n /**\n * The address of the validator\n *\n * @type {Address}\n */\n validator: Address;\n /**\n * The total number of incentives on the Boost\n *\n * @type {number}\n */\n incentiveQuantity: number;\n /**\n * The address of the claimant\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The ID of the boost\n *\n * @type {bigint}\n */\n boostId: bigint;\n}\n\n/**\n * Object representation of a {@link SignerValidatorInputParams} initialization payload\n *\n * @export\n * @interface SignerValidatorInputParams\n * @typedef {SignerValidatorInputParams}\n */\nexport interface SignerValidatorInputParams {\n /**\n * The signer address.\n *\n * @type {Address}\n */\n signer: Address;\n\n /**\n * The signature data.\n *\n * @type {string}\n */\n signature: Hex;\n\n /**\n * The total number of incentives on the Boost\n *\n * @type {number}\n */\n incentiveQuantity: number;\n}\n\n/**\n * Object representing the payload for signing before validaton.\n *\n * @export\n * @interface SignerValidatorSignaturePayload\n * @typedef {SignerValidatorSignaturePayload}\n */\nexport interface SignerValidatorSignaturePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {number}\n */\n incentiveQuantity: number;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n}\n\n/**\n * A generic `viem.Log` event with support for `BoostCore` event types.\n *\n * @export\n * @typedef {SignerValidatorLog}\n * @template {ContractEventName<\n * typeof signerValidatorAbi\n * >} [event=ContractEventName<typeof signerValidatorAbi>]\n */\nexport type SignerValidatorLog<\n event extends ContractEventName<\n typeof signerValidatorAbi\n > = ContractEventName<typeof signerValidatorAbi>,\n> = GenericLog<typeof signerValidatorAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class SignerValidator\n * @typedef {SignerValidator}\n * @extends {DeployableTarget<SignerValidatorPayload>}\n */\nexport class SignerValidator extends DeployableTarget<\n SignerValidatorPayload,\n typeof signerValidatorAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = signerValidatorAbi;\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_SIGNER_VALIDATOR_BASE,\n ...(SignerValidatorBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.VALIDATOR;\n\n /**\n * The set of authorized signers\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async signers(address: Address, params?: ReadParams) {\n return await readSignerValidatorSigners(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 * Retrieve the hash and signer data for a given hash\n *\n * @public\n * @async\n * @param {SignerValidatorSignaturePayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async hashSignerData(\n payload: SignerValidatorSignaturePayload,\n params?: ReadParams,\n ) {\n return await readSignerValidatorHashSignerData(this._config, {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveQuantity,\n payload.claimant,\n payload.incentiveData,\n ],\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 * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validate(\n payload: SignerValidatorValidatePayload,\n params?: WriteParams,\n ) {\n return await this.awaitResult(this.validateRaw(payload, params));\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validateRaw(\n payload: SignerValidatorValidatePayload,\n params?: ReadParams,\n ) {\n const { request, result } = await simulateSignerValidatorValidate(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveId,\n payload.claimant,\n payload.claimData,\n ],\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 writeSignerValidatorValidate(this._config, request);\n return { hash, result };\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setAuthorized(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setAuthorizedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setAuthorizedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n const { request, result } = await simulateSignerValidatorSetAuthorized(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\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 writeSignerValidatorSetAuthorized(this._config, request);\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setValidatorCallerRaw(address: Address, params?: WriteParams) {\n const { request, result } = await simulateSignerValidatorSetValidatorCaller(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address],\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 writeSignerValidatorSetValidatorCaller(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setValidatorCaller(address: Address, params?: WriteParams) {\n return await this.awaitResult(this.setValidatorCallerRaw(address, params));\n }\n\n /**\n * Properly encodes the data needed to claim\n *\n * @public\n * @async\n * @param {SignerValidatorClaimDataParams} params\n * @returns {Promise<Hex>}\n */\n public async encodeClaimData(\n params: Omit<SignerValidatorClaimDataParams, 'validator'>,\n ): Promise<Hex> {\n return await prepareSignerValidatorClaimDataPayload({\n ...params,\n validator: this.assertValidAddress(),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SignerValidatorPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SignerValidatorPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: signerValidatorAbi,\n bytecode: bytecode as Hex,\n args: [prepareSignerValidatorPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Signer Validator Claim Data Payload Preparation\n *\n * @export\n * @async\n * @param {SignerValidatorClaimDataParams} param0\n * @param {{ account: Address; key: Hex; privateKey: PrivateKeyAccount; }} param0.signer\n * @param {Hex} param0.incentiveData\n * @param {number} param0.chainId\n * @param {Address} param0.validator\n * @param {number} param0.incentiveQuantity\n * @param {Address} param0.claimant\n * @param {bigint} param0.boostId\n * @returns {Promise<Hex>}\n */\nexport async function prepareSignerValidatorClaimDataPayload({\n signer,\n incentiveData,\n chainId,\n validator,\n incentiveQuantity,\n claimant,\n boostId,\n}: SignerValidatorClaimDataParams): Promise<Hex> {\n const trustedSignature = await signer.privateKey.signTypedData({\n domain: {\n name: 'SignerValidator',\n version: '1',\n chainId: chainId,\n verifyingContract: validator,\n },\n types: {\n SignerValidatorData: [\n { name: 'boostId', type: 'uint256' },\n { name: 'incentiveQuantity', type: 'uint8' },\n { name: 'claimant', type: 'address' },\n { name: 'incentiveData', type: 'bytes' },\n ],\n },\n primaryType: 'SignerValidatorData' as const,\n message: {\n boostId,\n incentiveQuantity,\n claimant,\n incentiveData: incentiveData,\n },\n });\n\n // Prepare the claim data payload using the new helper\n const validatorData = prepareSignerValidatorInputParams({\n signer: signer.account,\n signature: trustedSignature,\n incentiveQuantity, // Adjust incentive quantity as necessary\n });\n\n const boostClaimDataPayload = encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n [{ validatorData, incentiveData }],\n );\n\n return boostClaimDataPayload;\n}\n\n/**\n * Given a {@link SignerValidatorInputParams}, properly encode the initialization payload.\n *\n * @param {SignerValidatorInputParams} param0\n * @param {Address} param0.signer\n * @param {Hex} param0.signature\n * @param {number} param0.incentiveQuantity\n * @returns {Hex}\n */\nexport function prepareSignerValidatorInputParams({\n signer,\n signature,\n incentiveQuantity,\n}: SignerValidatorInputParams) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'SignerValidatorInputParams',\n components: [\n { type: 'address', name: 'signer' },\n { type: 'bytes', name: 'signature' },\n { type: 'uint8', name: 'incentiveQuantity' },\n ],\n },\n ],\n [{ signer, signature, incentiveQuantity }],\n );\n}\n\n/**\n * Given a {@link SignerValidatorPayload}, properly encode the initialization payload.\n *\n * @param {SignerValidatorPayload} param0\n * @param {Address[]} param0.signers\n * @param {Address} param0.validatorCaller\n * @returns {Hex}\n */\nexport function prepareSignerValidatorPayload({\n signers,\n validatorCaller,\n}: SignerValidatorPayload) {\n return encodeAbiParameters(\n [\n { type: 'address[]', name: 'signers' },\n { type: 'address', name: 'validatorCaller' },\n ],\n [signers, validatorCaller],\n );\n}\n"],"names":["_SignerValidator","DeployableTarget","signerValidatorAbi","address","params","readSignerValidatorSigners","payload","readSignerValidatorHashSignerData","request","result","simulateSignerValidatorValidate","writeSignerValidatorValidate","addresses","allowed","simulateSignerValidatorSetAuthorized","writeSignerValidatorSetAuthorized","simulateSignerValidatorSetValidatorCaller","writeSignerValidatorSetValidatorCaller","prepareSignerValidatorClaimDataPayload","_payload","_options","options","bytecode","prepareSignerValidatorPayload","SignerValidatorBases","RegistryType","SignerValidator","signer","incentiveData","chainId","validator","incentiveQuantity","claimant","boostId","trustedSignature","validatorData","prepareSignerValidatorInputParams","encodeAbiParameters","signature","signers","validatorCaller"],"mappings":"27hBAoSaA,EAAN,MAAMA,UAAwBC,EAAAA,gBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAWL,KAAyB,IAAMC,GAAA,CA8B/B,MAAa,QAAQC,EAAkBC,EAAqB,CACnD,OAAA,MAAMC,EAAAA,GAA2B,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACF,CAAO,EAEd,GAAIC,CAAA,CACL,CACH,CAWA,MAAa,eACXE,EACAF,EACA,CACO,OAAA,MAAMG,EAAAA,GAAkC,KAAK,QAAS,CAC3D,QAAS,KAAK,mBAAmB,EACjC,KAAM,CACJD,EAAQ,QACRA,EAAQ,kBACRA,EAAQ,SACRA,EAAQ,aACV,EAEA,GAAIF,CAAA,CACL,CACH,CAWA,MAAgB,SACdE,EACAF,EACA,CACA,OAAO,MAAM,KAAK,YAAY,KAAK,YAAYE,EAASF,CAAM,CAAC,CACjE,CA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,UAAAW,EACA,kBAAAP,CACF,EAA+B,CACtB,OAAAM,EAAA,oBACL,CACE,CACE,KAAM,QACN,KAAM,6BACN,WAAY,CACV,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,QAAS,KAAM,WAAY,EACnC,CAAE,KAAM,QAAS,KAAM,mBAAoB,CAC7C,CACF,CACF,EACA,CAAC,CAAE,OAAAV,EAAQ,UAAAW,EAAW,kBAAAP,EAAmB,CAAA,CAE7C,CAUO,SAASR,EAA8B,CAC5C,QAAAgB,EACA,gBAAAC,CACF,EAA2B,CAClB,OAAAH,EAAA,oBACL,CACE,CAAE,KAAM,YAAa,KAAM,SAAU,EACrC,CAAE,KAAM,UAAW,KAAM,iBAAkB,CAC7C,EACA,CAACE,EAASC,CAAe,CAAA,CAE7B"}
1
+ {"version":3,"file":"SignerValidator.cjs","sources":["../../src/Validators/SignerValidator.ts"],"sourcesContent":["import {\n readSignerValidatorHashSignerData,\n readSignerValidatorSigners,\n signerValidatorAbi,\n simulateSignerValidatorSetAuthorized,\n simulateSignerValidatorSetValidatorCaller,\n simulateSignerValidatorValidate,\n writeSignerValidatorSetAuthorized,\n writeSignerValidatorSetValidatorCaller,\n writeSignerValidatorValidate,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/validators/SignerValidator.sol/SignerValidator.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n type PrivateKeyAccount,\n encodeAbiParameters,\n} from 'viem';\nimport { SignerValidator as SignerValidatorBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { signerValidatorAbi };\n\n/**\n * Object reprentation of a {@link SignerValidator} initialization payload\n *\n * @export\n * @interface SignerValidatorPayload\n * @typedef {SignerValidatorPayload}\n */\nexport interface SignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface SignerValidatorValidatePayload\n * @typedef {SignerValidatorValidatePayload}\n */\nexport interface SignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Object reprentation of a {@link SignerValidator} initialization payload\n *\n * @export\n * @interface SignerValidatorPayload\n * @typedef {SignerValidatorPayload}\n */\nexport interface SignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface SignerValidatorValidatePayload\n * @typedef {SignerValidatorValidatePayload}\n */\nexport interface SignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Signer Validator Claim Data Payload\n *\n * @export\n * @interface SignerValidatorClaimDataParams\n * @typedef {SignerValidatorClaimDataParams}\n */\nexport interface SignerValidatorClaimDataParams {\n /**\n * The signer with which to sign the input\n *\n * @type {{\n * account: Address;\n * key: Hex;\n * privateKey: PrivateKeyAccount;\n * }}\n */\n signer: {\n account: Address;\n key: Hex;\n privateKey: PrivateKeyAccount;\n };\n /**\n * The encoded data to provide the underlying incentive. You can use {@link prepareAllowListIncentivePayload}, {@link prepareCGDAIncentivePayload}, {@link prepareERC20IncentivePayload}, {@link prepareERC1155IncentivePayload}, or {@link preparePointsIncentivePayload}\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n /**\n * The chain id to target\n *\n * @type {number}\n */\n chainId: number;\n /**\n * The address of the validator\n *\n * @type {Address}\n */\n validator: Address;\n /**\n * The total number of incentives on the Boost\n *\n * @type {number}\n */\n incentiveQuantity: number;\n /**\n * The address of the claimant\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The ID of the boost\n *\n * @type {bigint}\n */\n boostId: bigint;\n}\n\n/**\n * Object representation of a {@link SignerValidatorInputParams} initialization payload\n *\n * @export\n * @interface SignerValidatorInputParams\n * @typedef {SignerValidatorInputParams}\n */\nexport interface SignerValidatorInputParams {\n /**\n * The signer address.\n *\n * @type {Address}\n */\n signer: Address;\n\n /**\n * The signature data.\n *\n * @type {string}\n */\n signature: Hex;\n\n /**\n * The total number of incentives on the Boost\n *\n * @type {number}\n */\n incentiveQuantity: number;\n}\n\n/**\n * Object representing the payload for signing before validaton.\n *\n * @export\n * @interface SignerValidatorSignaturePayload\n * @typedef {SignerValidatorSignaturePayload}\n */\nexport interface SignerValidatorSignaturePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {number}\n */\n incentiveQuantity: number;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n}\n\n/**\n * A generic `viem.Log` event with support for `BoostCore` event types.\n *\n * @export\n * @typedef {SignerValidatorLog}\n * @template {ContractEventName<\n * typeof signerValidatorAbi\n * >} [event=ContractEventName<typeof signerValidatorAbi>]\n */\nexport type SignerValidatorLog<\n event extends ContractEventName<\n typeof signerValidatorAbi\n > = ContractEventName<typeof signerValidatorAbi>,\n> = GenericLog<typeof signerValidatorAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class SignerValidator\n * @typedef {SignerValidator}\n * @extends {DeployableTarget<SignerValidatorPayload>}\n */\nexport class SignerValidator extends DeployableTarget<\n SignerValidatorPayload,\n typeof signerValidatorAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = signerValidatorAbi;\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_SIGNER_VALIDATOR_BASE,\n ...(SignerValidatorBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.VALIDATOR;\n\n /**\n * The set of authorized signers\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async signers(address: Address, params?: ReadParams) {\n return await readSignerValidatorSigners(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 * Retrieve the hash and signer data for a given hash\n *\n * @public\n * @async\n * @param {SignerValidatorSignaturePayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async hashSignerData(\n payload: SignerValidatorSignaturePayload,\n params?: ReadParams,\n ) {\n return await readSignerValidatorHashSignerData(this._config, {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveQuantity,\n payload.claimant,\n payload.incentiveData,\n ],\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 * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validate(\n payload: SignerValidatorValidatePayload,\n params?: WriteParams,\n ) {\n return await this.awaitResult(this.validateRaw(payload, params));\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validateRaw(\n payload: SignerValidatorValidatePayload,\n params?: ReadParams,\n ) {\n const { request, result } = await simulateSignerValidatorValidate(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveId,\n payload.claimant,\n payload.claimData,\n ],\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 writeSignerValidatorValidate(this._config, request);\n return { hash, result };\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setAuthorized(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setAuthorizedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setAuthorizedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n const { request, result } = await simulateSignerValidatorSetAuthorized(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\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 writeSignerValidatorSetAuthorized(this._config, request);\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setValidatorCallerRaw(address: Address, params?: WriteParams) {\n const { request, result } = await simulateSignerValidatorSetValidatorCaller(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address],\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 writeSignerValidatorSetValidatorCaller(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setValidatorCaller(address: Address, params?: WriteParams) {\n return await this.awaitResult(this.setValidatorCallerRaw(address, params));\n }\n\n /**\n * Properly encodes the data needed to claim\n *\n * @public\n * @async\n * @param {SignerValidatorClaimDataParams} params\n * @returns {Promise<Hex>}\n */\n public async encodeClaimData(\n params: Omit<SignerValidatorClaimDataParams, 'validator'>,\n ): Promise<Hex> {\n return await prepareSignerValidatorClaimDataPayload({\n ...params,\n validator: this.assertValidAddress(),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SignerValidatorPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SignerValidatorPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: signerValidatorAbi,\n bytecode: bytecode as Hex,\n args: [prepareSignerValidatorPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Signer Validator Claim Data Payload Preparation\n *\n * @export\n * @async\n * @param {SignerValidatorClaimDataParams} param0\n * @param {{ account: Address; key: Hex; privateKey: PrivateKeyAccount; }} param0.signer\n * @param {Hex} param0.incentiveData\n * @param {number} param0.chainId\n * @param {Address} param0.validator\n * @param {number} param0.incentiveQuantity\n * @param {Address} param0.claimant\n * @param {bigint} param0.boostId\n * @returns {Promise<Hex>}\n */\nexport async function prepareSignerValidatorClaimDataPayload({\n signer,\n incentiveData,\n chainId,\n validator,\n incentiveQuantity,\n claimant,\n boostId,\n}: SignerValidatorClaimDataParams): Promise<Hex> {\n const trustedSignature = await signer.privateKey.signTypedData({\n domain: {\n name: 'SignerValidator',\n version: '1',\n chainId: chainId,\n verifyingContract: validator,\n },\n types: {\n SignerValidatorData: [\n { name: 'boostId', type: 'uint256' },\n { name: 'incentiveQuantity', type: 'uint8' },\n { name: 'claimant', type: 'address' },\n { name: 'incentiveData', type: 'bytes' },\n ],\n },\n primaryType: 'SignerValidatorData' as const,\n message: {\n boostId,\n incentiveQuantity,\n claimant,\n incentiveData: incentiveData,\n },\n });\n\n // Prepare the claim data payload using the new helper\n const validatorData = prepareSignerValidatorInputParams({\n signer: signer.account,\n signature: trustedSignature,\n incentiveQuantity, // Adjust incentive quantity as necessary\n });\n\n const boostClaimDataPayload = encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n [{ validatorData, incentiveData }],\n );\n\n return boostClaimDataPayload;\n}\n\n/**\n * Given a {@link SignerValidatorInputParams}, properly encode the initialization payload.\n *\n * @param {SignerValidatorInputParams} param0\n * @param {Address} param0.signer\n * @param {Hex} param0.signature\n * @param {number} param0.incentiveQuantity\n * @returns {Hex}\n */\nexport function prepareSignerValidatorInputParams({\n signer,\n signature,\n incentiveQuantity,\n}: SignerValidatorInputParams) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'SignerValidatorInputParams',\n components: [\n { type: 'address', name: 'signer' },\n { type: 'bytes', name: 'signature' },\n { type: 'uint8', name: 'incentiveQuantity' },\n ],\n },\n ],\n [{ signer, signature, incentiveQuantity }],\n );\n}\n\n/**\n * Given a {@link SignerValidatorPayload}, properly encode the initialization payload.\n *\n * @param {SignerValidatorPayload} param0\n * @param {Address[]} param0.signers\n * @param {Address} param0.validatorCaller\n * @returns {Hex}\n */\nexport function prepareSignerValidatorPayload({\n signers,\n validatorCaller,\n}: SignerValidatorPayload) {\n return encodeAbiParameters(\n [\n { type: 'address[]', name: 'signers' },\n { type: 'address', name: 'validatorCaller' },\n ],\n [signers, validatorCaller],\n );\n}\n"],"names":["_SignerValidator","DeployableTarget","signerValidatorAbi","address","params","readSignerValidatorSigners","payload","readSignerValidatorHashSignerData","request","result","simulateSignerValidatorValidate","writeSignerValidatorValidate","addresses","allowed","simulateSignerValidatorSetAuthorized","writeSignerValidatorSetAuthorized","simulateSignerValidatorSetValidatorCaller","writeSignerValidatorSetValidatorCaller","prepareSignerValidatorClaimDataPayload","_payload","_options","options","bytecode","prepareSignerValidatorPayload","SignerValidatorBases","RegistryType","SignerValidator","signer","incentiveData","chainId","validator","incentiveQuantity","claimant","boostId","trustedSignature","validatorData","prepareSignerValidatorInputParams","encodeAbiParameters","signature","signers","validatorCaller"],"mappings":"27hBAmSaA,EAAN,MAAMA,UAAwBC,EAAAA,gBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAWL,KAAyB,IAAMC,GAAA,CA8B/B,MAAa,QAAQC,EAAkBC,EAAqB,CACnD,OAAA,MAAMC,EAAAA,GAA2B,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACF,CAAO,EAEd,GA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AAgBC,EAAkC,CACtD,OAAQT,EAAO,QACf,UAAWO,EACX,kBAAAH,CAAA,CACD,EAgBM,OAduBM,EAAA,oBAC5B,CACE,CACE,KAAM,QACN,KAAM,iBACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,eAAgB,EACvC,CAAE,KAAM,QAAS,KAAM,eAAgB,CACzC,CACF,CACF,EACA,CAAC,CAAE,cAAAF,EAAe,cAAAP,EAAe,CAAA,CAIrC,CAWO,SAASQ,EAAkC,CAChD,OAAAT,EACA,UAAAW,EACA,kBAAAP,CACF,EAA+B,CACtB,OAAAM,EAAA,oBACL,CACE,CACE,KAAM,QACN,KAAM,6BACN,WAAY,CACV,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,QAAS,KAAM,WAAY,EACnC,CAAE,KAAM,QAAS,KAAM,mBAAoB,CAC7C,CACF,CACF,EACA,CAAC,CAAE,OAAAV,EAAQ,UAAAW,EAAW,kBAAAP,EAAmB,CAAA,CAE7C,CAUO,SAASR,EAA8B,CAC5C,QAAAgB,EACA,gBAAAC,CACF,EAA2B,CAClB,OAAAH,EAAA,oBACL,CACE,CAAE,KAAM,YAAa,KAAM,SAAU,EACrC,CAAE,KAAM,UAAW,KAAM,iBAAkB,CAC7C,EACA,CAACE,EAASC,CAAe,CAAA,CAE7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"SignerValidator.d.ts","sourceRoot":"","sources":["../../src/Validators/SignerValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAOnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EACR,KAAK,iBAAiB,EAEvB,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACL,KAAK,U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EAC3D,MAAM,EACN,aAAa,EACb,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,OAAO,GACR,EAAE,8BAA8B,GAAG,OAAO,CAAC,GAAG,CAAC,CA+C/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,EAChD,MAAM,EACN,SAAS,EACT,iBAAiB,GAClB,EAAE,0BAA0B,iBAe5B;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,EACP,eAAe,GAChB,EAAE,sBAAsB,iBAQxB"}
1
+ {"version":3,"file":"SignerValidator.d.ts","sourceRoot":"","sources":["../../src/Validators/SignerValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAOnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EACR,KAAK,iBAAiB,EAEvB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,SAAS,EAAE,GAAG,CAAC;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