@boostxyz/sdk 0.0.0-alpha.5 → 0.0.0-alpha.7

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 (165) hide show
  1. package/dist/Actions/Action.cjs +1 -0
  2. package/dist/Actions/Action.cjs.map +1 -0
  3. package/dist/Actions/Action.js +1 -0
  4. package/dist/Actions/Action.js.map +1 -0
  5. package/dist/Actions/EventAction.cjs +2 -1
  6. package/dist/Actions/EventAction.cjs.map +1 -0
  7. package/dist/Actions/EventAction.d.ts.map +1 -1
  8. package/dist/Actions/EventAction.js +39 -40
  9. package/dist/Actions/EventAction.js.map +1 -0
  10. package/dist/AllowLists/AllowList.cjs +1 -0
  11. package/dist/AllowLists/AllowList.cjs.map +1 -0
  12. package/dist/AllowLists/AllowList.js +1 -0
  13. package/dist/AllowLists/AllowList.js.map +1 -0
  14. package/dist/AllowLists/SimpleAllowList.cjs +1 -0
  15. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
  16. package/dist/AllowLists/SimpleAllowList.js +1 -0
  17. package/dist/AllowLists/SimpleAllowList.js.map +1 -0
  18. package/dist/AllowLists/SimpleDenyList.cjs +1 -0
  19. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
  20. package/dist/AllowLists/SimpleDenyList.js +1 -0
  21. package/dist/AllowLists/SimpleDenyList.js.map +1 -0
  22. package/dist/Auth/Auth.cjs +1 -0
  23. package/dist/Auth/Auth.cjs.map +1 -0
  24. package/dist/Auth/Auth.js +1 -0
  25. package/dist/Auth/Auth.js.map +1 -0
  26. package/dist/Auth/PassthroughAuth.cjs +1 -0
  27. package/dist/Auth/PassthroughAuth.cjs.map +1 -0
  28. package/dist/Auth/PassthroughAuth.js +1 -0
  29. package/dist/Auth/PassthroughAuth.js.map +1 -0
  30. package/dist/Boost.cjs +1 -0
  31. package/dist/Boost.cjs.map +1 -0
  32. package/dist/Boost.js +1 -0
  33. package/dist/Boost.js.map +1 -0
  34. package/dist/BoostCore.cjs +1 -0
  35. package/dist/BoostCore.cjs.map +1 -0
  36. package/dist/BoostCore.js +1 -0
  37. package/dist/BoostCore.js.map +1 -0
  38. package/dist/BoostRegistry.cjs +1 -0
  39. package/dist/BoostRegistry.cjs.map +1 -0
  40. package/dist/BoostRegistry.js +1 -0
  41. package/dist/BoostRegistry.js.map +1 -0
  42. package/dist/Budgets/Budget.cjs +1 -0
  43. package/dist/Budgets/Budget.cjs.map +1 -0
  44. package/dist/Budgets/Budget.js +1 -0
  45. package/dist/Budgets/Budget.js.map +1 -0
  46. package/dist/Budgets/ManagedBudget.cjs +1 -0
  47. package/dist/Budgets/ManagedBudget.cjs.map +1 -0
  48. package/dist/Budgets/ManagedBudget.js +1 -0
  49. package/dist/Budgets/ManagedBudget.js.map +1 -0
  50. package/dist/Deployable/Contract.cjs +1 -0
  51. package/dist/Deployable/Contract.cjs.map +1 -0
  52. package/dist/Deployable/Contract.js +1 -0
  53. package/dist/Deployable/Contract.js.map +1 -0
  54. package/dist/Deployable/Deployable.cjs +1 -0
  55. package/dist/Deployable/Deployable.cjs.map +1 -0
  56. package/dist/Deployable/Deployable.js +1 -0
  57. package/dist/Deployable/Deployable.js.map +1 -0
  58. package/dist/Deployable/DeployableTarget.cjs +1 -0
  59. package/dist/Deployable/DeployableTarget.cjs.map +1 -0
  60. package/dist/Deployable/DeployableTarget.js +1 -0
  61. package/dist/Deployable/DeployableTarget.js.map +1 -0
  62. package/dist/Incentives/AllowListIncentive.cjs +1 -0
  63. package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
  64. package/dist/Incentives/AllowListIncentive.js +1 -0
  65. package/dist/Incentives/AllowListIncentive.js.map +1 -0
  66. package/dist/Incentives/CGDAIncentive.cjs +1 -0
  67. package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
  68. package/dist/Incentives/CGDAIncentive.js +1 -0
  69. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  70. package/dist/Incentives/ERC20Incentive.cjs +1 -0
  71. package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
  72. package/dist/Incentives/ERC20Incentive.js +1 -0
  73. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  74. package/dist/Incentives/Incentive.cjs +1 -0
  75. package/dist/Incentives/Incentive.cjs.map +1 -0
  76. package/dist/Incentives/Incentive.js +1 -0
  77. package/dist/Incentives/Incentive.js.map +1 -0
  78. package/dist/Incentives/PointsIncentive.cjs +1 -0
  79. package/dist/Incentives/PointsIncentive.cjs.map +1 -0
  80. package/dist/Incentives/PointsIncentive.js +1 -0
  81. package/dist/Incentives/PointsIncentive.js.map +1 -0
  82. package/dist/Validators/SignerValidator.cjs +1 -0
  83. package/dist/Validators/SignerValidator.cjs.map +1 -0
  84. package/dist/Validators/SignerValidator.js +1 -0
  85. package/dist/Validators/SignerValidator.js.map +1 -0
  86. package/dist/Validators/Validator.cjs +1 -0
  87. package/dist/Validators/Validator.cjs.map +1 -0
  88. package/dist/Validators/Validator.js +1 -0
  89. package/dist/Validators/Validator.js.map +1 -0
  90. package/dist/componentInterfaces-CKCBwG16.cjs +1 -0
  91. package/dist/componentInterfaces-CKCBwG16.cjs.map +1 -0
  92. package/dist/componentInterfaces-DYkaxBda.js +1 -0
  93. package/dist/componentInterfaces-DYkaxBda.js.map +1 -0
  94. package/dist/errors.cjs +1 -0
  95. package/dist/errors.cjs.map +1 -0
  96. package/dist/errors.js +1 -0
  97. package/dist/errors.js.map +1 -0
  98. package/dist/generated-Cd-Fe7W7.cjs +1 -0
  99. package/dist/generated-Cd-Fe7W7.cjs.map +1 -0
  100. package/dist/generated-DGpIVcv5.js +1 -0
  101. package/dist/generated-DGpIVcv5.js.map +1 -0
  102. package/dist/index.cjs +1 -0
  103. package/dist/index.cjs.map +1 -0
  104. package/dist/index.js +1 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/utils.cjs +1 -0
  107. package/dist/utils.cjs.map +1 -0
  108. package/dist/utils.js +1 -0
  109. package/dist/utils.js.map +1 -0
  110. package/package.json +3 -2
  111. package/src/Actions/Action.test.ts +77 -0
  112. package/src/Actions/Action.ts +61 -0
  113. package/src/Actions/ContractAction.test.ts +199 -0
  114. package/src/Actions/ContractAction.ts +238 -0
  115. package/src/Actions/ERC721MintAction.test.ts +112 -0
  116. package/src/Actions/ERC721MintAction.ts +238 -0
  117. package/src/Actions/EventAction.test.ts +182 -0
  118. package/src/Actions/EventAction.ts +380 -0
  119. package/src/AllowLists/AllowList.test.ts +64 -0
  120. package/src/AllowLists/AllowList.ts +60 -0
  121. package/src/AllowLists/SimpleAllowList.test.ts +52 -0
  122. package/src/AllowLists/SimpleAllowList.ts +240 -0
  123. package/src/AllowLists/SimpleDenyList.test.ts +52 -0
  124. package/src/AllowLists/SimpleDenyList.ts +289 -0
  125. package/src/Auth/Auth.ts +11 -0
  126. package/src/Auth/PassthroughAuth.test.ts +12 -0
  127. package/src/Auth/PassthroughAuth.ts +80 -0
  128. package/src/Boost.ts +155 -0
  129. package/src/BoostCore.test.ts +846 -0
  130. package/src/BoostCore.ts +1192 -0
  131. package/src/BoostRegistry.ts +449 -0
  132. package/src/Budgets/Budget.test.ts +27 -0
  133. package/src/Budgets/Budget.ts +61 -0
  134. package/src/Budgets/ManagedBudget.test.ts +154 -0
  135. package/src/Budgets/ManagedBudget.ts +743 -0
  136. package/src/Budgets/SimpleBudget.test.ts +152 -0
  137. package/src/Budgets/SimpleBudget.ts +521 -0
  138. package/src/Budgets/VestingBudget.test.ts +123 -0
  139. package/src/Budgets/VestingBudget.ts +532 -0
  140. package/src/Deployable/Contract.ts +229 -0
  141. package/src/Deployable/Deployable.ts +244 -0
  142. package/src/Deployable/DeployableTarget.ts +210 -0
  143. package/src/Incentives/AllowListIncentive.test.ts +146 -0
  144. package/src/Incentives/AllowListIncentive.ts +290 -0
  145. package/src/Incentives/CGDAIncentive.test.ts +136 -0
  146. package/src/Incentives/CGDAIncentive.ts +364 -0
  147. package/src/Incentives/ERC1155Incentive.test.ts +98 -0
  148. package/src/Incentives/ERC1155Incentive.ts +384 -0
  149. package/src/Incentives/ERC20Incentive.test.ts +141 -0
  150. package/src/Incentives/ERC20Incentive.ts +417 -0
  151. package/src/Incentives/ERC20VariableIncentive.test.ts +156 -0
  152. package/src/Incentives/ERC20VariableIncentive.ts +368 -0
  153. package/src/Incentives/Incentive.test.ts +92 -0
  154. package/src/Incentives/Incentive.ts +85 -0
  155. package/src/Incentives/PointsIncentive.test.ts +142 -0
  156. package/src/Incentives/PointsIncentive.ts +303 -0
  157. package/src/Validators/SignerValidator.test.ts +163 -0
  158. package/src/Validators/SignerValidator.ts +272 -0
  159. package/src/Validators/Validator.test.ts +21 -0
  160. package/src/Validators/Validator.ts +55 -0
  161. package/src/errors.ts +524 -0
  162. package/src/index.test.ts +40 -0
  163. package/src/index.ts +50 -0
  164. package/src/utils.test.ts +44 -0
  165. package/src/utils.ts +2247 -0
package/dist/index.cjs CHANGED
@@ -1 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./BoostRegistry.cjs"),i=require("./BoostCore.cjs"),y=require("./Boost.cjs"),r=require("./errors.cjs"),e=require("./utils.cjs"),u=require("./Auth/PassthroughAuth.cjs"),l=require("./Actions/Action.cjs"),A=require("./Actions/EventAction.cjs"),p=require("./AllowLists/AllowList.cjs"),d=require("./AllowLists/SimpleAllowList.cjs"),E=require("./AllowLists/SimpleDenyList.cjs"),s=require("./Budgets/Budget.cjs"),o=require("./Budgets/ManagedBudget.cjs"),g=require("./Deployable/Deployable.cjs"),C=require("./Deployable/Contract.cjs"),P=require("./Deployable/DeployableTarget.cjs"),v=require("./Incentives/AllowListIncentive.cjs"),m=require("./Incentives/CGDAIncentive.cjs"),I=require("./Incentives/ERC20Incentive.cjs"),t=require("./Incentives/Incentive.cjs"),S=require("./Incentives/PointsIncentive.cjs"),R=require("./Validators/SignerValidator.cjs"),c=require("./Validators/Validator.cjs"),a=require("./generated-Cd-Fe7W7.cjs");exports.BOOST_REGISTRY_ADDRESS=n.BOOST_REGISTRY_ADDRESS;exports.BoostRegistry=n.BoostRegistry;exports.BOOST_CORE_ADDRESS=i.BOOST_CORE_ADDRESS;exports.BoostCore=i.BoostCore;exports.Boost=y.Boost;exports.BoostCoreNoIdentifierEmitted=r.BoostCoreNoIdentifierEmitted;exports.BudgetMustAuthorizeBoostCore=r.BudgetMustAuthorizeBoostCore;exports.ContractAddressRequiredError=r.ContractAddressRequiredError;exports.DeployableAlreadyDeployedError=r.DeployableAlreadyDeployedError;exports.DeployableBuildParametersUnspecifiedError=r.DeployableBuildParametersUnspecifiedError;exports.DeployableMissingPayloadError=r.DeployableMissingPayloadError;exports.DeployableUnknownOwnerProvidedError=r.DeployableUnknownOwnerProvidedError;exports.DeployableWagmiConfigurationRequiredError=r.DeployableWagmiConfigurationRequiredError;exports.EventActionValidationError=r.EventActionValidationError;exports.FieldValueNotComparableError=r.FieldValueNotComparableError;exports.FieldValueUndefinedError=r.FieldValueUndefinedError;exports.IncentiveNotCloneableError=r.IncentiveNotCloneableError;exports.InvalidComponentInterfaceError=r.InvalidComponentInterfaceError;exports.InvalidNumericalCriteriaError=r.InvalidNumericalCriteriaError;exports.NoContractAddressUponReceiptError=r.NoContractAddressUponReceiptError;exports.NoEventActionStepsProvidedError=r.NoEventActionStepsProvidedError;exports.TooManyEventActionStepsProvidedError=r.TooManyEventActionStepsProvidedError;exports.UnknownTransferPayloadSupplied=r.UnknownTransferPayloadSupplied;exports.UnrecognizedFilterTypeError=r.UnrecognizedFilterTypeError;exports.AssetType=e.AssetType;exports.ERC1155StrategyType=e.ERC1155StrategyType;exports.FilterType=e.FilterType;exports.PrimitiveType=e.PrimitiveType;exports.RegistryType=e.RegistryType;exports.SignatureType=e.SignatureType;exports.StrategyType=e.StrategyType;exports.awaitResult=e.awaitResult;exports.bytes4=e.bytes4;exports.dedupeActionSteps=e.dedupeActionSteps;exports.getDeployedContractAddress=e.getDeployedContractAddress;exports.isEventActionPayloadSimple=e.isEventActionPayloadSimple;exports.prepareAllowListIncentivePayload=e.prepareAllowListIncentivePayload;exports.prepareBoostClaimData=e.prepareBoostClaimData;exports.prepareBoostPayload=e.prepareBoostPayload;exports.prepareCGDAIncentivePayload=e.prepareCGDAIncentivePayload;exports.prepareClaimPayload=e.prepareClaimPayload;exports.prepareContractActionPayload=e.prepareContractActionPayload;exports.prepareERC1155IncentivePayload=e.prepareERC1155IncentivePayload;exports.prepareERC1155Payload=e.prepareERC1155Payload;exports.prepareERC1155Transfer=e.prepareERC1155Transfer;exports.prepareERC20IncentivePayload=e.prepareERC20IncentivePayload;exports.prepareERC20VariableIncentivePayload=e.prepareERC20VariableIncentivePayload;exports.prepareERC721MintActionPayload=e.prepareERC721MintActionPayload;exports.prepareERC721MintActionValidate=e.prepareERC721MintActionValidate;exports.prepareEventActionPayload=e.prepareEventActionPayload;exports.prepareFungiblePayload=e.prepareFungiblePayload;exports.prepareFungibleTransfer=e.prepareFungibleTransfer;exports.prepareManagedBudgetPayload=e.prepareManagedBudgetPayload;exports.preparePointsIncentivePayload=e.preparePointsIncentivePayload;exports.prepareSignerValidatorClaimDataPayload=e.prepareSignerValidatorClaimDataPayload;exports.prepareSignerValidatorInputParams=e.prepareSignerValidatorInputParams;exports.prepareSignerValidatorPayload=e.prepareSignerValidatorPayload;exports.prepareSimpleAllowListPayload=e.prepareSimpleAllowListPayload;exports.prepareSimpleBudgetPayload=e.prepareSimpleBudgetPayload;exports.prepareSimpleDenyListPayload=e.prepareSimpleDenyListPayload;exports.prepareTransferPayload=e.prepareTransferPayload;exports.prepareVestingBudgetPayload=e.prepareVestingBudgetPayload;exports.PassthroughAuth=u.PassthroughAuth;exports.ActionByComponentInterface=l.ActionByComponentInterface;exports.actionFromAddress=l.actionFromAddress;exports.EventAction=A.EventAction;exports.AllowListByComponentInterface=p.AllowListByComponentInterface;exports.allowListFromAddress=p.allowListFromAddress;exports.LIST_MANAGER_ROLE=d.LIST_MANAGER_ROLE;exports.SimpleAllowList=d.SimpleAllowList;exports.SimpleDenyList=E.SimpleDenyList;exports.BudgetByComponentInterface=s.BudgetByComponentInterface;exports.budgetFromAddress=s.budgetFromAddress;exports.ManagedBudget=o.ManagedBudget;exports.ManagedBudgetRoles=o.ManagedBudgetRoles;exports.isERC1155TransferPayload=o.isERC1155TransferPayload;exports.isFungibleTransfer=o.isFungibleTransfer;exports.prepareTransfer=o.prepareTransfer;exports.Deployable=g.Deployable;exports.Contract=C.Contract;exports.DeployableTarget=P.DeployableTarget;exports.AllowListIncentive=v.AllowListIncentive;exports.CGDAIncentive=m.CGDAIncentive;exports.ERC20Incentive=I.ERC20Incentive;exports.ERC20VariableIncentive=t.ERC20VariableIncentive;exports.IncentiveByComponentInterface=t.IncentiveByComponentInterface;exports.incentiveFromAddress=t.incentiveFromAddress;exports.PointsIncentive=S.PointsIncentive;exports.SignerValidator=R.SignerValidator;exports.ValidatorByComponentInterface=c.ValidatorByComponentInterface;exports.validatorFromAddress=c.validatorFromAddress;exports.allowListIncentiveAbi=a.A;exports.boostCoreAbi=a.c;exports.boostRegistryAbi=a.ee;exports.cgdaIncentiveAbi=a.v;exports.erc20IncentiveAbi=a.f;exports.managedBudgetAbi=a.p;exports.passthroughAuthAbi=a.ze;exports.pointsIncentiveAbi=a.l;exports.signerValidatorAbi=a.M;exports.simpleAllowListAbi=a.T;exports.simpleDenyListAbi=a.S;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -126,3 +126,4 @@ export {
126
126
  Cr as simpleDenyListAbi,
