@boostxyz/sdk 0.0.0-alpha.9 → 1.1.0-alpha.23
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.cjs.map +1 -1
- package/dist/Actions/Action.js +2 -2
- package/dist/Actions/ContractAction.d.ts +11 -11
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +14 -14
- 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 +174 -41
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +557 -129
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.cjs.map +1 -1
- package/dist/AllowLists/AllowList.d.ts +6 -4
- package/dist/AllowLists/AllowList.d.ts.map +1 -1
- package/dist/AllowLists/AllowList.js +45 -23
- package/dist/AllowLists/AllowList.js.map +1 -1
- package/dist/AllowLists/OpenAllowList.d.ts +423 -0
- package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +92 -37
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +60 -75
- 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 +203 -11
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +11 -112
- package/dist/AllowLists/SimpleDenyList.js.map +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/Boost.cjs +1 -1
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.d.ts +20 -21
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +43 -57
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore-Btl5BdAs.cjs +3 -0
- package/dist/BoostCore-Btl5BdAs.cjs.map +1 -0
- package/dist/BoostCore-CD56zbYX.js +2641 -0
- package/dist/BoostCore-CD56zbYX.js.map +1 -0
- package/dist/BoostCore.cjs +1 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +749 -78
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +29 -1150
- 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 +80 -25
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +164 -82
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.cjs.map +1 -1
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/Budget.js.map +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +103 -221
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +81 -298
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +223 -89
- 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.d.ts +4 -5
- package/dist/Deployable/Contract.d.ts.map +1 -1
- package/dist/Deployable/Contract.js +5 -7
- package/dist/Deployable/Contract.js.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +1 -1
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +3 -5
- 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 +13 -13
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +28 -25
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
- package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts +248 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js +320 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
- package/dist/Incentive-CcnOIc8L.cjs +2 -0
- package/dist/Incentive-CcnOIc8L.cjs.map +1 -0
- package/dist/Incentive-rM5nKznp.js +313 -0
- package/dist/Incentive-rM5nKznp.js.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +38 -16
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +43 -29
- 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 +234 -21
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +46 -32
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +224 -37
- 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 +234 -30
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +62 -46
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +333 -438
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +231 -29
- 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.d.ts +4 -4
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +16 -296
- 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 +40 -18
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +38 -24
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-BDXpY74P.js +133 -0
- package/dist/SimpleDenyList-BDXpY74P.js.map +1 -0
- package/dist/SimpleDenyList-DNj5qDWM.cjs +2 -0
- package/dist/SimpleDenyList-DNj5qDWM.cjs.map +1 -0
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +16 -16
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +32 -28
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.cjs.map +1 -1
- package/dist/Validators/Validator.d.ts +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/Validators/Validator.js.map +1 -1
- package/dist/claiming.cjs.map +1 -1
- package/dist/claiming.d.ts +1 -1
- package/dist/claiming.js.map +1 -1
- package/dist/componentInterfaces-BBCFkrZv.js +14 -0
- package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
- package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
- package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
- package/dist/deployments-DF_6-7hH.cjs +2 -0
- package/dist/deployments-DF_6-7hH.cjs.map +1 -0
- package/dist/deployments-fJsWblwS.js +56 -0
- package/dist/deployments-fJsWblwS.js.map +1 -0
- package/dist/deployments.json +58 -0
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +256 -20
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +183 -26
- package/dist/errors.js.map +1 -1
- package/dist/{generated-57_Kffpz.js → generated-CsNyWPKA.js} +3843 -2084
- package/dist/generated-CsNyWPKA.js.map +1 -0
- package/dist/generated-DHerxf1y.cjs +3 -0
- package/dist/generated-DHerxf1y.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +142 -108
- package/dist/index.js.map +1 -1
- package/dist/transfers.cjs.map +1 -1
- package/dist/transfers.d.ts +1 -1
- package/dist/transfers.js.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +26 -12
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +38 -23
- package/dist/utils.js.map +1 -1
- package/package.json +20 -10
- package/src/Actions/Action.test.ts +14 -13
- package/src/Actions/ContractAction.test.ts +10 -10
- package/src/Actions/ContractAction.ts +11 -12
- package/src/Actions/ERC721MintAction.test.ts +6 -6
- package/src/Actions/ERC721MintAction.ts +14 -15
- package/src/Actions/EventAction.test.ts +735 -109
- package/src/Actions/EventAction.ts +527 -88
- package/src/AllowLists/AllowList.test.ts +7 -7
- package/src/AllowLists/AllowList.ts +5 -3
- package/src/AllowLists/OpenAllowList.test.ts +40 -0
- package/src/AllowLists/OpenAllowList.ts +45 -0
- package/src/AllowLists/SimpleAllowList.test.ts +4 -4
- package/src/AllowLists/SimpleAllowList.ts +40 -61
- package/src/AllowLists/SimpleDenyList.test.ts +4 -4
- package/src/AllowLists/SimpleDenyList.ts +41 -17
- package/src/Auth/PassthroughAuth.test.ts +1 -1
- package/src/Boost.ts +21 -24
- package/src/BoostCore.test.ts +361 -306
- package/src/BoostCore.ts +403 -220
- package/src/BoostRegistry.test.ts +53 -0
- package/src/BoostRegistry.ts +161 -40
- package/src/Budgets/Budget.test.ts +2 -2
- package/src/Budgets/Budget.ts +1 -2
- package/src/Budgets/ManagedBudget.test.ts +106 -19
- package/src/Budgets/ManagedBudget.ts +49 -321
- package/src/Budgets/VestingBudget.test.ts +7 -7
- package/src/Budgets/VestingBudget.ts +36 -106
- package/src/Deployable/Contract.ts +4 -5
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Deployable/DeployableTarget.ts +30 -19
- package/src/Deployable/DeployableTargetWithRBAC.test.ts +103 -0
- package/src/Deployable/DeployableTargetWithRBAC.ts +447 -0
- package/src/Incentives/AllowListIncentive.test.ts +12 -12
- package/src/Incentives/AllowListIncentive.ts +30 -15
- package/src/Incentives/CGDAIncentive.test.ts +9 -6
- package/src/Incentives/CGDAIncentive.ts +39 -18
- package/src/Incentives/ERC1155Incentive.test.ts +3 -3
- package/src/Incentives/ERC1155Incentive.ts +30 -29
- package/src/Incentives/ERC20Incentive.test.ts +9 -6
- package/src/Incentives/ERC20Incentive.ts +54 -27
- package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +325 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +8 -11
- package/src/Incentives/ERC20VariableIncentive.ts +50 -26
- package/src/Incentives/Incentive.test.ts +4 -1
- package/src/Incentives/Incentive.ts +7 -6
- package/src/Incentives/PointsIncentive.test.ts +24 -25
- package/src/Incentives/PointsIncentive.ts +32 -17
- package/src/Validators/SignerValidator.test.ts +6 -6
- package/src/Validators/SignerValidator.ts +20 -17
- package/src/Validators/Validator.test.ts +2 -2
- package/src/Validators/Validator.ts +1 -1
- package/src/claiming.ts +1 -1
- package/src/errors.ts +345 -21
- package/src/index.test.ts +118 -36
- package/src/index.ts +5 -0
- package/src/transfers.ts +1 -1
- package/src/utils.test.ts +2 -2
- package/src/utils.ts +61 -12
- package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
- package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
- package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
- package/dist/componentInterfaces-DYkaxBda.js +0 -13
- package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
- package/dist/generated-57_Kffpz.js.map +0 -1
- package/dist/generated-wKBNvm48.cjs +0 -3
- package/dist/generated-wKBNvm48.cjs.map +0 -1
- package/src/Budgets/SimpleBudget.test.ts +0 -152
- package/src/Budgets/SimpleBudget.ts +0 -564
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z as d, C as c } from "../generated-CsNyWPKA.js";
|
|
2
2
|
import { deployContract as h } from "@wagmi/core";
|
|
3
|
-
import { isAddress as
|
|
4
|
-
import { DeployableAlreadyDeployedError as
|
|
5
|
-
import { RegistryType as
|
|
3
|
+
import { isAddress as u, zeroAddress as l, isAddressEqual as a } from "viem";
|
|
4
|
+
import { DeployableAlreadyDeployedError as y, DeployableMissingPayloadError as f } from "../errors.js";
|
|
5
|
+
import { RegistryType as m } from "../utils.js";
|
|
6
6
|
import { Deployable as p } from "./Deployable.js";
|
|
7
|
-
const
|
|
7
|
+
const i = class i extends p {
|
|
8
8
|
/**
|
|
9
9
|
* Creates an instance of DeployableTarget.
|
|
10
10
|
*
|
|
@@ -14,20 +14,25 @@ const e = class e extends p {
|
|
|
14
14
|
* @param {?boolean} [isBase] - A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.
|
|
15
15
|
*/
|
|
16
16
|
constructor(t, s, r) {
|
|
17
|
-
super(t, s), this._isBase = !0, typeof s == "string" &&
|
|
17
|
+
super(t, s), this._isBase = !0, typeof s == "string" && u(s) && s !== l && !Object.values(this.bases).some((e) => !s || !e ? !1 : a(s, e)) && (r = !1), r !== void 0 && (this._isBase = r);
|
|
18
18
|
}
|
|
19
19
|
get isBase() {
|
|
20
|
-
return this.address &&
|
|
20
|
+
return this.address && Object.values(this.bases).some(
|
|
21
|
+
(t) => (
|
|
22
|
+
// biome-ignore lint/style/noNonNullAssertion: won't evaluate this if address checked and defined above
|
|
23
|
+
a(this.address, t)
|
|
24
|
+
)
|
|
25
|
+
) ? !0 : this._isBase;
|
|
21
26
|
}
|
|
22
27
|
/**
|
|
23
|
-
* A getter that will return the base implementation's static
|
|
28
|
+
* A getter that will return the base implementation's static addresses by numerical chain ID
|
|
24
29
|
*
|
|
25
30
|
* @public
|
|
26
31
|
* @readonly
|
|
27
|
-
* @type {Address}
|
|
32
|
+
* @type {Record<number, Address>}
|
|
28
33
|
*/
|
|
29
|
-
get
|
|
30
|
-
return this.constructor.
|
|
34
|
+
get bases() {
|
|
35
|
+
return this.constructor.bases;
|
|
31
36
|
}
|
|
32
37
|
/**
|
|
33
38
|
* A getter that returns the registry type of the base implementation
|
|
@@ -47,7 +52,7 @@ const e = class e extends p {
|
|
|
47
52
|
* @param {?Payload} [payload]
|
|
48
53
|
* @param {?DeployableOptions} [options]
|
|
49
54
|
* @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]
|
|
50
|
-
* @returns {
|
|
55
|
+
* @returns {Promise<this>}
|
|
51
56
|
*/
|
|
52
57
|
async deploy(t, s, r) {
|
|
53
58
|
return await super.deploy(t, s, r), this.assertValidAddress(), this;
|
|
@@ -62,10 +67,9 @@ const e = class e extends p {
|
|
|
62
67
|
* @returns {Promise<Hash>}
|
|
63
68
|
*/
|
|
64
69
|
async deployRaw(t, s) {
|
|
65
|
-
if (this.address)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return await h(o, {
|
|
70
|
+
if (this.address) throw new y(this.address);
|
|
71
|
+
const r = t || this._payload, e = (s == null ? void 0 : s.config) || this._config, { args: g, ...n } = this.buildParameters(r);
|
|
72
|
+
return await h(e, {
|
|
69
73
|
...n,
|
|
70
74
|
...this.optionallyAttachAccount(s == null ? void 0 : s.account),
|
|
71
75
|
// Deployable targets don't construct with arguments, they initialize with encoded payloads
|
|
@@ -78,8 +82,8 @@ const e = class e extends p {
|
|
|
78
82
|
* @public
|
|
79
83
|
* @async
|
|
80
84
|
* @param {Hex} interfaceId - The interface identifier
|
|
81
|
-
* @param {?ReadParams
|
|
82
|
-
* @returns {
|
|
85
|
+
* @param {?ReadParams} [params]
|
|
86
|
+
* @returns {Promise<boolean>} - True if the contract supports the interface
|
|
83
87
|
*/
|
|
84
88
|
async supportsInterface(t, s) {
|
|
85
89
|
return await d(this._config, {
|
|
@@ -96,8 +100,8 @@ const e = class e extends p {
|
|
|
96
100
|
*
|
|
97
101
|
* @public
|
|
98
102
|
* @async
|
|
99
|
-
* @param {?ReadParams
|
|
100
|
-
* @returns {
|
|
103
|
+
* @param {?ReadParams} [params]
|
|
104
|
+
* @returns {Promise<Hex>}
|
|
101
105
|
*/
|
|
102
106
|
async getComponentInterface(t) {
|
|
103
107
|
return await c(this._config, {
|
|
@@ -119,14 +123,13 @@ const e = class e extends p {
|
|
|
119
123
|
*/
|
|
120
124
|
validateDeploymentConfig(t, s) {
|
|
121
125
|
const r = t || this._payload;
|
|
122
|
-
if (!r)
|
|
123
|
-
throw new f();
|
|
126
|
+
if (!r) throw new f();
|
|
124
127
|
return super.validateDeploymentConfig(r, s);
|
|
125
128
|
}
|
|
126
129
|
};
|
|
127
|
-
|
|
128
|
-
let
|
|
130
|
+
i.bases = {}, i.registryType = m.ACTION;
|
|
131
|
+
let o = i;
|
|
129
132
|
export {
|
|
130
|
-
|
|
133
|
+
o as DeployableTarget
|
|
131
134
|
};
|
|
132
135
|
//# sourceMappingURL=DeployableTarget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeployableTarget.js","sources":["../../src/Deployable/DeployableTarget.ts"],"sourcesContent":["import {\n type aCloneableAbi,\n readACloneableGetComponentInterface
|
|
1
|
+
{"version":3,"file":"DeployableTarget.js","sources":["../../src/Deployable/DeployableTarget.ts"],"sourcesContent":["import {\n type aCloneableAbi,\n readACloneableGetComponentInterface,\n readACloneableSupportsInterface,\n} from '@boostxyz/evm';\nimport { deployContract } from '@wagmi/core';\nimport {\n type Abi,\n type Address,\n type Hash,\n type Hex,\n type WaitForTransactionReceiptParameters,\n isAddress,\n isAddressEqual,\n zeroAddress,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableMissingPayloadError,\n} from '../errors';\nimport { type ReadParams, RegistryType } from '../utils';\nimport {\n Deployable,\n type DeployableOptions,\n type DeployablePayloadOrAddress,\n} from './Deployable';\n\n/**\n * A base class representing a generic base Boost Protocol target contract, extended by Actions, AllowLists, Budgets, Incentives, and Validators.\n *\n * @export\n * @class DeployableTarget\n * @typedef {DeployableTarget}\n * @template [Payload=unknown]\n * @extends {Deployable<Payload>}\n */\nexport class DeployableTarget<\n Payload,\n ContractAbi extends Abi,\n> extends Deployable<Payload, ContractAbi> {\n /**\n * A static property representing a map of stringified chain ID's to the address of the base implementation on chain, used when cloning base contracts.\n *\n * @static\n * @readonly\n * @type {Record<string, Address>}\n */\n static readonly bases: Record<number, Address> = {};\n /**\n * The target's registry type.\n *\n * @static\n * @readonly\n * @type {RegistryType}\n */\n static readonly registryType: RegistryType = RegistryType.ACTION;\n /**\n * A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.\n *\n * @readonly\n * @type {boolean}\n */\n readonly _isBase: boolean = true;\n public get isBase() {\n if (\n !!this.address &&\n Object.values(this.bases).some((base) =>\n // biome-ignore lint/style/noNonNullAssertion: won't evaluate this if address checked and defined above\n isAddressEqual(this.address!, base),\n )\n )\n return true;\n return this._isBase;\n }\n\n /**\n * Creates an instance of DeployableTarget.\n *\n * @constructor\n * @param {DeployableOptions} options\n * @param {DeployablePayloadOrAddress<Payload>} payload - Either a given implementation's initialization payload, or an address to an existing on chain target.\n * @param {?boolean} [isBase] - A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.\n */\n constructor(\n options: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n isBase?: boolean,\n ) {\n super(options, payload);\n // if supplying a custom address, safe enough to assume it is not a base address which makes reusing contracts like budgets easier\n if (\n typeof payload === 'string' &&\n isAddress(payload) &&\n payload !== zeroAddress &&\n !Object.values(this.bases).some((base) => {\n if (!payload || !base) return false;\n return isAddressEqual(payload, base);\n })\n )\n isBase = false;\n if (isBase !== undefined) this._isBase = isBase;\n }\n\n /**\n * A getter that will return the base implementation's static addresses by numerical chain ID\n *\n * @public\n * @readonly\n * @type {Record<number, Address>}\n */\n public get bases(): Record<number, Address> {\n return (this.constructor as typeof DeployableTarget).bases;\n }\n\n /**\n * A getter that returns the registry type of the base implementation\n *\n * @public\n * @readonly\n * @type {RegistryType}\n */\n public get registryType(): RegistryType {\n return (this.constructor as typeof DeployableTarget).registryType;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @async\n * @param {?Payload} [payload]\n * @param {?DeployableOptions} [options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<this>}\n */\n protected override async deploy(\n payload?: Payload,\n options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n await super.deploy(payload, options, waitParams);\n this.assertValidAddress();\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n */\n protected override async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const payload = _payload || this._payload;\n const config = _options?.config || this._config;\n const { args, ...deployment } = this.buildParameters(payload);\n return await deployContract(config, {\n ...deployment,\n ...this.optionallyAttachAccount(_options?.account),\n // Deployable targets don't construct with arguments, they initialize with encoded payloads\n args: [],\n });\n }\n\n /**\n * Check if the contract supports the given interface\n *\n * @public\n * @async\n * @param {Hex} interfaceId - The interface identifier\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the contract supports the interface\n */\n public async supportsInterface(\n interfaceId: Hex,\n params?: ReadParams<typeof aCloneableAbi, 'supportsInterface'>,\n ) {\n return await readACloneableSupportsInterface(this._config, {\n address: this.assertValidAddress(),\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 args: [interfaceId],\n });\n }\n\n /**\n * Return a cloneable's unique identifier for downstream consumers to differentiate various targets\n * All implementations must override this function\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async getComponentInterface(\n params?: ReadParams<typeof aCloneableAbi, 'getComponentInterface'>,\n ) {\n return await readACloneableGetComponentInterface(this._config, {\n address: this.assertValidAddress(),\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 args: [],\n });\n }\n\n /**\n * @inheritdoc\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n */\n protected override validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const payload = _payload || this._payload;\n if (!payload) throw new DeployableMissingPayloadError();\n return super.validateDeploymentConfig(payload, _options) as [\n P,\n DeployableOptions,\n ];\n }\n}\n"],"names":["_DeployableTarget","Deployable","options","payload","isBase","isAddress","zeroAddress","base","isAddressEqual","waitParams","_payload","_options","DeployableAlreadyDeployedError","config","args","deployment","deployContract","interfaceId","params","readACloneableSupportsInterface","readACloneableGetComponentInterface","DeployableMissingPayloadError","RegistryType","DeployableTarget"],"mappings":";;;;;;AAoCO,MAAMA,IAAN,MAAMA,UAGHC,EAAiC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4CzC,YACEC,GACAC,GACAC,GACA;AACA,UAAMF,GAASC,CAAO,GA1BxB,KAAS,UAAmB,IA6BxB,OAAOA,KAAY,YACnBE,EAAUF,CAAO,KACjBA,MAAYG,KACZ,CAAC,OAAO,OAAO,KAAK,KAAK,EAAE,KAAK,CAACC,MAC3B,CAACJ,KAAW,CAACI,IAAa,KACvBC,EAAeL,GAASI,CAAI,CACpC,MAEQH,IAAA,KACPA,MAAW,WAAW,KAAK,UAAUA;AAAA,EAC3C;AAAA,EAtCA,IAAW,SAAS;AAEhB,WAAE,KAAK,WACP,OAAO,OAAO,KAAK,KAAK,EAAE;AAAA,MAAK,CAACG;AAAA;AAAA,QAE9BC,EAAe,KAAK,SAAUD,CAAI;AAAA;AAAA,IACpC,IAEO,KACF,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqCA,IAAW,QAAiC;AAC1C,WAAQ,KAAK,YAAwC;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAW,eAA6B;AACtC,WAAQ,KAAK,YAAwC;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAyB,OACvBJ,GACAD,GACAO,GACA;AACA,iBAAM,MAAM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,MAAM,yBAAyBlB,GAASQ,CAAQ;AAAA,EAIzD;AACF;AA1LEX,EAAgB,QAAiC,IAQjDA,EAAgB,eAA6BsB,EAAa;AAnBrD,IAAMC,IAANvB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../generated-DHerxf1y.cjs"),c=require("./DeployableTarget.cjs");var h=(n=>(n[n.MANAGER=1n]="MANAGER",n[n.ADMIN=2n]="ADMIN",n))(h||{});class l extends c.DeployableTarget{async setAuthorized(t,s,a){return await this.awaitResult(this.setAuthorizedRaw(t,s,a))}async setAuthorizedRaw(t,s,a){const{request:i,result:r}=await e.O6(this._config,{address:this.assertValidAddress(),args:[t,s],...this.optionallyAttachAccount(),...a});return{hash:await e.b6(this._config,i),result:r}}async grantRoles(t,s,a){return await this.awaitResult(this.grantRolesRaw(t,s,a))}async grantRolesRaw(t,s,a){const{request:i,result:r}=await e.I6(this._config,{address:this.assertValidAddress(),args:[t,s],...this.optionallyAttachAccount(),...a});return{hash:await e.u6(this._config,i),result:r}}async revokeRoles(t,s,a){return await this.awaitResult(this.revokeRolesRaw(t,s,a))}async revokeRolesRaw(t,s,a){const{request:i,result:r}=await e.R6(this._config,{address:this.assertValidAddress(),args:[t,s],...this.optionallyAttachAccount(),...a});return{hash:await e.m6(this._config,i),result:r}}async grantManyRoles(t,s,a){return await this.awaitResult(this.grantManyRolesRaw(t,s,a))}async grantManyRolesRaw(t,s,a){const{request:i,result:r}=await e.A6(this._config,{address:this.assertValidAddress(),args:[t,s],...this.optionallyAttachAccount(),...a});return{hash:await e.p6(this._config,i),result:r}}async revokeManyRoles(t,s,a){return await this.awaitResult(this.revokeManyRolesRaw(t,s,a))}async revokeManyRolesRaw(t,s,a){const{request:i,result:r}=await e.M6(this._config,{address:this.assertValidAddress(),args:[t,s],...this.optionallyAttachAccount(),...a});return{hash:await e.c6(this._config,i),result:r}}async rolesOf(t,s){const a=await e.i6(this._config,{address:this.assertValidAddress(),args:[t],...this.optionallyAttachAccount(),...s});return[h.MANAGER,h.ADMIN].filter(i=>(a&i)===i)}hasAnyRole(t,s,a){return e.e6(this._config,{address:this.assertValidAddress(),args:[t,s],...this.optionallyAttachAccount(),...a})}hasAllRoles(t,s,a){return e.YR(this._config,{address:this.assertValidAddress(),args:[t,s],...this.optionallyAttachAccount(),...a})}isAuthorized(t,s){return e.t6(this._config,{address:this.assertValidAddress(),args:[t],...this.optionallyAttachAccount(),...s})}}exports.rbacAbi=e.R;exports.DeployableTargetWithRBAC=l;exports.Roles=h;
|
|
2
|
+
//# sourceMappingURL=DeployableTargetWithRBAC.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeployableTargetWithRBAC.cjs","sources":["../../src/Deployable/DeployableTargetWithRBAC.ts"],"sourcesContent":["import {\n rbacAbi,\n readRbacHasAllRoles,\n readRbacHasAnyRole,\n readRbacIsAuthorized,\n readRbacRolesOf,\n simulateRbacGrantManyRoles,\n simulateRbacGrantRoles,\n simulateRbacRevokeManyRoles,\n simulateRbacRevokeRoles,\n simulateRbacSetAuthorized,\n writeRbacGrantManyRoles,\n writeRbacGrantRoles,\n writeRbacRevokeManyRoles,\n writeRbacRevokeRoles,\n writeRbacSetAuthorized,\n} from '@boostxyz/evm';\nimport type { Abi, Address, ContractEventName } from 'viem';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport type { GenericLog, ReadParams, WriteParams } from '../utils';\nexport { rbacAbi };\n\n/**\n * Enum representing available roles for use with the `RBAC` authorization scheme.\n * `MANAGER` has lowest level of write permissions, for specific implementations, see Budgets and ALlowLists\n * `ADMIN` can additionally manage authorized users on the contract.\n *\n * @export\n * @type {{ readonly MANAGER: 1n; readonly ADMIN_ROLE: 2n; }}\n * @enum {bigint}\n */\nexport enum Roles {\n //@ts-expect-error ts doesn't like bigint enum values\n MANAGER = 1n,\n //@ts-expect-error ts doesn't like bigint enum values\n ADMIN = 2n,\n}\n\n/**\n * A generic `viem.Log` event with support for `Rbac` event types.\n *\n * @export\n * @typedef {RBACLog}\n * @template {ContractEventName<typeof rbacAbi>} [event=ContractEventName<\n * typeof rbacAbi\n * >]\n */\nexport type RBACLog<\n event extends ContractEventName<typeof rbacAbi> = ContractEventName<\n typeof rbacAbi\n >,\n> = GenericLog<typeof rbacAbi, event>;\n\n/**\n * A minimal RBAC implementation that offers MANAGER and ADMIN roles, and\n * Budgets and allowlists support this auth scheme\n *\n * @export\n * @class DeployableTargetWithRBAC\n * @typedef {DeployableTargetWithRBAC}\n * @extends {DeployableTarget<RbacPayload>}\n */\nexport class DeployableTargetWithRBAC<\n Payload,\n ABI extends Abi,\n> extends DeployableTarget<Payload, ABI> {\n /**\n * Set the authorized status of the given accounts\n * The mechanism for managing authorization is left to the implementing contract\n *\n * @public\n * @async\n * @param {Address[]} addresses - The accounts to authorize or deauthorize\n * @param {boolean[]} allowed - The authorization status for the given accounts\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setAuthorized(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof rbacAbi, 'setAuthorized'>,\n ) {\n return await this.awaitResult(\n this.setAuthorizedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the authorized status of the given accounts\n * The mechanism for managing authorization is left to the implementing contract\n *\n * @public\n * @async\n * @param {Address[]} addresses - The accounts to authorize or deauthorize\n * @param {boolean[]} allowed - The authorization status for the given accounts\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setAuthorizedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof rbacAbi, 'setAuthorized'>,\n ) {\n const { request, result } = await simulateRbacSetAuthorized(this._config, {\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 const hash = await writeRbacSetAuthorized(this._config, request);\n return { hash, result };\n }\n\n /**\n * Grant permissions for a user on the rbac.\n *\n * @example\n * ```ts\n * await rbac.grantRoles('0xfoo', Roles.MANAGER)\n * ```\n * @public\n * @async\n * @param {Address} address\n * @param {Roles} role\n * @param {?WriteParams<typeof rbacAbi, 'grantRoles'>} [params]\n * @returns {Promise<void>}\n */\n public async grantRoles(\n address: Address,\n role: Roles,\n params?: WriteParams<typeof rbacAbi, 'grantRoles'>,\n ) {\n return await this.awaitResult(this.grantRolesRaw(address, role, params));\n }\n\n /**\n * Grant permissions for a user on the rbac.\n *\n * @example\n * ```ts\n * await rbac.grantRoles('0xfoo', Roles.MANAGER)\n * ```\n * @public\n * @async\n * @param {Address} address\n * @param {Roles} role\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async grantRolesRaw(\n address: Address,\n role: Roles,\n params?: WriteParams<typeof rbacAbi, 'grantRoles'>,\n ) {\n const { request, result } = await simulateRbacGrantRoles(this._config, {\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 const hash = await writeRbacGrantRoles(\n this._config,\n // biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection\n request as any,\n );\n return { hash, result };\n }\n\n /**\n * Revoke permissions for a user on the rbac.\n *\n * @example\n * ```ts\n * await rbac.revokeRoles('0xfoo', Roles.MANAGER)\n * ```\n * @public\n * @async\n * @param {Address} address\n * @param {Roles} role\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async revokeRoles(\n address: Address,\n role: Roles,\n params?: WriteParams<typeof rbacAbi, 'revokeRoles'>,\n ) {\n return await this.awaitResult(this.revokeRolesRaw(address, role, params));\n }\n\n /**\n * Revoke permissions for a user on the rbac.\n *\n * @example\n * ```ts\n * await rbac.revokeRoles('0xfoo', Roles.MANAGER)\n * ```\n * @public\n * @async\n * @param {Address} address\n * @param {Roles} role\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async revokeRolesRaw(\n address: Address,\n role: Roles,\n params?: WriteParams<typeof rbacAbi, 'revokeRoles'>,\n ) {\n const { request, result } = await simulateRbacRevokeRoles(this._config, {\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 const hash = await writeRbacRevokeRoles(\n this._config,\n // biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection\n request as any,\n );\n return { hash, result };\n }\n\n /**\n * Grant many accounts permissions on the rbac.\n *\n * @example\n * ```ts\n * await rbac.grantManyRoles(['0xfoo', '0xbar], [Roles.MANAGER, Roles.ADMIN])\n * ```\n * @public\n * @async\n * @param {Address[]} addresses\n * @param {Roles[]} roles\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async grantManyRoles(\n addresses: Address[],\n roles: Roles[],\n params?: WriteParams<typeof rbacAbi, 'grantManyRoles'>,\n ) {\n return await this.awaitResult(\n this.grantManyRolesRaw(addresses, roles, params),\n );\n }\n\n /**\n * Grant many accounts permissions on the rbac.\n *\n * @example\n * ```ts\n * await rbac.grantManyRoles(['0xfoo', '0xbar], [Roles.MANAGER, Roles.ADMIN])\n * ```\n * @public\n * @async\n * @param {Address[]} addresses\n * @param {Roles[]} roles\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async grantManyRolesRaw(\n addresses: Address[],\n roles: Roles[],\n params?: WriteParams<typeof rbacAbi, 'grantManyRoles'>,\n ) {\n const { request, result } = await simulateRbacGrantManyRoles(this._config, {\n address: this.assertValidAddress(),\n args: [addresses, roles],\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 const hash = await writeRbacGrantManyRoles(\n this._config,\n // biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection\n request as any,\n );\n return { hash, result };\n }\n\n /**\n * Revoke many accounts' permissions on the rbac.\n *\n * @example\n * ```ts\n * await rbac.revokeManyRoles(['0xfoo', '0xbar], [Roles.MANAGER, Roles.ADMIN])\n * ```\n * @public\n * @async\n * @param {Address[]} addresses\n * @param {Roles[]} roles\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async revokeManyRoles(\n addresses: Address[],\n roles: Roles[],\n params?: WriteParams<typeof rbacAbi, 'revokeManyRoles'>,\n ) {\n return await this.awaitResult(\n this.revokeManyRolesRaw(addresses, roles, params),\n );\n }\n\n /**\n * Revoke many accounts' permissions on the rbac.\n *\n * @example\n * ```ts\n * await rbac.revokeManyRoles(['0xfoo', '0xbar], [Roles.MANAGER, Roles.ADMIN])\n * ```\n * @public\n * @async\n * @param {Address[]} addresses\n * @param {Roles[]} roles\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async revokeManyRolesRaw(\n addresses: Address[],\n roles: Roles[],\n params?: WriteParams<typeof rbacAbi, 'revokeManyRoles'>,\n ) {\n const { request, result } = await simulateRbacRevokeManyRoles(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, roles],\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 writeRbacRevokeManyRoles(\n this._config,\n // biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection\n request as any,\n );\n return { hash, result };\n }\n\n /**\n * Return an array of the roles assigned to the given account.\n * @example\n * ```ts\n * (await rbac.rolesOf(0xfoo)).includes(Roles.ADMIN)\n * ```\n * @public\n * @param {Address} account\n * @param {?ReadParams} [params]\n * @returns {Promise<Array<Roles>>}\n */\n public async rolesOf(\n account: Address,\n params?: ReadParams<typeof rbacAbi, 'rolesOf'>,\n ) {\n const roles = await readRbacRolesOf(this._config, {\n address: this.assertValidAddress(),\n args: [account],\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 return ([Roles.MANAGER, Roles.ADMIN] as unknown as Array<bigint>).filter(\n (role) => (roles & role) === role,\n ) as unknown as Roles[];\n }\n\n /**\n * Returns whether given account has any of the provided roles bitmap.\n *\n * @example\n * ```ts\n * await rbac.hasAnyRole(0xfoo, Roles.ADMIN | Roles.MANAGER)\n * ```\n * @public\n * @param {Address} account\n * @param {Roles} roles\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public hasAnyRole(\n account: Address,\n roles: Roles,\n params?: ReadParams<typeof rbacAbi, 'hasAnyRole'>,\n ) {\n return readRbacHasAnyRole(this._config, {\n address: this.assertValidAddress(),\n args: [account, roles],\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 * Returns whether given account has all of the provided roles bitmap.\n *\n * @example\n * ```ts\n * await rbac.hasAllRoles(0xfoo, Roles.ADMIN | Roles.MANAGER)\n * ```\n * @public\n * @param {Address} account\n * @param {Roles} roles\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public hasAllRoles(\n account: Address,\n roles: Roles,\n params?: ReadParams<typeof rbacAbi, 'hasAllRoles'>,\n ) {\n return readRbacHasAllRoles(this._config, {\n address: this.assertValidAddress(),\n args: [account, roles],\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 * Check if the given account is authorized to use the rbac\n *\n * @public\n * @param {Address} account\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the account is authorized\n */\n public isAuthorized(\n account: Address,\n params?: ReadParams<typeof rbacAbi, 'isAuthorized'>,\n ) {\n return readRbacIsAuthorized(this._config, {\n address: this.assertValidAddress(),\n args: [account],\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"],"names":["Roles","DeployableTargetWithRBAC","DeployableTarget","addresses","allowed","params","request","result","simulateRbacSetAuthorized","writeRbacSetAuthorized","address","role","simulateRbacGrantRoles","writeRbacGrantRoles","simulateRbacRevokeRoles","writeRbacRevokeRoles","roles","simulateRbacGrantManyRoles","writeRbacGrantManyRoles","simulateRbacRevokeManyRoles","writeRbacRevokeManyRoles","account","readRbacRolesOf","readRbacHasAnyRole","readRbacHasAllRoles","readRbacIsAuthorized"],"mappings":"iKA+BY,IAAAA,GAAAA,IAEVA,EAAAA,EAAA,QAAU,EAAV,EAAA,UAEAA,EAAAA,EAAA,MAAQ,EAAR,EAAA,QAJUA,IAAAA,GAAA,CAAA,CAAA,EA+BL,MAAMC,UAGHC,EAAAA,gBAA+B,CAYvC,MAAa,cACXC,EACAC,EACAC,EACA,CACA,OAAO,MAAM,KAAK,YAChB,KAAK,iBAAiBF,EAAWC,EAASC,CAAM,CAAA,CAEpD,CAaA,MAAa,iBACXF,EACAC,EACAC,EACA,CACA,KAAM,CAAE,QAAAC,EAAS,OAAAC,CAAA,EAAW,MAAMC,EAAA,GAA0B,KAAK,QAAS,CACxE,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACL,EAAWC,CAAO,EACzB,GAAG,KAAK,wBAAwB,EAEhC,GAAIC,CAAA,CACL,EAEM,MAAA,CAAE,KADI,MAAMI,EAAuB,GAAA,KAAK,QAASH,CAAO,EAChD,OAAAC,EACjB,CAgBA,MAAa,WACXG,EACAC,EACAN,EACA,CACO,OAAA,MAAM,KAAK,YAAY,KAAK,cAAcK,EAASC,EAAMN,CAAM,CAA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|
+
import type { Abi, Address, ContractEventName } from 'viem';
|
|
3
|
+
import { DeployableTarget } from '../Deployable/DeployableTarget';
|
|
4
|
+
import type { GenericLog, ReadParams, WriteParams } from '../utils';
|
|
5
|
+
export { rbacAbi };
|
|
6
|
+
/**
|
|
7
|
+
* Enum representing available roles for use with the `RBAC` authorization scheme.
|
|
8
|
+
* `MANAGER` has lowest level of write permissions, for specific implementations, see Budgets and ALlowLists
|
|
9
|
+
* `ADMIN` can additionally manage authorized users on the contract.
|
|
10
|
+
*
|
|
11
|
+
* @export
|
|
12
|
+
* @type {{ readonly MANAGER: 1n; readonly ADMIN_ROLE: 2n; }}
|
|
13
|
+
* @enum {bigint}
|
|
14
|
+
*/
|
|
15
|
+
export declare enum Roles {
|
|
16
|
+
MANAGER,
|
|
17
|
+
ADMIN
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A generic `viem.Log` event with support for `Rbac` event types.
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @typedef {RBACLog}
|
|
24
|
+
* @template {ContractEventName<typeof rbacAbi>} [event=ContractEventName<
|
|
25
|
+
* typeof rbacAbi
|
|
26
|
+
* >]
|
|
27
|
+
*/
|
|
28
|
+
export type RBACLog<event extends ContractEventName<typeof rbacAbi> = ContractEventName<typeof rbacAbi>> = GenericLog<typeof rbacAbi, event>;
|
|
29
|
+
/**
|
|
30
|
+
* A minimal RBAC implementation that offers MANAGER and ADMIN roles, and
|
|
31
|
+
* Budgets and allowlists support this auth scheme
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @class DeployableTargetWithRBAC
|
|
35
|
+
* @typedef {DeployableTargetWithRBAC}
|
|
36
|
+
* @extends {DeployableTarget<RbacPayload>}
|
|
37
|
+
*/
|
|
38
|
+
export declare class DeployableTargetWithRBAC<Payload, ABI extends Abi> extends DeployableTarget<Payload, ABI> {
|
|
39
|
+
/**
|
|
40
|
+
* Set the authorized status of the given accounts
|
|
41
|
+
* The mechanism for managing authorization is left to the implementing contract
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
* @async
|
|
45
|
+
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
46
|
+
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
47
|
+
* @param {?WriteParams} [params]
|
|
48
|
+
* @returns {Promise<void>}
|
|
49
|
+
*/
|
|
50
|
+
setAuthorized(addresses: Address[], allowed: boolean[], params?: WriteParams<typeof rbacAbi, 'setAuthorized'>): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Set the authorized status of the given accounts
|
|
53
|
+
* The mechanism for managing authorization is left to the implementing contract
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
* @async
|
|
57
|
+
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
58
|
+
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
59
|
+
* @param {?WriteParams} [params]
|
|
60
|
+
* @returns {Promise<void>}
|
|
61
|
+
*/
|
|
62
|
+
setAuthorizedRaw(addresses: Address[], allowed: boolean[], params?: WriteParams<typeof rbacAbi, 'setAuthorized'>): Promise<{
|
|
63
|
+
hash: `0x${string}`;
|
|
64
|
+
result: void;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Grant permissions for a user on the rbac.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* await rbac.grantRoles('0xfoo', Roles.MANAGER)
|
|
72
|
+
* ```
|
|
73
|
+
* @public
|
|
74
|
+
* @async
|
|
75
|
+
* @param {Address} address
|
|
76
|
+
* @param {Roles} role
|
|
77
|
+
* @param {?WriteParams<typeof rbacAbi, 'grantRoles'>} [params]
|
|
78
|
+
* @returns {Promise<void>}
|
|
79
|
+
*/
|
|
80
|
+
grantRoles(address: Address, role: Roles, params?: WriteParams<typeof rbacAbi, 'grantRoles'>): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Grant permissions for a user on the rbac.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* await rbac.grantRoles('0xfoo', Roles.MANAGER)
|
|
87
|
+
* ```
|
|
88
|
+
* @public
|
|
89
|
+
* @async
|
|
90
|
+
* @param {Address} address
|
|
91
|
+
* @param {Roles} role
|
|
92
|
+
* @param {?WriteParams} [params]
|
|
93
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
94
|
+
*/
|
|
95
|
+
grantRolesRaw(address: Address, role: Roles, params?: WriteParams<typeof rbacAbi, 'grantRoles'>): Promise<{
|
|
96
|
+
hash: `0x${string}`;
|
|
97
|
+
result: void;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Revoke permissions for a user on the rbac.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* await rbac.revokeRoles('0xfoo', Roles.MANAGER)
|
|
105
|
+
* ```
|
|
106
|
+
* @public
|
|
107
|
+
* @async
|
|
108
|
+
* @param {Address} address
|
|
109
|
+
* @param {Roles} role
|
|
110
|
+
* @param {?WriteParams} [params]
|
|
111
|
+
* @returns {Promise<void>}
|
|
112
|
+
*/
|
|
113
|
+
revokeRoles(address: Address, role: Roles, params?: WriteParams<typeof rbacAbi, 'revokeRoles'>): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Revoke permissions for a user on the rbac.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* await rbac.revokeRoles('0xfoo', Roles.MANAGER)
|
|
120
|
+
* ```
|
|
121
|
+
* @public
|
|
122
|
+
* @async
|
|
123
|
+
* @param {Address} address
|
|
124
|
+
* @param {Roles} role
|
|
125
|
+
* @param {?WriteParams} [params]
|
|
126
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
127
|
+
*/
|
|
128
|
+
revokeRolesRaw(address: Address, role: Roles, params?: WriteParams<typeof rbacAbi, 'revokeRoles'>): Promise<{
|
|
129
|
+
hash: `0x${string}`;
|
|
130
|
+
result: void;
|
|
131
|
+
}>;
|
|
132
|
+
/**
|
|
133
|
+
* Grant many accounts permissions on the rbac.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* await rbac.grantManyRoles(['0xfoo', '0xbar], [Roles.MANAGER, Roles.ADMIN])
|
|
138
|
+
* ```
|
|
139
|
+
* @public
|
|
140
|
+
* @async
|
|
141
|
+
* @param {Address[]} addresses
|
|
142
|
+
* @param {Roles[]} roles
|
|
143
|
+
* @param {?WriteParams} [params]
|
|
144
|
+
* @returns {Promise<void>}
|
|
145
|
+
*/
|
|
146
|
+
grantManyRoles(addresses: Address[], roles: Roles[], params?: WriteParams<typeof rbacAbi, 'grantManyRoles'>): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Grant many accounts permissions on the rbac.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* await rbac.grantManyRoles(['0xfoo', '0xbar], [Roles.MANAGER, Roles.ADMIN])
|
|
153
|
+
* ```
|
|
154
|
+
* @public
|
|
155
|
+
* @async
|
|
156
|
+
* @param {Address[]} addresses
|
|
157
|
+
* @param {Roles[]} roles
|
|
158
|
+
* @param {?WriteParams} [params]
|
|
159
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
160
|
+
*/
|
|
161
|
+
grantManyRolesRaw(addresses: Address[], roles: Roles[], params?: WriteParams<typeof rbacAbi, 'grantManyRoles'>): Promise<{
|
|
162
|
+
hash: `0x${string}`;
|
|
163
|
+
result: void;
|
|
164
|
+
}>;
|
|
165
|
+
/**
|
|
166
|
+
* Revoke many accounts' permissions on the rbac.
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* await rbac.revokeManyRoles(['0xfoo', '0xbar], [Roles.MANAGER, Roles.ADMIN])
|
|
171
|
+
* ```
|
|
172
|
+
* @public
|
|
173
|
+
* @async
|
|
174
|
+
* @param {Address[]} addresses
|
|
175
|
+
* @param {Roles[]} roles
|
|
176
|
+
* @param {?WriteParams} [params]
|
|
177
|
+
* @returns {Promise<void>}
|
|
178
|
+
*/
|
|
179
|
+
revokeManyRoles(addresses: Address[], roles: Roles[], params?: WriteParams<typeof rbacAbi, 'revokeManyRoles'>): Promise<void>;
|
|
180
|
+
/**
|
|
181
|
+
* Revoke many accounts' permissions on the rbac.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```ts
|
|
185
|
+
* await rbac.revokeManyRoles(['0xfoo', '0xbar], [Roles.MANAGER, Roles.ADMIN])
|
|
186
|
+
* ```
|
|
187
|
+
* @public
|
|
188
|
+
* @async
|
|
189
|
+
* @param {Address[]} addresses
|
|
190
|
+
* @param {Roles[]} roles
|
|
191
|
+
* @param {?WriteParams} [params]
|
|
192
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
193
|
+
*/
|
|
194
|
+
revokeManyRolesRaw(addresses: Address[], roles: Roles[], params?: WriteParams<typeof rbacAbi, 'revokeManyRoles'>): Promise<{
|
|
195
|
+
hash: `0x${string}`;
|
|
196
|
+
result: void;
|
|
197
|
+
}>;
|
|
198
|
+
/**
|
|
199
|
+
* Return an array of the roles assigned to the given account.
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* (await rbac.rolesOf(0xfoo)).includes(Roles.ADMIN)
|
|
203
|
+
* ```
|
|
204
|
+
* @public
|
|
205
|
+
* @param {Address} account
|
|
206
|
+
* @param {?ReadParams} [params]
|
|
207
|
+
* @returns {Promise<Array<Roles>>}
|
|
208
|
+
*/
|
|
209
|
+
rolesOf(account: Address, params?: ReadParams<typeof rbacAbi, 'rolesOf'>): Promise<Roles[]>;
|
|
210
|
+
/**
|
|
211
|
+
* Returns whether given account has any of the provided roles bitmap.
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```ts
|
|
215
|
+
* await rbac.hasAnyRole(0xfoo, Roles.ADMIN | Roles.MANAGER)
|
|
216
|
+
* ```
|
|
217
|
+
* @public
|
|
218
|
+
* @param {Address} account
|
|
219
|
+
* @param {Roles} roles
|
|
220
|
+
* @param {?ReadParams} [params]
|
|
221
|
+
* @returns {Promise<boolean>}
|
|
222
|
+
*/
|
|
223
|
+
hasAnyRole(account: Address, roles: Roles, params?: ReadParams<typeof rbacAbi, 'hasAnyRole'>): Promise<boolean>;
|
|
224
|
+
/**
|
|
225
|
+
* Returns whether given account has all of the provided roles bitmap.
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```ts
|
|
229
|
+
* await rbac.hasAllRoles(0xfoo, Roles.ADMIN | Roles.MANAGER)
|
|
230
|
+
* ```
|
|
231
|
+
* @public
|
|
232
|
+
* @param {Address} account
|
|
233
|
+
* @param {Roles} roles
|
|
234
|
+
* @param {?ReadParams} [params]
|
|
235
|
+
* @returns {Promise<boolean>}
|
|
236
|
+
*/
|
|
237
|
+
hasAllRoles(account: Address, roles: Roles, params?: ReadParams<typeof rbacAbi, 'hasAllRoles'>): Promise<boolean>;
|
|
238
|
+
/**
|
|
239
|
+
* Check if the given account is authorized to use the rbac
|
|
240
|
+
*
|
|
241
|
+
* @public
|
|
242
|
+
* @param {Address} account
|
|
243
|
+
* @param {?ReadParams} [params]
|
|
244
|
+
* @returns {Promise<boolean>} - True if the account is authorized
|
|
245
|
+
*/
|
|
246
|
+
isAuthorized(account: Address, params?: ReadParams<typeof rbacAbi, 'isAuthorized'>): Promise<boolean>;
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=DeployableTargetWithRBAC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeployableTargetWithRBAC.d.ts","sourceRoot":"","sources":["../../src/Deployable/DeployableTargetWithRBAC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAeR,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EA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