@boostxyz/sdk 0.0.0-alpha.10
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/LICENSE +674 -0
- package/README.md +7 -0
- package/dist/Actions/Action.cjs +2 -0
- package/dist/Actions/Action.cjs.map +1 -0
- package/dist/Actions/Action.d.ts +31 -0
- package/dist/Actions/Action.d.ts.map +1 -0
- package/dist/Actions/Action.js +29 -0
- package/dist/Actions/Action.js.map +1 -0
- package/dist/Actions/ContractAction.d.ts +370 -0
- package/dist/Actions/ContractAction.d.ts.map +1 -0
- package/dist/Actions/ERC721MintAction.d.ts +513 -0
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -0
- package/dist/Actions/EventAction.cjs +2 -0
- package/dist/Actions/EventAction.cjs.map +1 -0
- package/dist/Actions/EventAction.d.ts +694 -0
- package/dist/Actions/EventAction.d.ts.map +1 -0
- package/dist/Actions/EventAction.js +491 -0
- package/dist/Actions/EventAction.js.map +1 -0
- package/dist/AllowLists/AllowList.cjs +2 -0
- package/dist/AllowLists/AllowList.cjs.map +1 -0
- package/dist/AllowLists/AllowList.d.ts +32 -0
- package/dist/AllowLists/AllowList.d.ts.map +1 -0
- package/dist/AllowLists/AllowList.js +30 -0
- package/dist/AllowLists/AllowList.js.map +1 -0
- package/dist/AllowLists/SimpleAllowList.cjs +2 -0
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
- package/dist/AllowLists/SimpleAllowList.d.ts +481 -0
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.js +154 -0
- package/dist/AllowLists/SimpleAllowList.js.map +1 -0
- package/dist/AllowLists/SimpleDenyList.cjs +2 -0
- package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
- package/dist/AllowLists/SimpleDenyList.d.ts +335 -0
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleDenyList.js +115 -0
- package/dist/AllowLists/SimpleDenyList.js.map +1 -0
- package/dist/Auth/Auth.cjs +2 -0
- package/dist/Auth/Auth.cjs.map +1 -0
- package/dist/Auth/Auth.d.ts +10 -0
- package/dist/Auth/Auth.d.ts.map +1 -0
- package/dist/Auth/Auth.js +5 -0
- package/dist/Auth/Auth.js.map +1 -0
- package/dist/Auth/PassthroughAuth.cjs +2 -0
- package/dist/Auth/PassthroughAuth.cjs.map +1 -0
- package/dist/Auth/PassthroughAuth.d.ts +51 -0
- package/dist/Auth/PassthroughAuth.d.ts.map +1 -0
- package/dist/Auth/PassthroughAuth.js +39 -0
- package/dist/Auth/PassthroughAuth.js.map +1 -0
- package/dist/Boost.cjs +2 -0
- package/dist/Boost.cjs.map +1 -0
- package/dist/Boost.d.ts +234 -0
- package/dist/Boost.d.ts.map +1 -0
- package/dist/Boost.js +162 -0
- package/dist/Boost.js.map +1 -0
- package/dist/BoostCore.cjs +3 -0
- package/dist/BoostCore.cjs.map +1 -0
- package/dist/BoostCore.d.ts +498 -0
- package/dist/BoostCore.d.ts.map +1 -0
- package/dist/BoostCore.js +1153 -0
- package/dist/BoostCore.js.map +1 -0
- package/dist/BoostRegistry.cjs +2 -0
- package/dist/BoostRegistry.cjs.map +1 -0
- package/dist/BoostRegistry.d.ts +243 -0
- package/dist/BoostRegistry.d.ts.map +1 -0
- package/dist/BoostRegistry.js +262 -0
- package/dist/BoostRegistry.js.map +1 -0
- package/dist/Budgets/Budget.cjs +2 -0
- package/dist/Budgets/Budget.cjs.map +1 -0
- package/dist/Budgets/Budget.d.ts +31 -0
- package/dist/Budgets/Budget.d.ts.map +1 -0
- package/dist/Budgets/Budget.js +29 -0
- package/dist/Budgets/Budget.js.map +1 -0
- package/dist/Budgets/ManagedBudget.cjs +2 -0
- package/dist/Budgets/ManagedBudget.cjs.map +1 -0
- package/dist/Budgets/ManagedBudget.d.ts +1103 -0
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -0
- package/dist/Budgets/ManagedBudget.js +516 -0
- package/dist/Budgets/ManagedBudget.js.map +1 -0
- package/dist/Budgets/SimpleBudget.d.ts +824 -0
- package/dist/Budgets/SimpleBudget.d.ts.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +778 -0
- package/dist/Budgets/VestingBudget.d.ts.map +1 -0
- package/dist/Deployable/Contract.cjs +2 -0
- package/dist/Deployable/Contract.cjs.map +1 -0
- package/dist/Deployable/Contract.d.ts +125 -0
- package/dist/Deployable/Contract.d.ts.map +1 -0
- package/dist/Deployable/Contract.js +150 -0
- package/dist/Deployable/Contract.js.map +1 -0
- package/dist/Deployable/Deployable.cjs +2 -0
- package/dist/Deployable/Deployable.cjs.map +1 -0
- package/dist/Deployable/Deployable.d.ts +161 -0
- package/dist/Deployable/Deployable.d.ts.map +1 -0
- package/dist/Deployable/Deployable.js +131 -0
- package/dist/Deployable/Deployable.js.map +1 -0
- package/dist/Deployable/DeployableTarget.cjs +2 -0
- package/dist/Deployable/DeployableTarget.cjs.map +1 -0
- package/dist/Deployable/DeployableTarget.d.ts +116 -0
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -0
- package/dist/Deployable/DeployableTarget.js +132 -0
- package/dist/Deployable/DeployableTarget.js.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +2 -0
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.d.ts +513 -0
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -0
- package/dist/Incentives/AllowListIncentive.js +201 -0
- package/dist/Incentives/AllowListIncentive.js.map +1 -0
- package/dist/Incentives/CGDAIncentive.cjs +2 -0
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
- package/dist/Incentives/CGDAIncentive.d.ts +644 -0
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -0
- package/dist/Incentives/CGDAIncentive.js +271 -0
- package/dist/Incentives/CGDAIncentive.js.map +1 -0
- package/dist/Incentives/ERC1155Incentive.d.ts +713 -0
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20Incentive.cjs +2 -0
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
- package/dist/Incentives/ERC20Incentive.d.ts +666 -0
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20Incentive.js +312 -0
- package/dist/Incentives/ERC20Incentive.js.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +582 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -0
- package/dist/Incentives/Incentive.cjs +2 -0
- package/dist/Incentives/Incentive.cjs.map +1 -0
- package/dist/Incentives/Incentive.d.ts +36 -0
- package/dist/Incentives/Incentive.d.ts.map +1 -0
- package/dist/Incentives/Incentive.js +299 -0
- package/dist/Incentives/Incentive.js.map +1 -0
- package/dist/Incentives/PointsIncentive.cjs +2 -0
- package/dist/Incentives/PointsIncentive.cjs.map +1 -0
- package/dist/Incentives/PointsIncentive.d.ts +659 -0
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -0
- package/dist/Incentives/PointsIncentive.js +215 -0
- package/dist/Incentives/PointsIncentive.js.map +1 -0
- package/dist/Validators/SignerValidator.cjs +2 -0
- package/dist/Validators/SignerValidator.cjs.map +1 -0
- package/dist/Validators/SignerValidator.d.ts +745 -0
- package/dist/Validators/SignerValidator.d.ts.map +1 -0
- package/dist/Validators/SignerValidator.js +293 -0
- package/dist/Validators/SignerValidator.js.map +1 -0
- package/dist/Validators/Validator.cjs +2 -0
- package/dist/Validators/Validator.cjs.map +1 -0
- package/dist/Validators/Validator.d.ts +31 -0
- package/dist/Validators/Validator.d.ts.map +1 -0
- package/dist/Validators/Validator.js +27 -0
- package/dist/Validators/Validator.js.map +1 -0
- 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/componentInterfaces-CKCBwG16.cjs +2 -0
- package/dist/componentInterfaces-CKCBwG16.cjs.map +1 -0
- package/dist/componentInterfaces-DYkaxBda.js +13 -0
- package/dist/componentInterfaces-DYkaxBda.js.map +1 -0
- package/dist/errors.cjs +2 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.ts +441 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +262 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated-BDeDiaCK.js +4625 -0
- package/dist/generated-BDeDiaCK.js.map +1 -0
- package/dist/generated-wKBNvm48.cjs +3 -0
- package/dist/generated-wKBNvm48.cjs.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -0
- 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 +2 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +116 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +30 -0
- package/dist/utils.js.map +1 -0
- package/package.json +211 -0
- package/src/Actions/Action.test.ts +75 -0
- package/src/Actions/Action.ts +61 -0
- package/src/Actions/ContractAction.test.ts +197 -0
- package/src/Actions/ContractAction.ts +301 -0
- package/src/Actions/ERC721MintAction.test.ts +112 -0
- package/src/Actions/ERC721MintAction.ts +292 -0
- package/src/Actions/EventAction.test.ts +205 -0
- package/src/Actions/EventAction.ts +811 -0
- package/src/AllowLists/AllowList.test.ts +64 -0
- package/src/AllowLists/AllowList.ts +60 -0
- package/src/AllowLists/SimpleAllowList.test.ts +52 -0
- package/src/AllowLists/SimpleAllowList.ts +284 -0
- package/src/AllowLists/SimpleDenyList.test.ts +52 -0
- package/src/AllowLists/SimpleDenyList.ts +227 -0
- package/src/Auth/Auth.ts +11 -0
- package/src/Auth/PassthroughAuth.test.ts +12 -0
- package/src/Auth/PassthroughAuth.ts +80 -0
- package/src/Boost.ts +290 -0
- package/src/BoostCore.test.ts +773 -0
- package/src/BoostCore.ts +1261 -0
- package/src/BoostRegistry.ts +467 -0
- package/src/Budgets/Budget.test.ts +27 -0
- package/src/Budgets/Budget.ts +61 -0
- package/src/Budgets/ManagedBudget.test.ts +154 -0
- package/src/Budgets/ManagedBudget.ts +796 -0
- package/src/Budgets/SimpleBudget.test.ts +152 -0
- package/src/Budgets/SimpleBudget.ts +564 -0
- package/src/Budgets/VestingBudget.test.ts +123 -0
- package/src/Budgets/VestingBudget.ts +602 -0
- package/src/Deployable/Contract.ts +229 -0
- package/src/Deployable/Deployable.ts +250 -0
- package/src/Deployable/DeployableTarget.ts +223 -0
- package/src/Incentives/AllowListIncentive.test.ts +143 -0
- package/src/Incentives/AllowListIncentive.ts +334 -0
- package/src/Incentives/CGDAIncentive.test.ts +132 -0
- package/src/Incentives/CGDAIncentive.ts +468 -0
- package/src/Incentives/ERC1155Incentive.test.ts +87 -0
- package/src/Incentives/ERC1155Incentive.ts +466 -0
- package/src/Incentives/ERC20Incentive.test.ts +130 -0
- package/src/Incentives/ERC20Incentive.ts +482 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +136 -0
- package/src/Incentives/ERC20VariableIncentive.ts +420 -0
- package/src/Incentives/Incentive.test.ts +92 -0
- package/src/Incentives/Incentive.ts +85 -0
- package/src/Incentives/PointsIncentive.test.ts +139 -0
- package/src/Incentives/PointsIncentive.ts +365 -0
- package/src/Validators/SignerValidator.test.ts +159 -0
- package/src/Validators/SignerValidator.ts +681 -0
- package/src/Validators/Validator.test.ts +21 -0
- package/src/Validators/Validator.ts +55 -0
- package/src/claiming.ts +56 -0
- package/src/errors.ts +542 -0
- package/src/index.test.ts +40 -0
- package/src/index.ts +53 -0
- package/src/transfers.ts +284 -0
- package/src/utils.test.ts +44 -0
- package/src/utils.ts +198 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { T as s, a2 as i, a3 as n, a4 as h, a5 as l, a6 as u } from "../generated-BDeDiaCK.js";
|
|
2
|
+
import { getAccount as w } from "@wagmi/core";
|
|
3
|
+
import { zeroHash as A, zeroAddress as p, encodeAbiParameters as y } from "viem";
|
|
4
|
+
import { DeployableTarget as g } from "../Deployable/DeployableTarget.js";
|
|
5
|
+
import { DeployableUnknownOwnerProvidedError as m } from "../errors.js";
|
|
6
|
+
import { RegistryType as R } from "../utils.js";
|
|
7
|
+
const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61140e806100bd5f395ff3fe608060405260043610610113575f3560e01c80634a4ee7b11161009f57806398332bbc1161006357806398332bbc1461031d578063e3f756de14610347578063f04e283e14610383578063f2fde38b1461039f578063fee81cf4146103bb57610113565b80634a4ee7b114610287578063514e62fc146102a357806354d1f13d146102df578063715018a6146102e95780638da5cb5b146102f357610113565b806325692962116100e657806325692962146101c757806328d6183b146101d15780632de94807146101fb5780633abb060414610237578063439fab911461025f57610113565b806301ffc9a714610117578063183a4f6e146101535780631c10893f1461016f5780631cd64df41461018b575b5f80fd5b348015610122575f80fd5b5061013d60048036038101906101389190610d51565b6103f7565b60405161014a9190610d96565b60405180910390f35b61016d60048036038101906101689190610de2565b610470565b005b61018960048036038101906101849190610e67565b61047d565b005b348015610196575f80fd5b506101b160048036038101906101ac9190610e67565b610493565b6040516101be9190610d96565b60405180910390f35b6101cf6104a9565b005b3480156101dc575f80fd5b506101e56104fa565b6040516101f29190610eb4565b60405180910390f35b348015610206575f80fd5b50610221600480360381019061021c9190610ecd565b610521565b60405161022e9190610f07565b60405180910390f35b348015610242575f80fd5b5061025d60048036038101906102589190610fd6565b61053a565b005b34801561026a575f80fd5b50610285600480360381019061028091906110a9565b610647565b005b6102a1600480360381019061029c9190610e67565b61076f565b005b3480156102ae575f80fd5b506102c960048036038101906102c49190610e67565b610785565b6040516102d69190610d96565b60405180910390f35b6102e761079c565b005b6102f16107d5565b005b3480156102fe575f80fd5b506103076107e8565b6040516103149190611103565b60405180910390f35b348015610328575f80fd5b50610331610810565b60405161033e9190610f07565b60405180910390f35b348015610352575f80fd5b5061036d6004803603810190610368919061111c565b610815565b60405161037a9190610d96565b60405180910390f35b61039d60048036038101906103989190610ecd565b610868565b005b6103b960048036038101906103b49190610ecd565b6108a6565b005b3480156103c6575f80fd5b506103e160048036038101906103dc9190610ecd565b6108cf565b6040516103ee9190610f07565b60405180910390f35b5f7f8ba1fc24000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806104695750610468826108e8565b5b9050919050565b61047a3382610961565b50565b610485610970565b61048f82826109a7565b5050565b5f818261049f85610521565b1614905092915050565b5f6104b26109b7565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f8ba1fc2400000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b6002610545816109c1565b828290508585905014610584576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561063f578383828181106105a4576105a3611179565b5b90506020020160208101906105b991906111d0565b5f808888858181106105ce576105cd611179565b5b90506020020160208101906105e39190610ecd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610586565b505050505050565b5f6106506109e8565b905080546003825580156106825760018160011c14303b106106795763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f808484810190610694919061137e565b915091506106a182610a11565b6106ac8260026109a7565b5f5b81518110156107325760015f808484815181106106ce576106cd611179565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506106ae565b505050801561076a576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b610777610970565b6107818282610961565b5050565b5f808261079185610521565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6107dd610970565b6107e65f610ae7565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b600281565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1690509392505050565b610870610970565b63389a75e1600c52805f526020600c20805442111561089657636f5e88185f526004601cfd5b5f8155506108a381610ae7565b50565b6108ae610970565b8060601b6108c357637448fbae5f526004601cfd5b6108cc81610ae7565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061095a575061095982610bad565b5b9050919050565b61096c82825f610c26565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146109a5576382b429005f526004601cfd5b565b6109b382826001610c26565b5050565b5f6202a300905090565b638b78c6d8600c52335f52806020600c2054166109e5576382b429005f526004601cfd5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610a19610c7e565b15610a91577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610a5357630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610ae4565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b610aef610c7e565b15610b54577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610baa565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610c1f5750610c1e82610c82565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783610c4857848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610d3081610cfc565b8114610d3a575f80fd5b50565b5f81359050610d4b81610d27565b92915050565b5f60208284031215610d6657610d65610cf4565b5b5f610d7384828501610d3d565b91505092915050565b5f8115159050919050565b610d9081610d7c565b82525050565b5f602082019050610da95f830184610d87565b92915050565b5f819050919050565b610dc181610daf565b8114610dcb575f80fd5b50565b5f81359050610ddc81610db8565b92915050565b5f60208284031215610df757610df6610cf4565b5b5f610e0484828501610dce565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610e3682610e0d565b9050919050565b610e4681610e2c565b8114610e50575f80fd5b50565b5f81359050610e6181610e3d565b92915050565b5f8060408385031215610e7d57610e7c610cf4565b5b5f610e8a85828601610e53565b9250506020610e9b85828601610dce565b9150509250929050565b610eae81610cfc565b82525050565b5f602082019050610ec75f830184610ea5565b92915050565b5f60208284031215610ee257610ee1610cf4565b5b5f610eef84828501610e53565b91505092915050565b610f0181610daf565b82525050565b5f602082019050610f1a5f830184610ef8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112610f4157610f40610f20565b5b8235905067ffffffffffffffff811115610f5e57610f5d610f24565b5b602083019150836020820283011115610f7a57610f79610f28565b5b9250929050565b5f8083601f840112610f9657610f95610f20565b5b8235905067ffffffffffffffff811115610fb357610fb2610f24565b5b602083019150836020820283011115610fcf57610fce610f28565b5b9250929050565b5f805f8060408587031215610fee57610fed610cf4565b5b5f85013567ffffffffffffffff81111561100b5761100a610cf8565b5b61101787828801610f2c565b9450945050602085013567ffffffffffffffff81111561103a57611039610cf8565b5b61104687828801610f81565b925092505092959194509250565b5f8083601f84011261106957611068610f20565b5b8235905067ffffffffffffffff81111561108657611085610f24565b5b6020830191508360018202830111156110a2576110a1610f28565b5b9250929050565b5f80602083850312156110bf576110be610cf4565b5b5f83013567ffffffffffffffff8111156110dc576110db610cf8565b5b6110e885828601611054565b92509250509250929050565b6110fd81610e2c565b82525050565b5f6020820190506111165f8301846110f4565b92915050565b5f805f6040848603121561113357611132610cf4565b5b5f61114086828701610e53565b935050602084013567ffffffffffffffff81111561116157611160610cf8565b5b61116d86828701611054565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6111af81610d7c565b81146111b9575f80fd5b50565b5f813590506111ca816111a6565b92915050565b5f602082840312156111e5576111e4610cf4565b5b5f6111f2848285016111bc565b91505092915050565b5f61120582610e0d565b9050919050565b611215816111fb565b811461121f575f80fd5b50565b5f813590506112308161120c565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61127c82611236565b810181811067ffffffffffffffff8211171561129b5761129a611246565b5b80604052505050565b5f6112ad610ceb565b90506112b98282611273565b919050565b5f67ffffffffffffffff8211156112d8576112d7611246565b5b602082029050602081019050919050565b5f6112fb6112f6846112be565b6112a4565b9050808382526020820190506020840283018581111561131e5761131d610f28565b5b835b8181101561134757806113338882610e53565b845260208401935050602081019050611320565b5050509392505050565b5f82601f83011261136557611364610f20565b5b81356113758482602086016112e9565b91505092915050565b5f806040838503121561139457611393610cf4565b5b5f6113a185828601611222565b925050602083013567ffffffffffffffff8111156113c2576113c1610cf8565b5b6113ce85828601611351565b915050925092905056fea264697066735822122094368c65f566939d0b9827de55e44a26c567f89bc0bf24103275890d9278dc0164736f6c634300081a0033", O = 2n, t = class t extends g {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments), this.abi = s;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Check if a user is authorized.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
* @async
|
|
16
|
+
* @param {Address} address - The address of the user
|
|
17
|
+
* @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]
|
|
18
|
+
* @returns {Promise<boolean>} - True if the user is authorized
|
|
19
|
+
*/
|
|
20
|
+
async isAllowed(f, e) {
|
|
21
|
+
return await i(this._config, {
|
|
22
|
+
address: this.assertValidAddress(),
|
|
23
|
+
args: [f, A],
|
|
24
|
+
...this.optionallyAttachAccount(),
|
|
25
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
26
|
+
...e
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.
|
|
31
|
+
* This function can only be called by the owner
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
* @async
|
|
35
|
+
* @param {Address[]} addresses - The list of users to update
|
|
36
|
+
* @param {boolean[]} allowed - The allowed status of each user
|
|
37
|
+
* @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]
|
|
38
|
+
* @returns {Promise<void>}
|
|
39
|
+
*/
|
|
40
|
+
async setAllowed(f, e, b) {
|
|
41
|
+
return await this.awaitResult(
|
|
42
|
+
this.setAllowedRaw(f, e, b)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.
|
|
47
|
+
* This function can only be called by the owner
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
* @async
|
|
51
|
+
* @param {Address[]} addresses - The list of users to update
|
|
52
|
+
* @param {boolean[]} allowed - The allowed status of each user
|
|
53
|
+
* @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]
|
|
54
|
+
* @returns {Promise<void>}
|
|
55
|
+
*/
|
|
56
|
+
async setAllowedRaw(f, e, b) {
|
|
57
|
+
const { request: a, result: c } = await n(
|
|
58
|
+
this._config,
|
|
59
|
+
{
|
|
60
|
+
address: this.assertValidAddress(),
|
|
61
|
+
args: [f, e],
|
|
62
|
+
...this.optionallyAttachAccount(),
|
|
63
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
64
|
+
...b
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
return { hash: await h(this._config, a), result: c };
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Allows the owner to grant `user` `roles`.
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
* @async
|
|
74
|
+
* @param {Address} address
|
|
75
|
+
* @param {bigint} role
|
|
76
|
+
* @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]
|
|
77
|
+
* @returns {Promise<void>}
|
|
78
|
+
*/
|
|
79
|
+
async grantRoles(f, e, b) {
|
|
80
|
+
return await this.awaitResult(this.grantRolesRaw(f, e, b));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Allows the owner to grant `user` `roles`.
|
|
84
|
+
*
|
|
85
|
+
* @public
|
|
86
|
+
* @async
|
|
87
|
+
* @param {Address} address
|
|
88
|
+
* @param {bigint} role
|
|
89
|
+
* @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]
|
|
90
|
+
* @returns {Promise<void>}
|
|
91
|
+
*/
|
|
92
|
+
async grantRolesRaw(f, e, b) {
|
|
93
|
+
const { request: a, result: c } = await l(
|
|
94
|
+
this._config,
|
|
95
|
+
{
|
|
96
|
+
address: this.assertValidAddress(),
|
|
97
|
+
args: [f, e],
|
|
98
|
+
...this.optionallyAttachAccount(),
|
|
99
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
100
|
+
...b
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
return { hash: await u(this._config, a), result: c };
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @inheritdoc
|
|
107
|
+
*
|
|
108
|
+
* @public
|
|
109
|
+
* @param {?SimpleAllowListPayload} [_payload]
|
|
110
|
+
* @param {?DeployableOptions} [_options]
|
|
111
|
+
* @returns {GenericDeployableParams}
|
|
112
|
+
*/
|
|
113
|
+
buildParameters(f, e) {
|
|
114
|
+
var c;
|
|
115
|
+
const [b, a] = this.validateDeploymentConfig(
|
|
116
|
+
f,
|
|
117
|
+
e
|
|
118
|
+
);
|
|
119
|
+
if (!b.owner || b.owner === p) {
|
|
120
|
+
const d = a.account ? a.account.address : a.config ? w(a.config).address : (c = this._account) == null ? void 0 : c.address;
|
|
121
|
+
if (d)
|
|
122
|
+
b.owner = d;
|
|
123
|
+
else
|
|
124
|
+
throw new m();
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
abi: s,
|
|
128
|
+
bytecode: _,
|
|
129
|
+
args: [T(b)],
|
|
130
|
+
...this.optionallyAttachAccount(a.account)
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
t.base = "0x9A3848B6B35d406d758892C6b4b00042cCbc96AD", t.registryType = R.ALLOW_LIST;
|
|
135
|
+
let r = t;
|
|
136
|
+
function T({
|
|
137
|
+
owner: o,
|
|
138
|
+
allowed: f
|
|
139
|
+
}) {
|
|
140
|
+
return y(
|
|
141
|
+
[
|
|
142
|
+
{ type: "address", name: "owner" },
|
|
143
|
+
{ type: "address[]", name: "allowed" }
|
|
144
|
+
],
|
|
145
|
+
[o, f]
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
O as LIST_MANAGER_ROLE,
|
|
150
|
+
r as SimpleAllowList,
|
|
151
|
+
T as prepareSimpleAllowListPayload,
|
|
152
|
+
s as simpleAllowListAbi
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=SimpleAllowList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleAllowList.js","sources":["../../src/AllowLists/SimpleAllowList.ts"],"sourcesContent":["import {\n readSimpleAllowListIsAllowed,\n simpleAllowListAbi,\n simulateSimpleAllowListGrantRoles,\n simulateSimpleAllowListSetAllowed,\n writeSimpleAllowListGrantRoles,\n writeSimpleAllowListSetAllowed,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleAllowListAbi };\n\n/**\n * Object representation of a {@link SimpleAllowList} initialization payload.\n *\n * @export\n * @interface SimpleAllowListPayload\n * @typedef {SimpleAllowListPayload}\n */\nexport interface SimpleAllowListPayload {\n /**\n * The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of allowed addresses.\n *\n * @type {Address[]}\n */\n allowed: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleAllowList` event types.\n *\n * @export\n * @typedef {SimpleAllowListLog}\n * @template {ContractEventName<\n * typeof simpleAllowListAbi\n * >} [event=ContractEventName<typeof simpleAllowListAbi>]\n */\nexport type SimpleAllowListLog<\n event extends ContractEventName<\n typeof simpleAllowListAbi\n > = ContractEventName<typeof simpleAllowListAbi>,\n> = GenericLog<typeof simpleAllowListAbi, event>;\n\n/**\n * A constant representing the list manager's role\n *\n * @type {2n}\n */\nexport const LIST_MANAGER_ROLE = 2n;\n/**\n * A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses\n *\n * @export\n * @class SimpleAllowList\n * @typedef {SimpleAllowList}\n * @extends {DeployableTarget<SimpleAllowListPayload>}\n */\nexport class SimpleAllowList extends DeployableTarget<\n SimpleAllowListPayload,\n typeof simpleAllowListAbi\n> {\n public override readonly abi = simpleAllowListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIMPLE_ALLOWLIST_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Check if a user is authorized.\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ): Promise<boolean> {\n return await readSimpleAllowListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\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\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<void>}\n */\n public async setAllowed(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ) {\n return await this.awaitResult(\n this.setAllowedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<void>}\n */\n public async setAllowedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ) {\n const { request, result } = await simulateSimpleAllowListSetAllowed(\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 writeSimpleAllowListSetAllowed(this._config, request);\n return { hash, result };\n }\n\n /**\n * Allows the owner to grant `user` `roles`.\n *\n * @public\n * @async\n * @param {Address} address\n * @param {bigint} role\n * @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]\n * @returns {Promise<void>}\n */\n public async grantRoles(\n address: Address,\n role: bigint,\n params?: WriteParams<typeof simpleAllowListAbi, 'grantRoles'>,\n ) {\n return await this.awaitResult(this.grantRolesRaw(address, role, params));\n }\n\n /**\n * Allows the owner to grant `user` `roles`.\n *\n * @public\n * @async\n * @param {Address} address\n * @param {bigint} role\n * @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]\n * @returns {Promise<void>}\n */\n public async grantRolesRaw(\n address: Address,\n role: bigint,\n params?: ReadParams<typeof simpleAllowListAbi, 'grantRoles'>,\n ) {\n const { request, result } = await simulateSimpleAllowListGrantRoles(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address, role],\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 writeSimpleAllowListGrantRoles(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleAllowListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleAllowListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleAllowListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleAllowListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleAllowListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleAllowListPayload} param0\n * @param {Address} param0.owner - The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n * @param {Address[]} param0.allowed - List of allowed addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleAllowListPayload({\n owner,\n allowed,\n}: SimpleAllowListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'allowed' },\n ],\n [owner, allowed],\n );\n}\n"],"names":["LIST_MANAGER_ROLE","_SimpleAllowList","DeployableTarget","simpleAllowListAbi","address","params","readSimpleAllowListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleAllowListSetAllowed","writeSimpleAllowListSetAllowed","role","simulateSimpleAllowListGrantRoles","writeSimpleAllowListGrantRoles","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleAllowListPayload","RegistryType","SimpleAllowList","encodeAbiParameters"],"mappings":";;;;;;s6UA2EaA,IAAoB,IASpBC,IAAN,MAAMA,UAAwBC,EAGnC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4B/B,MAAa,UACXC,GACAC,GACkB;AACX,WAAA,MAAMC,EAA6B,KAAK,SAAS;AAAA,MACtD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACF,GAASG,CAAQ;AAAA,MACxB,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAa,WACXG,GACAC,GACAJ,GACA;AACA,WAAO,MAAM,KAAK;AAAA,MAChB,KAAK,cAAcG,GAAWC,GAASJ,CAAM;AAAA,IAAA;AAAA,EAEjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAa,cACXG,GACAC,GACAJ,GACA;AACA,UAAM,EAAE,SAAAK,GAAS,QAAAC,EAAO,IAAI,MAAMC;AAAAA,MAChC,KAAK;AAAA,MACL;AAAA,QACE,SAAS,KAAK,mBAAmB;AAAA,QACjC,MAAM,CAACJ,GAAWC,CAAO;AAAA,QACzB,GAAG,KAAK,wBAAwB;AAAA;AAAA,QAEhC,GAAIJ;AAAA,MACN;AAAA,IAAA;AAGK,WAAA,EAAE,MADI,MAAMQ,EAA+B,KAAK,SAASH,CAAO,GACxD,QAAAC;EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAa,WACXP,GACAU,GACAT,GACA;AACO,WAAA,MAAM,KAAK,YAAY,KAAK,cAAcD,GAASU,GAAMT,CAAM,CAAC;AAAA,EACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAa,cACXD,GACAU,GACAT,GACA;AACA,UAAM,EAAE,SAAAK,GAAS,QAAAC,EAAO,IAAI,MAAMI;AAAAA,MAChC,KAAK;AAAA,MACL;AAAA,QACE,SAAS,KAAK,mBAAmB;AAAA,QACjC,MAAM,CAACX,GAASU,CAAI;AAAA,QACpB,GAAG,KAAK,wBAAwB;AAAA;AAAA,QAEhC,GAAIT;AAAA,MACN;AAAA,IAAA;AAGK,WAAA,EAAE,MADI,MAAMW,EAA+B,KAAK,SAASN,CAAO,GACxD,QAAAC;EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdM,GACAC,GACyB;;AACzB,UAAM,CAACC,GAASC,CAAO,IAAI,KAAK;AAAA,MAC9BH;AAAA,MACAC;AAAA,IAAA;AAEF,QAAI,CAACC,EAAQ,SAASA,EAAQ,UAAUE,GAAa;AACnD,YAAMC,IAAQF,EAAQ,UAClBA,EAAQ,QAAQ,UAChBA,EAAQ,SACNG,EAAWH,EAAQ,MAAM,EAAE,WAC3BI,IAAA,KAAK,aAAL,gBAAAA,EAAe;AACrB,UAAIF;AACF,QAAAH,EAAQ,QAAQG;AAAA;AAEhB,cAAM,IAAIG,EAAoC;AAAA,IAElD;AACO,WAAA;AAAA,MACL,KAAKtB;AAAAA,MACL,UAAAuB;AAAA,MACA,MAAM,CAACC,EAA8BR,CAAO,CAAC;AAAA,MAC7C,GAAG,KAAK,wBAAwBC,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;AAtKyBnB,EAAA,OAAgB,8CASvCA,EAAuB,eAA6B2B,EAAa;AArB5D,IAAMC,IAAN5B;AA4LA,SAAS0B,EAA8B;AAAA,EAC5C,OAAAL;AAAA,EACA,SAAAb;AACF,GAA2B;AAClB,SAAAqB;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,aAAa,MAAM,UAAU;AAAA,IACvC;AAAA,IACA,CAACR,GAAOb,CAAO;AAAA,EAAA;AAEnB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../generated-wKBNvm48.cjs"),l=require("@wagmi/core"),r=require("viem"),u=require("../Deployable/DeployableTarget.cjs"),h=require("../errors.cjs"),y=require("../utils.cjs"),p="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6110ac806100bd5f395ff3fe6080604052600436106100a6575f3560e01c8063715018a611610063578063715018a6146101745780638da5cb5b1461017e578063e3f756de146101a8578063f04e283e146101e4578063f2fde38b14610200578063fee81cf41461021c576100a6565b806301ffc9a7146100aa578063141973b0146100e6578063256929621461010e57806328d6183b14610118578063439fab911461014257806354d1f13d1461016a575b5f80fd5b3480156100b5575f80fd5b506100d060048036038101906100cb9190610a82565b610258565b6040516100dd9190610ac7565b60405180910390f35b3480156100f1575f80fd5b5061010c60048036038101906101079190610b96565b6102d1565b005b6101166103da565b005b348015610123575f80fd5b5061012c61042b565b6040516101399190610c23565b60405180910390f35b34801561014d575f80fd5b5061016860048036038101906101639190610c91565b610452565b005b61017261056f565b005b61017c6105a8565b005b348015610189575f80fd5b506101926105bb565b60405161019f9190610d1b565b60405180910390f35b3480156101b3575f80fd5b506101ce60048036038101906101c99190610d5e565b6105e3565b6040516101db9190610ac7565b60405180910390f35b6101fe60048036038101906101f99190610dbb565b610637565b005b61021a60048036038101906102159190610dbb565b610675565b005b348015610227575f80fd5b50610242600480360381019061023d9190610dbb565b61069e565b60405161024f9190610dfe565b60405180910390f35b5f7f3d30a22c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102ca57506102c9826106b7565b5b9050919050565b6102d9610730565b818190508484905014610318576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848490508110156103d35782828281811061033857610337610e17565b5b905060200201602081019061034d9190610e6e565b5f8087878581811061036257610361610e17565b5b90506020020160208101906103779190610dbb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550808060010191505061031a565b5050505050565b5f6103e3610767565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f3d30a22c00000000000000000000000000000000000000000000000000000000905090565b5f61045b610771565b9050805460038255801561048d5760018160011c14303b106104845763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f80848481019061049f919061101c565b915091506104ac8261079a565b5f5b81518110156105325760015f808484815181106104ce576104cd610e17565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506104ae565b505050801561056a576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6105b0610730565b6105b95f610870565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161590509392505050565b61063f610730565b63389a75e1600c52805f526020600c20805442111561066557636f5e88185f526004601cfd5b5f81555061067281610870565b50565b61067d610730565b8060601b61069257637448fbae5f526004601cfd5b61069b81610870565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610729575061072882610936565b5b9050919050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610765576382b429005f526004601cfd5b565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6107a26109af565b1561081a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156107dc57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061086d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b6108786109af565b156108dd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610933565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109a857506109a7826109b3565b5b9050919050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610a6181610a2d565b8114610a6b575f80fd5b50565b5f81359050610a7c81610a58565b92915050565b5f60208284031215610a9757610a96610a25565b5b5f610aa484828501610a6e565b91505092915050565b5f8115159050919050565b610ac181610aad565b82525050565b5f602082019050610ada5f830184610ab8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112610b0157610b00610ae0565b5b8235905067ffffffffffffffff811115610b1e57610b1d610ae4565b5b602083019150836020820283011115610b3a57610b39610ae8565b5b9250929050565b5f8083601f840112610b5657610b55610ae0565b5b8235905067ffffffffffffffff811115610b7357610b72610ae4565b5b602083019150836020820283011115610b8f57610b8e610ae8565b5b9250929050565b5f805f8060408587031215610bae57610bad610a25565b5b5f85013567ffffffffffffffff811115610bcb57610bca610a29565b5b610bd787828801610aec565b9450945050602085013567ffffffffffffffff811115610bfa57610bf9610a29565b5b610c0687828801610b41565b925092505092959194509250565b610c1d81610a2d565b82525050565b5f602082019050610c365f830184610c14565b92915050565b5f8083601f840112610c5157610c50610ae0565b5b8235905067ffffffffffffffff811115610c6e57610c6d610ae4565b5b602083019150836001820283011115610c8a57610c89610ae8565b5b9250929050565b5f8060208385031215610ca757610ca6610a25565b5b5f83013567ffffffffffffffff811115610cc457610cc3610a29565b5b610cd085828601610c3c565b92509250509250929050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610d0582610cdc565b9050919050565b610d1581610cfb565b82525050565b5f602082019050610d2e5f830184610d0c565b92915050565b610d3d81610cfb565b8114610d47575f80fd5b50565b5f81359050610d5881610d34565b92915050565b5f805f60408486031215610d7557610d74610a25565b5b5f610d8286828701610d4a565b935050602084013567ffffffffffffffff811115610da357610da2610a29565b5b610daf86828701610c3c565b92509250509250925092565b5f60208284031215610dd057610dcf610a25565b5b5f610ddd84828501610d4a565b91505092915050565b5f819050919050565b610df881610de6565b82525050565b5f602082019050610e115f830184610def565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b610e4d81610aad565b8114610e57575f80fd5b50565b5f81359050610e6881610e44565b92915050565b5f60208284031215610e8357610e82610a25565b5b5f610e9084828501610e5a565b91505092915050565b5f610ea382610cdc565b9050919050565b610eb381610e99565b8114610ebd575f80fd5b50565b5f81359050610ece81610eaa565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610f1a82610ed4565b810181811067ffffffffffffffff82111715610f3957610f38610ee4565b5b80604052505050565b5f610f4b610a1c565b9050610f578282610f11565b919050565b5f67ffffffffffffffff821115610f7657610f75610ee4565b5b602082029050602081019050919050565b5f610f99610f9484610f5c565b610f42565b90508083825260208201905060208402830185811115610fbc57610fbb610ae8565b5b835b81811015610fe55780610fd18882610d4a565b845260208401935050602081019050610fbe565b5050509392505050565b5f82601f83011261100357611002610ae0565b5b8135611013848260208601610f87565b91505092915050565b5f806040838503121561103257611031610a25565b5b5f61103f85828601610ec0565b925050602083013567ffffffffffffffff8111156110605761105f610a29565b5b61106c85828601610fef565b915050925092905056fea2646970667358221220f8901ba0ad91db050edba1d0412882eecda8dba26237dd3383d77357c2f7173964736f6c634300081a0033",t=class t extends u.DeployableTarget{constructor(){super(...arguments),this.abi=d.S}async isAllowed(f,e){return await d.A2(this._config,{address:this.assertValidAddress(),args:[f,r.zeroHash],...this.optionallyAttachAccount(),...e})}async setDenied(f,e,b){return await this.awaitResult(this.setDeniedRaw(f,e,b))}async setDeniedRaw(f,e,b){const{request:a,result:c}=await d.k2(this._config,{address:this.assertValidAddress(),args:[f,e],...this.optionallyAttachAccount(),...b});return{hash:await d.B2(this._config,a),result:c}}buildParameters(f,e){var c;const[b,a]=this.validateDeploymentConfig(f,e);if(!b.owner||b.owner===r.zeroAddress){const s=a.account?a.account.address:a.config?l.getAccount(a.config).address:(c=this._account)==null?void 0:c.address;if(s)b.owner=s;else throw new h.DeployableUnknownOwnerProvidedError}return{abi:d.S,bytecode:p,args:[n(b)],...this.optionallyAttachAccount(a.account)}}};t.base="0x7eb4E958D42b64fd1c4Ce947d05a755fCC7C30B7",t.registryType=y.RegistryType.ALLOW_LIST;let i=t;function n({owner:o,denied:f}){return r.encodeAbiParameters([{type:"address",name:"owner"},{type:"address[]",name:"denied"}],[o,f])}exports.simpleDenyListAbi=d.S;exports.SimpleDenyList=i;exports.prepareSimpleDenyListPayload=n;
|
|
2
|
+
//# sourceMappingURL=SimpleDenyList.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleDenyList.cjs","sources":["../../src/AllowLists/SimpleDenyList.ts"],"sourcesContent":["import {\n readSimpleDenyListIsAllowed,\n simpleDenyListAbi,\n simulateSimpleDenyListSetDenied,\n writeSimpleDenyListSetDenied,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleDenyList.sol/SimpleDenyList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleDenyListAbi };\n\n/**\n * Object representation of a {@link SimpleDenyList} initialization payload.\n *\n * @export\n * @interface SimpleDenyListPayload\n * @typedef {SimpleDenyListPayload}\n */\nexport interface SimpleDenyListPayload {\n /**\n * The allow list's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of denied addresses.\n *\n * @type {Address[]}\n */\n denied: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleDenyList` event types.\n *\n * @export\n * @typedef {SimpleDenyListLog}\n * @template {ContractEventName<typeof simpleDenyListAbi>} [event=ContractEventName<\n * typeof simpleDenyListAbi\n * >]\n */\nexport type SimpleDenyListLog<\n event extends ContractEventName<typeof simpleDenyListAbi> = ContractEventName<\n typeof simpleDenyListAbi\n >,\n> = GenericLog<typeof simpleDenyListAbi, event>;\n\n/**\n * A simple implementation of an AllowList that implicitly allows all addresses except those explicitly added to the deny list\n *\n * @export\n * @class SimpleDenyList\n * @typedef {SimpleDenyList}\n * @extends {DeployableTarget<SimpleDenyListPayload>}\n */\nexport class SimpleDenyList extends DeployableTarget<\n SimpleDenyListPayload,\n typeof simpleDenyListAbi\n> {\n public override readonly abi = simpleDenyListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIMPLE_DENYLIST_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Check if a user is authorized (i.e. not denied)\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams<typeof simpleDenyListAbi, 'isAllowed'>} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams<typeof simpleDenyListAbi, 'isAllowed'>,\n ): Promise<boolean> {\n return await readSimpleDenyListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\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\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]\n * @returns {unknown}\n */\n public async setDenied(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>,\n ) {\n return await this.awaitResult(\n this.setDeniedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]\n * @returns {unknown}\n */\n public async setDeniedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>,\n ) {\n const { request, result } = await simulateSimpleDenyListSetDenied(\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 writeSimpleDenyListSetDenied(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleDenyListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleDenyListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleDenyListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleDenyListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleDenyListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleDenyListPayload} param0\n * @param {Address} param0.owner - The allow list's owner\n * @param {Address[]} param0.denied - List of denied addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleDenyListPayload({\n owner,\n denied,\n}: SimpleDenyListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'denied' },\n ],\n [owner, denied],\n );\n}\n"],"names":["_SimpleDenyList","DeployableTarget","simpleDenyListAbi","address","params","readSimpleDenyListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleDenyListSetDenied","writeSimpleDenyListSetDenied","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleDenyListPayload","RegistryType","SimpleDenyList","denied","encodeAbiParameters"],"mappings":"s+RA4EaA,EAAN,MAAMA,UAAuBC,EAAAA,gBAGlC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA4B/B,MAAa,UACXC,EACAC,EACkB,CACX,OAAA,MAAMC,EAAAA,GAA4B,KAAK,QAAS,CACrD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACF,EAASG,UAAQ,EACxB,GAAG,KAAK,wBAAwB,EAEhC,GAAIF,CAAA,CACL,CACH,CAYA,MAAa,UACXG,EACAC,EACAJ,EACA,CACA,OAAO,MAAM,KAAK,YAChB,KAAK,aAAaG,EAAWC,EAASJ,CAAM,CAAA,CAEhD,CAYA,MAAa,aACXG,EACAC,EACAJ,EACA,CACA,KAAM,CAAE,QAAAK,EAAS,OAAAC,CAAO,EAAI,MAAMC,EAAA,GAChC,KAAK,QACL,CACE,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACJ,EAAWC,CAAO,EACzB,GAAG,KAAK,wBAAwB,EAEhC,GAAIJ,CACN,CAAA,EAGK,MAAA,CAAE,KADI,MAAMQ,EAA6B,GAAA,KAAK,QAASH,CAAO,EACtD,OAAAC,EACjB,CAUgB,gBACdG,EACAC,EACyB,OACzB,KAAM,CAACC,EAASC,CAAO,EAAI,KAAK,yBAC9BH,EACAC,CAAA,EAEF,GAAI,CAACC,EAAQ,OAASA,EAAQ,QAAUE,EAAAA,YAAa,CACnD,MAAMC,EAAQF,EAAQ,QAClBA,EAAQ,QAAQ,QAChBA,EAAQ,OACNG,EAAA,WAAWH,EAAQ,MAAM,EAAE,SAC3BI,EAAA,KAAK,WAAL,YAAAA,EAAe,QACrB,GAAIF,EACFH,EAAQ,MAAQG,MAEhB,OAAM,IAAIG,EAAoC,mCAElD,CACO,MAAA,CACL,IAAKnB,EAAA,EACL,SAAAoB,EACA,KAAM,CAACC,EAA6BR,CAAO,CAAC,EAC5C,GAAG,KAAK,wBAAwBC,EAAQ,OAAO,CAAA,CAEnD,CACF,EArHyBhB,EAAA,KAAgB,6CASvCA,EAAuB,aAA6BwB,EAAa,aAAA,WArB5D,IAAMC,EAANzB,EA2IA,SAASuB,EAA6B,CAC3C,MAAAL,EACA,OAAAQ,CACF,EAA0B,CACjB,OAAAC,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,YAAa,KAAM,QAAS,CACtC,EACA,CAACT,EAAOQ,CAAM,CAAA,CAElB"}
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { simpleDenyListAbi } from '@boostxyz/evm';
|
|
2
|
+
import { type Address, type ContractEventName } from 'viem';
|
|
3
|
+
import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
|
|
4
|
+
import { DeployableTarget } from '../Deployable/DeployableTarget';
|
|
5
|
+
import { type GenericLog, type ReadParams, RegistryType, type WriteParams } from '../utils';
|
|
6
|
+
export { simpleDenyListAbi };
|
|
7
|
+
/**
|
|
8
|
+
* Object representation of a {@link SimpleDenyList} initialization payload.
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @interface SimpleDenyListPayload
|
|
12
|
+
* @typedef {SimpleDenyListPayload}
|
|
13
|
+
*/
|
|
14
|
+
export interface SimpleDenyListPayload {
|
|
15
|
+
/**
|
|
16
|
+
* The allow list's owner
|
|
17
|
+
*
|
|
18
|
+
* @type {Address}
|
|
19
|
+
*/
|
|
20
|
+
owner: Address;
|
|
21
|
+
/**
|
|
22
|
+
* List of denied addresses.
|
|
23
|
+
*
|
|
24
|
+
* @type {Address[]}
|
|
25
|
+
*/
|
|
26
|
+
denied: Address[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A generic `viem.Log` event with support for `SimpleDenyList` event types.
|
|
30
|
+
*
|
|
31
|
+
* @export
|
|
32
|
+
* @typedef {SimpleDenyListLog}
|
|
33
|
+
* @template {ContractEventName<typeof simpleDenyListAbi>} [event=ContractEventName<
|
|
34
|
+
* typeof simpleDenyListAbi
|
|
35
|
+
* >]
|
|
36
|
+
*/
|
|
37
|
+
export type SimpleDenyListLog<event extends ContractEventName<typeof simpleDenyListAbi> = ContractEventName<typeof simpleDenyListAbi>> = GenericLog<typeof simpleDenyListAbi, event>;
|
|
38
|
+
/**
|
|
39
|
+
* A simple implementation of an AllowList that implicitly allows all addresses except those explicitly added to the deny list
|
|
40
|
+
*
|
|
41
|
+
* @export
|
|
42
|
+
* @class SimpleDenyList
|
|
43
|
+
* @typedef {SimpleDenyList}
|
|
44
|
+
* @extends {DeployableTarget<SimpleDenyListPayload>}
|
|
45
|
+
*/
|
|
46
|
+
export declare class SimpleDenyList extends DeployableTarget<SimpleDenyListPayload, typeof simpleDenyListAbi> {
|
|
47
|
+
readonly abi: readonly [{
|
|
48
|
+
readonly type: "constructor";
|
|
49
|
+
readonly inputs: readonly [];
|
|
50
|
+
readonly stateMutability: "nonpayable";
|
|
51
|
+
}, {
|
|
52
|
+
readonly type: "error";
|
|
53
|
+
readonly inputs: readonly [];
|
|
54
|
+
readonly name: "AlreadyInitialized";
|
|
55
|
+
}, {
|
|
56
|
+
readonly type: "error";
|
|
57
|
+
readonly inputs: readonly [];
|
|
58
|
+
readonly name: "CloneAlreadyInitialized";
|
|
59
|
+
}, {
|
|
60
|
+
readonly type: "error";
|
|
61
|
+
readonly inputs: readonly [];
|
|
62
|
+
readonly name: "InitializerNotImplemented";
|
|
63
|
+
}, {
|
|
64
|
+
readonly type: "error";
|
|
65
|
+
readonly inputs: readonly [];
|
|
66
|
+
readonly name: "InvalidInitialization";
|
|
67
|
+
}, {
|
|
68
|
+
readonly type: "error";
|
|
69
|
+
readonly inputs: readonly [];
|
|
70
|
+
readonly name: "InvalidInitializationData";
|
|
71
|
+
}, {
|
|
72
|
+
readonly type: "error";
|
|
73
|
+
readonly inputs: readonly [];
|
|
74
|
+
readonly name: "LengthMismatch";
|
|
75
|
+
}, {
|
|
76
|
+
readonly type: "error";
|
|
77
|
+
readonly inputs: readonly [];
|
|
78
|
+
readonly name: "NewOwnerIsZeroAddress";
|
|
79
|
+
}, {
|
|
80
|
+
readonly type: "error";
|
|
81
|
+
readonly inputs: readonly [];
|
|
82
|
+
readonly name: "NoHandoverRequest";
|
|
83
|
+
}, {
|
|
84
|
+
readonly type: "error";
|
|
85
|
+
readonly inputs: readonly [];
|
|
86
|
+
readonly name: "NotInitializing";
|
|
87
|
+
}, {
|
|
88
|
+
readonly type: "error";
|
|
89
|
+
readonly inputs: readonly [];
|
|
90
|
+
readonly name: "Unauthorized";
|
|
91
|
+
}, {
|
|
92
|
+
readonly type: "event";
|
|
93
|
+
readonly anonymous: false;
|
|
94
|
+
readonly inputs: readonly [{
|
|
95
|
+
readonly name: "version";
|
|
96
|
+
readonly internalType: "uint64";
|
|
97
|
+
readonly type: "uint64";
|
|
98
|
+
readonly indexed: false;
|
|
99
|
+
}];
|
|
100
|
+
readonly name: "Initialized";
|
|
101
|
+
}, {
|
|
102
|
+
readonly type: "event";
|
|
103
|
+
readonly anonymous: false;
|
|
104
|
+
readonly inputs: readonly [{
|
|
105
|
+
readonly name: "pendingOwner";
|
|
106
|
+
readonly internalType: "address";
|
|
107
|
+
readonly type: "address";
|
|
108
|
+
readonly indexed: true;
|
|
109
|
+
}];
|
|
110
|
+
readonly name: "OwnershipHandoverCanceled";
|
|
111
|
+
}, {
|
|
112
|
+
readonly type: "event";
|
|
113
|
+
readonly anonymous: false;
|
|
114
|
+
readonly inputs: readonly [{
|
|
115
|
+
readonly name: "pendingOwner";
|
|
116
|
+
readonly internalType: "address";
|
|
117
|
+
readonly type: "address";
|
|
118
|
+
readonly indexed: true;
|
|
119
|
+
}];
|
|
120
|
+
readonly name: "OwnershipHandoverRequested";
|
|
121
|
+
}, {
|
|
122
|
+
readonly type: "event";
|
|
123
|
+
readonly anonymous: false;
|
|
124
|
+
readonly inputs: readonly [{
|
|
125
|
+
readonly name: "oldOwner";
|
|
126
|
+
readonly internalType: "address";
|
|
127
|
+
readonly type: "address";
|
|
128
|
+
readonly indexed: true;
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "newOwner";
|
|
131
|
+
readonly internalType: "address";
|
|
132
|
+
readonly type: "address";
|
|
133
|
+
readonly indexed: true;
|
|
134
|
+
}];
|
|
135
|
+
readonly name: "OwnershipTransferred";
|
|
136
|
+
}, {
|
|
137
|
+
readonly type: "function";
|
|
138
|
+
readonly inputs: readonly [];
|
|
139
|
+
readonly name: "cancelOwnershipHandover";
|
|
140
|
+
readonly outputs: readonly [];
|
|
141
|
+
readonly stateMutability: "payable";
|
|
142
|
+
}, {
|
|
143
|
+
readonly type: "function";
|
|
144
|
+
readonly inputs: readonly [{
|
|
145
|
+
readonly name: "pendingOwner";
|
|
146
|
+
readonly internalType: "address";
|
|
147
|
+
readonly type: "address";
|
|
148
|
+
}];
|
|
149
|
+
readonly name: "completeOwnershipHandover";
|
|
150
|
+
readonly outputs: readonly [];
|
|
151
|
+
readonly stateMutability: "payable";
|
|
152
|
+
}, {
|
|
153
|
+
readonly type: "function";
|
|
154
|
+
readonly inputs: readonly [];
|
|
155
|
+
readonly name: "getComponentInterface";
|
|
156
|
+
readonly outputs: readonly [{
|
|
157
|
+
readonly name: "";
|
|
158
|
+
readonly internalType: "bytes4";
|
|
159
|
+
readonly type: "bytes4";
|
|
160
|
+
}];
|
|
161
|
+
readonly stateMutability: "pure";
|
|
162
|
+
}, {
|
|
163
|
+
readonly type: "function";
|
|
164
|
+
readonly inputs: readonly [{
|
|
165
|
+
readonly name: "data_";
|
|
166
|
+
readonly internalType: "bytes";
|
|
167
|
+
readonly type: "bytes";
|
|
168
|
+
}];
|
|
169
|
+
readonly name: "initialize";
|
|
170
|
+
readonly outputs: readonly [];
|
|
171
|
+
readonly stateMutability: "nonpayable";
|
|
172
|
+
}, {
|
|
173
|
+
readonly type: "function";
|
|
174
|
+
readonly inputs: readonly [{
|
|
175
|
+
readonly name: "user_";
|
|
176
|
+
readonly internalType: "address";
|
|
177
|
+
readonly type: "address";
|
|
178
|
+
}, {
|
|
179
|
+
readonly name: "";
|
|
180
|
+
readonly internalType: "bytes";
|
|
181
|
+
readonly type: "bytes";
|
|
182
|
+
}];
|
|
183
|
+
readonly name: "isAllowed";
|
|
184
|
+
readonly outputs: readonly [{
|
|
185
|
+
readonly name: "";
|
|
186
|
+
readonly internalType: "bool";
|
|
187
|
+
readonly type: "bool";
|
|
188
|
+
}];
|
|
189
|
+
readonly stateMutability: "view";
|
|
190
|
+
}, {
|
|
191
|
+
readonly type: "function";
|
|
192
|
+
readonly inputs: readonly [];
|
|
193
|
+
readonly name: "owner";
|
|
194
|
+
readonly outputs: readonly [{
|
|
195
|
+
readonly name: "result";
|
|
196
|
+
readonly internalType: "address";
|
|
197
|
+
readonly type: "address";
|
|
198
|
+
}];
|
|
199
|
+
readonly stateMutability: "view";
|
|
200
|
+
}, {
|
|
201
|
+
readonly type: "function";
|
|
202
|
+
readonly inputs: readonly [{
|
|
203
|
+
readonly name: "pendingOwner";
|
|
204
|
+
readonly internalType: "address";
|
|
205
|
+
readonly type: "address";
|
|
206
|
+
}];
|
|
207
|
+
readonly name: "ownershipHandoverExpiresAt";
|
|
208
|
+
readonly outputs: readonly [{
|
|
209
|
+
readonly name: "result";
|
|
210
|
+
readonly internalType: "uint256";
|
|
211
|
+
readonly type: "uint256";
|
|
212
|
+
}];
|
|
213
|
+
readonly stateMutability: "view";
|
|
214
|
+
}, {
|
|
215
|
+
readonly type: "function";
|
|
216
|
+
readonly inputs: readonly [];
|
|
217
|
+
readonly name: "renounceOwnership";
|
|
218
|
+
readonly outputs: readonly [];
|
|
219
|
+
readonly stateMutability: "payable";
|
|
220
|
+
}, {
|
|
221
|
+
readonly type: "function";
|
|
222
|
+
readonly inputs: readonly [];
|
|
223
|
+
readonly name: "requestOwnershipHandover";
|
|
224
|
+
readonly outputs: readonly [];
|
|
225
|
+
readonly stateMutability: "payable";
|
|
226
|
+
}, {
|
|
227
|
+
readonly type: "function";
|
|
228
|
+
readonly inputs: readonly [{
|
|
229
|
+
readonly name: "users_";
|
|
230
|
+
readonly internalType: "address[]";
|
|
231
|
+
readonly type: "address[]";
|
|
232
|
+
}, {
|
|
233
|
+
readonly name: "denied_";
|
|
234
|
+
readonly internalType: "bool[]";
|
|
235
|
+
readonly type: "bool[]";
|
|
236
|
+
}];
|
|
237
|
+
readonly name: "setDenied";
|
|
238
|
+
readonly outputs: readonly [];
|
|
239
|
+
readonly stateMutability: "nonpayable";
|
|
240
|
+
}, {
|
|
241
|
+
readonly type: "function";
|
|
242
|
+
readonly inputs: readonly [{
|
|
243
|
+
readonly name: "interfaceId";
|
|
244
|
+
readonly internalType: "bytes4";
|
|
245
|
+
readonly type: "bytes4";
|
|
246
|
+
}];
|
|
247
|
+
readonly name: "supportsInterface";
|
|
248
|
+
readonly outputs: readonly [{
|
|
249
|
+
readonly name: "";
|
|
250
|
+
readonly internalType: "bool";
|
|
251
|
+
readonly type: "bool";
|
|
252
|
+
}];
|
|
253
|
+
readonly stateMutability: "view";
|
|
254
|
+
}, {
|
|
255
|
+
readonly type: "function";
|
|
256
|
+
readonly inputs: readonly [{
|
|
257
|
+
readonly name: "newOwner";
|
|
258
|
+
readonly internalType: "address";
|
|
259
|
+
readonly type: "address";
|
|
260
|
+
}];
|
|
261
|
+
readonly name: "transferOwnership";
|
|
262
|
+
readonly outputs: readonly [];
|
|
263
|
+
readonly stateMutability: "payable";
|
|
264
|
+
}];
|
|
265
|
+
/**
|
|
266
|
+
* @inheritdoc
|
|
267
|
+
*
|
|
268
|
+
* @public
|
|
269
|
+
* @static
|
|
270
|
+
* @type {Address}
|
|
271
|
+
*/
|
|
272
|
+
static base: Address;
|
|
273
|
+
/**
|
|
274
|
+
* @inheritdoc
|
|
275
|
+
*
|
|
276
|
+
* @public
|
|
277
|
+
* @static
|
|
278
|
+
* @type {RegistryType}
|
|
279
|
+
*/
|
|
280
|
+
static registryType: RegistryType;
|
|
281
|
+
/**
|
|
282
|
+
* Check if a user is authorized (i.e. not denied)
|
|
283
|
+
*
|
|
284
|
+
* @public
|
|
285
|
+
* @async
|
|
286
|
+
* @param {Address} address - The address of the user
|
|
287
|
+
* @param {?ReadParams<typeof simpleDenyListAbi, 'isAllowed'>} [params]
|
|
288
|
+
* @returns {Promise<boolean>} - True if the user is authorized
|
|
289
|
+
*/
|
|
290
|
+
isAllowed(address: Address, params?: ReadParams<typeof simpleDenyListAbi, 'isAllowed'>): Promise<boolean>;
|
|
291
|
+
/**
|
|
292
|
+
* Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner
|
|
293
|
+
*
|
|
294
|
+
* @public
|
|
295
|
+
* @async
|
|
296
|
+
* @param {Address[]} addresses - The list of users to update
|
|
297
|
+
* @param {boolean[]} allowed - The denied status of each user
|
|
298
|
+
* @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]
|
|
299
|
+
* @returns {unknown}
|
|
300
|
+
*/
|
|
301
|
+
setDenied(addresses: Address[], allowed: boolean[], params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>): Promise<void>;
|
|
302
|
+
/**
|
|
303
|
+
* Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner
|
|
304
|
+
*
|
|
305
|
+
* @public
|
|
306
|
+
* @async
|
|
307
|
+
* @param {Address[]} addresses - The list of users to update
|
|
308
|
+
* @param {boolean[]} allowed - The denied status of each user
|
|
309
|
+
* @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]
|
|
310
|
+
* @returns {unknown}
|
|
311
|
+
*/
|
|
312
|
+
setDeniedRaw(addresses: Address[], allowed: boolean[], params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>): Promise<{
|
|
313
|
+
hash: `0x${string}`;
|
|
314
|
+
result: void;
|
|
315
|
+
}>;
|
|
316
|
+
/**
|
|
317
|
+
* @inheritdoc
|
|
318
|
+
*
|
|
319
|
+
* @public
|
|
320
|
+
* @param {?SimpleDenyListPayload} [_payload]
|
|
321
|
+
* @param {?DeployableOptions} [_options]
|
|
322
|
+
* @returns {GenericDeployableParams}
|
|
323
|
+
*/
|
|
324
|
+
buildParameters(_payload?: SimpleDenyListPayload, _options?: DeployableOptions): GenericDeployableParams;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Given a {@link SimpleDenyListPayload}, properly encode the initialization payload.
|
|
328
|
+
*
|
|
329
|
+
* @param {SimpleDenyListPayload} param0
|
|
330
|
+
* @param {Address} param0.owner - The allow list's owner
|
|
331
|
+
* @param {Address[]} param0.denied - List of denied addresses.
|
|
332
|
+
* @returns {Hex}
|
|
333
|
+
*/
|
|
334
|
+
export declare function prepareSimpleDenyListPayload({ owner, denied, }: SimpleDenyListPayload): `0x${string}`;
|
|
335
|
+
//# sourceMappingURL=SimpleDenyList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleDenyList.d.ts","sourceRoot":"","sources":["../../src/AllowLists/SimpleDenyList.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAKvB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,CAC3B,KAAK,SAAS,iBAAiB,CAAC,OAAO,iBAAiB,CAAC,GAAG,iBAAiB,CAC3E,OAAO,iBAAiB,CACzB,IACC,UAAU,CAAC,OAAO,iBAAiB,EAAE,KAAK,CAAC,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,gBAAgB,CAClD,qBAAqB,EACrB,OAAO,iBAAiB,CACzB;IACC,SAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAqB;IACjD;;;;;;OAMG;IACH,OAAuB,IAAI,EAAE,OAAO,CACP;IAC7B;;;;;;OAMG;IACH,OAAuB,YAAY,EAAE,YAAY,CAA2B;IAE5E;;;;;;;;OAQG;IACU,SAAS,CACpB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,iBAAiB,EAAE,WAAW,CAAC,GACzD,OAAO,CAAC,OAAO,CAAC;IAUnB;;;;;;;;;OASG;IACU,SAAS,CACpB,SAAS,EAAE,OAAO,EAAE,EACpB,OAAO,EAAE,OAAO,EAAE,EAClB,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,iBAAiB,EAAE,WAAW,CAAC;IAO7D;;;;;;;;;OASG;IACU,YAAY,CACvB,SAAS,EAAE,OAAO,EAAE,EACpB,OAAO,EAAE,OAAO,EAAE,EAClB,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,iBAAiB,EAAE,WAAW,CAAC;;;;IAgB7D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,qBAAqB,EAChC,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;CAwB3B;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,KAAK,EACL,MAAM,GACP,EAAE,qBAAqB,iBAQvB"}
|