@boostxyz/sdk 0.0.0-alpha.7 → 0.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +1 -1
- package/dist/Actions/ContractAction.d.ts +46 -3
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +37 -10
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +257 -11
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +249 -82
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.d.ts +2 -2
- package/dist/AllowLists/AllowList.js +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +33 -4
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +52 -37
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs.map +1 -1
- package/dist/AllowLists/SimpleDenyList.d.ts +31 -2
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +41 -129
- package/dist/AllowLists/SimpleDenyList.js.map +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.cjs.map +1 -1
- package/dist/Auth/PassthroughAuth.js +4 -4
- package/dist/Auth/PassthroughAuth.js.map +1 -1
- package/dist/Boost.cjs +1 -1
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.d.ts +93 -1
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +151 -5
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +45 -7
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +352 -305
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.d.ts +18 -4
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +36 -25
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +40 -2
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +53 -36
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/SimpleBudget.d.ts +33 -2
- package/dist/Budgets/SimpleBudget.d.ts.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +54 -2
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Contract.cjs +1 -1
- package/dist/Deployable/Contract.cjs.map +1 -1
- package/dist/Deployable/Contract.js +1 -1
- package/dist/Deployable/Contract.js.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +8 -2
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +6 -0
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -1
- package/dist/Deployable/DeployableTarget.d.ts +4 -3
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +31 -28
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +35 -5
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +33 -21
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +89 -5
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +44 -23
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +67 -6
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.d.ts +49 -5
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +46 -27
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +42 -5
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.cjs.map +1 -1
- package/dist/Incentives/Incentive.js +48 -32
- package/dist/Incentives/Incentive.js.map +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.d.ts +49 -5
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +38 -21
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +298 -5
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +151 -26
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +1 -1
- package/dist/claiming.cjs +2 -0
- package/dist/claiming.cjs.map +1 -0
- package/dist/claiming.d.ts +43 -0
- package/dist/claiming.d.ts.map +1 -0
- package/dist/claiming.js +17 -0
- package/dist/claiming.js.map +1 -0
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +15 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +30 -21
- package/dist/errors.js.map +1 -1
- package/dist/{generated-DGpIVcv5.js → generated-57_Kffpz.js} +293 -282
- package/dist/generated-57_Kffpz.js.map +1 -0
- package/dist/{generated-Cd-Fe7W7.cjs → generated-wKBNvm48.cjs} +3 -3
- package/dist/generated-wKBNvm48.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -124
- package/dist/transfers.cjs +2 -0
- package/dist/transfers.cjs.map +1 -0
- package/dist/transfers.d.ts +198 -0
- package/dist/transfers.d.ts.map +1 -0
- package/dist/transfers.js +84 -0
- package/dist/transfers.js.map +1 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +2 -1371
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +26 -653
- package/dist/utils.js.map +1 -1
- package/package.json +17 -3
- package/src/Actions/Action.test.ts +5 -4
- package/src/Actions/ContractAction.test.ts +4 -6
- package/src/Actions/ContractAction.ts +73 -10
- package/src/Actions/ERC721MintAction.test.ts +2 -2
- package/src/Actions/ERC721MintAction.ts +70 -16
- package/src/Actions/EventAction.test.ts +43 -17
- package/src/Actions/EventAction.ts +451 -26
- package/src/AllowLists/SimpleAllowList.ts +51 -7
- package/src/AllowLists/SimpleDenyList.ts +47 -109
- package/src/Auth/PassthroughAuth.ts +1 -1
- package/src/Boost.ts +136 -1
- package/src/BoostCore.test.ts +4 -11
- package/src/BoostCore.ts +114 -45
- package/src/BoostRegistry.ts +39 -21
- package/src/Budgets/ManagedBudget.ts +69 -16
- package/src/Budgets/SimpleBudget.ts +57 -14
- package/src/Budgets/VestingBudget.ts +79 -9
- package/src/Deployable/Contract.ts +1 -1
- package/src/Deployable/Deployable.ts +8 -2
- package/src/Deployable/DeployableTarget.ts +19 -6
- package/src/Incentives/AllowListIncentive.test.ts +2 -5
- package/src/Incentives/AllowListIncentive.ts +59 -15
- package/src/Incentives/CGDAIncentive.test.ts +3 -7
- package/src/Incentives/CGDAIncentive.ts +123 -19
- package/src/Incentives/ERC1155Incentive.test.ts +2 -13
- package/src/Incentives/ERC1155Incentive.ts +104 -22
- package/src/Incentives/ERC20Incentive.test.ts +6 -17
- package/src/Incentives/ERC20Incentive.ts +86 -21
- package/src/Incentives/ERC20VariableIncentive.test.ts +4 -24
- package/src/Incentives/ERC20VariableIncentive.ts +71 -19
- package/src/Incentives/Incentive.test.ts +1 -1
- package/src/Incentives/PointsIncentive.test.ts +3 -6
- package/src/Incentives/PointsIncentive.ts +79 -17
- package/src/Validators/SignerValidator.test.ts +3 -7
- package/src/Validators/SignerValidator.ts +422 -13
- package/src/claiming.ts +56 -0
- package/src/errors.ts +19 -1
- package/src/index.ts +10 -7
- package/src/transfers.ts +284 -0
- package/src/utils.ts +3 -2052
- package/dist/generated-Cd-Fe7W7.cjs.map +0 -1
- package/dist/generated-DGpIVcv5.js.map +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { M as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const m = "0x610120604052348015610010575f80fd5b503073ffffffffffffffffffffffffffffffffffffffff16608081815250504660a0818152505060608061004861013960201b60201c565b6100635761005a61014160201b60201c565b80925081935050505b5f61007261013960201b60201c565b610083578280519060200120610087565b5f801b5b90505f61009861013960201b60201c565b6100a95782805190602001206100ad565b5f801b5b90508160c081815250508060e081815250505f6100ce61013960201b60201c565b610118576040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f815283602082015282604082015246606082015230608082015260a081209150505b80610100818152505050505050506101346101b860201b60201c565b61024d565b5f6001905090565b6060806040518060400160405280600f81526020017f5369676e657256616c696461746f72000000000000000000000000000000000081525091506040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525090509091565b5f6101c761022460201b60201c565b9050805460018116156101e15763f92ee8a95f526004601cfd5b8160c01c808260011c1461021f578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b60805160a05160c05160e05161010051611ecc61028a5f395f610f6101525f6110a001525f61107d01525f61110f01525f6111330152611ecc5ff3fe6080604052600436106100f2575f3560e01c8063736c0d5b11610089578063d3de6e7511610058578063d3de6e75146102c4578063f04e283e14610300578063f2fde38b1461031c578063fee81cf414610338576100f2565b8063736c0d5b1461020657806384b0196e146102425780638da5cb5b14610272578063a1d2756f1461029c576100f2565b8063439fab91116100c5578063439fab911461018e57806354d1f13d146101b6578063703b6900146101c0578063715018a6146101fc576100f2565b806301ffc9a7146100f6578063256929621461013257806328d6183b1461013c5780634359d28a14610166575b5f80fd5b348015610101575f80fd5b5061011c60048036038101906101179190611232565b610374565b6040516101299190611277565b60405180910390f35b61013a6103ed565b005b348015610147575f80fd5b5061015061043e565b60405161015d919061129f565b60405180910390f35b348015610171575f80fd5b5061018c6004803603810190610187919061136e565b610465565b005b348015610199575f80fd5b506101b460048036038101906101af9190611441565b61056e565b005b6101be6106e5565b005b3480156101cb575f80fd5b506101e660048036038101906101e19190611519565b61071e565b6040516101f39190611277565b60405180910390f35b610204610911565b005b348015610211575f80fd5b5061022c6004803603810190610227919061159d565b610924565b6040516102399190611277565b60405180910390f35b34801561024d575f80fd5b50610256610940565b604051610269979695949392919061175f565b60405180910390f35b34801561027d575f80fd5b5061028661098b565b60405161029391906117e1565b60405180910390f35b3480156102a7575f80fd5b506102c260048036038101906102bd919061159d565b6109b3565b005b3480156102cf575f80fd5b506102ea60048036038101906102e59190611958565b6109fe565b6040516102f791906119d8565b60405180910390f35b61031a6004803603810190610315919061159d565b610a67565b005b6103366004803603810190610331919061159d565b610aa5565b005b348015610343575f80fd5b5061035e6004803603810190610359919061159d565b610ace565b60405161036b91906119f1565b60405180910390f35b5f7fb8ce7b22000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806103e657506103e582610ae7565b5b9050919050565b5f6103f6610b60565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7fb8ce7b2200000000000000000000000000000000000000000000000000000000905090565b61046d610b6a565b8181905084849050146104ac576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84849050811015610567578282828181106104cc576104cb611a0a565b5b90506020020160208101906104e19190611a61565b5f808787858181106104f6576104f5611a0a565b5b905060200201602081019061050b919061159d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506104ae565b5050505050565b5f610577610ba1565b905080546003825580156105a95760018160011c14303b106105a05763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8084848101906105bb9190611b87565b915091506105e2825f815181106105d5576105d4611a0a565b5b6020026020010151610bca565b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f5b82518110156106a85760015f8085848151811061064457610643611a0a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610624565b50505080156106e0576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107a5576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f83838101906107b59190611c6e565b90505f815f01518060200190518101906107cf9190611dc8565b90505f6107e68983604001518986602001516109fe565b905087826040015160ff1611610839578160400151886040517f17c66bc7000000000000000000000000000000000000000000000000000000008152600401610830929190611e1e565b60405180910390fd5b5f80835f015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff166108bb576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108d181896001610ca09092919063ffffffff16565b610903818360200151845f015173ffffffffffffffffffffffffffffffffffffffff16610d029092919063ffffffff16565b935050505095945050505050565b610919610b6a565b6109225f610e05565b565b5f602052805f5260405f205f915054906101000a900460ff1681565b5f6060805f805f60607f0f000000000000000000000000000000000000000000000000000000000000009650610974610ecb565b809650819750505046935030925090919293949596565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6109bb610b6a565b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f610a5d7ffea51d5bd45bcd3c2ecc3679b43a3b80b0bd0923f8c16f822455b8cdecd9852f8686868680519060200120604051602001610a42959493929190611e45565b60405160208183030381529060405280519060200120610f42565b9050949350505050565b610a6f610b6a565b63389a75e1600c52805f526020600c208054421115610a9557636f5e88185f526004601cfd5b5f815550610aa281610e05565b50565b610aad610b6a565b8060601b610ac257637448fbae5f526004601cfd5b610acb81610e05565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f5912b89c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610b595750610b5882610fbe565b5b9050919050565b5f6202a300905090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610b9f576382b429005f526004601cfd5b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610bd2611037565b15610c4a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610c0c57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610c9d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b5f633f57fc5c60e01b90505f634de1225a60e01b90506007831115610ccb57815f528260045260245ffd5b84602052835f5260405f206001841b81541880851c6001188015610cf557835f528560045260245ffd5b8183555050505050505050565b5f8360601b60601c93508315610dfe57604051835f5260208301516040526040835103610d6f576040830151601b8160ff1c016020528060011b60011c6060526020600160805f60015afa805187183d1517610d6c57600193505f60605282604052505050610dfe565b50505b6041835103610db55760608301515f1a60205260408301516060526020600160805f60015afa805186183d1517610db357600192505f606052816040525050610dfe565b505b5f60605280604052631626ba7e60e01b808252846004830152602482016040815284516020018060448501828860045afa5060208260443d01868b5afa83835114169450505050505b9392505050565b610e0d611037565b15610e72577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610ec8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b6060806040518060400160405280600f81526020017f5369676e657256616c696461746f72000000000000000000000000000000000081525091506040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525090509091565b5f610f4b61103b565b15610f5f57610f58611043565b9050610f9b565b7f00000000000000000000000000000000000000000000000000000000000000009050610f8a61110b565b15610f9a57610f97611043565b90505b5b6719010000000000005f5280601a5281603a52604260182090505f603a52919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611030575061102f82611163565b5b9050919050565b5f90565b5f6001905090565b5f8061104d61103b565b1561107b575f8061105c610ecb565b91509150818051906020012093508080519060200120925050506110c2565b7f000000000000000000000000000000000000000000000000000000000000000091507f000000000000000000000000000000000000000000000000000000000000000090505b6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f815282602082015281604082015246606082015230608082015260a081209250505090565b5f807f000000000000000000000000000000000000000000000000000000000000000090505f7f0000000000000000000000000000000000000000000000000000000000000000905080301482461416159250505090565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611211816111dd565b811461121b575f80fd5b50565b5f8135905061122c81611208565b92915050565b5f60208284031215611247576112466111d5565b5b5f6112548482850161121e565b91505092915050565b5f8115159050919050565b6112718161125d565b82525050565b5f60208201905061128a5f830184611268565b92915050565b611299816111dd565b82525050565b5f6020820190506112b25f830184611290565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126112d9576112d86112b8565b5b8235905067ffffffffffffffff8111156112f6576112f56112bc565b5b602083019150836020820283011115611312576113116112c0565b5b9250929050565b5f8083601f84011261132e5761132d6112b8565b5b8235905067ffffffffffffffff81111561134b5761134a6112bc565b5b602083019150836020820283011115611367576113666112c0565b5b9250929050565b5f805f8060408587031215611386576113856111d5565b5b5f85013567ffffffffffffffff8111156113a3576113a26111d9565b5b6113af878288016112c4565b9450945050602085013567ffffffffffffffff8111156113d2576113d16111d9565b5b6113de87828801611319565b925092505092959194509250565b5f8083601f840112611401576114006112b8565b5b8235905067ffffffffffffffff81111561141e5761141d6112bc565b5b60208301915083600182028301111561143a576114396112c0565b5b9250929050565b5f8060208385031215611457576114566111d5565b5b5f83013567ffffffffffffffff811115611474576114736111d9565b5b611480858286016113ec565b92509250509250929050565b5f819050919050565b61149e8161148c565b81146114a8575f80fd5b50565b5f813590506114b981611495565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6114e8826114bf565b9050919050565b6114f8816114de565b8114611502575f80fd5b50565b5f81359050611513816114ef565b92915050565b5f805f805f60808688031215611532576115316111d5565b5b5f61153f888289016114ab565b9550506020611550888289016114ab565b945050604061156188828901611505565b935050606086013567ffffffffffffffff811115611582576115816111d9565b5b61158e888289016113ec565b92509250509295509295909350565b5f602082840312156115b2576115b16111d5565b5b5f6115bf84828501611505565b91505092915050565b5f7fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6115fc816115c8565b82525050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61164482611602565b61164e818561160c565b935061165e81856020860161161c565b6116678161162a565b840191505092915050565b61167b8161148c565b82525050565b61168a816114de565b82525050565b5f819050919050565b6116a281611690565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6116da8161148c565b82525050565b5f6116eb83836116d1565b60208301905092915050565b5f602082019050919050565b5f61170d826116a8565b61171781856116b2565b9350611722836116c2565b805f5b8381101561175257815161173988826116e0565b9750611744836116f7565b925050600181019050611725565b5085935050505092915050565b5f60e0820190506117725f83018a6115f3565b8181036020830152611784818961163a565b90508181036040830152611798818861163a565b90506117a76060830187611672565b6117b46080830186611681565b6117c160a0830185611699565b81810360c08301526117d38184611703565b905098975050505050505050565b5f6020820190506117f45f830184611681565b92915050565b5f60ff82169050919050565b61180f816117fa565b8114611819575f80fd5b50565b5f8135905061182a81611806565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61186a8261162a565b810181811067ffffffffffffffff8211171561188957611888611834565b5b80604052505050565b5f61189b6111cc565b90506118a78282611861565b919050565b5f67ffffffffffffffff8211156118c6576118c5611834565b5b6118cf8261162a565b9050602081019050919050565b828183375f83830152505050565b5f6118fc6118f7846118ac565b611892565b90508281526020810184848401111561191857611917611830565b5b6119238482856118dc565b509392505050565b5f82601f83011261193f5761193e6112b8565b5b813561194f8482602086016118ea565b91505092915050565b5f805f80608085870312156119705761196f6111d5565b5b5f61197d878288016114ab565b945050602061198e8782880161181c565b935050604061199f87828801611505565b925050606085013567ffffffffffffffff8111156119c0576119bf6111d9565b5b6119cc8782880161192b565b91505092959194509250565b5f6020820190506119eb5f830184611699565b92915050565b5f602082019050611a045f830184611672565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b611a408161125d565b8114611a4a575f80fd5b50565b5f81359050611a5b81611a37565b92915050565b5f60208284031215611a7657611a756111d5565b5b5f611a8384828501611a4d565b91505092915050565b5f67ffffffffffffffff821115611aa657611aa5611834565b5b602082029050602081019050919050565b5f611ac9611ac484611a8c565b611892565b90508083825260208201905060208402830185811115611aec57611aeb6112c0565b5b835b81811015611b155780611b018882611505565b845260208401935050602081019050611aee565b5050509392505050565b5f82601f830112611b3357611b326112b8565b5b8135611b43848260208601611ab7565b91505092915050565b5f611b56826114bf565b9050919050565b611b6681611b4c565b8114611b70575f80fd5b50565b5f81359050611b8181611b5d565b92915050565b5f8060408385031215611b9d57611b9c6111d5565b5b5f83013567ffffffffffffffff811115611bba57611bb96111d9565b5b611bc685828601611b1f565b9250506020611bd785828601611b73565b9150509250929050565b5f80fd5b5f80fd5b5f60408284031215611bfe57611bfd611be1565b5b611c086040611892565b90505f82013567ffffffffffffffff811115611c2757611c26611be5565b5b611c338482850161192b565b5f83015250602082013567ffffffffffffffff811115611c5657611c55611be5565b5b611c628482850161192b565b60208301525092915050565b5f60208284031215611c8357611c826111d5565b5b5f82013567ffffffffffffffff811115611ca057611c9f6111d9565b5b611cac84828501611be9565b91505092915050565b5f81519050611cc3816114ef565b92915050565b5f611cdb611cd6846118ac565b611892565b905082815260208101848484011115611cf757611cf6611830565b5b611d0284828561161c565b509392505050565b5f82601f830112611d1e57611d1d6112b8565b5b8151611d2e848260208601611cc9565b91505092915050565b5f81519050611d4581611806565b92915050565b5f60608284031215611d6057611d5f611be1565b5b611d6a6060611892565b90505f611d7984828501611cb5565b5f83015250602082015167ffffffffffffffff811115611d9c57611d9b611be5565b5b611da884828501611d0a565b6020830152506040611dbc84828501611d37565b60408301525092915050565b5f60208284031215611ddd57611ddc6111d5565b5b5f82015167ffffffffffffffff811115611dfa57611df96111d9565b5b611e0684828501611d4b565b91505092915050565b611e18816117fa565b82525050565b5f604082019050611e315f830185611e0f565b611e3e6020830184611672565b9392505050565b5f60a082019050611e585f830188611699565b611e656020830187611672565b611e726040830186611e0f565b611e7f6060830185611681565b611e8c6080830184611699565b969550505050505056fea26469706673582212205fce26f05c322d5e151f6b16e70e28b485c147f70dd352b6a7a116eaca9f369f64736f6c634300081a0033", e = class e extends A {
|
|
1
|
+
import { M as r, aS as u, aT as h, aU as y, aV as m, aW as p, aX as g, aY as w, aZ as A } from "../generated-57_Kffpz.js";
|
|
2
|
+
import { encodeAbiParameters as s } from "viem";
|
|
3
|
+
import { signTypedData as D } from "viem/accounts";
|
|
4
|
+
import { DeployableTarget as v } from "../Deployable/DeployableTarget.js";
|
|
5
|
+
import { RegistryType as V } from "../utils.js";
|
|
6
|
+
const C = "0x610120604052348015610010575f80fd5b503073ffffffffffffffffffffffffffffffffffffffff16608081815250504660a0818152505060608061004861013960201b60201c565b6100635761005a61014160201b60201c565b80925081935050505b5f61007261013960201b60201c565b610083578280519060200120610087565b5f801b5b90505f61009861013960201b60201c565b6100a95782805190602001206100ad565b5f801b5b90508160c081815250508060e081815250505f6100ce61013960201b60201c565b610118576040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f815283602082015282604082015246606082015230608082015260a081209150505b80610100818152505050505050506101346101b860201b60201c565b61024d565b5f6001905090565b6060806040518060400160405280600f81526020017f5369676e657256616c696461746f72000000000000000000000000000000000081525091506040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525090509091565b5f6101c761022460201b60201c565b9050805460018116156101e15763f92ee8a95f526004601cfd5b8160c01c808260011c1461021f578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b60805160a05160c05160e05161010051611ecc61028a5f395f610f6101525f6110a001525f61107d01525f61110f01525f6111330152611ecc5ff3fe6080604052600436106100f2575f3560e01c8063736c0d5b11610089578063d3de6e7511610058578063d3de6e75146102c4578063f04e283e14610300578063f2fde38b1461031c578063fee81cf414610338576100f2565b8063736c0d5b1461020657806384b0196e146102425780638da5cb5b14610272578063a1d2756f1461029c576100f2565b8063439fab91116100c5578063439fab911461018e57806354d1f13d146101b6578063703b6900146101c0578063715018a6146101fc576100f2565b806301ffc9a7146100f6578063256929621461013257806328d6183b1461013c5780634359d28a14610166575b5f80fd5b348015610101575f80fd5b5061011c60048036038101906101179190611232565b610374565b6040516101299190611277565b60405180910390f35b61013a6103ed565b005b348015610147575f80fd5b5061015061043e565b60405161015d919061129f565b60405180910390f35b348015610171575f80fd5b5061018c6004803603810190610187919061136e565b610465565b005b348015610199575f80fd5b506101b460048036038101906101af9190611441565b61056e565b005b6101be6106e5565b005b3480156101cb575f80fd5b506101e660048036038101906101e19190611519565b61071e565b6040516101f39190611277565b60405180910390f35b610204610911565b005b348015610211575f80fd5b5061022c6004803603810190610227919061159d565b610924565b6040516102399190611277565b60405180910390f35b34801561024d575f80fd5b50610256610940565b604051610269979695949392919061175f565b60405180910390f35b34801561027d575f80fd5b5061028661098b565b60405161029391906117e1565b60405180910390f35b3480156102a7575f80fd5b506102c260048036038101906102bd919061159d565b6109b3565b005b3480156102cf575f80fd5b506102ea60048036038101906102e59190611958565b6109fe565b6040516102f791906119d8565b60405180910390f35b61031a6004803603810190610315919061159d565b610a67565b005b6103366004803603810190610331919061159d565b610aa5565b005b348015610343575f80fd5b5061035e6004803603810190610359919061159d565b610ace565b60405161036b91906119f1565b60405180910390f35b5f7fb8ce7b22000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806103e657506103e582610ae7565b5b9050919050565b5f6103f6610b60565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7fb8ce7b2200000000000000000000000000000000000000000000000000000000905090565b61046d610b6a565b8181905084849050146104ac576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84849050811015610567578282828181106104cc576104cb611a0a565b5b90506020020160208101906104e19190611a61565b5f808787858181106104f6576104f5611a0a565b5b905060200201602081019061050b919061159d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506104ae565b5050505050565b5f610577610ba1565b905080546003825580156105a95760018160011c14303b106105a05763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8084848101906105bb9190611b87565b915091506105e2825f815181106105d5576105d4611a0a565b5b6020026020010151610bca565b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f5b82518110156106a85760015f8085848151811061064457610643611a0a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610624565b50505080156106e0576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107a5576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f83838101906107b59190611c6e565b90505f815f01518060200190518101906107cf9190611dc8565b90505f6107e68983604001518986602001516109fe565b905087826040015160ff1611610839578160400151886040517f17c66bc7000000000000000000000000000000000000000000000000000000008152600401610830929190611e1e565b60405180910390fd5b5f80835f015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff166108bb576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108d181896001610ca09092919063ffffffff16565b610903818360200151845f015173ffffffffffffffffffffffffffffffffffffffff16610d029092919063ffffffff16565b935050505095945050505050565b610919610b6a565b6109225f610e05565b565b5f602052805f5260405f205f915054906101000a900460ff1681565b5f6060805f805f60607f0f000000000000000000000000000000000000000000000000000000000000009650610974610ecb565b809650819750505046935030925090919293949596565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6109bb610b6a565b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f610a5d7ffea51d5bd45bcd3c2ecc3679b43a3b80b0bd0923f8c16f822455b8cdecd9852f8686868680519060200120604051602001610a42959493929190611e45565b60405160208183030381529060405280519060200120610f42565b9050949350505050565b610a6f610b6a565b63389a75e1600c52805f526020600c208054421115610a9557636f5e88185f526004601cfd5b5f815550610aa281610e05565b50565b610aad610b6a565b8060601b610ac257637448fbae5f526004601cfd5b610acb81610e05565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f5912b89c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610b595750610b5882610fbe565b5b9050919050565b5f6202a300905090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610b9f576382b429005f526004601cfd5b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610bd2611037565b15610c4a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610c0c57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610c9d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b5f633f57fc5c60e01b90505f634de1225a60e01b90506007831115610ccb57815f528260045260245ffd5b84602052835f5260405f206001841b81541880851c6001188015610cf557835f528560045260245ffd5b8183555050505050505050565b5f8360601b60601c93508315610dfe57604051835f5260208301516040526040835103610d6f576040830151601b8160ff1c016020528060011b60011c6060526020600160805f60015afa805187183d1517610d6c57600193505f60605282604052505050610dfe565b50505b6041835103610db55760608301515f1a60205260408301516060526020600160805f60015afa805186183d1517610db357600192505f606052816040525050610dfe565b505b5f60605280604052631626ba7e60e01b808252846004830152602482016040815284516020018060448501828860045afa5060208260443d01868b5afa83835114169450505050505b9392505050565b610e0d611037565b15610e72577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610ec8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b6060806040518060400160405280600f81526020017f5369676e657256616c696461746f72000000000000000000000000000000000081525091506040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525090509091565b5f610f4b61103b565b15610f5f57610f58611043565b9050610f9b565b7f00000000000000000000000000000000000000000000000000000000000000009050610f8a61110b565b15610f9a57610f97611043565b90505b5b6719010000000000005f5280601a5281603a52604260182090505f603a52919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611030575061102f82611163565b5b9050919050565b5f90565b5f6001905090565b5f8061104d61103b565b1561107b575f8061105c610ecb565b91509150818051906020012093508080519060200120925050506110c2565b7f000000000000000000000000000000000000000000000000000000000000000091507f000000000000000000000000000000000000000000000000000000000000000090505b6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f815282602082015281604082015246606082015230608082015260a081209250505090565b5f807f000000000000000000000000000000000000000000000000000000000000000090505f7f0000000000000000000000000000000000000000000000000000000000000000905080301482461416159250505090565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611211816111dd565b811461121b575f80fd5b50565b5f8135905061122c81611208565b92915050565b5f60208284031215611247576112466111d5565b5b5f6112548482850161121e565b91505092915050565b5f8115159050919050565b6112718161125d565b82525050565b5f60208201905061128a5f830184611268565b92915050565b611299816111dd565b82525050565b5f6020820190506112b25f830184611290565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126112d9576112d86112b8565b5b8235905067ffffffffffffffff8111156112f6576112f56112bc565b5b602083019150836020820283011115611312576113116112c0565b5b9250929050565b5f8083601f84011261132e5761132d6112b8565b5b8235905067ffffffffffffffff81111561134b5761134a6112bc565b5b602083019150836020820283011115611367576113666112c0565b5b9250929050565b5f805f8060408587031215611386576113856111d5565b5b5f85013567ffffffffffffffff8111156113a3576113a26111d9565b5b6113af878288016112c4565b9450945050602085013567ffffffffffffffff8111156113d2576113d16111d9565b5b6113de87828801611319565b925092505092959194509250565b5f8083601f840112611401576114006112b8565b5b8235905067ffffffffffffffff81111561141e5761141d6112bc565b5b60208301915083600182028301111561143a576114396112c0565b5b9250929050565b5f8060208385031215611457576114566111d5565b5b5f83013567ffffffffffffffff811115611474576114736111d9565b5b611480858286016113ec565b92509250509250929050565b5f819050919050565b61149e8161148c565b81146114a8575f80fd5b50565b5f813590506114b981611495565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6114e8826114bf565b9050919050565b6114f8816114de565b8114611502575f80fd5b50565b5f81359050611513816114ef565b92915050565b5f805f805f60808688031215611532576115316111d5565b5b5f61153f888289016114ab565b9550506020611550888289016114ab565b945050604061156188828901611505565b935050606086013567ffffffffffffffff811115611582576115816111d9565b5b61158e888289016113ec565b92509250509295509295909350565b5f602082840312156115b2576115b16111d5565b5b5f6115bf84828501611505565b91505092915050565b5f7fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6115fc816115c8565b82525050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61164482611602565b61164e818561160c565b935061165e81856020860161161c565b6116678161162a565b840191505092915050565b61167b8161148c565b82525050565b61168a816114de565b82525050565b5f819050919050565b6116a281611690565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6116da8161148c565b82525050565b5f6116eb83836116d1565b60208301905092915050565b5f602082019050919050565b5f61170d826116a8565b61171781856116b2565b9350611722836116c2565b805f5b8381101561175257815161173988826116e0565b9750611744836116f7565b925050600181019050611725565b5085935050505092915050565b5f60e0820190506117725f83018a6115f3565b8181036020830152611784818961163a565b90508181036040830152611798818861163a565b90506117a76060830187611672565b6117b46080830186611681565b6117c160a0830185611699565b81810360c08301526117d38184611703565b905098975050505050505050565b5f6020820190506117f45f830184611681565b92915050565b5f60ff82169050919050565b61180f816117fa565b8114611819575f80fd5b50565b5f8135905061182a81611806565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61186a8261162a565b810181811067ffffffffffffffff8211171561188957611888611834565b5b80604052505050565b5f61189b6111cc565b90506118a78282611861565b919050565b5f67ffffffffffffffff8211156118c6576118c5611834565b5b6118cf8261162a565b9050602081019050919050565b828183375f83830152505050565b5f6118fc6118f7846118ac565b611892565b90508281526020810184848401111561191857611917611830565b5b6119238482856118dc565b509392505050565b5f82601f83011261193f5761193e6112b8565b5b813561194f8482602086016118ea565b91505092915050565b5f805f80608085870312156119705761196f6111d5565b5b5f61197d878288016114ab565b945050602061198e8782880161181c565b935050604061199f87828801611505565b925050606085013567ffffffffffffffff8111156119c0576119bf6111d9565b5b6119cc8782880161192b565b91505092959194509250565b5f6020820190506119eb5f830184611699565b92915050565b5f602082019050611a045f830184611672565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b611a408161125d565b8114611a4a575f80fd5b50565b5f81359050611a5b81611a37565b92915050565b5f60208284031215611a7657611a756111d5565b5b5f611a8384828501611a4d565b91505092915050565b5f67ffffffffffffffff821115611aa657611aa5611834565b5b602082029050602081019050919050565b5f611ac9611ac484611a8c565b611892565b90508083825260208201905060208402830185811115611aec57611aeb6112c0565b5b835b81811015611b155780611b018882611505565b845260208401935050602081019050611aee565b5050509392505050565b5f82601f830112611b3357611b326112b8565b5b8135611b43848260208601611ab7565b91505092915050565b5f611b56826114bf565b9050919050565b611b6681611b4c565b8114611b70575f80fd5b50565b5f81359050611b8181611b5d565b92915050565b5f8060408385031215611b9d57611b9c6111d5565b5b5f83013567ffffffffffffffff811115611bba57611bb96111d9565b5b611bc685828601611b1f565b9250506020611bd785828601611b73565b9150509250929050565b5f80fd5b5f80fd5b5f60408284031215611bfe57611bfd611be1565b5b611c086040611892565b90505f82013567ffffffffffffffff811115611c2757611c26611be5565b5b611c338482850161192b565b5f83015250602082013567ffffffffffffffff811115611c5657611c55611be5565b5b611c628482850161192b565b60208301525092915050565b5f60208284031215611c8357611c826111d5565b5b5f82013567ffffffffffffffff811115611ca057611c9f6111d9565b5b611cac84828501611be9565b91505092915050565b5f81519050611cc3816114ef565b92915050565b5f611cdb611cd6846118ac565b611892565b905082815260208101848484011115611cf757611cf6611830565b5b611d0284828561161c565b509392505050565b5f82601f830112611d1e57611d1d6112b8565b5b8151611d2e848260208601611cc9565b91505092915050565b5f81519050611d4581611806565b92915050565b5f60608284031215611d6057611d5f611be1565b5b611d6a6060611892565b90505f611d7984828501611cb5565b5f83015250602082015167ffffffffffffffff811115611d9c57611d9b611be5565b5b611da884828501611d0a565b6020830152506040611dbc84828501611d37565b60408301525092915050565b5f60208284031215611ddd57611ddc6111d5565b5b5f82015167ffffffffffffffff811115611dfa57611df96111d9565b5b611e0684828501611d4b565b91505092915050565b611e18816117fa565b82525050565b5f604082019050611e315f830185611e0f565b611e3e6020830184611672565b9392505050565b5f60a082019050611e585f830188611699565b611e656020830187611672565b611e726040830186611e0f565b611e7f6060830185611681565b611e8c6080830184611699565b969550505050505056fea26469706673582212205fce26f05c322d5e151f6b16e70e28b485c147f70dd352b6a7a116eaca9f369f64736f6c634300081a0033", t = class t extends v {
|
|
5
7
|
constructor() {
|
|
6
|
-
super(...arguments), this.abi =
|
|
8
|
+
super(...arguments), this.abi = r;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* The set of authorized signers
|
|
@@ -15,7 +17,7 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
15
17
|
* @returns {unknown}
|
|
16
18
|
*/
|
|
17
19
|
async signers(f, b) {
|
|
18
|
-
return
|
|
20
|
+
return await u(this._config, {
|
|
19
21
|
address: this.assertValidAddress(),
|
|
20
22
|
args: [f],
|
|
21
23
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -32,7 +34,7 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
32
34
|
* @returns {unknown}
|
|
33
35
|
*/
|
|
34
36
|
async hashSignerData(f, b) {
|
|
35
|
-
return
|
|
37
|
+
return await h(this._config, {
|
|
36
38
|
address: this.assertValidAddress(),
|
|
37
39
|
args: [
|
|
38
40
|
f.boostId,
|
|
@@ -54,7 +56,7 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
54
56
|
* @returns {Promise<boolean>} - True if the action has been validated based on the data payload
|
|
55
57
|
*/
|
|
56
58
|
async validate(f, b) {
|
|
57
|
-
return this.awaitResult(this.validateRaw(f, b));
|
|
59
|
+
return await this.awaitResult(this.validateRaw(f, b));
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.
|
|
@@ -66,7 +68,7 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
66
68
|
* @returns {Promise<boolean>} - True if the action has been validated based on the data payload
|
|
67
69
|
*/
|
|
68
70
|
async validateRaw(f, b) {
|
|
69
|
-
const { request: a, result:
|
|
71
|
+
const { request: a, result: e } = await y(
|
|
70
72
|
this._config,
|
|
71
73
|
{
|
|
72
74
|
address: this.assertValidAddress(),
|
|
@@ -81,7 +83,7 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
81
83
|
...b
|
|
82
84
|
}
|
|
83
85
|
);
|
|
84
|
-
return { hash: await
|
|
86
|
+
return { hash: await m(this._config, a), result: e };
|
|
85
87
|
}
|
|
86
88
|
/**
|
|
87
89
|
* Set the authorized status of a signer
|
|
@@ -94,7 +96,9 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
94
96
|
* @returns {unknown}
|
|
95
97
|
*/
|
|
96
98
|
async setAuthorized(f, b, a) {
|
|
97
|
-
return this.awaitResult(
|
|
99
|
+
return await this.awaitResult(
|
|
100
|
+
this.setAuthorizedRaw(f, b, a)
|
|
101
|
+
);
|
|
98
102
|
}
|
|
99
103
|
/**
|
|
100
104
|
* Set the authorized status of a signer
|
|
@@ -107,7 +111,7 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
107
111
|
* @returns {unknown}
|
|
108
112
|
*/
|
|
109
113
|
async setAuthorizedRaw(f, b, a) {
|
|
110
|
-
const { request:
|
|
114
|
+
const { request: e, result: d } = await p(
|
|
111
115
|
this._config,
|
|
112
116
|
{
|
|
113
117
|
address: this.assertValidAddress(),
|
|
@@ -117,10 +121,19 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
117
121
|
...a
|
|
118
122
|
}
|
|
119
123
|
);
|
|
120
|
-
return { hash: await
|
|
124
|
+
return { hash: await g(this._config, e), result: d };
|
|
121
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Update the authorized caller of the validator function
|
|
128
|
+
*
|
|
129
|
+
* @public
|
|
130
|
+
* @async
|
|
131
|
+
* @param {Address} address
|
|
132
|
+
* @param {?WriteParams<typeof signerValidatorAbi, 'setValidatorCaller'>} [params]
|
|
133
|
+
* @returns {unknown}
|
|
134
|
+
*/
|
|
122
135
|
async setValidatorCallerRaw(f, b) {
|
|
123
|
-
const { request: a, result:
|
|
136
|
+
const { request: a, result: e } = await w(
|
|
124
137
|
this._config,
|
|
125
138
|
{
|
|
126
139
|
address: this.assertValidAddress(),
|
|
@@ -130,13 +143,36 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
130
143
|
...b
|
|
131
144
|
}
|
|
132
145
|
);
|
|
133
|
-
return { hash: await
|
|
146
|
+
return { hash: await A(
|
|
134
147
|
this._config,
|
|
135
148
|
a
|
|
136
|
-
), result:
|
|
149
|
+
), result: e };
|
|
137
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Update the authorized caller of the validator function
|
|
153
|
+
*
|
|
154
|
+
* @public
|
|
155
|
+
* @async
|
|
156
|
+
* @param {Address} address
|
|
157
|
+
* @param {?WriteParams<typeof signerValidatorAbi, 'setValidatorCaller'>} [params]
|
|
158
|
+
* @returns {unknown}
|
|
159
|
+
*/
|
|
138
160
|
async setValidatorCaller(f, b) {
|
|
139
|
-
return this.awaitResult(this.setValidatorCallerRaw(f, b));
|
|
161
|
+
return await this.awaitResult(this.setValidatorCallerRaw(f, b));
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Properly encodes the data needed to claim
|
|
165
|
+
*
|
|
166
|
+
* @public
|
|
167
|
+
* @async
|
|
168
|
+
* @param {SignerValidatorClaimDataParams} params
|
|
169
|
+
* @returns {Promise<Hex>}
|
|
170
|
+
*/
|
|
171
|
+
async encodeClaimData(f) {
|
|
172
|
+
return await R({
|
|
173
|
+
...f,
|
|
174
|
+
validator: this.assertValidAddress()
|
|
175
|
+
});
|
|
140
176
|
}
|
|
141
177
|
/**
|
|
142
178
|
* @inheritdoc
|
|
@@ -147,22 +183,111 @@ const m = "0x610120604052348015610010575f80fd5b503073fffffffffffffffffffffffffff
|
|
|
147
183
|
* @returns {GenericDeployableParams}
|
|
148
184
|
*/
|
|
149
185
|
buildParameters(f, b) {
|
|
150
|
-
const [a,
|
|
186
|
+
const [a, e] = this.validateDeploymentConfig(
|
|
151
187
|
f,
|
|
152
188
|
b
|
|
153
189
|
);
|
|
154
190
|
return {
|
|
155
|
-
abi:
|
|
156
|
-
bytecode:
|
|
157
|
-
args: [
|
|
158
|
-
...this.optionallyAttachAccount(
|
|
191
|
+
abi: r,
|
|
192
|
+
bytecode: C,
|
|
193
|
+
args: [P(a)],
|
|
194
|
+
...this.optionallyAttachAccount(e.account)
|
|
159
195
|
};
|
|
160
196
|
}
|
|
161
197
|
};
|
|
162
|
-
|
|
163
|
-
let
|
|
198
|
+
t.base = "0x9d08826e771BD939088d5eAc28E0c8864dcb98cf", t.registryType = V.VALIDATOR;
|
|
199
|
+
let n = t;
|
|
200
|
+
async function R({
|
|
201
|
+
signer: c,
|
|
202
|
+
incentiveData: f,
|
|
203
|
+
chainId: b,
|
|
204
|
+
validator: a,
|
|
205
|
+
incentiveQuantity: e,
|
|
206
|
+
claimant: d,
|
|
207
|
+
boostId: i
|
|
208
|
+
}) {
|
|
209
|
+
const o = await D({
|
|
210
|
+
...{
|
|
211
|
+
domain: {
|
|
212
|
+
name: "SignerValidator",
|
|
213
|
+
version: "1",
|
|
214
|
+
chainId: b,
|
|
215
|
+
verifyingContract: a
|
|
216
|
+
},
|
|
217
|
+
types: {
|
|
218
|
+
SignerValidatorData: [
|
|
219
|
+
{ name: "boostId", type: "uint256" },
|
|
220
|
+
{ name: "incentiveQuantity", type: "uint8" },
|
|
221
|
+
{ name: "claimant", type: "address" },
|
|
222
|
+
{ name: "incentiveData", type: "bytes" }
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
primaryType: "SignerValidatorData",
|
|
226
|
+
message: {
|
|
227
|
+
boostId: i,
|
|
228
|
+
incentiveQuantity: e,
|
|
229
|
+
claimant: d,
|
|
230
|
+
incentiveData: f
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
privateKey: c.key
|
|
234
|
+
}), l = N({
|
|
235
|
+
signer: c.account,
|
|
236
|
+
signature: o,
|
|
237
|
+
incentiveQuantity: e
|
|
238
|
+
// Adjust incentive quantity as necessary
|
|
239
|
+
});
|
|
240
|
+
return s(
|
|
241
|
+
[
|
|
242
|
+
{
|
|
243
|
+
type: "tuple",
|
|
244
|
+
name: "BoostClaimData",
|
|
245
|
+
components: [
|
|
246
|
+
{ type: "bytes", name: "validatorData" },
|
|
247
|
+
{ type: "bytes", name: "incentiveData" }
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
[{ validatorData: l, incentiveData: f }]
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
function N({
|
|
255
|
+
signer: c,
|
|
256
|
+
signature: f,
|
|
257
|
+
incentiveQuantity: b
|
|
258
|
+
}) {
|
|
259
|
+
return s(
|
|
260
|
+
[
|
|
261
|
+
{
|
|
262
|
+
type: "tuple",
|
|
263
|
+
name: "SignerValidatorInputParams",
|
|
264
|
+
components: [
|
|
265
|
+
{ type: "address", name: "signer" },
|
|
266
|
+
{ type: "bytes", name: "signature" },
|
|
267
|
+
{ type: "uint8", name: "incentiveQuantity" }
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
[{ signer: c, signature: f, incentiveQuantity: b }]
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
function P({
|
|
275
|
+
signers: c,
|
|
276
|
+
validatorCaller: f
|
|
277
|
+
}) {
|
|
278
|
+
return s(
|
|
279
|
+
[
|
|
280
|
+
{ type: "address[]", name: "signers" },
|
|
281
|
+
{ type: "address", name: "validatorCaller" }
|
|
282
|
+
],
|
|
283
|
+
[c, f]
|
|
284
|
+
);
|
|
285
|
+
}
|
|
164
286
|
export {
|
|
165
|
-
|
|
166
|
-
|
|
287
|
+
n as SignerValidator,
|
|
288
|
+
R as prepareSignerValidatorClaimDataPayload,
|
|
289
|
+
N as prepareSignerValidatorInputParams,
|
|
290
|
+
P as prepareSignerValidatorPayload,
|
|
291
|
+
r as signerValidatorAbi
|
|
167
292
|
};
|
|
168
293
|
//# sourceMappingURL=SignerValidator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignerValidator.js","sources":["../../src/Validators/SignerValidator.ts"],"sourcesContent":["import {\n readSignerValidatorHashSignerData,\n readSignerValidatorSigners,\n signerValidatorAbi,\n simulateSignerValidatorSetAuthorized,\n simulateSignerValidatorSetValidatorCaller,\n simulateSignerValidatorValidate,\n writeSignerValidatorSetAuthorized,\n writeSignerValidatorSetValidatorCaller,\n writeSignerValidatorValidate,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/validators/SignerValidator.sol/SignerValidator.json';\nimport type { Address, ContractEventName, Hex } from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type SignerValidatorPayload,\n type SignerValidatorSignaturePayload,\n type SignerValidatorValidatePayload,\n type WriteParams,\n prepareSignerValidatorPayload,\n} from '../utils';\n\nexport { signerValidatorAbi };\nexport type { SignerValidatorPayload };\n\n/**\n * A generic `viem.Log` event with support for `BoostCore` event types.\n *\n * @export\n * @typedef {SignerValidatorLog}\n * @template {ContractEventName<\n * typeof signerValidatorAbi\n * >} [event=ContractEventName<typeof signerValidatorAbi>]\n */\nexport type SignerValidatorLog<\n event extends ContractEventName<\n typeof signerValidatorAbi\n > = ContractEventName<typeof signerValidatorAbi>,\n> = GenericLog<typeof signerValidatorAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class SignerValidator\n * @typedef {SignerValidator}\n * @extends {DeployableTarget<SignerValidatorPayload>}\n */\nexport class SignerValidator extends DeployableTarget<\n SignerValidatorPayload,\n typeof signerValidatorAbi\n> {\n public override readonly abi = signerValidatorAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIGNER_VALIDATOR_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.VALIDATOR;\n\n /**\n * The set of authorized signers\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams<typeof signerValidatorAbi, 'signers'>} [params]\n * @returns {unknown}\n */\n public async signers(\n address: Address,\n params?: ReadParams<typeof signerValidatorAbi, 'signers'>,\n ) {\n return readSignerValidatorSigners(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Retrieve the hash and signer data for a given hash\n *\n * @public\n * @async\n * @param {SignerValidatorSignaturePayload} payload\n * @param {?ReadParams<typeof signerValidatorAbi, 'hashSignerData'>} [params]\n * @returns {unknown}\n */\n public async hashSignerData(\n payload: SignerValidatorSignaturePayload,\n params?: ReadParams<typeof signerValidatorAbi, 'hashSignerData'>,\n ) {\n return readSignerValidatorHashSignerData(this._config, {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveQuantity,\n payload.claimant,\n payload.incentiveData,\n ],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams<typeof signerValidatorAbi, 'validate'>} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n public async validate(\n payload: SignerValidatorValidatePayload,\n params?: WriteParams<typeof signerValidatorAbi, 'validate'>,\n ) {\n return this.awaitResult(this.validateRaw(payload, params));\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams<typeof signerValidatorAbi, 'validate'>} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n public async validateRaw(\n payload: SignerValidatorValidatePayload,\n params?: ReadParams<typeof signerValidatorAbi, 'validate'>,\n ) {\n const { request, result } = await simulateSignerValidatorValidate(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveId,\n payload.claimant,\n payload.claimData,\n ],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSignerValidatorValidate(this._config, request);\n return { hash, result };\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams<typeof signerValidatorAbi, 'setAuthorized'>} [params]\n * @returns {unknown}\n */\n public async setAuthorized(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof signerValidatorAbi, 'setAuthorized'>,\n ) {\n return this.awaitResult(this.setAuthorizedRaw(addresses, allowed, params));\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams<typeof signerValidatorAbi, 'setAuthorized'>} [params]\n * @returns {unknown}\n */\n public async setAuthorizedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof signerValidatorAbi, 'setAuthorized'>,\n ) {\n const { request, result } = await simulateSignerValidatorSetAuthorized(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSignerValidatorSetAuthorized(this._config, request);\n return { hash, result };\n }\n\n public async setValidatorCallerRaw(\n address: Address,\n params?: WriteParams<typeof signerValidatorAbi, 'setValidatorCaller'>,\n ) {\n const { request, result } = await simulateSignerValidatorSetValidatorCaller(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSignerValidatorSetValidatorCaller(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n public async setValidatorCaller(\n address: Address,\n params?: WriteParams<typeof signerValidatorAbi, 'setValidatorCaller'>,\n ) {\n return this.awaitResult(this.setValidatorCallerRaw(address, params));\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SignerValidatorPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SignerValidatorPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: signerValidatorAbi,\n bytecode: bytecode as Hex,\n args: [prepareSignerValidatorPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["_SignerValidator","DeployableTarget","signerValidatorAbi","address","params","readSignerValidatorSigners","payload","readSignerValidatorHashSignerData","request","result","simulateSignerValidatorValidate","writeSignerValidatorValidate","addresses","allowed","simulateSignerValidatorSetAuthorized","writeSignerValidatorSetAuthorized","simulateSignerValidatorSetValidatorCaller","writeSignerValidatorSetValidatorCaller","_payload","_options","options","bytecode","prepareSignerValidatorPayload","RegistryType","SignerValidator"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"SignerValidator.js","sources":["../../src/Validators/SignerValidator.ts"],"sourcesContent":["import {\n readSignerValidatorHashSignerData,\n readSignerValidatorSigners,\n signerValidatorAbi,\n simulateSignerValidatorSetAuthorized,\n simulateSignerValidatorSetValidatorCaller,\n simulateSignerValidatorValidate,\n writeSignerValidatorSetAuthorized,\n writeSignerValidatorSetValidatorCaller,\n writeSignerValidatorValidate,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/validators/SignerValidator.sol/SignerValidator.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n type PrivateKeyAccount,\n encodeAbiParameters,\n} from 'viem';\nimport { signTypedData } from 'viem/accounts';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { signerValidatorAbi };\n\n/**\n * Object reprentation of a {@link SignerValidator} initialization payload\n *\n * @export\n * @interface SignerValidatorPayload\n * @typedef {SignerValidatorPayload}\n */\nexport interface SignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface SignerValidatorValidatePayload\n * @typedef {SignerValidatorValidatePayload}\n */\nexport interface SignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Object reprentation of a {@link SignerValidator} initialization payload\n *\n * @export\n * @interface SignerValidatorPayload\n * @typedef {SignerValidatorPayload}\n */\nexport interface SignerValidatorPayload {\n /**\n * The list of authorized signers. The first address in the list will be the initial owner of the contract.\n *\n * @type {Address[]}\n */\n signers: Address[];\n /**\n * The authorized caller of the {@link prepareSignerValidator} function\n * @type {Address}\n */\n validatorCaller: Address;\n}\n\n/**\n * Description placeholder\n *\n * @export\n * @interface SignerValidatorValidatePayload\n * @typedef {SignerValidatorValidatePayload}\n */\nexport interface SignerValidatorValidatePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {bigint}\n */\n incentiveId: bigint;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n claimData: Hex;\n}\n\n/**\n * Signer Validator Claim Data Payload\n *\n * @export\n * @interface SignerValidatorClaimDataParams\n * @typedef {SignerValidatorClaimDataParams}\n */\nexport interface SignerValidatorClaimDataParams {\n /**\n * The signer with which to sign the input\n *\n * @type {{\n * account: Address;\n * key: Hex;\n * privateKey: PrivateKeyAccount;\n * }}\n */\n signer: {\n account: Address;\n key: Hex;\n privateKey: PrivateKeyAccount;\n };\n /**\n * The encoded data to provide the underlying incentive. You can use {@link prepareAllowListIncentivePayload}, {@link prepareCGDAIncentivePayload}, {@link prepareERC20IncentivePayload}, {@link prepareERC1155IncentivePayload}, or {@link preparePointsIncentivePayload}\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n /**\n * The chain id to target\n *\n * @type {number}\n */\n chainId: number;\n /**\n * The address of the validator\n *\n * @type {Address}\n */\n validator: Address;\n /**\n * The 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 * 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 * Object representing the payload for signing before validaton.\n *\n * @export\n * @interface SignerValidatorSignaturePayload\n * @typedef {SignerValidatorSignaturePayload}\n */\nexport interface SignerValidatorSignaturePayload {\n /**\n * The ID of the boost.\n *\n * @type {bigint}\n */\n boostId: bigint;\n /**\n * The ID of the incentive.\n *\n * @type {number}\n */\n incentiveQuantity: number;\n /**\n * The address of the claimant.\n *\n * @type {Address}\n */\n claimant: Address;\n /**\n * The claim data.\n *\n * @type {Hex}\n */\n incentiveData: Hex;\n}\n\n/**\n * A generic `viem.Log` event with support for `BoostCore` event types.\n *\n * @export\n * @typedef {SignerValidatorLog}\n * @template {ContractEventName<\n * typeof signerValidatorAbi\n * >} [event=ContractEventName<typeof signerValidatorAbi>]\n */\nexport type SignerValidatorLog<\n event extends ContractEventName<\n typeof signerValidatorAbi\n > = ContractEventName<typeof signerValidatorAbi>,\n> = GenericLog<typeof signerValidatorAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class SignerValidator\n * @typedef {SignerValidator}\n * @extends {DeployableTarget<SignerValidatorPayload>}\n */\nexport class SignerValidator extends DeployableTarget<\n SignerValidatorPayload,\n typeof signerValidatorAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = signerValidatorAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIGNER_VALIDATOR_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.VALIDATOR;\n\n /**\n * The set of authorized signers\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams<typeof signerValidatorAbi, 'signers'>} [params]\n * @returns {unknown}\n */\n public async signers(\n address: Address,\n params?: ReadParams<typeof signerValidatorAbi, 'signers'>,\n ) {\n return await readSignerValidatorSigners(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Retrieve the hash and signer data for a given hash\n *\n * @public\n * @async\n * @param {SignerValidatorSignaturePayload} payload\n * @param {?ReadParams<typeof signerValidatorAbi, 'hashSignerData'>} [params]\n * @returns {unknown}\n */\n public async hashSignerData(\n payload: SignerValidatorSignaturePayload,\n params?: ReadParams<typeof signerValidatorAbi, 'hashSignerData'>,\n ) {\n return await readSignerValidatorHashSignerData(this._config, {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveQuantity,\n payload.claimant,\n payload.incentiveData,\n ],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams<typeof signerValidatorAbi, 'validate'>} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validate(\n payload: SignerValidatorValidatePayload,\n params?: WriteParams<typeof signerValidatorAbi, 'validate'>,\n ) {\n return await this.awaitResult(this.validateRaw(payload, params));\n }\n\n /**\n * Validate that the action has been completed successfully. The data payload is expected to be a tuple of (address signer, bytes32 hash, bytes signature). The signature is expected to be a valid ECDSA or EIP-1271 signature of a unique hash by an authorized signer.\n *\n * @public\n * @async\n * @param {SignerValidatorValidatePayload} payload\n * @param {?WriteParams<typeof signerValidatorAbi, 'validate'>} [params]\n * @returns {Promise<boolean>} - True if the action has been validated based on the data payload\n */\n protected async validateRaw(\n payload: SignerValidatorValidatePayload,\n params?: ReadParams<typeof signerValidatorAbi, 'validate'>,\n ) {\n const { request, result } = await simulateSignerValidatorValidate(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [\n payload.boostId,\n payload.incentiveId,\n payload.claimant,\n payload.claimData,\n ],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSignerValidatorValidate(this._config, request);\n return { hash, result };\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams<typeof signerValidatorAbi, 'setAuthorized'>} [params]\n * @returns {unknown}\n */\n public async setAuthorized(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof signerValidatorAbi, 'setAuthorized'>,\n ) {\n return await this.awaitResult(\n this.setAuthorizedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the authorized status of a signer\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of signers to update\n * @param {boolean[]} allowed - The authorized status of each signer\n * @param {?WriteParams<typeof signerValidatorAbi, 'setAuthorized'>} [params]\n * @returns {unknown}\n */\n public async setAuthorizedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof signerValidatorAbi, 'setAuthorized'>,\n ) {\n const { request, result } = await simulateSignerValidatorSetAuthorized(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSignerValidatorSetAuthorized(this._config, request);\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams<typeof signerValidatorAbi, 'setValidatorCaller'>} [params]\n * @returns {unknown}\n */\n public async setValidatorCallerRaw(\n address: Address,\n params?: WriteParams<typeof signerValidatorAbi, 'setValidatorCaller'>,\n ) {\n const { request, result } = await simulateSignerValidatorSetValidatorCaller(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSignerValidatorSetValidatorCaller(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Update the authorized caller of the validator function\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?WriteParams<typeof signerValidatorAbi, 'setValidatorCaller'>} [params]\n * @returns {unknown}\n */\n public async setValidatorCaller(\n address: Address,\n params?: WriteParams<typeof signerValidatorAbi, 'setValidatorCaller'>,\n ) {\n return await this.awaitResult(this.setValidatorCallerRaw(address, params));\n }\n\n /**\n * Properly encodes the data needed to claim\n *\n * @public\n * @async\n * @param {SignerValidatorClaimDataParams} params\n * @returns {Promise<Hex>}\n */\n public async encodeClaimData(\n params: Omit<SignerValidatorClaimDataParams, 'validator'>,\n ): Promise<Hex> {\n return await prepareSignerValidatorClaimDataPayload({\n ...params,\n validator: this.assertValidAddress(),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SignerValidatorPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SignerValidatorPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: signerValidatorAbi,\n bytecode: bytecode as Hex,\n args: [prepareSignerValidatorPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Signer Validator Claim Data Payload Preparation\n *\n * @export\n * @async\n * @param {SignerValidatorClaimDataParams} param0\n * @param {{ account: Address; key: Hex; privateKey: PrivateKeyAccount; }} param0.signer\n * @param {Hex} param0.incentiveData\n * @param {number} param0.chainId\n * @param {Address} param0.validator\n * @param {number} param0.incentiveQuantity\n * @param {Address} param0.claimant\n * @param {bigint} param0.boostId\n * @returns {Promise<Hex>}\n */\nexport async function prepareSignerValidatorClaimDataPayload({\n signer,\n incentiveData,\n chainId,\n validator,\n incentiveQuantity,\n claimant,\n boostId,\n}: SignerValidatorClaimDataParams): Promise<Hex> {\n const 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 * Given a {@link SignerValidatorInputParams}, properly encode the initialization payload.\n *\n * @param {SignerValidatorInputParams} param0\n * @param {Address} param0.signer\n * @param {Hex} param0.signature\n * @param {number} param0.incentiveQuantity\n * @returns {Hex}\n */\nexport function prepareSignerValidatorInputParams({\n signer,\n signature,\n incentiveQuantity,\n}: SignerValidatorInputParams) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'SignerValidatorInputParams',\n components: [\n { type: 'address', name: 'signer' },\n { type: 'bytes', name: 'signature' },\n { type: 'uint8', name: 'incentiveQuantity' },\n ],\n },\n ],\n [{ signer, signature, incentiveQuantity }],\n );\n}\n\n/**\n * Given a {@link SignerValidatorPayload}, properly encode the initialization payload.\n *\n * @param {SignerValidatorPayload} param0\n * @param {Address[]} param0.signers\n * @param {Address} param0.validatorCaller\n * @returns {Hex}\n */\nexport function prepareSignerValidatorPayload({\n signers,\n validatorCaller,\n}: SignerValidatorPayload) {\n return encodeAbiParameters(\n [\n { type: 'address[]', name: 'signers' },\n { type: 'address', name: 'validatorCaller' },\n ],\n [signers, validatorCaller],\n );\n}\n"],"names":["_SignerValidator","DeployableTarget","signerValidatorAbi","address","params","readSignerValidatorSigners","payload","readSignerValidatorHashSignerData","request","result","simulateSignerValidatorValidate","writeSignerValidatorValidate","addresses","allowed","simulateSignerValidatorSetAuthorized","writeSignerValidatorSetAuthorized","simulateSignerValidatorSetValidatorCaller","writeSignerValidatorSetValidatorCaller","prepareSignerValidatorClaimDataPayload","_payload","_options","options","bytecode","prepareSignerValidatorPayload","RegistryType","SignerValidator","signer","incentiveData","chainId","validator","incentiveQuantity","claimant","boostId","trustedSignature","signTypedData","validatorData","prepareSignerValidatorInputParams","encodeAbiParameters","signature","signers","validatorCaller"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../generated-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../generated-wKBNvm48.cjs"),c=require("../componentInterfaces-CKCBwG16.cjs"),d=require("@wagmi/core"),s=require("../errors.cjs"),a=require("./SignerValidator.cjs"),e={[c.ASignerValidator]:a.SignerValidator};async function l(r,t){const n=await d.readContract(r.config,{abi:i.re,functionName:"getComponentInterface",address:t}),o=e[n];if(!o)throw new s.InvalidComponentInterfaceError(Object.keys(e),n);return new o(r,t)}exports.SignerValidator=a.SignerValidator;exports.ValidatorByComponentInterface=e;exports.validatorFromAddress=l;
|
|
2
2
|
//# sourceMappingURL=Validator.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as a } from "../generated-
|
|
1
|
+
import { r as a } from "../generated-57_Kffpz.js";
|
|
2
2
|
import { d as i } from "../componentInterfaces-DYkaxBda.js";
|
|
3
3
|
import { readContract as m } from "@wagmi/core";
|
|
4
4
|
import { InvalidComponentInterfaceError as c } from "../errors.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("viem");var r=(e=>(e[e.POOL=0]="POOL",e[e.MINT=1]="MINT",e[e.RAFFLE=2]="RAFFLE",e))(r||{});const n=({target:e,data:o=a.zeroHash})=>a.encodeAbiParameters([{type:"address",name:"target"},{type:"bytes",name:"data"}],[e,o]);exports.StrategyType=r;exports.prepareClaimPayload=n;
|
|
2
|
+
//# sourceMappingURL=claiming.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claiming.cjs","sources":["../src/claiming.ts"],"sourcesContent":["import { type Address, type Hex, encodeAbiParameters, zeroHash } from 'viem';\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 * 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"],"names":["StrategyType","prepareClaimPayload","target","data","zeroHash","encodeAbiParameters"],"mappings":"wGAQY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,KAAO,CAAP,EAAA,OACAA,EAAAA,EAAA,KAAO,CAAP,EAAA,OACAA,EAAAA,EAAA,OAAS,CAAT,EAAA,SAHUA,IAAAA,GAAA,CAAA,CAAA,EAoCL,MAAMC,EAAsB,CAAC,CAClC,OAAAC,EACA,KAAAC,EAAOC,EAAA,QACT,IACSC,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,QAAS,KAAM,MAAO,CAChC,EACA,CAACH,EAAQC,CAAI,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Enum representing incentive disbursement strategies.
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @enum {number}
|
|
7
|
+
*/
|
|
8
|
+
export declare enum StrategyType {
|
|
9
|
+
POOL = 0,
|
|
10
|
+
MINT = 1,
|
|
11
|
+
RAFFLE = 2
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The object representation of an `Incentive.ClaimPayload`
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface ClaimPayload
|
|
18
|
+
* @typedef {ClaimPayload}
|
|
19
|
+
*/
|
|
20
|
+
export interface ClaimPayload {
|
|
21
|
+
/**
|
|
22
|
+
* The address of the recipient
|
|
23
|
+
*
|
|
24
|
+
* @type {Address}
|
|
25
|
+
*/
|
|
26
|
+
target: Address;
|
|
27
|
+
/**
|
|
28
|
+
* The implementation-specific data for the claim, if needed
|
|
29
|
+
*
|
|
30
|
+
* @type {?Hex}
|
|
31
|
+
*/
|
|
32
|
+
data?: Hex;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Given a valid {@link ClaimPayload}, encode the payload for use with Incentive operations.
|
|
36
|
+
*
|
|
37
|
+
* @param {ClaimPayload} param0
|
|
38
|
+
* @param {Address} param0.target - The address of the recipient
|
|
39
|
+
* @param {Hex} [param0.data=zeroHash] - The implementation-specific data for the claim, if needed
|
|
40
|
+
* @returns {*}
|
|
41
|
+
*/
|
|
42
|
+
export declare const prepareClaimPayload: ({ target, data, }: ClaimPayload) => `0x${string}`;
|
|
43
|
+
//# sourceMappingURL=claiming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claiming.d.ts","sourceRoot":"","sources":["../src/claiming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAiC,MAAM,MAAM,CAAC;AAE7E;;;;;GAKG;AACH,oBAAY,YAAY;IACtB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,MAAM,IAAI;CACX;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,sBAG7B,YAAY,kBAQd,CAAC"}
|
package/dist/claiming.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { encodeAbiParameters as e, zeroHash as o } from "viem";
|
|
2
|
+
var m = /* @__PURE__ */ ((r) => (r[r.POOL = 0] = "POOL", r[r.MINT = 1] = "MINT", r[r.RAFFLE = 2] = "RAFFLE", r))(m || {});
|
|
3
|
+
const s = ({
|
|
4
|
+
target: r,
|
|
5
|
+
data: a = o
|
|
6
|
+
}) => e(
|
|
7
|
+
[
|
|
8
|
+
{ type: "address", name: "target" },
|
|
9
|
+
{ type: "bytes", name: "data" }
|
|
10
|
+
],
|
|
11
|
+
[r, a]
|
|
12
|
+
);
|
|
13
|
+
export {
|
|
14
|
+
m as StrategyType,
|
|
15
|
+
s as prepareClaimPayload
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=claiming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claiming.js","sources":["../src/claiming.ts"],"sourcesContent":["import { type Address, type Hex, encodeAbiParameters, zeroHash } from 'viem';\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 * 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"],"names":["StrategyType","prepareClaimPayload","target","data","zeroHash","encodeAbiParameters"],"mappings":";AAQY,IAAAA,sBAAAA,OACVA,EAAAA,EAAA,OAAO,CAAP,IAAA,QACAA,EAAAA,EAAA,OAAO,CAAP,IAAA,QACAA,EAAAA,EAAA,SAAS,CAAT,IAAA,UAHUA,IAAAA,KAAA,CAAA,CAAA;AAoCL,MAAMC,IAAsB,CAAC;AAAA,EAClC,QAAAC;AAAA,EACA,MAAAC,IAAOC;AACT,MACSC;AAAA,EACL;AAAA,IACE,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,IAClC,EAAE,MAAM,SAAS,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,CAACH,GAAQC,CAAI;AAAA;"}
|
package/dist/errors.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("viem");class i extends Error{constructor(){super('No "BoostCreated" log was emitted from which to extract boostId')}}class d extends Error{constructor(){super("Attempted to call contract method without providing an address")}}class c extends Error{constructor(r){super("Attempted to deploy a contract that already has an address configured"),this.address=r}}class l extends Error{constructor(){super("Implementing class did not properly override the `buildParameters` method")}}class u extends Error{constructor(){super("Expected an an owner to be provided in configuration or an account to exist on Wagmi config.")}}class p extends Error{constructor(){super("Expected a valid Wagmi configuration to be available either on Deployable, or as argument to deploy.")}}class E extends Error{constructor(){super("Expected a valid payload to be available either on Deployable or as argument to deploy.")}}class y extends Error{constructor(r){super("Expected a contract address to exist on receipt.",{cause:r}),this.receipt=r}}class v extends Error{constructor(r,t){super("Address provided does not match any expected protocol interface",{cause:{expected:r,received:t}}),this.expected=[],this.received=a.zeroHash,this.expected=r,this.received=t}}class m extends Error{constructor(r){super("Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.",{cause:r}),this.received=r}}class b extends Error{constructor(r){super(`Budget needs to explicitly authorize ${r}. You can retrieve this value from BoostCore.address`)}}class h extends Error{constructor(r){super(`Incentive not cloneable: ${r.constructor.name}`)}}class x extends Error{constructor(){super("Must supply at least one action step")}}class
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("viem");class i extends Error{constructor(){super('No "BoostCreated" log was emitted from which to extract boostId')}}class d extends Error{constructor(){super("Attempted to call contract method without providing an address")}}class c extends Error{constructor(r){super("Attempted to deploy a contract that already has an address configured"),this.address=r}}class l extends Error{constructor(){super("Implementing class did not properly override the `buildParameters` method")}}class u extends Error{constructor(){super("Expected an an owner to be provided in configuration or an account to exist on Wagmi config.")}}class p extends Error{constructor(){super("Expected a valid Wagmi configuration to be available either on Deployable, or as argument to deploy.")}}class E extends Error{constructor(){super("Expected a valid payload to be available either on Deployable or as argument to deploy.")}}class y extends Error{constructor(r){super("Expected a contract address to exist on receipt.",{cause:r}),this.receipt=r}}class v extends Error{constructor(r,t){super("Address provided does not match any expected protocol interface",{cause:{expected:r,received:t}}),this.expected=[],this.received=a.zeroHash,this.expected=r,this.received=t}}class m extends Error{constructor(r){super("Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.",{cause:r}),this.received=r}}class b extends Error{constructor(r){super(`Budget needs to explicitly authorize ${r}. You can retrieve this value from BoostCore.address`)}}class g extends Error{constructor(){super("Budgets must be preinitialized before being used with a new Boost")}}class h extends Error{constructor(r){super(`Incentive not cloneable: ${r.constructor.name}`)}}class x extends Error{constructor(){super("Must supply at least one action step")}}class f extends Error{constructor(){super("Cannot supply more than 4 action steps with current protocol version")}}class o extends Error{constructor(r,{fieldValue:t,criteria:s,log:n}){super(r),this.fieldValue=t,this.criteria=s,this.log=n}}class C extends o{constructor(r){super("Field value is undefined",r)}}class A extends o{constructor(r){super("Numerical comparisons cannot be used with non-numerical criteria",r)}}class I extends o{constructor(r){super("Filter can only be used with bytes or string field type",r)}}class w extends o{constructor(r){super("Invalid FilterType provided",r)}}exports.BoostCoreNoIdentifierEmitted=i;exports.BudgetMustAuthorizeBoostCore=b;exports.ContractAddressRequiredError=d;exports.DeployableAlreadyDeployedError=c;exports.DeployableBuildParametersUnspecifiedError=l;exports.DeployableMissingPayloadError=E;exports.DeployableUnknownOwnerProvidedError=u;exports.DeployableWagmiConfigurationRequiredError=p;exports.EventActionValidationError=o;exports.FieldValueNotComparableError=I;exports.FieldValueUndefinedError=C;exports.IncentiveNotCloneableError=h;exports.InvalidComponentInterfaceError=v;exports.InvalidNumericalCriteriaError=A;exports.MustInitializeBudgetError=g;exports.NoContractAddressUponReceiptError=y;exports.NoEventActionStepsProvidedError=x;exports.TooManyEventActionStepsProvidedError=f;exports.UnknownTransferPayloadSupplied=m;exports.UnrecognizedFilterTypeError=w;
|
|
2
2
|
//# sourceMappingURL=errors.cjs.map
|
package/dist/errors.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs","sources":["../src/errors.ts"],"sourcesContent":["import {\n type Hex,\n type Log,\n type WaitForTransactionReceiptReturnType,\n zeroHash,\n} from 'viem';\nimport type { Incentive } from './Incentives/Incentive';\nimport type { Criteria } from './utils';\n\n/**\n * This error is thrown during Boost creation if no `BoostCreated` event was emitted.\n *\n * @export\n * @class BoostCoreNoIdentifierEmitted\n * @typedef {BoostCoreNoIdentifierEmitted}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * await boostCore.createBoost(...)\n * } catch(e) {\n * if(e instanceof BoostCoreNoIdentifierEmitted) {}\n * }\n * ```\n */\nexport class BoostCoreNoIdentifierEmitted extends Error {\n /**\n * Creates an instance of BoostCoreNoIdentifierEmitted.\n *\n * @constructor\n */\n constructor() {\n super(`No \"BoostCreated\" log was emitted from which to extract boostId`);\n }\n}\n\n/**\n * This error is thrown when `assertValidAddress` is called, usually because a contract call expects the class to have a valid address attached.\n *\n * @export\n * @class ContractAddressRequiredError\n * @typedef {ContractAddressRequiredError}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * target.assertValidAddress()\n * } catch(e) {\n * if(e instanceof ContractAddressRequiredError) {}\n * }\n */\nexport class ContractAddressRequiredError extends Error {\n /**\n * Creates an instance of ContractAddressRequiredError.\n *\n * @constructor\n */\n constructor() {\n super('Attempted to call contract method without providing an address');\n }\n}\n\n/**\n * This error is thrown when attempting to deploy a contract that has already been deployed, or has an address attached.\n *\n * @export\n * @class DeployableAlreadyDeployedError\n * @typedef {DeployableAlreadyDeployedError}\n * @extends {Error}\n */\nexport class DeployableAlreadyDeployedError extends Error {\n /**\n * The address already attached to the target.\n *\n * @type {string}\n */\n address: string;\n /**\n * Creates an instance of DeployableAlreadyDeployedError.\n *\n * @constructor\n * @param {string} address\n */\n constructor(address: string) {\n super(\n `Attempted to deploy a contract that already has an address configured`,\n );\n this.address = address;\n }\n}\n\n/**\n * You should never see this error if we did our jobs and every target overrides the `buildParameters` method.\n *\n * @export\n * @class DeployableBuildParametersUnspecifiedError\n * @typedef {DeployableBuildParametersUnspecifiedError}\n * @extends {Error}\n */\nexport class DeployableBuildParametersUnspecifiedError extends Error {\n /**\n * Creates an instance of DeployableBuildParametersUnspecifiedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Implementing class did not properly override the `buildParameters` method',\n );\n }\n}\n\n/**\n * This error is thrown when attempting to deploy an `ownable` contract and the owner cannot be ascertained from the initialization payload or configured account.\n *\n * @export\n * @class DeployableUnknownOwnerProvidedError\n * @typedef {DeployableUnknownOwnerProvidedError}\n * @extends {Error}\n */\nexport class DeployableUnknownOwnerProvidedError extends Error {\n /**\n * Creates an instance of DeployableUnknownOwnerProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected an an owner to be provided in configuration or an account to exist on Wagmi config.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid Wagmi configuration on the instance.\n *\n * @export\n * @class DeployableWagmiConfigurationRequiredError\n * @typedef {DeployableWagmiConfigurationRequiredError}\n * @extends {Error}\n */\nexport class DeployableWagmiConfigurationRequiredError extends Error {\n /**\n * Creates an instance of DeployableWagmiConfigurationRequiredError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid Wagmi configuration to be available either on Deployable, or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid initialization payload.\n *\n * @export\n * @class DeployableMissingPayloadError\n * @typedef {DeployableMissingPayloadError}\n * @extends {Error}\n */\nexport class DeployableMissingPayloadError extends Error {\n /**\n * Creates an instance of DeployableMissingPayloadError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid payload to be available either on Deployable or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when we receive a transaction receipt for a contract deployment without a contract address on it.\n *\n * @export\n * @class NoContractAddressUponReceiptError\n * @typedef {NoContractAddressUponReceiptError}\n * @extends {Error}\n */\nexport class NoContractAddressUponReceiptError extends Error {\n /**\n * The raw receipt we receive from [waitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n *\n * @public\n * @readonly\n * @type {WaitForTransactionReceiptReturnType}\n */\n public readonly receipt: WaitForTransactionReceiptReturnType;\n /**\n * Creates an instance of NoContractAddressUponReceiptError.\n *\n * @constructor\n * @param {WaitForTransactionReceiptReturnType} receipt\n */\n constructor(receipt: WaitForTransactionReceiptReturnType) {\n super(`Expected a contract address to exist on receipt.`, {\n cause: receipt,\n });\n this.receipt = receipt;\n }\n}\n\n/**\n * This error is thrown when a target address was provided that doesn't match any supported interface for the given registry type.\n * For example, if you try to do `incentiveFromAddress()` with the address of a deployed `SimpleBudget`\n *\n * @export\n * @class InvalidComponentInterfaceError\n * @typedef {InvalidComponentInterfaceError}\n * @extends {Error}\n */\nexport class InvalidComponentInterfaceError extends Error {\n /**\n * Expected interface hashes.\n *\n * @public\n * @readonly\n * @type {Hex[]}\n */\n public readonly expected: Hex[] = [];\n /**\n * The actual interface hash.\n *\n * @public\n * @readonly\n * @type {Hex}\n */\n public readonly received: Hex = zeroHash;\n\n /**\n * Creates an instance of InvalidComponentInterfaceError.\n *\n * @constructor\n * @param {Hex[]} expected\n * @param {Hex} received\n */\n constructor(expected: Hex[], received: Hex) {\n super(`Address provided does not match any expected protocol interface`, {\n cause: { expected, received },\n });\n this.expected = expected;\n this.received = received;\n }\n}\n\n/**\n * This error is thrown when attempting a Budget transfer and arguments aren't of the type `FungibleTransferPayload` or `ERC1155TransferPayload`\n *\n * @see {@link FungibleTransferPayload}\n * @see {@link ERC1155TransferPayload}\n * @export\n * @class UnknownTransferPayloadSupplied\n * @typedef {UnknownTransferPayloadSupplied}\n * @extends {Error}\n */\nexport class UnknownTransferPayloadSupplied extends Error {\n /**\n * The given payload that does not conform to the correct payload shape.\n *\n * @type {unknown}\n */\n received: unknown;\n /**\n * Creates an instance of UnknownTransferPayloadSupplied.\n *\n * @constructor\n * @param {unknown} received\n */\n constructor(received: unknown) {\n super(\n `Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.`,\n { cause: received },\n );\n this.received = received;\n }\n}\n\n/**\n * This error is thrown during Boost creation when the budget doesn't authorize the Boost Core address.\n *\n * @export\n * @class BudgetMustAuthorizeBoostCore\n * @typedef {BudgetMustAuthorizeBoostCore}\n * @extends {Error}\n */\nexport class BudgetMustAuthorizeBoostCore extends Error {\n /**\n * Creates an instance of BudgetMustAuthorizeBoostCore.\n *\n * @constructor\n * @param {string} boostCoreAddress\n */\n constructor(boostCoreAddress: string) {\n super(\n `Budget needs to explicitly authorize ${boostCoreAddress}. You can retrieve this value from BoostCore.address`,\n );\n }\n}\n\n/**\n * The error is thrown when trying to reuse an existing deployed Incentive that isn't a base implementation.\n * The protocol doesn't allow this.\n *\n * @export\n * @class IncentiveNotCloneableError\n * @typedef {IncentiveNotCloneableError}\n * @extends {Error}\n */\nexport class IncentiveNotCloneableError extends Error {\n /**\n * Creates an instance of IncentiveNotCloneableError.\n *\n * @constructor\n * @param {Incentive} incentive\n */\n constructor(incentive: Incentive) {\n super(`Incentive not cloneable: ${incentive.constructor.name}`);\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and no action steps are provided\n *\n * @export\n * @class NoEventActionStepsProvidedError\n * @typedef {NoEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class NoEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of NoEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super('Must supply at least one action step');\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and > 4 steps are provided\n *\n * @export\n * @class TooManyEventActionStepsProvidedError\n * @typedef {TooManyEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class TooManyEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of TooManyEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Cannot supply more than 4 action steps with current protocol version',\n );\n }\n}\n\n/**\n * Event action validation context to help debug other validation errors\n *\n * @interface EventActionValidationMeta\n * @typedef {EventActionValidationMeta}\n */\ninterface EventActionValidationMeta {\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log: Log;\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n}\n\n/**\n * The base error thrown during event action validation extended by more specific validation errors.\n * Instantiated with relevent context data for more in depth debugging.\n *\n * @export\n * @class EventActionValidationError\n * @typedef {EventActionValidationError}\n * @extends {Error}\n */\nexport class EventActionValidationError extends Error {\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log: Log;\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n /**\n * Creates an instance of EventActionValidationError.\n *\n * @constructor\n * @param {string} message\n * @param {EventActionValidationMeta} param0\n * @param {*} param0.fieldValue\n * @param {Criteria} param0.criteria\n * @param {Log} param0.log\n */\n constructor(\n message: string,\n { fieldValue, criteria, log }: EventActionValidationMeta,\n ) {\n super(message);\n this.fieldValue = fieldValue;\n this.criteria = criteria;\n this.log = log;\n }\n}\n\n/**\n * Thrown when field value on log is undefined\n *\n * @export\n * @class FieldValueUndefinedError\n * @typedef {FieldValueUndefinedError}\n * @extends {EventActionValidationError}\n */\nexport class FieldValueUndefinedError extends EventActionValidationError {\n /**\n * Creates an instance of FieldValueUndefinedError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Field value is undefined', metadata);\n }\n}\n\n/**\n * Thrown when a filter type is using a numerical operator but field type is not numerical\n *\n * @export\n * @class InvalidNumericalCriteriaError\n * @typedef {InvalidNumericalCriteriaError}\n * @extends {EventActionValidationError}\n */\nexport class InvalidNumericalCriteriaError extends EventActionValidationError {\n /**\n * Creates an instance of InvalidNumericalCriteria.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super(\n 'Numerical comparisons cannot be used with non-numerical criteria',\n metadata,\n );\n }\n}\n\n/**\n * Thrown when an the log's field value is being compared a field type that isn't bytes or string during event action validation\n *\n * @export\n * @class FieldValueNotComparableError\n * @typedef {FieldValueNotComparableError}\n * @extends {EventActionValidationError}\n */\nexport class FieldValueNotComparableError extends EventActionValidationError {\n /**\n * Creates an instance of FieldValueNotComparableError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Filter can only be used with bytes or string field type', metadata);\n }\n}\n\n/**\n * Thrown when an invalid filter type enum was provided event action validation.\n *\n * @export\n * @class UnrecognizedFilterTypeError\n * @typedef {UnrecognizedFilterTypeError}\n * @extends {EventActionValidationError}\n */\nexport class UnrecognizedFilterTypeError extends EventActionValidationError {\n /**\n * Creates an instance of UnrecognizedFilterTypeError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Invalid FilterType provided', metadata);\n }\n}\n"],"names":["BoostCoreNoIdentifierEmitted","ContractAddressRequiredError","DeployableAlreadyDeployedError","address","DeployableBuildParametersUnspecifiedError","DeployableUnknownOwnerProvidedError","DeployableWagmiConfigurationRequiredError","DeployableMissingPayloadError","NoContractAddressUponReceiptError","receipt","InvalidComponentInterfaceError","expected","received","zeroHash","UnknownTransferPayloadSupplied","BudgetMustAuthorizeBoostCore","boostCoreAddress","IncentiveNotCloneableError","incentive","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","EventActionValidationError","message","fieldValue","criteria","log","FieldValueUndefinedError","metadata","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError"],"mappings":"wGAyBO,MAAMA,UAAqC,KAAM,CAMtD,aAAc,CACZ,MAAM,iEAAiE,CACzE,CACF,CAiBO,MAAMC,UAAqC,KAAM,CAMtD,aAAc,CACZ,MAAM,gEAAgE,CACxE,CACF,CAUO,MAAMC,UAAuC,KAAM,CAaxD,YAAYC,EAAiB,CAC3B,MACE,uEAAA,EAEF,KAAK,QAAUA,CACjB,CACF,CAUO,MAAMC,UAAkD,KAAM,CAMnE,aAAc,CACZ,MACE,2EAAA,CAEJ,CACF,CAUO,MAAMC,UAA4C,KAAM,CAM7D,aAAc,CACZ,MACE,8FAAA,CAEJ,CACF,CAUO,MAAMC,UAAkD,KAAM,CAMnE,aAAc,CACZ,MACE,sGAAA,CAEJ,CACF,CAUO,MAAMC,UAAsC,KAAM,CAMvD,aAAc,CACZ,MACE,yFAAA,CAEJ,CACF,CAUO,MAAMC,UAA0C,KAAM,CAe3D,YAAYC,EAA8C,CACxD,MAAM,mDAAoD,CACxD,MAAOA,CAAA,CACR,EACD,KAAK,QAAUA,CACjB,CACF,CAWO,MAAMC,UAAuC,KAAM,CAyBxD,YAAYC,EAAiBC,EAAe,CAC1C,MAAM,kEAAmE,CACvE,MAAO,CAAE,SAAAD,EAAU,SAAAC,CAAS,CAAA,CAC7B,EApBH,KAAgB,SAAkB,GAQlC,KAAgB,SAAgBC,WAa9B,KAAK,SAAWF,EAChB,KAAK,SAAWC,CAClB,CACF,CAYO,MAAME,UAAuC,KAAM,CAaxD,YAAYF,EAAmB,CAC7B,MACE,+EACA,CAAE,MAAOA,CAAS,CAAA,EAEpB,KAAK,SAAWA,CAClB,CACF,CAUO,MAAMG,UAAqC,KAAM,CAOtD,YAAYC,EAA0B,CACpC,MACE,wCAAwCA,CAAgB,sDAAA,CAE5D,CACF,CAWO,MAAMC,UAAmC,KAAM,CAOpD,YAAYC,EAAsB,CAChC,MAAM,4BAA4BA,EAAU,YAAY,IAAI,EAAE,CAChE,CACF,CAUO,MAAMC,UAAwC,KAAM,CAMzD,aAAc,CACZ,MAAM,sCAAsC,CAC9C,CACF,CAUO,MAAMC,UAA6C,KAAM,CAM9D,aAAc,CACZ,MACE,sEAAA,CAEJ,CACF,CAuCO,MAAMC,UAAmC,KAAM,CA8BpD,YACEC,EACA,CAAE,WAAAC,EAAY,SAAAC,EAAU,IAAAC,GACxB,CACA,MAAMH,CAAO,EACb,KAAK,WAAaC,EAClB,KAAK,SAAWC,EAChB,KAAK,IAAMC,CACb,CACF,CAUO,MAAMC,UAAiCL,CAA2B,CAOvE,YAAYM,EAAqC,CAC/C,MAAM,2BAA4BA,CAAQ,CAC5C,CACF,CAUO,MAAMC,UAAsCP,CAA2B,CAO5E,YAAYM,EAAqC,CAC/C,MACE,mEACAA,CAAA,CAEJ,CACF,CAUO,MAAME,UAAqCR,CAA2B,CAO3E,YAAYM,EAAqC,CAC/C,MAAM,0DAA2DA,CAAQ,CAC3E,CACF,CAUO,MAAMG,UAAoCT,CAA2B,CAO1E,YAAYM,EAAqC,CAC/C,MAAM,8BAA+BA,CAAQ,CAC/C,CACF"}
|
|
1
|
+
{"version":3,"file":"errors.cjs","sources":["../src/errors.ts"],"sourcesContent":["import {\n type Hex,\n type Log,\n type WaitForTransactionReceiptReturnType,\n zeroHash,\n} from 'viem';\nimport type { Criteria } from './Actions/EventAction';\nimport type { BoostRegistry } from './BoostRegistry';\nimport type { Incentive } from './Incentives/Incentive';\n\n/**\n * This error is thrown during Boost creation if no `BoostCreated` event was emitted.\n *\n * @export\n * @class BoostCoreNoIdentifierEmitted\n * @typedef {BoostCoreNoIdentifierEmitted}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * await boostCore.createBoost(...)\n * } catch(e) {\n * if(e instanceof BoostCoreNoIdentifierEmitted) {}\n * }\n * ```\n */\nexport class BoostCoreNoIdentifierEmitted extends Error {\n /**\n * Creates an instance of BoostCoreNoIdentifierEmitted.\n *\n * @constructor\n */\n constructor() {\n super(`No \"BoostCreated\" log was emitted from which to extract boostId`);\n }\n}\n\n/**\n * This error is thrown when `assertValidAddress` is called, usually because a contract call expects the class to have a valid address attached.\n *\n * @export\n * @class ContractAddressRequiredError\n * @typedef {ContractAddressRequiredError}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * target.assertValidAddress()\n * } catch(e) {\n * if(e instanceof ContractAddressRequiredError) {}\n * }\n */\nexport class ContractAddressRequiredError extends Error {\n /**\n * Creates an instance of ContractAddressRequiredError.\n *\n * @constructor\n */\n constructor() {\n super('Attempted to call contract method without providing an address');\n }\n}\n\n/**\n * This error is thrown when attempting to deploy a contract that has already been deployed, or has an address attached.\n *\n * @export\n * @class DeployableAlreadyDeployedError\n * @typedef {DeployableAlreadyDeployedError}\n * @extends {Error}\n */\nexport class DeployableAlreadyDeployedError extends Error {\n /**\n * The address already attached to the target.\n *\n * @type {string}\n */\n address: string;\n /**\n * Creates an instance of DeployableAlreadyDeployedError.\n *\n * @constructor\n * @param {string} address\n */\n constructor(address: string) {\n super(\n `Attempted to deploy a contract that already has an address configured`,\n );\n this.address = address;\n }\n}\n\n/**\n * You should never see this error if we did our jobs and every target overrides the `buildParameters` method.\n *\n * @export\n * @class DeployableBuildParametersUnspecifiedError\n * @typedef {DeployableBuildParametersUnspecifiedError}\n * @extends {Error}\n */\nexport class DeployableBuildParametersUnspecifiedError extends Error {\n /**\n * Creates an instance of DeployableBuildParametersUnspecifiedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Implementing class did not properly override the `buildParameters` method',\n );\n }\n}\n\n/**\n * This error is thrown when attempting to deploy an `ownable` contract and the owner cannot be ascertained from the initialization payload or configured account.\n *\n * @export\n * @class DeployableUnknownOwnerProvidedError\n * @typedef {DeployableUnknownOwnerProvidedError}\n * @extends {Error}\n */\nexport class DeployableUnknownOwnerProvidedError extends Error {\n /**\n * Creates an instance of DeployableUnknownOwnerProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected an an owner to be provided in configuration or an account to exist on Wagmi config.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid Wagmi configuration on the instance.\n *\n * @export\n * @class DeployableWagmiConfigurationRequiredError\n * @typedef {DeployableWagmiConfigurationRequiredError}\n * @extends {Error}\n */\nexport class DeployableWagmiConfigurationRequiredError extends Error {\n /**\n * Creates an instance of DeployableWagmiConfigurationRequiredError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid Wagmi configuration to be available either on Deployable, or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid initialization payload.\n *\n * @export\n * @class DeployableMissingPayloadError\n * @typedef {DeployableMissingPayloadError}\n * @extends {Error}\n */\nexport class DeployableMissingPayloadError extends Error {\n /**\n * Creates an instance of DeployableMissingPayloadError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid payload to be available either on Deployable or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when we receive a transaction receipt for a contract deployment without a contract address on it.\n *\n * @export\n * @class NoContractAddressUponReceiptError\n * @typedef {NoContractAddressUponReceiptError}\n * @extends {Error}\n */\nexport class NoContractAddressUponReceiptError extends Error {\n /**\n * The raw receipt we receive from [waitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n *\n * @public\n * @readonly\n * @type {WaitForTransactionReceiptReturnType}\n */\n public readonly receipt: WaitForTransactionReceiptReturnType;\n /**\n * Creates an instance of NoContractAddressUponReceiptError.\n *\n * @constructor\n * @param {WaitForTransactionReceiptReturnType} receipt\n */\n constructor(receipt: WaitForTransactionReceiptReturnType) {\n super(`Expected a contract address to exist on receipt.`, {\n cause: receipt,\n });\n this.receipt = receipt;\n }\n}\n\n/**\n * This error is thrown when a target address was provided that doesn't match any supported interface for the given registry type.\n * For example, if you try to do `incentiveFromAddress()` with the address of a deployed `SimpleBudget`\n *\n * @export\n * @class InvalidComponentInterfaceError\n * @typedef {InvalidComponentInterfaceError}\n * @extends {Error}\n */\nexport class InvalidComponentInterfaceError extends Error {\n /**\n * Expected interface hashes.\n *\n * @public\n * @readonly\n * @type {Hex[]}\n */\n public readonly expected: Hex[] = [];\n /**\n * The actual interface hash.\n *\n * @public\n * @readonly\n * @type {Hex}\n */\n public readonly received: Hex = zeroHash;\n\n /**\n * Creates an instance of InvalidComponentInterfaceError.\n *\n * @constructor\n * @param {Hex[]} expected\n * @param {Hex} received\n */\n constructor(expected: Hex[], received: Hex) {\n super(`Address provided does not match any expected protocol interface`, {\n cause: { expected, received },\n });\n this.expected = expected;\n this.received = received;\n }\n}\n\n/**\n * This error is thrown when attempting a Budget transfer and arguments aren't of the type `FungibleTransferPayload` or `ERC1155TransferPayload`\n *\n * @see {@link FungibleTransferPayload}\n * @see {@link ERC1155TransferPayload}\n * @export\n * @class UnknownTransferPayloadSupplied\n * @typedef {UnknownTransferPayloadSupplied}\n * @extends {Error}\n */\nexport class UnknownTransferPayloadSupplied extends Error {\n /**\n * The given payload that does not conform to the correct payload shape.\n *\n * @type {unknown}\n */\n received: unknown;\n /**\n * Creates an instance of UnknownTransferPayloadSupplied.\n *\n * @constructor\n * @param {unknown} received\n */\n constructor(received: unknown) {\n super(\n `Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.`,\n { cause: received },\n );\n this.received = received;\n }\n}\n\n/**\n * This error is thrown during Boost creation when the budget doesn't authorize the Boost Core address.\n *\n * @export\n * @class BudgetMustAuthorizeBoostCore\n * @typedef {BudgetMustAuthorizeBoostCore}\n * @extends {Error}\n */\nexport class BudgetMustAuthorizeBoostCore extends Error {\n /**\n * Creates an instance of BudgetMustAuthorizeBoostCore.\n *\n * @constructor\n * @param {string} boostCoreAddress\n */\n constructor(boostCoreAddress: string) {\n super(\n `Budget needs to explicitly authorize ${boostCoreAddress}. You can retrieve this value from BoostCore.address`,\n );\n }\n}\n\n/**\n * Because this contract is a base implementation, it should not be initialized through the constructor. Instead, it should be cloned and initialized using the {@link BoostRegistry}\n *\n * @export\n * @class MustInitializeBudgetError\n * @typedef {MustInitializeBudgetError}\n * @extends {Error}\n */\nexport class MustInitializeBudgetError extends Error {\n /**\n * Creates an instance of MustInitializeBudgetError.\n */\n constructor() {\n super(`Budgets must be preinitialized before being used with a new Boost`);\n }\n}\n\n/**\n * The error is thrown when trying to reuse an existing deployed Incentive that isn't a base implementation.\n * The protocol doesn't allow this.\n *\n * @export\n * @class IncentiveNotCloneableError\n * @typedef {IncentiveNotCloneableError}\n * @extends {Error}\n */\nexport class IncentiveNotCloneableError extends Error {\n /**\n * Creates an instance of IncentiveNotCloneableError.\n *\n * @constructor\n * @param {Incentive} incentive\n */\n constructor(incentive: Incentive) {\n super(`Incentive not cloneable: ${incentive.constructor.name}`);\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and no action steps are provided\n *\n * @export\n * @class NoEventActionStepsProvidedError\n * @typedef {NoEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class NoEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of NoEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super('Must supply at least one action step');\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and > 4 steps are provided\n *\n * @export\n * @class TooManyEventActionStepsProvidedError\n * @typedef {TooManyEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class TooManyEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of TooManyEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Cannot supply more than 4 action steps with current protocol version',\n );\n }\n}\n\n/**\n * Event action validation context to help debug other validation errors\n *\n * @interface EventActionValidationMeta\n * @typedef {EventActionValidationMeta}\n */\ninterface EventActionValidationMeta {\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log: Log;\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n}\n\n/**\n * The base error thrown during event action validation extended by more specific validation errors.\n * Instantiated with relevent context data for more in depth debugging.\n *\n * @export\n * @class EventActionValidationError\n * @typedef {EventActionValidationError}\n * @extends {Error}\n */\nexport class EventActionValidationError extends Error {\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log: Log;\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n /**\n * Creates an instance of EventActionValidationError.\n *\n * @constructor\n * @param {string} message\n * @param {EventActionValidationMeta} param0\n * @param {*} param0.fieldValue\n * @param {Criteria} param0.criteria\n * @param {Log} param0.log\n */\n constructor(\n message: string,\n { fieldValue, criteria, log }: EventActionValidationMeta,\n ) {\n super(message);\n this.fieldValue = fieldValue;\n this.criteria = criteria;\n this.log = log;\n }\n}\n\n/**\n * Thrown when field value on log is undefined\n *\n * @export\n * @class FieldValueUndefinedError\n * @typedef {FieldValueUndefinedError}\n * @extends {EventActionValidationError}\n */\nexport class FieldValueUndefinedError extends EventActionValidationError {\n /**\n * Creates an instance of FieldValueUndefinedError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Field value is undefined', metadata);\n }\n}\n\n/**\n * Thrown when a filter type is using a numerical operator but field type is not numerical\n *\n * @export\n * @class InvalidNumericalCriteriaError\n * @typedef {InvalidNumericalCriteriaError}\n * @extends {EventActionValidationError}\n */\nexport class InvalidNumericalCriteriaError extends EventActionValidationError {\n /**\n * Creates an instance of InvalidNumericalCriteria.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super(\n 'Numerical comparisons cannot be used with non-numerical criteria',\n metadata,\n );\n }\n}\n\n/**\n * Thrown when an the log's field value is being compared a field type that isn't bytes or string during event action validation\n *\n * @export\n * @class FieldValueNotComparableError\n * @typedef {FieldValueNotComparableError}\n * @extends {EventActionValidationError}\n */\nexport class FieldValueNotComparableError extends EventActionValidationError {\n /**\n * Creates an instance of FieldValueNotComparableError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Filter can only be used with bytes or string field type', metadata);\n }\n}\n\n/**\n * Thrown when an invalid filter type enum was provided event action validation.\n *\n * @export\n * @class UnrecognizedFilterTypeError\n * @typedef {UnrecognizedFilterTypeError}\n * @extends {EventActionValidationError}\n */\nexport class UnrecognizedFilterTypeError extends EventActionValidationError {\n /**\n * Creates an instance of UnrecognizedFilterTypeError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Invalid FilterType provided', metadata);\n }\n}\n"],"names":["BoostCoreNoIdentifierEmitted","ContractAddressRequiredError","DeployableAlreadyDeployedError","address","DeployableBuildParametersUnspecifiedError","DeployableUnknownOwnerProvidedError","DeployableWagmiConfigurationRequiredError","DeployableMissingPayloadError","NoContractAddressUponReceiptError","receipt","InvalidComponentInterfaceError","expected","received","zeroHash","UnknownTransferPayloadSupplied","BudgetMustAuthorizeBoostCore","boostCoreAddress","MustInitializeBudgetError","IncentiveNotCloneableError","incentive","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","EventActionValidationError","message","fieldValue","criteria","log","FieldValueUndefinedError","metadata","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError"],"mappings":"wGA0BO,MAAMA,UAAqC,KAAM,CAMtD,aAAc,CACZ,MAAM,iEAAiE,CACzE,CACF,CAiBO,MAAMC,UAAqC,KAAM,CAMtD,aAAc,CACZ,MAAM,gEAAgE,CACxE,CACF,CAUO,MAAMC,UAAuC,KAAM,CAaxD,YAAYC,EAAiB,CAC3B,MACE,uEAAA,EAEF,KAAK,QAAUA,CACjB,CACF,CAUO,MAAMC,UAAkD,KAAM,CAMnE,aAAc,CACZ,MACE,2EAAA,CAEJ,CACF,CAUO,MAAMC,UAA4C,KAAM,CAM7D,aAAc,CACZ,MACE,8FAAA,CAEJ,CACF,CAUO,MAAMC,UAAkD,KAAM,CAMnE,aAAc,CACZ,MACE,sGAAA,CAEJ,CACF,CAUO,MAAMC,UAAsC,KAAM,CAMvD,aAAc,CACZ,MACE,yFAAA,CAEJ,CACF,CAUO,MAAMC,UAA0C,KAAM,CAe3D,YAAYC,EAA8C,CACxD,MAAM,mDAAoD,CACxD,MAAOA,CAAA,CACR,EACD,KAAK,QAAUA,CACjB,CACF,CAWO,MAAMC,UAAuC,KAAM,CAyBxD,YAAYC,EAAiBC,EAAe,CAC1C,MAAM,kEAAmE,CACvE,MAAO,CAAE,SAAAD,EAAU,SAAAC,CAAS,CAAA,CAC7B,EApBH,KAAgB,SAAkB,GAQlC,KAAgB,SAAgBC,WAa9B,KAAK,SAAWF,EAChB,KAAK,SAAWC,CAClB,CACF,CAYO,MAAME,UAAuC,KAAM,CAaxD,YAAYF,EAAmB,CAC7B,MACE,+EACA,CAAE,MAAOA,CAAS,CAAA,EAEpB,KAAK,SAAWA,CAClB,CACF,CAUO,MAAMG,UAAqC,KAAM,CAOtD,YAAYC,EAA0B,CACpC,MACE,wCAAwCA,CAAgB,sDAAA,CAE5D,CACF,CAUO,MAAMC,UAAkC,KAAM,CAInD,aAAc,CACZ,MAAM,mEAAmE,CAC3E,CACF,CAWO,MAAMC,UAAmC,KAAM,CAOpD,YAAYC,EAAsB,CAChC,MAAM,4BAA4BA,EAAU,YAAY,IAAI,EAAE,CAChE,CACF,CAUO,MAAMC,UAAwC,KAAM,CAMzD,aAAc,CACZ,MAAM,sCAAsC,CAC9C,CACF,CAUO,MAAMC,UAA6C,KAAM,CAM9D,aAAc,CACZ,MACE,sEAAA,CAEJ,CACF,CAuCO,MAAMC,UAAmC,KAAM,CA8BpD,YACEC,EACA,CAAE,WAAAC,EAAY,SAAAC,EAAU,IAAAC,GACxB,CACA,MAAMH,CAAO,EACb,KAAK,WAAaC,EAClB,KAAK,SAAWC,EAChB,KAAK,IAAMC,CACb,CACF,CAUO,MAAMC,UAAiCL,CAA2B,CAOvE,YAAYM,EAAqC,CAC/C,MAAM,2BAA4BA,CAAQ,CAC5C,CACF,CAUO,MAAMC,UAAsCP,CAA2B,CAO5E,YAAYM,EAAqC,CAC/C,MACE,mEACAA,CAAA,CAEJ,CACF,CAUO,MAAME,UAAqCR,CAA2B,CAO3E,YAAYM,EAAqC,CAC/C,MAAM,0DAA2DA,CAAQ,CAC3E,CACF,CAUO,MAAMG,UAAoCT,CAA2B,CAO1E,YAAYM,EAAqC,CAC/C,MAAM,8BAA+BA,CAAQ,CAC/C,CACF"}
|