127
127
  nr as validatorFromAddress
128
128
  };
129
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/utils.cjs CHANGED
@@ -1 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("@wagmi/core"),n=require("viem"),J=require("viem/accounts"),Y=require("./errors.cjs");var K=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},N={exports:{}};(function(e,a){(function(r,o){e.exports=o(r,1),a.LibZip=e.exports.LibZip,a.ERC1967Factory=e.exports.ERC1967Factory})(typeof window<"u"?window:K,function(r,o){var c={},b={};c.LibZip=b;function A(i){if((typeof i=="string"||i instanceof String)&&(i=i.match(/^[\s\uFEFF\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\s\uFEFF\xA0]*$/))){if(i[2].length%2)throw new Error("Hex string length must be a multiple of 2.");return i[2]}throw new Error("Data must be a hex string.")}function E(i){return(i|256).toString(16).slice(1)}function g(i,s){return parseInt(i.substr(s,2),16)}function w(i){for(var s=[],t=0;t<i.length;t+=2)s.push(g(i,t));return s}function T(i){for(var s="0x",t=0;t<i.length;s+=E(i[t++]));return s}b.flzCompress=function(i){var s=w(A(i)),t=s.length-4,d=[],p=[],y=0,u=2,l=0,m,h,R,C,B,f,I,F,S,x;function D(P){return s[P]|s[++P]<<8|s[++P]<<16}function L(P){return 2654435769*P>>19&8191}function V(P,O){for(;P>=32;)for(p[l++]=31,m=32;m--;P--)p[l++]=s[O++];if(P)for(p[l++]=P-1;P--;)p[l++]=s[O++]}for(;u<t-9;){do I=d[R=L(h=D(u))]||0,B=(C=(d[R]=u)-I)<8192?D(I):16777216;while(u<t-9&&u++&&h!=B);if(u>=t-9)break;for(--u>y&&V(u-y,y),f=0,F=I+3,S=u+3,x=t-S;f<x;f++)x*=s[F+f]===s[S+f];for(u+=f,--C;f>262;f-=262)p[l++]=224+(C>>8),p[l++]=253,p[l++]=C&255;f<7?(p[l++]=(f<<5)+(C>>8),p[l++]=C&255):(p[l++]=224+(C>>8),p[l++]=f-7,p[l++]=C&255),d[L(D(u))]=u++,d[L(D(u))]=u++,y=u}return V(t+4-y,y),T(p)},b.flzDecompress=function(i){for(var s=w(A(i)),t=0,d=0,p,y,u,l,m=[];t<s.length;)if(u=s[t]>>5)for(y=256*(s[t]&31)+s[t+2-(u=u<7)],p=u?2+(s[t]>>5):9+s[t+1],t=t+3-u,l=d-y-1;p--;)m[d++]=m[l++];else for(p=1+s[t++];p--;)m[d++]=s[t++];return T(m)},b.cdCompress=function(i){i=A(i);var s="0x",t=0,d=0,p=0,y;function u(m){s+=E((s.length<4*2+2)*255^m)}function l(m,h){u(0),u(h-1+m*128)}for(;p<i.length;p+=2){if(y=g(i,p),!y){d&&(l(1,d),d=0),++t===128&&(l(0,128),t=0);continue}if(y===255){t&&(l(0,t),t=0),++d===32&&(l(1,32),d=0);continue}d&&(l(1,d),d=0),t&&(l(0,t),t=0),u(y)}return d&&(l(1,d),d=0),t&&(l(0,t),t=0),s},b.cdDecompress=function(i){i=A(i);for(var s="0x",t=0,d,p,y;t<i.length;){if(p=(t<4*2)*255^g(i,t),t+=2,!p){for(p=(t<4*2)*255^g(i,t),y=(p&127)+1,t+=2,d=0;d<y;++d)s+=E((p>>7&&d<32)*255);continue}s+=E(p)}return s};var v={};return c.ERC1967Factory=v,v.address="0x0000000000006396FF2a80c067f99B3d2Ab4Df24",v.abi=JSON.parse('[{0:[],1:"DeploymentFailed"96"SaltDoesNotStartWithCaller"96"Unauthorized"96"UpgradeFailed",2:3959790,9791],1:"AdminChanged",2:10959790,9792,9791],1:"Deployed",2:10959790,9792],1:"Upgraded",2:10},{0:[{90],1:"adminOf",12:[{9199{0:[{90,{91],1:"changeAdmin",12:[],13:"nonpayable",2:15},{0:[{92,{91],1:"deploy",12:[{9098,{0:[{92,{91,{94],1:"deployAndCall",12:[{9098,{0:[{92,{91,{93],1:"deployDeterministic",12:[{9098,{0:[{92,{91,{93,{94],1:"deployDeterministicAndCall",12:[{9098,{0:[],1:"initCodeHash",12:[{6:19,1:"result",2:19}99{0:[{93],1:"predictDeterministicAddress",12:[{6:7,1:"predicted",2:7}99{0:[{90,{92],1:"upgrade",12:[98,{0:[{90,{92,{94],1:"upgradeAndCall",12:[98]'.replace(/9\d/g,function(i){return["6:7,1:8,2:7}","6:7,1:9,2:7}","6:7,1:11,2:7}","6:19,1:20,2:19}","6:17,1:18,2:17}","},{4:false,0:[",",2:3},{0:[],1:","{5:true,","],13:16,2:15}","],13:14,2:15},"][i-90]}).replace(/\d+/g,function(i){return'"'+"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt".split(",")[i]+'"'})),o||(r.solady=c),c})})(N,N.exports);var X=N.exports;function $(e){return n.slice(n.isHex(e)?n.keccak256(e):n.keccak256(n.toHex(e)),0,4)}async function ee(e,a,r){const o=await M.waitForTransactionReceipt(e,{...r,hash:await a});if(!o.contractAddress)throw new Y.NoContractAddressUponReceiptError(o);return o.contractAddress}async function ae(e,a,r){const{hash:o,result:c}=await a;return await M.waitForTransactionReceipt(e,{...r,hash:o}),c}var U=(e=>(e[e.ACTION=0]="ACTION",e[e.ALLOW_LIST=1]="ALLOW_LIST",e[e.BUDGET=2]="BUDGET",e[e.INCENTIVE=3]="INCENTIVE",e[e.VALIDATOR=4]="VALIDATOR",e))(U||{}),H=(e=>(e[e.POOL=0]="POOL",e[e.MINT=1]="MINT",e[e.RAFFLE=2]="RAFFLE",e))(H||{}),z=(e=>(e[e.POOL=0]="POOL",e[e.MINT=1]="MINT",e))(z||{}),G=(e=>(e[e.EQUAL=0]="EQUAL",e[e.NOT_EQUAL=1]="NOT_EQUAL",e[e.GREATER_THAN=2]="GREATER_THAN",e[e.LESS_THAN=3]="LESS_THAN",e[e.CONTAINS=4]="CONTAINS",e))(G||{}),k=(e=>(e[e.UINT=0]="UINT",e[e.ADDRESS=1]="ADDRESS",e[e.BYTES=2]="BYTES",e[e.STRING=3]="STRING",e))(k||{}),_=(e=>(e[e.EVENT=0]="EVENT",e[e.FUNC=1]="FUNC",e))(_||{});function te(e){return Array.isArray(e.actionSteps)}const ne=({actionClaimant:e,actionStepOne:a,actionStepTwo:r,actionStepThree:o,actionStepFour:c})=>n.encodeAbiParameters([{type:"tuple",name:"initPayload",components:[{type:"tuple",name:"actionClaimant",components:[{type:"uint8",name:"signatureType"},{type:"bytes4",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"}]},{type:"tuple",name:"actionStepOne",components:[{type:"bytes4",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]},{type:"tuple",name:"actionStepTwo",components:[{type:"bytes4",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]},{type:"tuple",name:"actionStepThree",components:[{type:"bytes4",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]},{type:"tuple",name:"actionStepFour",components:[{type:"bytes4",name:"signature"},{type:"uint8",name:"signatureType"},{type:"uint8",name:"actionType"},{type:"address",name:"targetContract"},{type:"tuple",name:"actionParameter",components:[{type:"uint8",name:"filterType"},{type:"uint8",name:"fieldType"},{type:"uint8",name:"fieldIndex"},{type:"bytes",name:"filterData"}]}]}]}],[{actionClaimant:e,actionStepOne:a,actionStepTwo:r,actionStepThree:o,actionStepFour:c}]),re=({signers:e,validatorCaller:a})=>n.encodeAbiParameters([{type:"address[]",name:"signers"},{type:"address",name:"validatorCaller"}],[e,a]),oe=({validatorData:e,incentiveData:a})=>n.encodeAbiParameters([{type:"bytes",name:"validatorData"},{type:"bytes",name:"incentiveData"}],[e,a]),q=({signer:e,signature:a,incentiveQuantity:r})=>n.encodeAbiParameters([{type:"tuple",name:"SignerValidatorInputParams",components:[{type:"address",name:"signer"},{type:"bytes",name:"signature"},{type:"uint8",name:"incentiveQuantity"}]}],[{signer:e,signature:a,incentiveQuantity:r}]);async function ie({signer:e,incentiveData:a,chainId:r,validator:o,incentiveQuantity:c,claimant:b,boostId:A}){const g={domain:{name:"SignerValidator",version:"1",chainId:r,verifyingContract:o},types:{SignerValidatorData:[{name:"boostId",type:"uint256"},{name:"incentiveQuantity",type:"uint8"},{name:"claimant",type:"address"},{name:"incentiveData",type:"bytes"}]},primaryType:"SignerValidatorData",message:{boostId:A,incentiveQuantity:c,claimant:b,incentiveData:a}},w=await J.signTypedData({...g,privateKey:e.key}),T=q({signer:e.account,signature:w,incentiveQuantity:c});return n.encodeAbiParameters([{type:"tuple",name:"BoostClaimData",components:[{type:"bytes",name:"validatorData"},{type:"bytes",name:"incentiveData"}]}],[{validatorData:T,incentiveData:a}])}const se=({owner:e,allowed:a})=>n.encodeAbiParameters([{type:"address",name:"owner"},{type:"address[]",name:"allowed"}],[e,a]),pe=({owner:e,denied:a})=>n.encodeAbiParameters([{type:"address",name:"owner"},{type:"address[]",name:"denied"}],[e,a]);function de({budget:e,action:a,validator:r,allowList:o,incentives:c,protocolFee:b=0n,referralFee:A=0n,maxParticipants:E=0n,owner:g}){return X.LibZip.cdCompress(n.encodeAbiParameters(n.parseAbiParameters(["BoostPayload payload","struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint64 referralFee; uint256 maxParticipants; address owner; }","struct Target { bool isBase; address instance; bytes parameters; }"]),[{budget:e,action:a,validator:r,allowList:o,incentives:c,protocolFee:b,referralFee:A,maxParticipants:E,owner:g}]))}function Q({tokenId:e,amount:a}){return n.encodeAbiParameters(n.parseAbiParameters(["ERC1155Payload payload","struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }"]),[{tokenId:e,amount:a,data:"0x"}])}const ue=({venue:e,selector:a,reward:r,limit:o})=>n.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[e,a,r,o]),le=({asset:e,initialReward:a,rewardDecay:r,rewardBoost:o,totalBudget:c})=>n.encodeAbiParameters([{type:"address",name:"asset"},{type:"uint256",name:"initialReward"},{type:"uint256",name:"rewardDecay"},{type:"uint256",name:"rewardBoost"},{type:"uint256",name:"totalBudget"}],[e,a,r,o,c]),ce=({asset:e,strategy:a,tokenId:r,limit:o,extraData:c})=>n.encodeAbiParameters(n.parseAbiParameters(["InitPayload payload","struct InitPayload { address asset; uint8 strategy; uint256 tokenId; uint256 limit; bytes extraData; }"]),[{asset:e,strategy:a,tokenId:r,limit:o,extraData:c}]),ye=({allowList:e,limit:a})=>n.encodeAbiParameters([{type:"address",name:"allowList"},{type:"uint256",name:"limit"}],[e,a]),me=({asset:e,strategy:a,reward:r,limit:o})=>n.encodeAbiParameters([{type:"address",name:"asset"},{type:"uint8",name:"strategy"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[e,a,r,o]),fe=({asset:e,reward:a,limit:r})=>n.encodeAbiParameters([{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[e,a,r]),Pe=({owner:e,authorized:a})=>n.encodeAbiParameters(n.parseAbiParameters(["SimpleBudgetPayload payload","struct SimpleBudgetPayload { address owner; address[] authorized; }"]),[{owner:e,authorized:a}]),be=({owner:e,authorized:a,roles:r})=>n.encodeAbiParameters(n.parseAbiParameters(["ManagedBudgetPayload payload","struct ManagedBudgetPayload { address owner; address[] authorized; uint256[] roles; }"]),[{owner:e,authorized:a,roles:r}]),Ae=({owner:e,authorized:a,start:r,duration:o,cliff:c})=>n.encodeAbiParameters(n.parseAbiParameters(["VestingBudgetPayload payload","struct VestingBudgetPayload { address owner; address[] authorized; uint64 start; uint64 duration; uint64 cliff; }"]),[{owner:e,authorized:a,start:r,duration:o,cliff:c}]),Z=({chainId:e,target:a,selector:r,value:o})=>n.encodeAbiParameters(n.parseAbiParameters(["ContractActionPayload payload","struct ContractActionPayload { uint256 chainId; address target; bytes4 selector; uint256 value; }"]),[{chainId:e,target:a,selector:r,value:o}]),ge=({chainId:e,target:a,selector:r,value:o})=>Z({chainId:e,target:a,selector:r,value:o}),Ce=({target:e,data:a=n.zeroHash})=>n.encodeAbiParameters([{type:"address",name:"target"},{type:"bytes",name:"data"}],[e,a]);var j=(e=>(e[e.ETH=0]="ETH",e[e.ERC20=1]="ERC20",e[e.ERC1155=2]="ERC1155",e))(j||{});const Ee=({assetType:e,address:a,target:r,data:o})=>n.encodeAbiParameters([{type:"uint8",name:"assetType"},{type:"address",name:"asset"},{type:"address",name:"target"},{type:"bytes",name:"data"}],[e,a,r,o]);function we({tokenId:e,amount:a,asset:r,target:o}){return n.encodeAbiParameters(n.parseAbiParameters(["Transfer request","struct Transfer { uint8 assetType; address asset; address target; bytes data; }"]),[{assetType:2,asset:r,data:Q({tokenId:e,amount:a}),target:o}])}function W({amount:e}){return n.encodeAbiParameters(n.parseAbiParameters(["FungiblePayload payload","struct FungiblePayload { uint256 amount; }"]),[{amount:e}])}function Te({amount:e,asset:a,target:r}){return n.encodeAbiParameters(n.parseAbiParameters(["Transfer request","struct Transfer { uint8 assetType; address asset; address target; bytes data; }"]),[{assetType:a==n.zeroAddress?0:1,asset:a,data:W({amount:e}),target:r}])}function ve(e,a){return n.encodeAbiParameters([{type:"address",name:"holder"},{type:"bytes",name:"payload"}],[e,n.toHex(a)])}function he(e){const a=[],r={};for(let o of e){const c=JSON.stringify(o);r[c]||(a.push(o),r[c]=!0)}return a}exports.AssetType=j;exports.ERC1155StrategyType=z;exports.FilterType=G;exports.PrimitiveType=k;exports.RegistryType=U;exports.SignatureType=_;exports.StrategyType=H;exports.awaitResult=ae;exports.bytes4=$;exports.dedupeActionSteps=he;exports.getDeployedContractAddress=ee;exports.isEventActionPayloadSimple=te;exports.prepareAllowListIncentivePayload=ye;exports.prepareBoostClaimData=oe;exports.prepareBoostPayload=de;exports.prepareCGDAIncentivePayload=le;exports.prepareClaimPayload=Ce;exports.prepareContractActionPayload=Z;exports.prepareERC1155IncentivePayload=ce;exports.prepareERC1155Payload=Q;exports.prepareERC1155Transfer=we;exports.prepareERC20IncentivePayload=me;exports.prepareERC20VariableIncentivePayload=fe;exports.prepareERC721MintActionPayload=ge;exports.prepareERC721MintActionValidate=ve;exports.prepareEventActionPayload=ne;exports.prepareFungiblePayload=W;exports.prepareFungibleTransfer=Te;exports.prepareManagedBudgetPayload=be;exports.preparePointsIncentivePayload=ue;exports.prepareSignerValidatorClaimDataPayload=ie;exports.prepareSignerValidatorInputParams=q;exports.prepareSignerValidatorPayload=re;exports.prepareSimpleAllowListPayload=se;exports.prepareSimpleBudgetPayload=Pe;exports.prepareSimpleDenyListPayload=pe;exports.prepareTransferPayload=Ee;exports.prepareVestingBudgetPayload=Ae;
2
+ //# sourceMappingURL=utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.cjs","sources":["../../../node_modules/.pnpm/solady@0.0.208/node_modules/solady/js/solady.js","../src/utils.ts"],"sourcesContent":["/**\n * Accompanying JavaScript library for Solady.\n *\n * To install:\n * \n * ```\n * npm install solady\n * ```\n *\n * Module exports:\n * \n * - `LibZip`\n * - `flzCompress(data)`: Compresses hex encoded data with FastLZ.\n * - `flzDecompress(data)`: Decompresses hex encoded data with FastLZ.\n * - `cdCompress(data)`: Compresses hex encoded calldata.\n * - `cdDecompress(data)`: Decompresses hex encoded calldata.\n * \n * - `ERC1967Factory`\n * - `address`: Canonical address of Solady's ERC1967Factory.\n * - `abi`: ABI of Solady's ERC1967Factory.\n *\n * @module solady\n */\n(function(global, factory) {\n\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = factory(global, 1);\n if (typeof exports === \"object\") {\n exports.LibZip = module.exports.LibZip;\n exports.ERC1967Factory = module.exports.ERC1967Factory;\n }\n } else {\n factory(global);\n }\n\n})(typeof window !== \"undefined\" ? window : this, function(window, noGlobal) {\n\n \"use strict\";\n\n var solady = {};\n\n /*============================================================*/\n /* LibZip Operations */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/LibZip.sol\n\n /**\n * FastLZ and calldata compression / decompression functions.\n * @namespace\n * @alias module:solady.LibZip\n */\n var LibZip = {};\n\n solady.LibZip = LibZip;\n\n function hexString(data) {\n if (typeof data === \"string\" || data instanceof String) {\n if (data = data.match(/^[\\s\\uFEFF\\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\\s\\uFEFF\\xA0]*$/)) {\n if (data[2].length % 2) {\n throw new Error(\"Hex string length must be a multiple of 2.\");\n }\n return data[2];\n }\n }\n throw new Error(\"Data must be a hex string.\");\n }\n\n function byteToString(b) {\n return (b | 0x100).toString(16).slice(1);\n }\n\n function parseByte(data, i) {\n return parseInt(data.substr(i, 2), 16);\n }\n\n function hexToBytes(data) {\n var a = [], i = 0;\n for (; i < data.length; i += 2) a.push(parseByte(data, i));\n return a;\n }\n\n function bytesToHex(a) {\n var o = \"0x\", i = 0;\n for (; i < a.length; o += byteToString(a[i++])) ;\n return o;\n }\n\n /**\n * Compresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.flzCompress = function(data) {\n var ib = hexToBytes(hexString(data)), b = ib.length - 4;\n var ht = [], ob = [], a = 0, i = 2, o = 0, j, s, h, d, c, l, r, p, q, e;\n\n function u24(i) {\n return ib[i] | (ib[++i] << 8) | (ib[++i] << 16);\n }\n\n function hash(x) {\n return ((2654435769 * x) >> 19) & 8191;\n }\n\n function literals(r, s) {\n while (r >= 32) for (ob[o++] = 31, j = 32; j--; r--) ob[o++] = ib[s++];\n if (r) for (ob[o++] = r - 1; r--; ) ob[o++] = ib[s++];\n }\n\n while (i < b - 9) {\n do {\n r = ht[h = hash(s = u24(i))] || 0;\n c = (d = (ht[h] = i) - r) < 8192 ? u24(r) : 0x1000000;\n } while (i < b - 9 && i++ && s != c);\n if (i >= b - 9) break;\n if (--i > a) literals(i - a, a);\n for (l = 0, p = r + 3, q = i + 3, e = b - q; l < e; l++) e *= ib[p + l] === ib[q + l];\n i += l;\n for (--d; l > 262; l -= 262) ob[o++] = 224 + (d >> 8), ob[o++] = 253, ob[o++] = d & 255;\n if (l < 7) ob[o++] = (l << 5) + (d >> 8), ob[o++] = d & 255;\n else ob[o++] = 224 + (d >> 8), ob[o++] = l - 7, ob[o++] = d & 255;\n ht[hash(u24(i))] = i++, ht[hash(u24(i))] = i++, a = i;\n }\n literals(b + 4 - a, a);\n return bytesToHex(ob);\n }\n\n /**\n * Decompresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.flzDecompress = function(data) {\n var ib = hexToBytes(hexString(data)), i = 0, o = 0, l, f, t, r, h, ob = [];\n while (i < ib.length) {\n if (!(t = ib[i] >> 5)) {\n for (l = 1 + ib[i++]; l--;) ob[o++] = ib[i++];\n } else {\n f = 256 * (ib[i] & 31) + ib[i + 2 - (t = t < 7)];\n l = t ? 2 + (ib[i] >> 5) : 9 + ib[i + 1];\n i = i + 3 - t;\n r = o - f - 1;\n while (l--) ob[o++] = ob[r++];\n }\n }\n return bytesToHex(ob);\n }\n\n /**\n * Compresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.cdCompress = function(data) {\n data = hexString(data);\n var o = \"0x\", z = 0, y = 0, i = 0, c;\n\n function pushByte(b) {\n o += byteToString(((o.length < 4 * 2 + 2) * 0xff) ^ b);\n }\n\n function rle(v, d) {\n pushByte(0x00);\n pushByte(d - 1 + v * 0x80);\n }\n\n for (; i < data.length; i += 2) {\n c = parseByte(data, i);\n if (!c) {\n if (y) rle(1, y), y = 0;\n if (++z === 0x80) rle(0, 0x80), z = 0;\n continue;\n }\n if (c === 0xff) {\n if (z) rle(0, z), z = 0;\n if (++y === 0x20) rle(1, 0x20), y = 0;\n continue;\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n pushByte(c);\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n return o;\n }\n\n /**\n * Decompresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.cdDecompress = function(data) {\n data = hexString(data);\n var o = \"0x\", i = 0, j, c, s;\n\n while (i < data.length) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n i += 2;\n if (!c) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n s = (c & 0x7f) + 1;\n i += 2;\n for (j = 0; j < s; ++j) o += byteToString((c >> 7 && j < 32) * 0xff);\n continue;\n }\n o += byteToString(c);\n }\n return o;\n }\n\n /*============================================================*/\n /* ERC1967Factory */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/ERC1967Factory.sol\n\n /**\n * ERC1967Factory canonical address and ABI.\n * @namespace\n * @alias module:solady.ERC1967Factory\n */\n var ERC1967Factory = {};\n\n solady.ERC1967Factory = ERC1967Factory;\n\n /**\n * Canonical address of Solady's ERC1967Factory.\n * @type {string}\n */\n ERC1967Factory.address = \"0x0000000000006396FF2a80c067f99B3d2Ab4Df24\";\n\n /**\n * ABI of Solady's ERC1967Factory.\n * @type {Object}\n */\n ERC1967Factory.abi = JSON.parse('[{0:[],1:\"DeploymentFailed\"96\"SaltDoesNotStartWithCaller\"96\"Unauthorized\"96\"UpgradeFailed\",2:3959790,9791],1:\"AdminChanged\",2:10959790,9792,9791],1:\"Deployed\",2:10959790,9792],1:\"Upgraded\",2:10},{0:[{90],1:\"adminOf\",12:[{9199{0:[{90,{91],1:\"changeAdmin\",12:[],13:\"nonpayable\",2:15},{0:[{92,{91],1:\"deploy\",12:[{9098,{0:[{92,{91,{94],1:\"deployAndCall\",12:[{9098,{0:[{92,{91,{93],1:\"deployDeterministic\",12:[{9098,{0:[{92,{91,{93,{94],1:\"deployDeterministicAndCall\",12:[{9098,{0:[],1:\"initCodeHash\",12:[{6:19,1:\"result\",2:19}99{0:[{93],1:\"predictDeterministicAddress\",12:[{6:7,1:\"predicted\",2:7}99{0:[{90,{92],1:\"upgrade\",12:[98,{0:[{90,{92,{94],1:\"upgradeAndCall\",12:[98]'.replace(/9\\d/g, function (m) { return [\"6:7,1:8,2:7}\",\"6:7,1:9,2:7}\",\"6:7,1:11,2:7}\",\"6:19,1:20,2:19}\",\"6:17,1:18,2:17}\",\"},{4:false,0:[\",\",2:3},{0:[],1:\",\"{5:true,\",\"],13:16,2:15}\",\"],13:14,2:15},\"][m-90] }).replace(/\\d+/g, function (m) { return '\"' + (\"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt\".split(\",\")[m]) + '\"' }));\n\n /*--------------------------- END ----------------------------*/\n\n if (typeof define === \"function\" && define.amd) {\n define(\"solady\", [], function() {\n return solady\n });\n }\n\n if (!noGlobal) {\n window.solady = solady;\n }\n\n return solady;\n});\n","import {\n type Config,\n type ReadContractParameters,\n type WatchContractEventParameters,\n type WriteContractParameters,\n waitForTransactionReceipt,\n} from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport { LibZip } from 'solady';\nimport type {\n Abi,\n AbiEvent,\n Address,\n ContractEventName,\n ContractFunctionName,\n GetLogsParameters,\n Hash,\n Hex,\n Log,\n PrivateKeyAccount,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n encodeAbiParameters,\n isHex,\n keccak256,\n parseAbiParameters,\n slice,\n toHex,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { signTypedData } from 'viem/accounts';\nimport { ContractAction } from './Actions/ContractAction';\nimport { ERC721MintAction } from './Actions/ERC721MintAction';\nimport {\n LIST_MANAGER_ROLE,\n SimpleAllowList,\n} from './AllowLists/SimpleAllowList';\nimport { SimpleDenyList } from './AllowLists/SimpleDenyList';\nimport { VestingBudget } from './Budgets/VestingBudget';\nimport type { ERC1155Incentive } from './Incentives/ERC1155Incentive';\nimport { SignerValidator } from './Validators/SignerValidator';\nimport { NoContractAddressUponReceiptError } from './errors';\n\n/**\n * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (writeContract)[https://viem.sh/docs/contract/writeContract]\n *\n * @export\n * @typedef {WriteParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type WriteParams<\n abi extends Abi,\n functionName extends ContractFunctionName<abi>,\n> = Partial<\n Omit<\n WriteContractParameters<abi, functionName>,\n 'address' | 'args' | 'functionName' | 'abi'\n >\n>;\n\n/**\n * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (readContract)[https://viem.sh/docs/contract/readContract]\n *\n * @export\n * @typedef {ReadParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type ReadParams<\n abi extends Abi,\n functionName extends ContractFunctionName<abi>,\n> = Partial<\n Omit<\n ReadContractParameters<abi, functionName>,\n 'address' | 'args' | 'functionName' | 'abi'\n >\n>;\n\n/**\n * Helper type that encapsulates common `watchContractEvent` parameters without fields like `address`, and `abi` that are expected to be provided the SDK.\n * See (watchContractEvent)[https://wagmi.sh/core/api/actions/watchContractEvent]\n *\n * @export\n * @typedef {WatchParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi> | undefined} [eventName=undefined]\n */\nexport type WatchParams<\n abi extends Abi,\n eventName extends ContractEventName<abi> | undefined = undefined,\n> = Partial<\n Omit<WatchContractEventParameters<abi, eventName>, 'address' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `getLogs` parameters without fields like `address` that are expected to be provided the SDK.\n * See (getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]\n *\n * @export\n * @typedef {GetLogsParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} event\n * @template {ExtractAbiEvent<abi, event>} [abiEvent=ExtractAbiEvent<abi, event>]\n * @template {| readonly AbiEvent[]\n * | readonly unknown[]\n * | undefined} [abiEvents=abiEvent extends AbiEvent ? [abiEvent] : undefined]\n */\nexport type GetLogsParams<\n abi extends Abi,\n event extends ContractEventName<abi>,\n abiEvent extends ExtractAbiEvent<abi, event> = ExtractAbiEvent<abi, event>,\n abiEvents extends\n | readonly AbiEvent[]\n | readonly unknown[]\n | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined,\n> = Partial<Omit<GetLogsParameters<abiEvent, abiEvents>, 'address'>> & {\n chainId?: number | undefined;\n};\n\n/**\n * A generic `viem.Log` event with typed `args` support via a given `Abi` and `ContractEventName`\n *\n * @export\n * @typedef {GenericLog}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} [event=ContractEventName<abi>]\n */\nexport type GenericLog<\n abi extends Abi,\n event extends ContractEventName<abi> = ContractEventName<abi>,\n> = Log<bigint, number, false, ExtractAbiEvent<abi, event>, false>;\n\n/**\n * Helper utility to convert a string to a `bytes4` type\n *\n * @export\n * @param {string} input\n * @returns {Hex}\n */\nexport function bytes4(input: string) {\n return slice(isHex(input) ? keccak256(input) : keccak256(toHex(input)), 0, 4);\n}\n\n/**\n * Utility function to wait for a transaction receipt, and extract the contractAddress\n *\n * @export\n * @async\n * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {Promise<Hash>} hash - A transaction hash promise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}\n * @returns {unknown}\n * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received\n */\nexport async function getDeployedContractAddress(\n config: Config,\n hash: Promise<Hash>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n) {\n const receipt = await waitForTransactionReceipt(config, {\n ...waitParams,\n hash: await hash,\n });\n if (!receipt.contractAddress)\n throw new NoContractAddressUponReceiptError(receipt);\n return receipt.contractAddress;\n}\n\n/**\n * Utility type to encapsulate a transaction hash, and the simulated result prior to submitting the transaction.\n *\n * @export\n * @typedef {HashAndSimulatedResult}\n * @template [T=unknown]\n */\nexport type HashAndSimulatedResult<T = unknown> = { hash: Hash; result: T };\n\n/**\n * Helper function to wait for a transaction receipt given a hash promise.\n *\n * @export\n * @async\n * @template [Result=unknown]\n * @param {WagmiConfig} config\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\nexport async function awaitResult<Result = unknown>(\n config: Config,\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n): Promise<Result> {\n const { hash, result } = await hashPromise;\n await waitForTransactionReceipt(config, {\n ...waitParams,\n hash,\n });\n return result;\n}\n\n/**\n * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.\n *\n * @export\n * @enum {number}\n */\nexport enum RegistryType {\n ACTION = 0,\n ALLOW_LIST = 1,\n BUDGET = 2,\n INCENTIVE = 3,\n VALIDATOR = 4,\n}\n\n/**\n * Enum representing incentive disbursement strategies.\n *\n * @export\n * @enum {number}\n */\nexport enum StrategyType {\n POOL = 0,\n MINT = 1,\n RAFFLE = 2,\n}\n\n/**\n * Enum representing inventive disbursement strategies for {@link ERC1155Incentive}\n *\n * @export\n * @enum {number}\n */\nexport enum ERC1155StrategyType {\n POOL = 0,\n MINT = 1,\n}\n\n/**\n * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.\n * This is used to pass the base contract and its initialization parameters in an efficient manner\n *\n * @export\n * @typedef {Target}\n */\nexport type Target = {\n isBase: boolean;\n instance: Address;\n parameters: Hex;\n};\n\n/*\n * Action Event Payloads\n */\n\n/**\n * Filter types used to determine how criteria are evaluated.\n *\n * @export\n * @enum {number}\n */\nexport enum FilterType {\n EQUAL = 0,\n NOT_EQUAL = 1,\n GREATER_THAN = 2,\n LESS_THAN = 3,\n CONTAINS = 4,\n}\n\n/**\n * The primitive types supported for filtering.\n *\n * @export\n * @enum {number}\n */\nexport enum PrimitiveType {\n UINT = 0,\n ADDRESS = 1,\n BYTES = 2,\n STRING = 3,\n}\n\n/**\n * Object representation of a `Criteria` struct used in event actions.\n *\n * @export\n * @interface Criteria\n * @typedef {Criteria}\n */\nexport interface Criteria {\n /**\n * The filter type used in this criteria.\n *\n * @type {FilterType}\n */\n filterType: FilterType;\n /**\n * The primitive type of the field being filtered.\n *\n * @type {PrimitiveType}\n */\n fieldType: PrimitiveType;\n /**\n * The index in the logs argument array where the field is located.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The filter data used for complex filtering.\n *\n * @type {Hex}\n */\n filterData: Hex;\n}\n\n/**\n * Whether a given signature is an event or function\n *\n * @export\n * @enum {number}\n */\nexport enum SignatureType {\n EVENT = 0,\n FUNC = 1,\n}\n\n/**\n * The payload describing how claimants are identified\n *\n * @export\n * @interface ActionClaimant\n * @typedef {ActionClaimant}\n */\nexport interface ActionClaimant {\n /**\n * Whether claimaint is inferred from event or function\n *\n * @type {SignatureType}\n */\n signatureType: SignatureType;\n /**\n * The 4 byte signature of the event or function\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index corresponding to claimant.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the target contract\n *\n * @type {Address}\n */\n targetContract: Address;\n}\n\n/**\n * Object representation of an `ActionStep` struct used in event actions.\n *\n * @export\n * @interface ActionStep\n * @typedef {ActionStep}\n */\nexport interface ActionStep {\n /**\n * The signature of the event.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * Whether claimaint is inferred from event or function\n *\n * @type {SignatureType}\n */\n signatureType: SignatureType;\n /**\n * The type of action being performed.\n *\n * @type {number}\n */\n actionType: number;\n /**\n * The address of the target contract.\n *\n * @type {Address}\n */\n targetContract: Address;\n /**\n * The criteria used for this action step.\n *\n * @type {Criteria}\n */\n actionParameter: Criteria;\n}\n\n/**\n * You can either supply a simplified version of the payload, or one that explicitly declares action steps.\n *\n * @export\n * @typedef {EventActionPayload}\n */\nexport type EventActionPayload =\n | EventActionPayloadSimple\n | EventActionPayloadRaw;\n\nexport interface EventActionPayloadSimple {\n /**\n * The payload describing how claimants are identified\n *\n * @type {ActionClaimant}\n */\n actionClaimant: ActionClaimant;\n\n /**\n * Up to 4 action steps.\n * If you supply less than 4, then the last step will be reused to satisfy the EventAction.InitPayload\n * Any more than 4 will throw an error.\n *\n * @type {ActionStep[]}\n */\n actionSteps: ActionStep[];\n}\n\n/**\n * Typeguard to determine if a user is supplying a simple or raw EventActionPayload\n *\n * @param {*} opts\n * @returns {opts is EventActionPayloadSimple}\n */\nexport function isEventActionPayloadSimple(\n opts: EventActionPayload,\n): opts is EventActionPayloadSimple {\n return Array.isArray((opts as EventActionPayloadSimple).actionSteps);\n}\n\n/**\n * Object representation of an `InitPayload` struct used to initialize event actions.\n *\n * @export\n * @interface EventActionPayloadRaw\n * @typedef {EventActionPayloadRaw}\n */\nexport interface EventActionPayloadRaw {\n /**\n * The payload describing how claimants are identified\n *\n * @type {ActionClaimant}\n */\n actionClaimant: ActionClaimant;\n /**\n * The first action step.\n *\n * @type {ActionStep}\n */\n actionStepOne: ActionStep;\n /**\n * The second action step.\n *\n * @type {ActionStep}\n */\n actionStepTwo: ActionStep;\n /**\n * The third action step.\n *\n * @type {ActionStep}\n */\n actionStepThree: ActionStep;\n /**\n * The fourth action step.\n *\n * @type {ActionStep}\n */\n actionStepFour: ActionStep;\n}\n\n/**\n * Function to properly encode an event action payload.\n *\n * @param {InitPayload} param0\n * @param {ActionStep} param0.actionStepOne - The first action step to initialize.\n * @param {ActionStep} param0.actionStepTwo - The second action step to initialize.\n * @param {ActionStep} param0.actionStepThree - The third action step to initialize.\n * @param {ActionStep} param0.actionStepFour - The fourth action step to initialize.\n * @returns {Hex}\n */\nexport const prepareEventActionPayload = ({\n actionClaimant,\n actionStepOne,\n actionStepTwo,\n actionStepThree,\n actionStepFour,\n}: EventActionPayloadRaw) => {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayload',\n components: [\n {\n type: 'tuple',\n name: 'actionClaimant',\n components: [\n { type: 'uint8', name: 'signatureType' },\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepOne',\n components: [\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepTwo',\n components: [\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepThree',\n components: [\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepFour',\n components: [\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n ],\n },\n ],\n [\n {\n actionClaimant,\n actionStepOne,\n actionStepTwo,\n actionStepThree,\n actionStepFour,\n },\n ],\n );\n};\n\n/**\n * Object representation of the `ERC20Incentive.InitPayload`.\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\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// * Function to properly encode a validation payload.\n// *\n// * @param {SignerValidatorValidatePayload} param0\n// * @param {Address} param0.signer - The address of the signer with which to validate.\n// * @param {Hex} param0.hash - The transaction 558 to associate with the validation.\n// * @param {Hex} param0.signature - The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer\n// * @param {Address} param0.validator - Address of the validator module.\n// * @returns {*}\n// */\n// export const prepareSignerValidatorSignaturePayload = ({\n// boostId,\n// incentiveId,\n// claimant,\n// claimData,\n// validator,\n// chainId,\n// }: SignerValidatorSignaturePayload) => {\n// const domain = {\n// name: 'SignerValidator',\n// version: '1',\n// chainId: chainId,\n// verifyingContract: validator,\n// };\n// return hashTypedData({\n// domain,\n// types: {\n// SignerValidatorData: [\n// { name: 'incentiveId', type: 'uint256' },\n// { name: 'claimant', type: 'address' },\n// { name: 'boostId', type: 'uint256' },\n// { name: 'claimData', type: 'bytes32' },\n// ],\n// },\n// primaryType: 'SignerValidatorData',\n// message: {\n// incentiveId,\n// claimant,\n// boostId,\n// claimData,\n// },\n// });\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 * 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 const 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\n/**\n * Object representation of a {@link BoostClaimData} initialization payload\n *\n * @export\n * @interface BoostClaimData\n * @typedef {BoostClaimData}\n */\nexport interface BoostClaimData {\n /**\n * The validator data.\n *\n * @type {Hex}\n */\n validatorData: Hex;\n\n /**\n * The incentive data.\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n}\n\n/**\n * Given a {@link BoostClaimData}, properly encode the initialization payload.\n *\n * @param {BoostClaimData} param0\n * @param {Hex} param0.validatorData\n * @param {Hex} param0.incentiveData\n * @returns {Hex}\n */\nexport const prepareBoostClaimData = ({\n validatorData,\n incentiveData,\n}: BoostClaimData) => {\n return encodeAbiParameters(\n [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n [validatorData, incentiveData],\n );\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 incentive quantity.\n *\n * @type {number}\n */\n incentiveQuantity: number;\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 const 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 * 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 incentive quantity.\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 * 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 domain = {\n name: 'SignerValidator',\n version: '1',\n chainId: chainId,\n verifyingContract: validator,\n };\n const typedData = {\n domain,\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 const trustedSignature = await signTypedData({\n ...typedData,\n privateKey: signer.key,\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 * Object representation of a {@link SimpleAllowList} initialization payload.\n *\n * @export\n * @interface SimpleAllowListPayload\n * @typedef {SimpleAllowListPayload}\n */\nexport interface SimpleAllowListPayload {\n /**\n * The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of allowed addresses.\n *\n * @type {Address[]}\n */\n allowed: Address[];\n}\n\n/**\n * Given a {@link SimpleAllowListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleAllowListPayload} param0\n * @param {Address} param0.owner - The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n * @param {Address[]} param0.allowed - List of allowed addresses.\n * @returns {Hex}\n */\nexport const prepareSimpleAllowListPayload = ({\n owner,\n allowed,\n}: SimpleAllowListPayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'allowed' },\n ],\n [owner, allowed],\n );\n};\n\n/**\n * Object representation of a {@link SimpleDenyList} initialization payload.\n *\n * @export\n * @interface SimpleDenyListPayload\n * @typedef {SimpleDenyListPayload}\n */\nexport interface SimpleDenyListPayload {\n /**\n * The allow list's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of denied addresses.\n *\n * @type {Address[]}\n */\n denied: Address[];\n}\n\n/**\n * Given a {@link SimpleDenyListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleDenyListPayload} param0\n * @param {Address} param0.owner - The allow list's owner\n * @param {Address[]} param0.denied - List of denied addresses.\n * @returns {Hex}\n */\nexport const prepareSimpleDenyListPayload = ({\n owner,\n denied,\n}: SimpleDenyListPayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'denied' },\n ],\n [owner, denied],\n );\n};\n\n/**\n * Object representation of `BoostCore.InitPayload` struct.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface BoostPayload {\n /**\n * Address to valid budget.\n *\n * @type {Address}\n */\n budget: Address;\n /**\n * Target for existing action, or base with initialization payload.\n *\n * @type {Target}\n */\n action: Target;\n /**\n * Target for existing validator, or base with initialization payload.\n *\n * @type {Target}\n */\n validator: Target;\n /**\n * Target for existing allowList, or base with initialization payload.\n *\n * @type {Target}\n */\n allowList: Target;\n /**\n * Targets for new incentives, with initialization payloads.\n *\n * @type {Target[]}\n */\n incentives: Target[];\n /**\n * The base protocol fee (in bps)\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n * The base referral fee (in bps)\n *\n * @type {?bigint}\n */\n referralFee?: bigint;\n /**\n * Optional maximum amount of participants in the Boost.\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n * The owner of the Boost.\n *\n * @type {Address}\n */\n owner: Address;\n}\n\n/**\n * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`\n *\n * @export\n * @param {BoostPayload} param0\n * @param {Address} param0.budget - Address to valid budget.\n * @param {Target} param0.action - Target for existing action, or base with initialization payload.\n * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.\n * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.\n * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.\n * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)\n * @param {bigint} [param0.referralFee=0n] - The base referral fee (in bps)\n * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.\n * @param {Address} param0.owner - The owner of the Boost.\n * @returns {Hex}\n */\nexport function prepareBoostPayload({\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee = 0n,\n referralFee = 0n,\n maxParticipants = 0n,\n owner,\n}: BoostPayload): Hex {\n return LibZip.cdCompress(\n encodeAbiParameters(\n parseAbiParameters([\n 'BoostPayload payload',\n 'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint64 referralFee; uint256 maxParticipants; address owner; }',\n 'struct Target { bool isBase; address instance; bytes parameters; }',\n ]),\n [\n {\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee,\n referralFee,\n maxParticipants,\n owner,\n },\n ],\n ),\n ) as Hex;\n}\n\n/**\n * Object representation of\n *\n * @export\n * @interface ERC1155Payload\n * @typedef {ERC1155Payload}\n */\nexport interface ERC1155Payload {\n /**\n * The ERC1155 token ID for the incentive\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Given a token ID and amount, properly encode a `ERC1155Incentive.ERC1155Payload` for use with {@link ERC1155Incentive} initialization.\n *\n * @export\n * @param {ERC1155Payload} param0\n * @param {bigint} param0.tokenId - The ERC1155 token ID for the incentive\n * @param {bigint} param0.amount - The amount to transfer\n * @returns {Hex}\n */\nexport function prepareERC1155Payload({ tokenId, amount }: ERC1155Payload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ERC1155Payload payload',\n 'struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }',\n ]),\n [{ tokenId, amount, data: '0x' }],\n );\n}\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 * 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\n/**\n * The configuration parameters for the CGDAIncentive\n *\n * @export\n * @interface CGDAParameters\n * @typedef {CGDAParameters}\n */\nexport interface CGDAParameters {\n /**\n * The amount to subtract from the current reward after each claim\n *\n * @type {bigint}\n */\n rewardDecay: bigint;\n /**\n * The amount by which the reward increases for each hour without a claim (continuous linear increase)\n *\n * @type {bigint}\n */\n rewardBoost: bigint;\n /**\n * The timestamp of the last claim\n *\n * @type {bigint}\n */\n lastClaimTime: bigint;\n /**\n * The current reward amount\n *\n * @type {bigint}\n */\n currentReward: bigint;\n}\n\n/**\n * The object representation of a `CGDAIncentive.InitPayload`\n *\n * @export\n * @interface CGDAIncentivePayload\n * @typedef {CGDAIncentivePayload}\n */\nexport interface CGDAIncentivePayload {\n /**\n * The address of the ERC20-like token\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The initial reward amount\n *\n * @type {bigint}\n */\n initialReward: bigint;\n /**\n * The amount to subtract from the current reward after each claim\n *\n * @type {bigint}\n */\n rewardDecay: bigint;\n /**\n * The amount by which the reward increases for each hour without a claim (continuous linear increase)\n *\n * @type {bigint}\n */\n rewardBoost: bigint;\n /**\n * The total budget for the incentive\n *\n * @type {bigint}\n */\n totalBudget: bigint;\n}\n\n/**\n * Given a {@link CGDAIncentivePayload}, properly encode a `CGDAIncentive.InitPayload` for use with {@link CGDAIncentive} initialization.\n *\n * @param {CGDAIncentivePayload} param0\n * @param {Address} param0.asset - The address of the ERC20-like token\n * @param {bigint} param0.initialReward - The initial reward amount\n * @param {bigint} param0.rewardDecay - The amount to subtract from the current reward after each claim\n * @param {bigint} param0.rewardBoost - The amount by which the reward increases for each hour without a claim (continuous linear increase)\n * @param {bigint} param0.totalBudget - The total budget for the incentive\n * @returns {Hex}\n */\nexport const prepareCGDAIncentivePayload = ({\n asset,\n initialReward,\n rewardDecay,\n rewardBoost,\n totalBudget,\n}: CGDAIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'initialReward' },\n { type: 'uint256', name: 'rewardDecay' },\n { type: 'uint256', name: 'rewardBoost' },\n { type: 'uint256', name: 'totalBudget' },\n ],\n [asset, initialReward, rewardDecay, rewardBoost, totalBudget],\n );\n};\n\n/**\n * The object representation of a `ERC1155Incentive.InitPayload`\n *\n * @export\n * @interface ERC1155IncentivePayload\n * @typedef {ERC1155IncentivePayload}\n */\nexport interface ERC1155IncentivePayload {\n /**\n * The address of the `ERC1155` asset\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * Should be `Strategy.POOL`\n *\n * @type {ERC1155StrategyType}\n */\n strategy: ERC1155StrategyType;\n /**\n * The token ID to target\n *\n * @type {bigint}\n */\n tokenId: 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 * Any extra data to accompany the claim, if applicable.\n *\n * @type {Hex}\n */\n extraData: Hex;\n}\n\n/**\n * Given a {@link ERC1155IncentivePayload}, properly encode a `ERC1155Incentive.InitPayload` for use with {@link ERC1155Incentive} initialization.\n *\n * @param {ERC1155IncentivePayload} param0\n * @param {Address} param0.asset - The address of the `ERC1155` asset\n * @param {ERC1155StrategyType} param0.strategy - Should be `Strategy.POOL`\n * @param {bigint} param0.tokenId - The token ID to target\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @param {Hex} param0.extraData - Any extra data to accompany the claim, if applicable.\n * @returns {Hex}\n */\nexport const prepareERC1155IncentivePayload = ({\n asset,\n strategy,\n tokenId,\n limit,\n extraData,\n}: ERC1155IncentivePayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'InitPayload payload',\n 'struct InitPayload { address asset; uint8 strategy; uint256 tokenId; uint256 limit; bytes extraData; }',\n ]),\n [{ asset, strategy, tokenId, limit, extraData }],\n );\n // return encodeAbiParameters(\n // [\n // { type: 'address', name: 'asset' },\n // { type: 'uint8', name: 'strategy' },\n // { type: 'uint256', name: 'tokenId' },\n // { type: 'uint256', name: 'limit' },\n // { type: 'bytes', name: 'extraData' },\n // ],\n // [asset, strategy, tokenId, limit, extraData],\n // );\n};\n\n/**\n * The object representation of a `AllowListIncentive.InitPayload`\n *\n * @export\n * @interface AllowListIncentivePayload\n * @typedef {AllowListIncentivePayload}\n */\nexport interface AllowListIncentivePayload {\n /**\n * The address to the allowlist to add claimers to.\n *\n * @type {Address}\n */\n allowList: Address;\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 * Given a {@link AllowListIncentivePayload}, properly encode a `AllowListIncentive.InitPayload` for use with {@link AllowListIncentive} initialization.\n *\n * @param {AllowListIncentivePayload} param0\n * @param {Address} param0.allowList - The address to the allowlist to add claimers to.\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {Hex}\n */\nexport const prepareAllowListIncentivePayload = ({\n allowList,\n limit,\n}: AllowListIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'allowList' },\n { type: 'uint256', name: 'limit' },\n ],\n [allowList, limit],\n );\n};\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @returns {*}\n */\nexport const prepareERC20IncentivePayload = ({\n asset,\n strategy,\n reward,\n limit,\n}: ERC20IncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [asset, strategy, reward, limit],\n );\n};\n\n/**\n * The object representation of a `ERC20VariableIncentivePayload.InitPayload`\n *\n * @export\n * @interface ERC20VariableIncentivePayload\n * @typedef {ERC20VariableIncentivePayload}\n */\nexport interface ERC20VariableIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * Given a {@link ERC20VariableIncentivePayload}, properly encode a ` ERC20VariableIncentive.InitPayload` for use with {@link ERC20VariableIncentive} initialization.\n *\n * @param {ERC20VariableIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @returns {*}\n */\nexport const prepareERC20VariableIncentivePayload = ({\n asset,\n reward,\n limit,\n}: ERC20VariableIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [asset, reward, limit],\n );\n};\n\n/**\n * The object representation of a `ContractAction.InitPayload`\n *\n * @export\n * @interface ContractActionPayload\n * @typedef {ContractActionPayload}\n */\nexport interface ContractActionPayload {\n /**\n * The chain ID on which the target exists\n *\n * @type {bigint}\n */\n chainId: bigint;\n /**\n * The target contract address\n *\n * @type {Address}\n */\n target: Address;\n /**\n * The selector for the function to be called\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The native token value to send with the function call\n *\n * @type {bigint}\n */\n value: bigint;\n}\n\n/**\n * `ERC721MintActionPayload` is a re-exported `ContractActionPayload`\n *\n * @export\n * @typedef {ERC721MintActionPayload}\n */\nexport type ERC721MintActionPayload = ContractActionPayload;\n\n/**\n * The object representation of a `SimpleBudgetPayload.InitPayload`\n *\n * @export\n * @interface SimpleBudgetPayload\n * @typedef {SimpleBudgetPayload}\n */\nexport interface SimpleBudgetPayload {\n /**\n * The budget's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n *\n * @type {Address[]}\n */\n authorized: Address[];\n}\n\n/**\n * Given a {@link SimpleBudgetPayload}, properly encode a `SimpleBudget.InitPayload` for use with {@link SimpleBudget} initialization.\n *\n * @param {SimpleBudgetPayload} param0\n * @param {Address} param0.owner - The budget's owner\n * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n * @returns {*}\n */\nexport const prepareSimpleBudgetPayload = ({\n owner,\n authorized,\n}: SimpleBudgetPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'SimpleBudgetPayload payload',\n 'struct SimpleBudgetPayload { address owner; address[] authorized; }',\n ]),\n [{ owner, authorized }],\n );\n};\n\n/**\n * The object representation of a `ManagedBudgetPayload.InitPayload`\n *\n * @export\n * @interface ManagedBudgetPayload\n * @typedef {ManagedBudgetPayload}\n */\nexport interface ManagedBudgetPayload {\n /**\n * The budget's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n *\n * @type {Address[]}\n */\n authorized: Address[];\n /**\n * List of roles to assign to the corresponding account by index.\n *\n * @type {bigint[]}\n */\n roles: bigint[];\n}\n\n/**\n * Given a {@link ManagedBudgetPayload}, properly encode a `ManagedBudget.InitPayload` for use with {@link ManagedBudget} initialization.\n *\n * @param {ManagedBudgetPayload} param0\n * @param {Address} param0.owner - The budget's owner\n * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n * @param {{}} param0.roles - List of roles to assign to the corresponding account by index.\n * @returns {*}\n */\nexport const prepareManagedBudgetPayload = ({\n owner,\n authorized,\n roles,\n}: ManagedBudgetPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ManagedBudgetPayload payload',\n 'struct ManagedBudgetPayload { address owner; address[] authorized; uint256[] roles; }',\n ]),\n [{ owner, authorized, roles }],\n );\n};\n\n/**\n * The object representation of a `VestingBudget.InitPayload`\n *\n * @export\n * @interface VestingBudgetPayload\n * @typedef {VestingBudgetPayload}\n */\nexport interface VestingBudgetPayload {\n /**\n * The budget's owner.\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n *\n * @type {Address[]}\n */\n authorized: Address[];\n /**\n * The timestamp at which the vesting schedule begins\n *\n * @type {bigint}\n */\n start: bigint;\n /**\n * The duration of the vesting schedule (in seconds)\n *\n * @type {bigint}\n */\n duration: bigint;\n /**\n * The duration of the cliff period (in seconds)\n *\n * @type {bigint}\n */\n cliff: bigint;\n}\n\n/**\n * Given a {@link VestingBudgetPayload}, properly encode a `VestingBudget.InitPayload` for use with {@link VestingBudget} initialization.\n *\n * @param {VestingBudgetPayload} param0\n * @param {Address} param0.owner - The budget's owner.\n * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n * @param {bigint} param0.start - The timestamp at which the vesting schedule begins\n * @param {bigint} param0.duration - The duration of the vesting schedule (in seconds)\n * @param {bigint} param0.cliff - The duration of the cliff period (in seconds)\n * @returns {Hex}\n */\nexport const prepareVestingBudgetPayload = ({\n owner,\n authorized,\n start,\n duration,\n cliff,\n}: VestingBudgetPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'VestingBudgetPayload payload',\n 'struct VestingBudgetPayload { address owner; address[] authorized; uint64 start; uint64 duration; uint64 cliff; }',\n ]),\n [{ owner, authorized, start, duration, cliff }],\n );\n};\n\n/**\n * Given a {@link ContractActionPayload}, properly encode a `ContractAction.InitPayload` for use with {@link ContractAction} initialization.\n *\n * @param {ContractActionPayload} param0\n * @param {bigint} param0.chainId - The chain ID on which the target exists\n * @param {Address} param0.target - The target contract address\n * @param {Hex} param0.selector - The selector for the function to be called\n * @param {bigint} param0.value - The native token value to send with the function call\n * @returns {Hex}\n */\nexport const prepareContractActionPayload = ({\n chainId,\n target,\n selector,\n value,\n}: ContractActionPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ContractActionPayload payload',\n 'struct ContractActionPayload { uint256 chainId; address target; bytes4 selector; uint256 value; }',\n ]),\n [{ chainId, target, selector, value }],\n );\n};\n\n/**\n * Given a {@link ContractActionPayload}, properly encode a `ContractAction.InitPayload` for use with {@link ERC721MintAction} initialization.\n *\n * @param {ContractActionPayload} param0\n * @param {bigint} param0.chainId - The chain ID on which the target exists\n * @param {Address} param0.target - The target contract address\n * @param {Hex} param0.selector - The selector for the function to be called\n * @param {bigint} param0.value - The native token value to send with the function call\n * @returns {*}\n */\nexport const prepareERC721MintActionPayload = ({\n chainId,\n target,\n selector,\n value,\n}: ContractActionPayload) => {\n return prepareContractActionPayload({ chainId, target, selector, value });\n};\n\n/**\n * The object representation of an `Incentive.ClaimPayload`\n *\n * @export\n * @interface ClaimPayload\n * @typedef {ClaimPayload}\n */\nexport interface ClaimPayload {\n /**\n * The address of the recipient\n *\n * @type {Address}\n */\n target: Address;\n /**\n * The implementation-specific data for the claim, if needed\n *\n * @type {?Hex}\n */\n data?: Hex;\n}\n\n/**\n * Given a valid {@link ClaimPayload}, encode the payload for use with Incentive operations.\n *\n * @param {ClaimPayload} param0\n * @param {Address} param0.target - The address of the recipient\n * @param {Hex} [param0.data=zeroHash] - The implementation-specific data for the claim, if needed\n * @returns {*}\n */\nexport const prepareClaimPayload = ({\n target,\n data = zeroHash,\n}: ClaimPayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'target' },\n { type: 'bytes', name: 'data' },\n ],\n [target, data],\n );\n};\n\n/*\n * Transfer Payloads\n */\n\n/**\n * The various types of assets supported in Budgets and Incentives.\n *\n * @export\n * @enum {number}\n */\nexport enum AssetType {\n ETH,\n ERC20,\n ERC1155,\n}\n\n/**\n * Object representation of a generic `Transfer` struct.\n *\n * @export\n * @interface TransferPayload\n * @typedef {TransferPayload}\n */\nexport interface TransferPayload {\n /**\n * The type of the asset being transferred.\n *\n * @type {AssetType}\n */\n assetType: AssetType;\n /**\n * The address of the asset to transfer, zero address for ETH.\n *\n * @type {Address}\n */\n address: Address;\n /**\n * The account from which to transfer the assets.\n *\n * @type {Address}\n */\n target: Address;\n /**\n * An encoded {@link FungiblePayload}, use {@link prepareFungiblePayload} to construct.\n *\n * @type {Hex}\n */\n data: Hex;\n}\n\n/**\n * Encodes parameters for transferring the transfer of Fungible and ERC1155 assets, used for {@link Budget} operations.\n * Typically you'd use {@link prepareFungibleTransfer} or {@link prepareERC1155Transfer}\n *\n * @param {TransferPayload} param0\n * @param {AssetType} param0.assetType - The asset type being transferred.\n * @param {Address} param0.address - The address of the asset, use zero address for ETH transfers.\n * @param {Address} param0.target - The address of the account being transferred from\n * @param {Hex} param0.data - Use {@link prepareFungiblePayload} to properly encode an amount to transfer\n * @returns {Hex}\n */\nexport const prepareTransferPayload = ({\n assetType,\n address,\n target,\n data,\n}: TransferPayload) => {\n return encodeAbiParameters(\n [\n { type: 'uint8', name: 'assetType' },\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'target' },\n { type: 'bytes', name: 'data' },\n ],\n [assetType, address, target, data],\n );\n};\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of ERC1155 assets.\n *\n * @export\n * @interface ERC1155TransferPayload\n * @typedef {ERC1155TransferPayload}\n */\nexport interface ERC1155TransferPayload {\n /**\n * The token ID to transfer\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset to target\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for transferring the transfer of ERC1155 assets, used for {@link Budget} operations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {ERC1155TransferPayload} param0\n * @param {bigint} param0.tokenId - The token ID to transfer\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset to target\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareERC1155Transfer({\n tokenId,\n amount,\n asset,\n target,\n}: ERC1155TransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: AssetType.ERC1155,\n asset,\n data: prepareERC1155Payload({ tokenId, amount }),\n target,\n },\n ],\n );\n}\n\n/**\n * An object representation of the `FungiblePayload` struct\n *\n * @export\n * @interface FungiblePayload\n * @typedef {FungiblePayload}\n */\nexport interface FungiblePayload {\n /**\n * The amount being transferred\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Encodes an amount for the `FungiblePayload` struct\n *\n * @export\n * @param {FungiblePayload} param0\n * @param {bigint} param0.amount - The amount being transferred\n * @returns {*}\n */\nexport function prepareFungiblePayload({ amount }: FungiblePayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'FungiblePayload payload',\n 'struct FungiblePayload { uint256 amount; }',\n ]),\n [{ amount }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of fungible assets.\n *\n * @export\n * @interface FungibleTransferPayload\n * @typedef {FungibleTransferPayload}\n */\nexport interface FungibleTransferPayload {\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset. Use zero address for ETH transfers.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for a Fungible transfer, used for Budget allocations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {FungibleTransferPayload} param0\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset. Use zero address for ETH transfers.\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareFungibleTransfer({\n amount,\n asset,\n target,\n}: FungibleTransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: asset == zeroAddress ? AssetType.ETH : AssetType.ERC20,\n asset,\n data: prepareFungiblePayload({ amount }),\n target,\n },\n ],\n );\n}\n\n/**\n * Encodes a payload to validate that an action has been completed successfully.\n *\n *\n * @export\n * @param {Address} holder - The holder address\n * @param {bigint} payload - The token ID\n * @returns {Hex} - The first 20 bytes of the payload will be the holder address and the remaining bytes must be an encoded token ID (uint256)\n */\nexport function prepareERC721MintActionValidate(\n holder: Address,\n payload: bigint,\n) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'holder' },\n { type: 'bytes', name: 'payload' },\n ],\n [holder, toHex(payload)],\n );\n}\n\nexport function dedupeActionSteps(_steps: ActionStep[]): ActionStep[] {\n const steps: ActionStep[] = [],\n signatures: Record<string, boolean> = {};\n for (let step of _steps) {\n const signature = JSON.stringify(step);\n if (signatures[signature]) continue;\n steps.push(step);\n signatures[signature] = true;\n }\n return steps;\n}\n"],"names":["global","factory","module","exports","this","window","noGlobal","solady","LibZip","hexString","data","byteToString","b","parseByte","i","hexToBytes","a","bytesToHex","o","ib","ht","ob","j","s","h","d","c","l","r","p","q","e","u24","hash","x","literals","f","t","z","y","pushByte","rle","v","ERC1967Factory","m","bytes4","input","slice","isHex","keccak256","toHex","getDeployedContractAddress","config","waitParams","receipt","waitForTransactionReceipt","NoContractAddressUponReceiptError","awaitResult","hashPromise","result","RegistryType","StrategyType","ERC1155StrategyType","FilterType","PrimitiveType","SignatureType","isEventActionPayloadSimple","opts","prepareEventActionPayload","actionClaimant","actionStepOne","actionStepTwo","actionStepThree","actionStepFour","encodeAbiParameters","prepareSignerValidatorPayload","signers","validatorCaller","prepareBoostClaimData","validatorData","incentiveData","prepareSignerValidatorInputParams","signer","signature","incentiveQuantity","prepareSignerValidatorClaimDataPayload","chainId","validator","claimant","boostId","typedData","trustedSignature","signTypedData","prepareSimpleAllowListPayload","owner","allowed","prepareSimpleDenyListPayload","denied","prepareBoostPayload","budget","action","allowList","incentives","protocolFee","referralFee","maxParticipants","parseAbiParameters","prepareERC1155Payload","tokenId","amount","preparePointsIncentivePayload","venue","selector","reward","limit","prepareCGDAIncentivePayload","asset","initialReward","rewardDecay","rewardBoost","totalBudget","prepareERC1155IncentivePayload","strategy","extraData","prepareAllowListIncentivePayload","prepareERC20IncentivePayload","prepareERC20VariableIncentivePayload","prepareSimpleBudgetPayload","authorized","prepareManagedBudgetPayload","roles","prepareVestingBudgetPayload","start","duration","cliff","prepareContractActionPayload","target","value","prepareERC721MintActionPayload","prepareClaimPayload","zeroHash","AssetType","AssetType2","prepareTransferPayload","assetType","address","prepareERC1155Transfer","prepareFungiblePayload","prepareFungibleTransfer","zeroAddress","prepareERC721MintActionValidate","holder","payload","dedupeActionSteps","_steps","steps","signatures","step"],"mappings":"sUAuBC,SAASA,EAAQC,EAAS,CAKnBC,UAAiBD,EAAQD,EAAQ,CAAC,EAE9BG,SAAiBD,EAAO,QAAQ,OAChCC,iBAAyBD,EAAO,QAAQ,cAMpD,GAAG,OAAO,OAAW,IAAc,OAASE,EAAM,SAASC,EAAQC,EAAU,CAIzE,IAAIC,EAAS,CAAA,EAaTC,EAAS,CAAA,EAEbD,EAAO,OAASC,EAEhB,SAASC,EAAUC,EAAM,CACrB,IAAI,OAAOA,GAAS,UAAYA,aAAgB,UACxCA,EAAOA,EAAK,MAAM,wDAAwD,GAAG,CAC7E,GAAIA,EAAK,CAAC,EAAE,OAAS,EACjB,MAAM,IAAI,MAAM,4CAA4C,EAEhE,OAAOA,EAAK,CAAC,CAChB,CAEL,MAAM,IAAI,MAAM,4BAA4B,CAC/C,CAED,SAASC,EAAaC,EAAG,CACrB,OAAQA,EAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC,CAC1C,CAED,SAASC,EAAUH,EAAMI,EAAG,CACxB,OAAO,SAASJ,EAAK,OAAOI,EAAG,CAAC,EAAG,EAAE,CACxC,CAED,SAASC,EAAWL,EAAM,CAEtB,QADIM,EAAI,CAAA,EAAIF,EAAI,EACTA,EAAIJ,EAAK,OAAQI,GAAK,EAAGE,EAAE,KAAKH,EAAUH,EAAMI,CAAC,CAAC,EACzD,OAAOE,CACV,CAED,SAASC,EAAWD,EAAG,CAEnB,QADIE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AY,KAAK,UAAU0E,CAAI,EACjCD,EAAWzE,CAAS,IACxBwE,EAAM,KAAKE,CAAI,EACfD,EAAWzE,CAAS,EAAI,GAC1B,CACO,OAAAwE,CACT","x_google_ignoreList":[0]}
package/dist/utils.js CHANGED
@@ -654,3 +654,4 @@ export {
654
654
  Be as prepareTransferPayload,
655
655
  Se as prepareVestingBudgetPayload
656
656
  };
657
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../node_modules/.pnpm/solady@0.0.208/node_modules/solady/js/solady.js","../src/utils.ts"],"sourcesContent":["/**\n * Accompanying JavaScript library for Solady.\n *\n * To install:\n * \n * ```\n * npm install solady\n * ```\n *\n * Module exports:\n * \n * - `LibZip`\n * - `flzCompress(data)`: Compresses hex encoded data with FastLZ.\n * - `flzDecompress(data)`: Decompresses hex encoded data with FastLZ.\n * - `cdCompress(data)`: Compresses hex encoded calldata.\n * - `cdDecompress(data)`: Decompresses hex encoded calldata.\n * \n * - `ERC1967Factory`\n * - `address`: Canonical address of Solady's ERC1967Factory.\n * - `abi`: ABI of Solady's ERC1967Factory.\n *\n * @module solady\n */\n(function(global, factory) {\n\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = factory(global, 1);\n if (typeof exports === \"object\") {\n exports.LibZip = module.exports.LibZip;\n exports.ERC1967Factory = module.exports.ERC1967Factory;\n }\n } else {\n factory(global);\n }\n\n})(typeof window !== \"undefined\" ? window : this, function(window, noGlobal) {\n\n \"use strict\";\n\n var solady = {};\n\n /*============================================================*/\n /* LibZip Operations */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/LibZip.sol\n\n /**\n * FastLZ and calldata compression / decompression functions.\n * @namespace\n * @alias module:solady.LibZip\n */\n var LibZip = {};\n\n solady.LibZip = LibZip;\n\n function hexString(data) {\n if (typeof data === \"string\" || data instanceof String) {\n if (data = data.match(/^[\\s\\uFEFF\\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\\s\\uFEFF\\xA0]*$/)) {\n if (data[2].length % 2) {\n throw new Error(\"Hex string length must be a multiple of 2.\");\n }\n return data[2];\n }\n }\n throw new Error(\"Data must be a hex string.\");\n }\n\n function byteToString(b) {\n return (b | 0x100).toString(16).slice(1);\n }\n\n function parseByte(data, i) {\n return parseInt(data.substr(i, 2), 16);\n }\n\n function hexToBytes(data) {\n var a = [], i = 0;\n for (; i < data.length; i += 2) a.push(parseByte(data, i));\n return a;\n }\n\n function bytesToHex(a) {\n var o = \"0x\", i = 0;\n for (; i < a.length; o += byteToString(a[i++])) ;\n return o;\n }\n\n /**\n * Compresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.flzCompress = function(data) {\n var ib = hexToBytes(hexString(data)), b = ib.length - 4;\n var ht = [], ob = [], a = 0, i = 2, o = 0, j, s, h, d, c, l, r, p, q, e;\n\n function u24(i) {\n return ib[i] | (ib[++i] << 8) | (ib[++i] << 16);\n }\n\n function hash(x) {\n return ((2654435769 * x) >> 19) & 8191;\n }\n\n function literals(r, s) {\n while (r >= 32) for (ob[o++] = 31, j = 32; j--; r--) ob[o++] = ib[s++];\n if (r) for (ob[o++] = r - 1; r--; ) ob[o++] = ib[s++];\n }\n\n while (i < b - 9) {\n do {\n r = ht[h = hash(s = u24(i))] || 0;\n c = (d = (ht[h] = i) - r) < 8192 ? u24(r) : 0x1000000;\n } while (i < b - 9 && i++ && s != c);\n if (i >= b - 9) break;\n if (--i > a) literals(i - a, a);\n for (l = 0, p = r + 3, q = i + 3, e = b - q; l < e; l++) e *= ib[p + l] === ib[q + l];\n i += l;\n for (--d; l > 262; l -= 262) ob[o++] = 224 + (d >> 8), ob[o++] = 253, ob[o++] = d & 255;\n if (l < 7) ob[o++] = (l << 5) + (d >> 8), ob[o++] = d & 255;\n else ob[o++] = 224 + (d >> 8), ob[o++] = l - 7, ob[o++] = d & 255;\n ht[hash(u24(i))] = i++, ht[hash(u24(i))] = i++, a = i;\n }\n literals(b + 4 - a, a);\n return bytesToHex(ob);\n }\n\n /**\n * Decompresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.flzDecompress = function(data) {\n var ib = hexToBytes(hexString(data)), i = 0, o = 0, l, f, t, r, h, ob = [];\n while (i < ib.length) {\n if (!(t = ib[i] >> 5)) {\n for (l = 1 + ib[i++]; l--;) ob[o++] = ib[i++];\n } else {\n f = 256 * (ib[i] & 31) + ib[i + 2 - (t = t < 7)];\n l = t ? 2 + (ib[i] >> 5) : 9 + ib[i + 1];\n i = i + 3 - t;\n r = o - f - 1;\n while (l--) ob[o++] = ob[r++];\n }\n }\n return bytesToHex(ob);\n }\n\n /**\n * Compresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.cdCompress = function(data) {\n data = hexString(data);\n var o = \"0x\", z = 0, y = 0, i = 0, c;\n\n function pushByte(b) {\n o += byteToString(((o.length < 4 * 2 + 2) * 0xff) ^ b);\n }\n\n function rle(v, d) {\n pushByte(0x00);\n pushByte(d - 1 + v * 0x80);\n }\n\n for (; i < data.length; i += 2) {\n c = parseByte(data, i);\n if (!c) {\n if (y) rle(1, y), y = 0;\n if (++z === 0x80) rle(0, 0x80), z = 0;\n continue;\n }\n if (c === 0xff) {\n if (z) rle(0, z), z = 0;\n if (++y === 0x20) rle(1, 0x20), y = 0;\n continue;\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n pushByte(c);\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n return o;\n }\n\n /**\n * Decompresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.cdDecompress = function(data) {\n data = hexString(data);\n var o = \"0x\", i = 0, j, c, s;\n\n while (i < data.length) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n i += 2;\n if (!c) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n s = (c & 0x7f) + 1;\n i += 2;\n for (j = 0; j < s; ++j) o += byteToString((c >> 7 && j < 32) * 0xff);\n continue;\n }\n o += byteToString(c);\n }\n return o;\n }\n\n /*============================================================*/\n /* ERC1967Factory */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/ERC1967Factory.sol\n\n /**\n * ERC1967Factory canonical address and ABI.\n * @namespace\n * @alias module:solady.ERC1967Factory\n */\n var ERC1967Factory = {};\n\n solady.ERC1967Factory = ERC1967Factory;\n\n /**\n * Canonical address of Solady's ERC1967Factory.\n * @type {string}\n */\n ERC1967Factory.address = \"0x0000000000006396FF2a80c067f99B3d2Ab4Df24\";\n\n /**\n * ABI of Solady's ERC1967Factory.\n * @type {Object}\n */\n ERC1967Factory.abi = JSON.parse('[{0:[],1:\"DeploymentFailed\"96\"SaltDoesNotStartWithCaller\"96\"Unauthorized\"96\"UpgradeFailed\",2:3959790,9791],1:\"AdminChanged\",2:10959790,9792,9791],1:\"Deployed\",2:10959790,9792],1:\"Upgraded\",2:10},{0:[{90],1:\"adminOf\",12:[{9199{0:[{90,{91],1:\"changeAdmin\",12:[],13:\"nonpayable\",2:15},{0:[{92,{91],1:\"deploy\",12:[{9098,{0:[{92,{91,{94],1:\"deployAndCall\",12:[{9098,{0:[{92,{91,{93],1:\"deployDeterministic\",12:[{9098,{0:[{92,{91,{93,{94],1:\"deployDeterministicAndCall\",12:[{9098,{0:[],1:\"initCodeHash\",12:[{6:19,1:\"result\",2:19}99{0:[{93],1:\"predictDeterministicAddress\",12:[{6:7,1:\"predicted\",2:7}99{0:[{90,{92],1:\"upgrade\",12:[98,{0:[{90,{92,{94],1:\"upgradeAndCall\",12:[98]'.replace(/9\\d/g, function (m) { return [\"6:7,1:8,2:7}\",\"6:7,1:9,2:7}\",\"6:7,1:11,2:7}\",\"6:19,1:20,2:19}\",\"6:17,1:18,2:17}\",\"},{4:false,0:[\",\",2:3},{0:[],1:\",\"{5:true,\",\"],13:16,2:15}\",\"],13:14,2:15},\"][m-90] }).replace(/\\d+/g, function (m) { return '\"' + (\"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt\".split(\",\")[m]) + '\"' }));\n\n /*--------------------------- END ----------------------------*/\n\n if (typeof define === \"function\" && define.amd) {\n define(\"solady\", [], function() {\n return solady\n });\n }\n\n if (!noGlobal) {\n window.solady = solady;\n }\n\n return solady;\n});\n","import {\n type Config,\n type ReadContractParameters,\n type WatchContractEventParameters,\n type WriteContractParameters,\n waitForTransactionReceipt,\n} from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport { LibZip } from 'solady';\nimport type {\n Abi,\n AbiEvent,\n Address,\n ContractEventName,\n ContractFunctionName,\n GetLogsParameters,\n Hash,\n Hex,\n Log,\n PrivateKeyAccount,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n encodeAbiParameters,\n isHex,\n keccak256,\n parseAbiParameters,\n slice,\n toHex,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { signTypedData } from 'viem/accounts';\nimport { ContractAction } from './Actions/ContractAction';\nimport { ERC721MintAction } from './Actions/ERC721MintAction';\nimport {\n LIST_MANAGER_ROLE,\n SimpleAllowList,\n} from './AllowLists/SimpleAllowList';\nimport { SimpleDenyList } from './AllowLists/SimpleDenyList';\nimport { VestingBudget } from './Budgets/VestingBudget';\nimport type { ERC1155Incentive } from './Incentives/ERC1155Incentive';\nimport { SignerValidator } from './Validators/SignerValidator';\nimport { NoContractAddressUponReceiptError } from './errors';\n\n/**\n * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (writeContract)[https://viem.sh/docs/contract/writeContract]\n *\n * @export\n * @typedef {WriteParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type WriteParams<\n abi extends Abi,\n functionName extends ContractFunctionName<abi>,\n> = Partial<\n Omit<\n WriteContractParameters<abi, functionName>,\n 'address' | 'args' | 'functionName' | 'abi'\n >\n>;\n\n/**\n * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (readContract)[https://viem.sh/docs/contract/readContract]\n *\n * @export\n * @typedef {ReadParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type ReadParams<\n abi extends Abi,\n functionName extends ContractFunctionName<abi>,\n> = Partial<\n Omit<\n ReadContractParameters<abi, functionName>,\n 'address' | 'args' | 'functionName' | 'abi'\n >\n>;\n\n/**\n * Helper type that encapsulates common `watchContractEvent` parameters without fields like `address`, and `abi` that are expected to be provided the SDK.\n * See (watchContractEvent)[https://wagmi.sh/core/api/actions/watchContractEvent]\n *\n * @export\n * @typedef {WatchParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi> | undefined} [eventName=undefined]\n */\nexport type WatchParams<\n abi extends Abi,\n eventName extends ContractEventName<abi> | undefined = undefined,\n> = Partial<\n Omit<WatchContractEventParameters<abi, eventName>, 'address' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `getLogs` parameters without fields like `address` that are expected to be provided the SDK.\n * See (getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]\n *\n * @export\n * @typedef {GetLogsParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} event\n * @template {ExtractAbiEvent<abi, event>} [abiEvent=ExtractAbiEvent<abi, event>]\n * @template {| readonly AbiEvent[]\n * | readonly unknown[]\n * | undefined} [abiEvents=abiEvent extends AbiEvent ? [abiEvent] : undefined]\n */\nexport type GetLogsParams<\n abi extends Abi,\n event extends ContractEventName<abi>,\n abiEvent extends ExtractAbiEvent<abi, event> = ExtractAbiEvent<abi, event>,\n abiEvents extends\n | readonly AbiEvent[]\n | readonly unknown[]\n | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined,\n> = Partial<Omit<GetLogsParameters<abiEvent, abiEvents>, 'address'>> & {\n chainId?: number | undefined;\n};\n\n/**\n * A generic `viem.Log` event with typed `args` support via a given `Abi` and `ContractEventName`\n *\n * @export\n * @typedef {GenericLog}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} [event=ContractEventName<abi>]\n */\nexport type GenericLog<\n abi extends Abi,\n event extends ContractEventName<abi> = ContractEventName<abi>,\n> = Log<bigint, number, false, ExtractAbiEvent<abi, event>, false>;\n\n/**\n * Helper utility to convert a string to a `bytes4` type\n *\n * @export\n * @param {string} input\n * @returns {Hex}\n */\nexport function bytes4(input: string) {\n return slice(isHex(input) ? keccak256(input) : keccak256(toHex(input)), 0, 4);\n}\n\n/**\n * Utility function to wait for a transaction receipt, and extract the contractAddress\n *\n * @export\n * @async\n * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {Promise<Hash>} hash - A transaction hash promise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}\n * @returns {unknown}\n * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received\n */\nexport async function getDeployedContractAddress(\n config: Config,\n hash: Promise<Hash>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n) {\n const receipt = await waitForTransactionReceipt(config, {\n ...waitParams,\n hash: await hash,\n });\n if (!receipt.contractAddress)\n throw new NoContractAddressUponReceiptError(receipt);\n return receipt.contractAddress;\n}\n\n/**\n * Utility type to encapsulate a transaction hash, and the simulated result prior to submitting the transaction.\n *\n * @export\n * @typedef {HashAndSimulatedResult}\n * @template [T=unknown]\n */\nexport type HashAndSimulatedResult<T = unknown> = { hash: Hash; result: T };\n\n/**\n * Helper function to wait for a transaction receipt given a hash promise.\n *\n * @export\n * @async\n * @template [Result=unknown]\n * @param {WagmiConfig} config\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\nexport async function awaitResult<Result = unknown>(\n config: Config,\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n): Promise<Result> {\n const { hash, result } = await hashPromise;\n await waitForTransactionReceipt(config, {\n ...waitParams,\n hash,\n });\n return result;\n}\n\n/**\n * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.\n *\n * @export\n * @enum {number}\n */\nexport enum RegistryType {\n ACTION = 0,\n ALLOW_LIST = 1,\n BUDGET = 2,\n INCENTIVE = 3,\n VALIDATOR = 4,\n}\n\n/**\n * Enum representing incentive disbursement strategies.\n *\n * @export\n * @enum {number}\n */\nexport enum StrategyType {\n POOL = 0,\n MINT = 1,\n RAFFLE = 2,\n}\n\n/**\n * Enum representing inventive disbursement strategies for {@link ERC1155Incentive}\n *\n * @export\n * @enum {number}\n */\nexport enum ERC1155StrategyType {\n POOL = 0,\n MINT = 1,\n}\n\n/**\n * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.\n * This is used to pass the base contract and its initialization parameters in an efficient manner\n *\n * @export\n * @typedef {Target}\n */\nexport type Target = {\n isBase: boolean;\n instance: Address;\n parameters: Hex;\n};\n\n/*\n * Action Event Payloads\n */\n\n/**\n * Filter types used to determine how criteria are evaluated.\n *\n * @export\n * @enum {number}\n */\nexport enum FilterType {\n EQUAL = 0,\n NOT_EQUAL = 1,\n GREATER_THAN = 2,\n LESS_THAN = 3,\n CONTAINS = 4,\n}\n\n/**\n * The primitive types supported for filtering.\n *\n * @export\n * @enum {number}\n */\nexport enum PrimitiveType {\n UINT = 0,\n ADDRESS = 1,\n BYTES = 2,\n STRING = 3,\n}\n\n/**\n * Object representation of a `Criteria` struct used in event actions.\n *\n * @export\n * @interface Criteria\n * @typedef {Criteria}\n */\nexport interface Criteria {\n /**\n * The filter type used in this criteria.\n *\n * @type {FilterType}\n */\n filterType: FilterType;\n /**\n * The primitive type of the field being filtered.\n *\n * @type {PrimitiveType}\n */\n fieldType: PrimitiveType;\n /**\n * The index in the logs argument array where the field is located.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The filter data used for complex filtering.\n *\n * @type {Hex}\n */\n filterData: Hex;\n}\n\n/**\n * Whether a given signature is an event or function\n *\n * @export\n * @enum {number}\n */\nexport enum SignatureType {\n EVENT = 0,\n FUNC = 1,\n}\n\n/**\n * The payload describing how claimants are identified\n *\n * @export\n * @interface ActionClaimant\n * @typedef {ActionClaimant}\n */\nexport interface ActionClaimant {\n /**\n * Whether claimaint is inferred from event or function\n *\n * @type {SignatureType}\n */\n signatureType: SignatureType;\n /**\n * The 4 byte signature of the event or function\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index corresponding to claimant.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the target contract\n *\n * @type {Address}\n */\n targetContract: Address;\n}\n\n/**\n * Object representation of an `ActionStep` struct used in event actions.\n *\n * @export\n * @interface ActionStep\n * @typedef {ActionStep}\n */\nexport interface ActionStep {\n /**\n * The signature of the event.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * Whether claimaint is inferred from event or function\n *\n * @type {SignatureType}\n */\n signatureType: SignatureType;\n /**\n * The type of action being performed.\n *\n * @type {number}\n */\n actionType: number;\n /**\n * The address of the target contract.\n *\n * @type {Address}\n */\n targetContract: Address;\n /**\n * The criteria used for this action step.\n *\n * @type {Criteria}\n */\n actionParameter: Criteria;\n}\n\n/**\n * You can either supply a simplified version of the payload, or one that explicitly declares action steps.\n *\n * @export\n * @typedef {EventActionPayload}\n */\nexport type EventActionPayload =\n | EventActionPayloadSimple\n | EventActionPayloadRaw;\n\nexport interface EventActionPayloadSimple {\n /**\n * The payload describing how claimants are identified\n *\n * @type {ActionClaimant}\n */\n actionClaimant: ActionClaimant;\n\n /**\n * Up to 4 action steps.\n * If you supply less than 4, then the last step will be reused to satisfy the EventAction.InitPayload\n * Any more than 4 will throw an error.\n *\n * @type {ActionStep[]}\n */\n actionSteps: ActionStep[];\n}\n\n/**\n * Typeguard to determine if a user is supplying a simple or raw EventActionPayload\n *\n * @param {*} opts\n * @returns {opts is EventActionPayloadSimple}\n */\nexport function isEventActionPayloadSimple(\n opts: EventActionPayload,\n): opts is EventActionPayloadSimple {\n return Array.isArray((opts as EventActionPayloadSimple).actionSteps);\n}\n\n/**\n * Object representation of an `InitPayload` struct used to initialize event actions.\n *\n * @export\n * @interface EventActionPayloadRaw\n * @typedef {EventActionPayloadRaw}\n */\nexport interface EventActionPayloadRaw {\n /**\n * The payload describing how claimants are identified\n *\n * @type {ActionClaimant}\n */\n actionClaimant: ActionClaimant;\n /**\n * The first action step.\n *\n * @type {ActionStep}\n */\n actionStepOne: ActionStep;\n /**\n * The second action step.\n *\n * @type {ActionStep}\n */\n actionStepTwo: ActionStep;\n /**\n * The third action step.\n *\n * @type {ActionStep}\n */\n actionStepThree: ActionStep;\n /**\n * The fourth action step.\n *\n * @type {ActionStep}\n */\n actionStepFour: ActionStep;\n}\n\n/**\n * Function to properly encode an event action payload.\n *\n * @param {InitPayload} param0\n * @param {ActionStep} param0.actionStepOne - The first action step to initialize.\n * @param {ActionStep} param0.actionStepTwo - The second action step to initialize.\n * @param {ActionStep} param0.actionStepThree - The third action step to initialize.\n * @param {ActionStep} param0.actionStepFour - The fourth action step to initialize.\n * @returns {Hex}\n */\nexport const prepareEventActionPayload = ({\n actionClaimant,\n actionStepOne,\n actionStepTwo,\n actionStepThree,\n actionStepFour,\n}: EventActionPayloadRaw) => {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayload',\n components: [\n {\n type: 'tuple',\n name: 'actionClaimant',\n components: [\n { type: 'uint8', name: 'signatureType' },\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepOne',\n components: [\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepTwo',\n components: [\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepThree',\n components: [\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n {\n type: 'tuple',\n name: 'actionStepFour',\n components: [\n { type: 'bytes4', name: 'signature' },\n { type: 'uint8', name: 'signatureType' },\n { type: 'uint8', name: 'actionType' },\n { type: 'address', name: 'targetContract' },\n {\n type: 'tuple',\n name: 'actionParameter',\n components: [\n { type: 'uint8', name: 'filterType' },\n { type: 'uint8', name: 'fieldType' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'bytes', name: 'filterData' },\n ],\n },\n ],\n },\n ],\n },\n ],\n [\n {\n actionClaimant,\n actionStepOne,\n actionStepTwo,\n actionStepThree,\n actionStepFour,\n },\n ],\n );\n};\n\n/**\n * Object representation of the `ERC20Incentive.InitPayload`.\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\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// * Function to properly encode a validation payload.\n// *\n// * @param {SignerValidatorValidatePayload} param0\n// * @param {Address} param0.signer - The address of the signer with which to validate.\n// * @param {Hex} param0.hash - The transaction 558 to associate with the validation.\n// * @param {Hex} param0.signature - The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer\n// * @param {Address} param0.validator - Address of the validator module.\n// * @returns {*}\n// */\n// export const prepareSignerValidatorSignaturePayload = ({\n// boostId,\n// incentiveId,\n// claimant,\n// claimData,\n// validator,\n// chainId,\n// }: SignerValidatorSignaturePayload) => {\n// const domain = {\n// name: 'SignerValidator',\n// version: '1',\n// chainId: chainId,\n// verifyingContract: validator,\n// };\n// return hashTypedData({\n// domain,\n// types: {\n// SignerValidatorData: [\n// { name: 'incentiveId', type: 'uint256' },\n// { name: 'claimant', type: 'address' },\n// { name: 'boostId', type: 'uint256' },\n// { name: 'claimData', type: 'bytes32' },\n// ],\n// },\n// primaryType: 'SignerValidatorData',\n// message: {\n// incentiveId,\n// claimant,\n// boostId,\n// claimData,\n// },\n// });\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 * 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 const 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\n/**\n * Object representation of a {@link BoostClaimData} initialization payload\n *\n * @export\n * @interface BoostClaimData\n * @typedef {BoostClaimData}\n */\nexport interface BoostClaimData {\n /**\n * The validator data.\n *\n * @type {Hex}\n */\n validatorData: Hex;\n\n /**\n * The incentive data.\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n}\n\n/**\n * Given a {@link BoostClaimData}, properly encode the initialization payload.\n *\n * @param {BoostClaimData} param0\n * @param {Hex} param0.validatorData\n * @param {Hex} param0.incentiveData\n * @returns {Hex}\n */\nexport const prepareBoostClaimData = ({\n validatorData,\n incentiveData,\n}: BoostClaimData) => {\n return encodeAbiParameters(\n [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n [validatorData, incentiveData],\n );\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 incentive quantity.\n *\n * @type {number}\n */\n incentiveQuantity: number;\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 const 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 * 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 incentive quantity.\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 * 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 domain = {\n name: 'SignerValidator',\n version: '1',\n chainId: chainId,\n verifyingContract: validator,\n };\n const typedData = {\n domain,\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 const trustedSignature = await signTypedData({\n ...typedData,\n privateKey: signer.key,\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 * Object representation of a {@link SimpleAllowList} initialization payload.\n *\n * @export\n * @interface SimpleAllowListPayload\n * @typedef {SimpleAllowListPayload}\n */\nexport interface SimpleAllowListPayload {\n /**\n * The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of allowed addresses.\n *\n * @type {Address[]}\n */\n allowed: Address[];\n}\n\n/**\n * Given a {@link SimpleAllowListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleAllowListPayload} param0\n * @param {Address} param0.owner - The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n * @param {Address[]} param0.allowed - List of allowed addresses.\n * @returns {Hex}\n */\nexport const prepareSimpleAllowListPayload = ({\n owner,\n allowed,\n}: SimpleAllowListPayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'allowed' },\n ],\n [owner, allowed],\n );\n};\n\n/**\n * Object representation of a {@link SimpleDenyList} initialization payload.\n *\n * @export\n * @interface SimpleDenyListPayload\n * @typedef {SimpleDenyListPayload}\n */\nexport interface SimpleDenyListPayload {\n /**\n * The allow list's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of denied addresses.\n *\n * @type {Address[]}\n */\n denied: Address[];\n}\n\n/**\n * Given a {@link SimpleDenyListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleDenyListPayload} param0\n * @param {Address} param0.owner - The allow list's owner\n * @param {Address[]} param0.denied - List of denied addresses.\n * @returns {Hex}\n */\nexport const prepareSimpleDenyListPayload = ({\n owner,\n denied,\n}: SimpleDenyListPayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'denied' },\n ],\n [owner, denied],\n );\n};\n\n/**\n * Object representation of `BoostCore.InitPayload` struct.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface BoostPayload {\n /**\n * Address to valid budget.\n *\n * @type {Address}\n */\n budget: Address;\n /**\n * Target for existing action, or base with initialization payload.\n *\n * @type {Target}\n */\n action: Target;\n /**\n * Target for existing validator, or base with initialization payload.\n *\n * @type {Target}\n */\n validator: Target;\n /**\n * Target for existing allowList, or base with initialization payload.\n *\n * @type {Target}\n */\n allowList: Target;\n /**\n * Targets for new incentives, with initialization payloads.\n *\n * @type {Target[]}\n */\n incentives: Target[];\n /**\n * The base protocol fee (in bps)\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n * The base referral fee (in bps)\n *\n * @type {?bigint}\n */\n referralFee?: bigint;\n /**\n * Optional maximum amount of participants in the Boost.\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n * The owner of the Boost.\n *\n * @type {Address}\n */\n owner: Address;\n}\n\n/**\n * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`\n *\n * @export\n * @param {BoostPayload} param0\n * @param {Address} param0.budget - Address to valid budget.\n * @param {Target} param0.action - Target for existing action, or base with initialization payload.\n * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.\n * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.\n * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.\n * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)\n * @param {bigint} [param0.referralFee=0n] - The base referral fee (in bps)\n * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.\n * @param {Address} param0.owner - The owner of the Boost.\n * @returns {Hex}\n */\nexport function prepareBoostPayload({\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee = 0n,\n referralFee = 0n,\n maxParticipants = 0n,\n owner,\n}: BoostPayload): Hex {\n return LibZip.cdCompress(\n encodeAbiParameters(\n parseAbiParameters([\n 'BoostPayload payload',\n 'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint64 referralFee; uint256 maxParticipants; address owner; }',\n 'struct Target { bool isBase; address instance; bytes parameters; }',\n ]),\n [\n {\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee,\n referralFee,\n maxParticipants,\n owner,\n },\n ],\n ),\n ) as Hex;\n}\n\n/**\n * Object representation of\n *\n * @export\n * @interface ERC1155Payload\n * @typedef {ERC1155Payload}\n */\nexport interface ERC1155Payload {\n /**\n * The ERC1155 token ID for the incentive\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Given a token ID and amount, properly encode a `ERC1155Incentive.ERC1155Payload` for use with {@link ERC1155Incentive} initialization.\n *\n * @export\n * @param {ERC1155Payload} param0\n * @param {bigint} param0.tokenId - The ERC1155 token ID for the incentive\n * @param {bigint} param0.amount - The amount to transfer\n * @returns {Hex}\n */\nexport function prepareERC1155Payload({ tokenId, amount }: ERC1155Payload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ERC1155Payload payload',\n 'struct ERC1155Payload { uint256 tokenId; uint256 amount; bytes data; }',\n ]),\n [{ tokenId, amount, data: '0x' }],\n );\n}\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 * 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\n/**\n * The configuration parameters for the CGDAIncentive\n *\n * @export\n * @interface CGDAParameters\n * @typedef {CGDAParameters}\n */\nexport interface CGDAParameters {\n /**\n * The amount to subtract from the current reward after each claim\n *\n * @type {bigint}\n */\n rewardDecay: bigint;\n /**\n * The amount by which the reward increases for each hour without a claim (continuous linear increase)\n *\n * @type {bigint}\n */\n rewardBoost: bigint;\n /**\n * The timestamp of the last claim\n *\n * @type {bigint}\n */\n lastClaimTime: bigint;\n /**\n * The current reward amount\n *\n * @type {bigint}\n */\n currentReward: bigint;\n}\n\n/**\n * The object representation of a `CGDAIncentive.InitPayload`\n *\n * @export\n * @interface CGDAIncentivePayload\n * @typedef {CGDAIncentivePayload}\n */\nexport interface CGDAIncentivePayload {\n /**\n * The address of the ERC20-like token\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The initial reward amount\n *\n * @type {bigint}\n */\n initialReward: bigint;\n /**\n * The amount to subtract from the current reward after each claim\n *\n * @type {bigint}\n */\n rewardDecay: bigint;\n /**\n * The amount by which the reward increases for each hour without a claim (continuous linear increase)\n *\n * @type {bigint}\n */\n rewardBoost: bigint;\n /**\n * The total budget for the incentive\n *\n * @type {bigint}\n */\n totalBudget: bigint;\n}\n\n/**\n * Given a {@link CGDAIncentivePayload}, properly encode a `CGDAIncentive.InitPayload` for use with {@link CGDAIncentive} initialization.\n *\n * @param {CGDAIncentivePayload} param0\n * @param {Address} param0.asset - The address of the ERC20-like token\n * @param {bigint} param0.initialReward - The initial reward amount\n * @param {bigint} param0.rewardDecay - The amount to subtract from the current reward after each claim\n * @param {bigint} param0.rewardBoost - The amount by which the reward increases for each hour without a claim (continuous linear increase)\n * @param {bigint} param0.totalBudget - The total budget for the incentive\n * @returns {Hex}\n */\nexport const prepareCGDAIncentivePayload = ({\n asset,\n initialReward,\n rewardDecay,\n rewardBoost,\n totalBudget,\n}: CGDAIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'initialReward' },\n { type: 'uint256', name: 'rewardDecay' },\n { type: 'uint256', name: 'rewardBoost' },\n { type: 'uint256', name: 'totalBudget' },\n ],\n [asset, initialReward, rewardDecay, rewardBoost, totalBudget],\n );\n};\n\n/**\n * The object representation of a `ERC1155Incentive.InitPayload`\n *\n * @export\n * @interface ERC1155IncentivePayload\n * @typedef {ERC1155IncentivePayload}\n */\nexport interface ERC1155IncentivePayload {\n /**\n * The address of the `ERC1155` asset\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * Should be `Strategy.POOL`\n *\n * @type {ERC1155StrategyType}\n */\n strategy: ERC1155StrategyType;\n /**\n * The token ID to target\n *\n * @type {bigint}\n */\n tokenId: 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 * Any extra data to accompany the claim, if applicable.\n *\n * @type {Hex}\n */\n extraData: Hex;\n}\n\n/**\n * Given a {@link ERC1155IncentivePayload}, properly encode a `ERC1155Incentive.InitPayload` for use with {@link ERC1155Incentive} initialization.\n *\n * @param {ERC1155IncentivePayload} param0\n * @param {Address} param0.asset - The address of the `ERC1155` asset\n * @param {ERC1155StrategyType} param0.strategy - Should be `Strategy.POOL`\n * @param {bigint} param0.tokenId - The token ID to target\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @param {Hex} param0.extraData - Any extra data to accompany the claim, if applicable.\n * @returns {Hex}\n */\nexport const prepareERC1155IncentivePayload = ({\n asset,\n strategy,\n tokenId,\n limit,\n extraData,\n}: ERC1155IncentivePayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'InitPayload payload',\n 'struct InitPayload { address asset; uint8 strategy; uint256 tokenId; uint256 limit; bytes extraData; }',\n ]),\n [{ asset, strategy, tokenId, limit, extraData }],\n );\n // return encodeAbiParameters(\n // [\n // { type: 'address', name: 'asset' },\n // { type: 'uint8', name: 'strategy' },\n // { type: 'uint256', name: 'tokenId' },\n // { type: 'uint256', name: 'limit' },\n // { type: 'bytes', name: 'extraData' },\n // ],\n // [asset, strategy, tokenId, limit, extraData],\n // );\n};\n\n/**\n * The object representation of a `AllowListIncentive.InitPayload`\n *\n * @export\n * @interface AllowListIncentivePayload\n * @typedef {AllowListIncentivePayload}\n */\nexport interface AllowListIncentivePayload {\n /**\n * The address to the allowlist to add claimers to.\n *\n * @type {Address}\n */\n allowList: Address;\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 * Given a {@link AllowListIncentivePayload}, properly encode a `AllowListIncentive.InitPayload` for use with {@link AllowListIncentive} initialization.\n *\n * @param {AllowListIncentivePayload} param0\n * @param {Address} param0.allowList - The address to the allowlist to add claimers to.\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {Hex}\n */\nexport const prepareAllowListIncentivePayload = ({\n allowList,\n limit,\n}: AllowListIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'allowList' },\n { type: 'uint256', name: 'limit' },\n ],\n [allowList, limit],\n );\n};\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @returns {*}\n */\nexport const prepareERC20IncentivePayload = ({\n asset,\n strategy,\n reward,\n limit,\n}: ERC20IncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [asset, strategy, reward, limit],\n );\n};\n\n/**\n * The object representation of a `ERC20VariableIncentivePayload.InitPayload`\n *\n * @export\n * @interface ERC20VariableIncentivePayload\n * @typedef {ERC20VariableIncentivePayload}\n */\nexport interface ERC20VariableIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * Given a {@link ERC20VariableIncentivePayload}, properly encode a ` ERC20VariableIncentive.InitPayload` for use with {@link ERC20VariableIncentive} initialization.\n *\n * @param {ERC20VariableIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @returns {*}\n */\nexport const prepareERC20VariableIncentivePayload = ({\n asset,\n reward,\n limit,\n}: ERC20VariableIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [asset, reward, limit],\n );\n};\n\n/**\n * The object representation of a `ContractAction.InitPayload`\n *\n * @export\n * @interface ContractActionPayload\n * @typedef {ContractActionPayload}\n */\nexport interface ContractActionPayload {\n /**\n * The chain ID on which the target exists\n *\n * @type {bigint}\n */\n chainId: bigint;\n /**\n * The target contract address\n *\n * @type {Address}\n */\n target: Address;\n /**\n * The selector for the function to be called\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The native token value to send with the function call\n *\n * @type {bigint}\n */\n value: bigint;\n}\n\n/**\n * `ERC721MintActionPayload` is a re-exported `ContractActionPayload`\n *\n * @export\n * @typedef {ERC721MintActionPayload}\n */\nexport type ERC721MintActionPayload = ContractActionPayload;\n\n/**\n * The object representation of a `SimpleBudgetPayload.InitPayload`\n *\n * @export\n * @interface SimpleBudgetPayload\n * @typedef {SimpleBudgetPayload}\n */\nexport interface SimpleBudgetPayload {\n /**\n * The budget's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n *\n * @type {Address[]}\n */\n authorized: Address[];\n}\n\n/**\n * Given a {@link SimpleBudgetPayload}, properly encode a `SimpleBudget.InitPayload` for use with {@link SimpleBudget} initialization.\n *\n * @param {SimpleBudgetPayload} param0\n * @param {Address} param0.owner - The budget's owner\n * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n * @returns {*}\n */\nexport const prepareSimpleBudgetPayload = ({\n owner,\n authorized,\n}: SimpleBudgetPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'SimpleBudgetPayload payload',\n 'struct SimpleBudgetPayload { address owner; address[] authorized; }',\n ]),\n [{ owner, authorized }],\n );\n};\n\n/**\n * The object representation of a `ManagedBudgetPayload.InitPayload`\n *\n * @export\n * @interface ManagedBudgetPayload\n * @typedef {ManagedBudgetPayload}\n */\nexport interface ManagedBudgetPayload {\n /**\n * The budget's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n *\n * @type {Address[]}\n */\n authorized: Address[];\n /**\n * List of roles to assign to the corresponding account by index.\n *\n * @type {bigint[]}\n */\n roles: bigint[];\n}\n\n/**\n * Given a {@link ManagedBudgetPayload}, properly encode a `ManagedBudget.InitPayload` for use with {@link ManagedBudget} initialization.\n *\n * @param {ManagedBudgetPayload} param0\n * @param {Address} param0.owner - The budget's owner\n * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n * @param {{}} param0.roles - List of roles to assign to the corresponding account by index.\n * @returns {*}\n */\nexport const prepareManagedBudgetPayload = ({\n owner,\n authorized,\n roles,\n}: ManagedBudgetPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ManagedBudgetPayload payload',\n 'struct ManagedBudgetPayload { address owner; address[] authorized; uint256[] roles; }',\n ]),\n [{ owner, authorized, roles }],\n );\n};\n\n/**\n * The object representation of a `VestingBudget.InitPayload`\n *\n * @export\n * @interface VestingBudgetPayload\n * @typedef {VestingBudgetPayload}\n */\nexport interface VestingBudgetPayload {\n /**\n * The budget's owner.\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n *\n * @type {Address[]}\n */\n authorized: Address[];\n /**\n * The timestamp at which the vesting schedule begins\n *\n * @type {bigint}\n */\n start: bigint;\n /**\n * The duration of the vesting schedule (in seconds)\n *\n * @type {bigint}\n */\n duration: bigint;\n /**\n * The duration of the cliff period (in seconds)\n *\n * @type {bigint}\n */\n cliff: bigint;\n}\n\n/**\n * Given a {@link VestingBudgetPayload}, properly encode a `VestingBudget.InitPayload` for use with {@link VestingBudget} initialization.\n *\n * @param {VestingBudgetPayload} param0\n * @param {Address} param0.owner - The budget's owner.\n * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n * @param {bigint} param0.start - The timestamp at which the vesting schedule begins\n * @param {bigint} param0.duration - The duration of the vesting schedule (in seconds)\n * @param {bigint} param0.cliff - The duration of the cliff period (in seconds)\n * @returns {Hex}\n */\nexport const prepareVestingBudgetPayload = ({\n owner,\n authorized,\n start,\n duration,\n cliff,\n}: VestingBudgetPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'VestingBudgetPayload payload',\n 'struct VestingBudgetPayload { address owner; address[] authorized; uint64 start; uint64 duration; uint64 cliff; }',\n ]),\n [{ owner, authorized, start, duration, cliff }],\n );\n};\n\n/**\n * Given a {@link ContractActionPayload}, properly encode a `ContractAction.InitPayload` for use with {@link ContractAction} initialization.\n *\n * @param {ContractActionPayload} param0\n * @param {bigint} param0.chainId - The chain ID on which the target exists\n * @param {Address} param0.target - The target contract address\n * @param {Hex} param0.selector - The selector for the function to be called\n * @param {bigint} param0.value - The native token value to send with the function call\n * @returns {Hex}\n */\nexport const prepareContractActionPayload = ({\n chainId,\n target,\n selector,\n value,\n}: ContractActionPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ContractActionPayload payload',\n 'struct ContractActionPayload { uint256 chainId; address target; bytes4 selector; uint256 value; }',\n ]),\n [{ chainId, target, selector, value }],\n );\n};\n\n/**\n * Given a {@link ContractActionPayload}, properly encode a `ContractAction.InitPayload` for use with {@link ERC721MintAction} initialization.\n *\n * @param {ContractActionPayload} param0\n * @param {bigint} param0.chainId - The chain ID on which the target exists\n * @param {Address} param0.target - The target contract address\n * @param {Hex} param0.selector - The selector for the function to be called\n * @param {bigint} param0.value - The native token value to send with the function call\n * @returns {*}\n */\nexport const prepareERC721MintActionPayload = ({\n chainId,\n target,\n selector,\n value,\n}: ContractActionPayload) => {\n return prepareContractActionPayload({ chainId, target, selector, value });\n};\n\n/**\n * The object representation of an `Incentive.ClaimPayload`\n *\n * @export\n * @interface ClaimPayload\n * @typedef {ClaimPayload}\n */\nexport interface ClaimPayload {\n /**\n * The address of the recipient\n *\n * @type {Address}\n */\n target: Address;\n /**\n * The implementation-specific data for the claim, if needed\n *\n * @type {?Hex}\n */\n data?: Hex;\n}\n\n/**\n * Given a valid {@link ClaimPayload}, encode the payload for use with Incentive operations.\n *\n * @param {ClaimPayload} param0\n * @param {Address} param0.target - The address of the recipient\n * @param {Hex} [param0.data=zeroHash] - The implementation-specific data for the claim, if needed\n * @returns {*}\n */\nexport const prepareClaimPayload = ({\n target,\n data = zeroHash,\n}: ClaimPayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'target' },\n { type: 'bytes', name: 'data' },\n ],\n [target, data],\n );\n};\n\n/*\n * Transfer Payloads\n */\n\n/**\n * The various types of assets supported in Budgets and Incentives.\n *\n * @export\n * @enum {number}\n */\nexport enum AssetType {\n ETH,\n ERC20,\n ERC1155,\n}\n\n/**\n * Object representation of a generic `Transfer` struct.\n *\n * @export\n * @interface TransferPayload\n * @typedef {TransferPayload}\n */\nexport interface TransferPayload {\n /**\n * The type of the asset being transferred.\n *\n * @type {AssetType}\n */\n assetType: AssetType;\n /**\n * The address of the asset to transfer, zero address for ETH.\n *\n * @type {Address}\n */\n address: Address;\n /**\n * The account from which to transfer the assets.\n *\n * @type {Address}\n */\n target: Address;\n /**\n * An encoded {@link FungiblePayload}, use {@link prepareFungiblePayload} to construct.\n *\n * @type {Hex}\n */\n data: Hex;\n}\n\n/**\n * Encodes parameters for transferring the transfer of Fungible and ERC1155 assets, used for {@link Budget} operations.\n * Typically you'd use {@link prepareFungibleTransfer} or {@link prepareERC1155Transfer}\n *\n * @param {TransferPayload} param0\n * @param {AssetType} param0.assetType - The asset type being transferred.\n * @param {Address} param0.address - The address of the asset, use zero address for ETH transfers.\n * @param {Address} param0.target - The address of the account being transferred from\n * @param {Hex} param0.data - Use {@link prepareFungiblePayload} to properly encode an amount to transfer\n * @returns {Hex}\n */\nexport const prepareTransferPayload = ({\n assetType,\n address,\n target,\n data,\n}: TransferPayload) => {\n return encodeAbiParameters(\n [\n { type: 'uint8', name: 'assetType' },\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'target' },\n { type: 'bytes', name: 'data' },\n ],\n [assetType, address, target, data],\n );\n};\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of ERC1155 assets.\n *\n * @export\n * @interface ERC1155TransferPayload\n * @typedef {ERC1155TransferPayload}\n */\nexport interface ERC1155TransferPayload {\n /**\n * The token ID to transfer\n *\n * @type {bigint}\n */\n tokenId: bigint;\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset to target\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for transferring the transfer of ERC1155 assets, used for {@link Budget} operations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {ERC1155TransferPayload} param0\n * @param {bigint} param0.tokenId - The token ID to transfer\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset to target\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareERC1155Transfer({\n tokenId,\n amount,\n asset,\n target,\n}: ERC1155TransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: AssetType.ERC1155,\n asset,\n data: prepareERC1155Payload({ tokenId, amount }),\n target,\n },\n ],\n );\n}\n\n/**\n * An object representation of the `FungiblePayload` struct\n *\n * @export\n * @interface FungiblePayload\n * @typedef {FungiblePayload}\n */\nexport interface FungiblePayload {\n /**\n * The amount being transferred\n *\n * @type {bigint}\n */\n amount: bigint;\n}\n\n/**\n * Encodes an amount for the `FungiblePayload` struct\n *\n * @export\n * @param {FungiblePayload} param0\n * @param {bigint} param0.amount - The amount being transferred\n * @returns {*}\n */\nexport function prepareFungiblePayload({ amount }: FungiblePayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'FungiblePayload payload',\n 'struct FungiblePayload { uint256 amount; }',\n ]),\n [{ amount }],\n );\n}\n\n/**\n * An object representation of the `Budget.Transfer` contract struct for transfers of fungible assets.\n *\n * @export\n * @interface FungibleTransferPayload\n * @typedef {FungibleTransferPayload}\n */\nexport interface FungibleTransferPayload {\n /**\n * The amount to transfer\n *\n * @type {bigint}\n */\n amount: bigint;\n /**\n * The address of the asset. Use zero address for ETH transfers.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The account to transfer from\n *\n * @type {Address}\n */\n target: Address;\n}\n\n/**\n * Encodes parameters for a Fungible transfer, used for Budget allocations.\n * The caller must have already approved the contract to transfer the asset.\n *\n * @export\n * @param {FungibleTransferPayload} param0\n * @param {bigint} param0.amount - The amount to transfer\n * @param {Address} param0.asset - The address of the asset. Use zero address for ETH transfers.\n * @param {Address} param0.target - The account to transfer from\n * @returns {Hex}\n */\nexport function prepareFungibleTransfer({\n amount,\n asset,\n target,\n}: FungibleTransferPayload) {\n return encodeAbiParameters(\n parseAbiParameters([\n 'Transfer request',\n 'struct Transfer { uint8 assetType; address asset; address target; bytes data; }',\n ]),\n [\n {\n assetType: asset == zeroAddress ? AssetType.ETH : AssetType.ERC20,\n asset,\n data: prepareFungiblePayload({ amount }),\n target,\n },\n ],\n );\n}\n\n/**\n * Encodes a payload to validate that an action has been completed successfully.\n *\n *\n * @export\n * @param {Address} holder - The holder address\n * @param {bigint} payload - The token ID\n * @returns {Hex} - The first 20 bytes of the payload will be the holder address and the remaining bytes must be an encoded token ID (uint256)\n */\nexport function prepareERC721MintActionValidate(\n holder: Address,\n payload: bigint,\n) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'holder' },\n { type: 'bytes', name: 'payload' },\n ],\n [holder, toHex(payload)],\n );\n}\n\nexport function dedupeActionSteps(_steps: ActionStep[]): ActionStep[] {\n const steps: ActionStep[] = [],\n signatures: Record<string, boolean> = {};\n for (let step of _steps) {\n const signature = JSON.stringify(step);\n if (signatures[signature]) continue;\n steps.push(step);\n signatures[signature] = true;\n }\n return steps;\n}\n"],"names":["global","factory","module","exports","this","window","noGlobal","solady","LibZip","hexString","data","byteToString","b","parseByte","hexToBytes","a","i","bytesToHex","o","ib","ht","ob","j","s","h","d","c","l","r","p","q","e","u24","hash","x","literals","f","t","z","y","pushByte","rle","v","ERC1967Factory","m","bytes4","input","slice","isHex","keccak256","toHex","getDeployedContractAddress","config","waitParams","receipt","waitForTransactionReceipt","NoContractAddressUponReceiptError","awaitResult","hashPromise","result","RegistryType","StrategyType","ERC1155StrategyType","FilterType","PrimitiveType","SignatureType","isEventActionPayloadSimple","opts","prepareEventActionPayload","actionClaimant","actionStepOne","actionStepTwo","actionStepThree","actionStepFour","encodeAbiParameters","prepareSignerValidatorPayload","signers","validatorCaller","prepareBoostClaimData","validatorData","incentiveData","prepareSignerValidatorInputParams","signer","signature","incentiveQuantity","prepareSignerValidatorClaimDataPayload","chainId","validator","claimant","boostId","trustedSignature","signTypedData","prepareSimpleAllowListPayload","owner","allowed","prepareSimpleDenyListPayload","denied","prepareBoostPayload","budget","action","allowList","incentives","protocolFee","referralFee","maxParticipants","parseAbiParameters","prepareERC1155Payload","tokenId","amount","preparePointsIncentivePayload","venue","selector","reward","limit","prepareCGDAIncentivePayload","asset","initialReward","rewardDecay","rewardBoost","totalBudget","prepareERC1155IncentivePayload","strategy","extraData","prepareAllowListIncentivePayload","prepareERC20IncentivePayload","prepareERC20VariableIncentivePayload","prepareSimpleBudgetPayload","authorized","prepareManagedBudgetPayload","roles","prepareVestingBudgetPayload","start","duration","cliff","prepareContractActionPayload","target","value","prepareERC721MintActionPayload","prepareClaimPayload","zeroHash","AssetType","AssetType2","prepareTransferPayload","assetType","address","prepareERC1155Transfer","prepareFungiblePayload","prepareFungibleTransfer","zeroAddress","prepareERC721MintActionValidate","holder","payload","dedupeActionSteps","_steps","steps","signatures","step"],"mappings":";;;;;;AAuBA,GAAC,SAASA,GAAQC,GAAS;A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AAW,GAAuB,EAAE,QAAAtC,KAA2B;AAC3D,SAAAlC;AAAA,IACL+B,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD,CAAC,EAAE,QAAAG,EAAA,CAAQ;AAAA,EAAA;AAEf;AAyCO,SAASuC,GAAwB;AAAA,EACtC,QAAAvC;AAAA,EACA,OAAAO;AAAA,EACA,QAAAoB;AACF,GAA4B;AACnB,SAAA7D;AAAA,IACL+B,EAAmB;AAAA,MACjB;AAAA,MACA;AAAA,IAAA,CACD;AAAA,IACD;AAAA,MACE;AAAA,QACE,WAAWU,KAASiC,IAAc,IAAgB;AAAA,QAClD,OAAAjC;AAAA,QACA,MAAM+B,GAAuB,EAAE,QAAAtC,GAAQ;AAAA,QACvC,QAAA2B;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;AAWgB,SAAAc,GACdC,GACAC,GACA;AACO,SAAA7E;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,MAClC,EAAE,MAAM,SAAS,MAAM,UAAU;AAAA,IACnC;AAAA,IACA,CAAC4E,GAAQpG,EAAMqG,CAAO,CAAC;AAAA,EAAA;AAE3B;AAEO,SAASC,GAAkBC,GAAoC;AACpE,QAAMC,IAAsB,CAAA,GAC1BC,IAAsC;AACxC,WAASC,KAAQH,GAAQ;AACjB,UAAAtE,IAAY,KAAK,UAAUyE,CAAI;AACrC,IAAID,EAAWxE,CAAS,MACxBuE,EAAM,KAAKE,CAAI,GACfD,EAAWxE,CAAS,IAAI;AAAA,EAC1B;AACO,SAAAuE;AACT;","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@boostxyz/sdk",
3
- "version": "0.0.0-alpha.5",
3
+ "version": "0.0.0-alpha.7",
4
4
  "license": "GPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "files": [
7
- "dist"
7
+ "dist",
8
+ "src"
8
9
  ],
9
10
  "repository": "https://github.com/rabbitholegg/boost-protocol",
10
11
  "author": "Boost Team<boost-team@boost.xyz>",
@@ -0,0 +1,77 @@
1
+ import { selectors } from '@boostxyz/signatures/events';
2
+ import { loadFixture } from '@nomicfoundation/hardhat-toolbox-viem/network-helpers';
3
+ import type { Hex } from 'viem';
4
+ import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
5
+ import type { MockERC721 } from '../../test/MockERC721';
6
+ import { accounts } from '../../test/accounts';
7
+ import {
8
+ type Fixtures,
9
+ defaultOptions,
10
+ deployFixtures,
11
+ fundErc721,
12
+ } from '../../test/helpers';
13
+ import {
14
+ type EventActionPayloadSimple,
15
+ FilterType,
16
+ PrimitiveType,
17
+ SignatureType,
18
+ } from '../utils';
19
+ import { EventAction, actionFromAddress } from './Action';
20
+
21
+ let fixtures: Fixtures, erc721: MockERC721;
22
+
23
+ export function basicErc721TransferAction(
24
+ erc721: MockERC721,
25
+ ): EventActionPayloadSimple {
26
+ return {
27
+ actionClaimant: {
28
+ signatureType: SignatureType.EVENT,
29
+ signature: selectors['Transfer(address,address,uint256)'] as Hex,
30
+ fieldIndex: 2,
31
+ targetContract: erc721.assertValidAddress(),
32
+ },
33
+ actionSteps: [
34
+ {
35
+ signature: selectors['Transfer(address,address,uint256)'] as Hex,
36
+ signatureType: SignatureType.EVENT,
37
+ actionType: 0,
38
+ targetContract: erc721.assertValidAddress(),
39
+ actionParameter: {
40
+ filterType: FilterType.EQUAL,
41
+ fieldType: PrimitiveType.ADDRESS,
42
+ fieldIndex: 2,
43
+ filterData: accounts.at(1)!.account,
44
+ },
45
+ },
46
+ ],
47
+ };
48
+ }
49
+
50
+ export function cloneEventAction(fixtures: Fixtures, erc721: MockERC721) {
51
+ return function cloneEventAction() {
52
+ return fixtures.registry.clone(
53
+ crypto.randomUUID(),
54
+ new fixtures.bases.EventAction(
55
+ defaultOptions,
56
+ basicErc721TransferAction(erc721),
57
+ ),
58
+ );
59
+ };
60
+ }
61
+
62
+ beforeAll(async () => {
63
+ fixtures = await loadFixture(deployFixtures);
64
+ });
65
+
66
+ describe('Action', () => {
67
+ beforeEach(async () => {
68
+ erc721 = await loadFixture(fundErc721(defaultOptions));
69
+ });
70
+
71
+ test('can automatically instantiate EventAction given an address', async () => {
72
+ const _action = await loadFixture(cloneEventAction(fixtures, erc721));
73
+ expect(
74
+ await actionFromAddress(defaultOptions, _action.assertValidAddress()),
75
+ ).toBeInstanceOf(EventAction);
76
+ });
77
+ });