@boostxyz/sdk 0.0.0-alpha.12 → 0.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.js +1 -1
  3. package/dist/Actions/ContractAction.d.ts +2 -2
  4. package/dist/Actions/ContractAction.d.ts.map +1 -1
  5. package/dist/Actions/ERC721MintAction.d.ts +2 -2
  6. package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
  7. package/dist/Actions/EventAction.cjs +1 -1
  8. package/dist/Actions/EventAction.cjs.map +1 -1
  9. package/dist/Actions/EventAction.d.ts +2 -2
  10. package/dist/Actions/EventAction.d.ts.map +1 -1
  11. package/dist/Actions/EventAction.js +47 -43
  12. package/dist/Actions/EventAction.js.map +1 -1
  13. package/dist/AllowLists/AllowList.cjs +1 -1
  14. package/dist/AllowLists/AllowList.js +2 -2
  15. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  16. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  17. package/dist/AllowLists/SimpleAllowList.d.ts +2 -2
  18. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  19. package/dist/AllowLists/SimpleAllowList.js +23 -19
  20. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  21. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  22. package/dist/AllowLists/SimpleDenyList.d.ts +2 -2
  23. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  24. package/dist/AllowLists/SimpleDenyList.js +6 -5
  25. package/dist/AllowLists/SimpleDenyList.js.map +1 -1
  26. package/dist/Auth/PassthroughAuth.cjs +1 -1
  27. package/dist/Auth/PassthroughAuth.js +1 -1
  28. package/dist/BoostCore.cjs +2 -2
  29. package/dist/BoostCore.cjs.map +1 -1
  30. package/dist/BoostCore.d.ts +27 -5
  31. package/dist/BoostCore.d.ts.map +1 -1
  32. package/dist/BoostCore.js +438 -347
  33. package/dist/BoostCore.js.map +1 -1
  34. package/dist/BoostRegistry.cjs +1 -1
  35. package/dist/BoostRegistry.cjs.map +1 -1
  36. package/dist/BoostRegistry.d.ts +26 -5
  37. package/dist/BoostRegistry.d.ts.map +1 -1
  38. package/dist/BoostRegistry.js +125 -64
  39. package/dist/BoostRegistry.js.map +1 -1
  40. package/dist/Budgets/Budget.cjs +1 -1
  41. package/dist/Budgets/Budget.js +1 -1
  42. package/dist/Budgets/ManagedBudget.cjs +1 -1
  43. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  44. package/dist/Budgets/ManagedBudget.d.ts +2 -2
  45. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  46. package/dist/Budgets/ManagedBudget.js +41 -37
  47. package/dist/Budgets/ManagedBudget.js.map +1 -1
  48. package/dist/Budgets/SimpleBudget.d.ts +2 -2
  49. package/dist/Budgets/SimpleBudget.d.ts.map +1 -1
  50. package/dist/Budgets/VestingBudget.d.ts +2 -2
  51. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  52. package/dist/Deployable/DeployableTarget.cjs +1 -1
  53. package/dist/Deployable/DeployableTarget.cjs.map +1 -1
  54. package/dist/Deployable/DeployableTarget.d.ts +6 -6
  55. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  56. package/dist/Deployable/DeployableTarget.js +22 -17
  57. package/dist/Deployable/DeployableTarget.js.map +1 -1
  58. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  59. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  60. package/dist/Incentives/AllowListIncentive.d.ts +2 -2
  61. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  62. package/dist/Incentives/AllowListIncentive.js +17 -13
  63. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  64. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  65. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  66. package/dist/Incentives/CGDAIncentive.d.ts +14 -2
  67. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  68. package/dist/Incentives/CGDAIncentive.js +27 -23
  69. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  70. package/dist/Incentives/ERC1155Incentive.d.ts +2 -2
  71. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  72. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  73. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  74. package/dist/Incentives/ERC20Incentive.d.ts +2 -2
  75. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  76. package/dist/Incentives/ERC20Incentive.js +17 -13
  77. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  78. package/dist/Incentives/ERC20VariableIncentive.d.ts +2 -2
  79. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  80. package/dist/Incentives/Incentive.cjs +1 -1
  81. package/dist/Incentives/Incentive.cjs.map +1 -1
  82. package/dist/Incentives/Incentive.js +32 -28
  83. package/dist/Incentives/Incentive.js.map +1 -1
  84. package/dist/Incentives/PointsIncentive.cjs +1 -1
  85. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  86. package/dist/Incentives/PointsIncentive.d.ts +2 -2
  87. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  88. package/dist/Incentives/PointsIncentive.js +13 -9
  89. package/dist/Incentives/PointsIncentive.js.map +1 -1
  90. package/dist/{SimpleDenyList-IJ9Ipya7.js → SimpleDenyList-C21O9Yfi.js} +23 -19
  91. package/dist/SimpleDenyList-C21O9Yfi.js.map +1 -0
  92. package/dist/SimpleDenyList-DeJRKD2D.cjs +2 -0
  93. package/dist/{SimpleDenyList-IJ9Ipya7.js.map → SimpleDenyList-DeJRKD2D.cjs.map} +1 -1
  94. package/dist/Validators/SignerValidator.cjs +1 -1
  95. package/dist/Validators/SignerValidator.cjs.map +1 -1
  96. package/dist/Validators/SignerValidator.d.ts +2 -2
  97. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  98. package/dist/Validators/SignerValidator.js +18 -14
  99. package/dist/Validators/SignerValidator.js.map +1 -1
  100. package/dist/Validators/Validator.cjs +1 -1
  101. package/dist/Validators/Validator.js +1 -1
  102. package/dist/deployments-BvFcK_eR.js +40 -0
  103. package/dist/deployments-BvFcK_eR.js.map +1 -0
  104. package/dist/deployments-Ho4PnGCS.cjs +2 -0
  105. package/dist/deployments-Ho4PnGCS.cjs.map +1 -0
  106. package/dist/deployments.json +38 -0
  107. package/dist/errors.cjs +1 -1
  108. package/dist/errors.cjs.map +1 -1
  109. package/dist/errors.d.ts +6 -0
  110. package/dist/errors.d.ts.map +1 -1
  111. package/dist/errors.js +70 -54
  112. package/dist/errors.js.map +1 -1
  113. package/dist/{generated-HGddZXHJ.js → generated-LpgSHrH0.js} +130 -90
  114. package/dist/generated-LpgSHrH0.js.map +1 -0
  115. package/dist/generated-tq_HLZJ0.cjs +3 -0
  116. package/dist/generated-tq_HLZJ0.cjs.map +1 -0
  117. package/dist/index.cjs +1 -1
  118. package/dist/index.js +113 -109
  119. package/dist/utils.cjs +1 -1
  120. package/dist/utils.cjs.map +1 -1
  121. package/dist/utils.d.ts +25 -11
  122. package/dist/utils.d.ts.map +1 -1
  123. package/dist/utils.js +38 -23
  124. package/dist/utils.js.map +1 -1
  125. package/package.json +6 -5
  126. package/src/Actions/ContractAction.ts +5 -3
  127. package/src/Actions/ERC721MintAction.ts +5 -3
  128. package/src/Actions/EventAction.ts +6 -2
  129. package/src/AllowLists/AllowList.test.ts +1 -1
  130. package/src/AllowLists/SimpleAllowList.ts +6 -3
  131. package/src/AllowLists/SimpleDenyList.ts +6 -3
  132. package/src/BoostCore.test.ts +31 -91
  133. package/src/BoostCore.ts +137 -34
  134. package/src/BoostRegistry.ts +89 -21
  135. package/src/Budgets/ManagedBudget.ts +6 -4
  136. package/src/Budgets/SimpleBudget.ts +4 -3
  137. package/src/Budgets/VestingBudget.ts +4 -3
  138. package/src/Deployable/DeployableTarget.ts +22 -11
  139. package/src/Incentives/AllowListIncentive.ts +6 -3
  140. package/src/Incentives/CGDAIncentive.ts +6 -3
  141. package/src/Incentives/ERC1155Incentive.ts +4 -3
  142. package/src/Incentives/ERC20Incentive.ts +6 -3
  143. package/src/Incentives/ERC20VariableIncentive.ts +6 -3
  144. package/src/Incentives/PointsIncentive.ts +6 -3
  145. package/src/Validators/SignerValidator.ts +6 -3
  146. package/src/errors.ts +17 -1
  147. package/src/utils.ts +60 -11
  148. package/dist/SimpleDenyList-CqT0BMP7.cjs +0 -2
  149. package/dist/SimpleDenyList-CqT0BMP7.cjs.map +0 -1
  150. package/dist/generated-HGddZXHJ.js.map +0 -1
  151. package/dist/generated-wKBNvm48.cjs +0 -3
  152. package/dist/generated-wKBNvm48.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  type aCloneableAbi,
3
- readACloneableGetComponentInterface as readACloneableGetComponentInterface,
3
+ readACloneableGetComponentInterface,
4
4
  readACloneableSupportsInterface,
5
5
  } from '@boostxyz/evm';
6
6
  import { deployContract } from '@wagmi/core';
@@ -11,6 +11,7 @@ import {
11
11
  type Hex,
12
12
  type WaitForTransactionReceiptParameters,
13
13
  isAddress,
14
+ isAddressEqual,
14
15
  zeroAddress,
15
16
  } from 'viem';
16
17
  import {
@@ -38,13 +39,13 @@ export class DeployableTarget<
38
39
  ContractAbi extends Abi,
39
40
  > extends Deployable<Payload, ContractAbi> {
40
41
  /**
41
- * A static property representing the address of the base implementation on chain, used when cloning base contracts.
42
+ * 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.
42
43
  *
43
44
  * @static
44
45
  * @readonly
45
- * @type {Address}
46
+ * @type {Record<string, Address>}
46
47
  */
47
- static readonly base: Address = zeroAddress;
48
+ static readonly bases: Record<number, Address> = {};
48
49
  /**
49
50
  * The target's registry type.
50
51
  *
@@ -61,7 +62,14 @@ export class DeployableTarget<
61
62
  */
62
63
  protected _isBase = true;
63
64
  get isBase() {
64
- if (!!this.address && this.address !== this.base) return false;
65
+ if (
66
+ !!this.address &&
67
+ Object.values(this.bases).some((base) =>
68
+ // biome-ignore lint/style/noNonNullAssertion: won't evaluate this if address checked and defined above
69
+ isAddressEqual(this.address!, base),
70
+ )
71
+ )
72
+ return true;
65
73
  return this._isBase;
66
74
  }
67
75
 
@@ -83,22 +91,25 @@ export class DeployableTarget<
83
91
  if (
84
92
  typeof payload === 'string' &&
85
93
  isAddress(payload) &&
86
- payload !== this.base &&
87
- payload !== zeroAddress
94
+ payload !== zeroAddress &&
95
+ !Object.values(this.bases).some((base) => {
96
+ if (!payload || !base) return false;
97
+ return isAddressEqual(payload, base);
98
+ })
88
99
  )
89
100
  isBase = false;
90
101
  if (isBase !== undefined) this._isBase = isBase;
91
102
  }
92
103
 
93
104
  /**
94
- * A getter that will return the base implementation's static address
105
+ * A getter that will return the base implementation's static addresses by numerical chain ID
95
106
  *
96
107
  * @public
97
108
  * @readonly
98
- * @type {Address}
109
+ * @type {Record<number, Address>}
99
110
  */
100
- public get base(): Address {
101
- return (this.constructor as typeof DeployableTarget).base;
111
+ public get bases(): Record<number, Address> {
112
+ return (this.constructor as typeof DeployableTarget).bases;
102
113
  }
103
114
 
104
115
  /**
@@ -17,6 +17,7 @@ import {
17
17
  type Hex,
18
18
  encodeAbiParameters,
19
19
  } from 'viem';
20
+ import { AllowListIncentive as AllowListIncentiveBases } from '../../dist/deployments.json';
20
21
  import { SimpleAllowList } from '../AllowLists/AllowList';
21
22
  import type {
22
23
  DeployableOptions,
@@ -92,10 +93,12 @@ export class AllowListIncentive extends DeployableTarget<
92
93
  *
93
94
  * @public
94
95
  * @static
95
- * @type {Address}
96
+ * @type {Record<number, Address>}
96
97
  */
97
- public static override base: Address = import.meta.env
98
- .VITE_ALLOWLIST_INCENTIVE_BASE;
98
+ public static override bases: Record<number, Address> = {
99
+ ...(AllowListIncentiveBases as Record<number, Address>),
100
+ 31337: import.meta.env.VITE_ALLOWLIST_INCENTIVE_BASE,
101
+ };
99
102
  /**
100
103
  * @inheritdoc
101
104
  *
@@ -21,6 +21,7 @@ import {
21
21
  type Hex,
22
22
  encodeAbiParameters,
23
23
  } from 'viem';
24
+ import { CGDAIncentive as CGDAIncentiveBases } from '../../dist/deployments.json';
24
25
  import type {
25
26
  DeployableOptions,
26
27
  GenericDeployableParams,
@@ -144,10 +145,12 @@ export class CGDAIncentive extends DeployableTarget<
144
145
  *
145
146
  * @public
146
147
  * @static
147
- * @type {Address}
148
+ * @type {Record<number, Address>}
148
149
  */
149
- public static override base: Address = import.meta.env
150
- .VITE_CGDA_INCENTIVE_BASE;
150
+ public static override bases: Record<number, Address> = {
151
+ ...(CGDAIncentiveBases as Record<number, Address>),
152
+ 31337: import.meta.env.VITE_CGDA_INCENTIVE_BASE,
153
+ };
151
154
  /**
152
155
  * @inheritdoc
153
156
  *
@@ -127,10 +127,11 @@ export class ERC1155Incentive extends DeployableTarget<
127
127
  *
128
128
  * @public
129
129
  * @static
130
- * @type {Address}
130
+ * @type {Record<number, Address>}
131
131
  */
132
- public static override base: Address = import.meta.env
133
- .VITE_ERC1155_INCENTIVE_BASE;
132
+ public static override bases: Record<number, Address> = {
133
+ 31337: import.meta.env.VITE_ERC1155_INCENTIVE_BASE,
134
+ };
134
135
  /**
135
136
  * @inheritdoc
136
137
  *
@@ -24,6 +24,7 @@ import {
24
24
  type Hex,
25
25
  encodeAbiParameters,
26
26
  } from 'viem';
27
+ import { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';
27
28
  import type {
28
29
  DeployableOptions,
29
30
  GenericDeployableParams,
@@ -110,10 +111,12 @@ export class ERC20Incentive extends DeployableTarget<
110
111
  *
111
112
  * @public
112
113
  * @static
113
- * @type {Address}
114
+ * @type {Record<number, Address>}
114
115
  */
115
- public static override base: Address = import.meta.env
116
- .VITE_ERC20_INCENTIVE_BASE;
116
+ public static override bases: Record<number, Address> = {
117
+ ...(ERC20IncentiveBases as Record<number, Address>),
118
+ 31337: import.meta.env.VITE_ERC20_INCENTIVE_BASE,
119
+ };
117
120
  /**
118
121
  * @inheritdoc
119
122
  *
@@ -21,6 +21,7 @@ import {
21
21
  type Hex,
22
22
  encodeAbiParameters,
23
23
  } from 'viem';
24
+ import { ERC20VariableIncentive as ERC20VariableIncentiveBases } from '../../dist/deployments.json';
24
25
  import type {
25
26
  DeployableOptions,
26
27
  GenericDeployableParams,
@@ -96,10 +97,12 @@ export class ERC20VariableIncentive extends DeployableTarget<
96
97
  *
97
98
  * @public
98
99
  * @static
99
- * @type {Address}
100
+ * @type {Record<number, Address>}
100
101
  */
101
- public static override base: Address = import.meta.env
102
- .VITE_ERC20_VARIABLE_INCENTIVE_BASE;
102
+ public static override bases: Record<number, Address> = {
103
+ ...(ERC20VariableIncentiveBases as Record<number, Address>),
104
+ 31337: import.meta.env.VITE_ERC20_VARIABLE_INCENTIVE_BASE,
105
+ };
103
106
  /**
104
107
  * @inheritdoc
105
108
  *
@@ -18,6 +18,7 @@ import {
18
18
  type Hex,
19
19
  encodeAbiParameters,
20
20
  } from 'viem';
21
+ import { PointsIncentive as PointsIncentiveBases } from '../../dist/deployments.json';
21
22
  import type {
22
23
  DeployableOptions,
23
24
  GenericDeployableParams,
@@ -105,10 +106,12 @@ export class PointsIncentive extends DeployableTarget<
105
106
  *
106
107
  * @public
107
108
  * @static
108
- * @type {Address}
109
+ * @type {Record<number, Address>}
109
110
  */
110
- public static override base: Address = import.meta.env
111
- .VITE_POINTS_INCENTIVE_BASE;
111
+ public static override bases: Record<number, Address> = {
112
+ ...(PointsIncentiveBases as Record<number, Address>),
113
+ 31337: import.meta.env.VITE_POINTS_INCENTIVE_BASE,
114
+ };
112
115
  /**
113
116
  * @inheritdoc
114
117
  *
@@ -18,6 +18,7 @@ import {
18
18
  encodeAbiParameters,
19
19
  } from 'viem';
20
20
  import { signTypedData } from 'viem/accounts';
21
+ import { SignerValidator as SignerValidatorBases } from '../../dist/deployments.json';
21
22
  import type {
22
23
  DeployableOptions,
23
24
  GenericDeployableParams,
@@ -306,10 +307,12 @@ export class SignerValidator extends DeployableTarget<
306
307
  *
307
308
  * @public
308
309
  * @static
309
- * @type {Address}
310
+ * @type {Record<number, Address>}
310
311
  */
311
- public static override base: Address = import.meta.env
312
- .VITE_SIGNER_VALIDATOR_BASE;
312
+ public static override bases: Record<number, Address> = {
313
+ ...(SignerValidatorBases as Record<number, Address>),
314
+ 31337: import.meta.env.VITE_SIGNER_VALIDATOR_BASE,
315
+ };
313
316
  /**
314
317
  * @inheritdoc
315
318
  *
package/src/errors.ts CHANGED
@@ -87,7 +87,7 @@ export class DeployableAlreadyDeployedError extends Error {
87
87
  */
88
88
  constructor(address: string) {
89
89
  super(
90
- `Attempted to deploy a contract that already has an address configured`,
90
+ 'Attempted to deploy a contract that already has an address configured',
91
91
  );
92
92
  this.address = address;
93
93
  }
@@ -680,3 +680,19 @@ export class UnrecognizedFilterTypeError extends FieldActionValidationError {
680
680
  super('Invalid FilterType provided', metadata);
681
681
  }
682
682
  }
683
+
684
+ export class NoConnectedChainIdError extends Error {
685
+ constructor() {
686
+ super(
687
+ 'Provided Wagmi configuration does not define `chainId` property with which to target protocol contracts',
688
+ );
689
+ }
690
+ }
691
+
692
+ export class InvalidProtocolChainIdError extends Error {
693
+ constructor(chainId: number, validChainIds: number[]) {
694
+ super(
695
+ `Provided Wagmi configuration supplied a "chainId" where protocol is not deployed, provided: ${chainId}, but valid chains are: ${validChainIds}`,
696
+ );
697
+ }
698
+ }
package/src/utils.ts CHANGED
@@ -3,12 +3,15 @@ import {
3
3
  type ReadContractParameters,
4
4
  type WatchContractEventParameters,
5
5
  type WriteContractParameters,
6
+ getAccount,
7
+ getClient,
6
8
  waitForTransactionReceipt,
7
9
  } from '@wagmi/core';
8
10
  import type { ExtractAbiEvent } from 'abitype';
9
11
  import type {
10
12
  Abi,
11
13
  AbiEvent,
14
+ Address,
12
15
  ContractEventName,
13
16
  ContractFunctionName,
14
17
  GetLogsParameters,
@@ -18,10 +21,28 @@ import type {
18
21
  WaitForTransactionReceiptParameters,
19
22
  } from 'viem';
20
23
  import { isHex, keccak256, slice, toHex } from 'viem';
21
- import { NoContractAddressUponReceiptError } from './errors';
24
+ import {
25
+ InvalidProtocolChainIdError,
26
+ NoConnectedChainIdError,
27
+ NoContractAddressUponReceiptError,
28
+ } from './errors';
22
29
 
23
30
  export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
24
31
 
32
+ /**
33
+ * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
34
+ *
35
+ * @export
36
+ * @enum {number}
37
+ */
38
+ export enum RegistryType {
39
+ ACTION = 0,
40
+ ALLOW_LIST = 1,
41
+ BUDGET = 2,
42
+ INCENTIVE = 3,
43
+ VALIDATOR = 4,
44
+ }
45
+
25
46
  /**
26
47
  * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
27
48
  * See (writeContract)[https://viem.sh/docs/contract/writeContract]
@@ -32,8 +53,8 @@ export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
32
53
  * @template {ContractFunctionName<abi>} functionName
33
54
  */
34
55
  export type WriteParams<
35
- abi extends Abi,
36
- functionName extends ContractFunctionName<abi>,
56
+ abi extends Abi = Abi,
57
+ functionName extends ContractFunctionName<abi> = ContractFunctionName<abi>,
37
58
  > = Partial<
38
59
  Omit<
39
60
  WriteContractParameters<abi, functionName>,
@@ -184,15 +205,43 @@ export async function awaitResult<Result = unknown>(
184
205
  }
185
206
 
186
207
  /**
187
- * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
208
+ * Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.
188
209
  *
189
210
  * @export
190
- * @enum {number}
211
+ * @param {Config} config
212
+ * @param {Record<string, Address>} addressByChainId
213
+ * @param {number} desiredChainId
214
+ * @returns {{ chainId: number, address: Address }}
215
+ * @throws {@link InvalidProtocolChainIdError}
191
216
  */
192
- export enum RegistryType {
193
- ACTION = 0,
194
- ALLOW_LIST = 1,
195
- BUDGET = 2,
196
- INCENTIVE = 3,
197
- VALIDATOR = 4,
217
+ export function assertValidAddressByChainId(
218
+ config: Config,
219
+ addressByChainId: Record<number, Address>,
220
+ desiredChainId?: number,
221
+ ): { chainId: number; address: Address } {
222
+ let chainId: number | undefined = undefined;
223
+ const wagmiAccount = getAccount(config);
224
+ // if manually providing a chain id for some contract operation, try to use it
225
+ if (desiredChainId !== undefined) {
226
+ if (addressByChainId[desiredChainId]) chainId = desiredChainId;
227
+ } else if (wagmiAccount.chainId !== undefined) {
228
+ // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it
229
+ if (addressByChainId[wagmiAccount.chainId]) chainId = wagmiAccount.chainId;
230
+ }
231
+ // chainId is still undefined, try to get chain id off viem client
232
+ if (chainId === undefined) {
233
+ const client = getClient(config);
234
+ if (client?.chain.id && addressByChainId[client?.chain.id])
235
+ chainId = client.chain.id;
236
+ }
237
+ // if chainId is STILL undefined, use our default addresses
238
+ // TODO: update this when on prod network
239
+ if (chainId === undefined) chainId = Number(__DEFAULT_CHAIN_ID__);
240
+ if (!addressByChainId[chainId])
241
+ throw new InvalidProtocolChainIdError(
242
+ chainId,
243
+ Object.keys(addressByChainId).map(Number),
244
+ );
245
+ // biome-ignore lint/style/noNonNullAssertion: this type should be narrowed by the above statement but isn't?
246
+ return { chainId, address: addressByChainId[chainId]! };
198
247
  }
@@ -1,2 +0,0 @@
1
- "use strict";const c=require("./generated-wKBNvm48.cjs"),h=require("@wagmi/core"),r=require("viem"),y=require("./Deployable/DeployableTarget.cjs"),p=require("./errors.cjs"),w=require("./utils.cjs"),i="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6110ac806100bd5f395ff3fe6080604052600436106100a6575f3560e01c8063715018a611610063578063715018a6146101745780638da5cb5b1461017e578063e3f756de146101a8578063f04e283e146101e4578063f2fde38b14610200578063fee81cf41461021c576100a6565b806301ffc9a7146100aa578063141973b0146100e6578063256929621461010e57806328d6183b14610118578063439fab911461014257806354d1f13d1461016a575b5f80fd5b3480156100b5575f80fd5b506100d060048036038101906100cb9190610a82565b610258565b6040516100dd9190610ac7565b60405180910390f35b3480156100f1575f80fd5b5061010c60048036038101906101079190610b96565b6102d1565b005b6101166103da565b005b348015610123575f80fd5b5061012c61042b565b6040516101399190610c23565b60405180910390f35b34801561014d575f80fd5b5061016860048036038101906101639190610c91565b610452565b005b61017261056f565b005b61017c6105a8565b005b348015610189575f80fd5b506101926105bb565b60405161019f9190610d1b565b60405180910390f35b3480156101b3575f80fd5b506101ce60048036038101906101c99190610d5e565b6105e3565b6040516101db9190610ac7565b60405180910390f35b6101fe60048036038101906101f99190610dbb565b610637565b005b61021a60048036038101906102159190610dbb565b610675565b005b348015610227575f80fd5b50610242600480360381019061023d9190610dbb565b61069e565b60405161024f9190610dfe565b60405180910390f35b5f7f3d30a22c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102ca57506102c9826106b7565b5b9050919050565b6102d9610730565b818190508484905014610318576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848490508110156103d35782828281811061033857610337610e17565b5b905060200201602081019061034d9190610e6e565b5f8087878581811061036257610361610e17565b5b90506020020160208101906103779190610dbb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550808060010191505061031a565b5050505050565b5f6103e3610767565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f3d30a22c00000000000000000000000000000000000000000000000000000000905090565b5f61045b610771565b9050805460038255801561048d5760018160011c14303b106104845763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f80848481019061049f919061101c565b915091506104ac8261079a565b5f5b81518110156105325760015f808484815181106104ce576104cd610e17565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506104ae565b505050801561056a576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6105b0610730565b6105b95f610870565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161590509392505050565b61063f610730565b63389a75e1600c52805f526020600c20805442111561066557636f5e88185f526004601cfd5b5f81555061067281610870565b50565b61067d610730565b8060601b61069257637448fbae5f526004601cfd5b61069b81610870565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610729575061072882610936565b5b9050919050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610765576382b429005f526004601cfd5b565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6107a26109af565b1561081a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156107dc57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061086d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b6108786109af565b156108dd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610933565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109a857506109a7826109b3565b5b9050919050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610a6181610a2d565b8114610a6b575f80fd5b50565b5f81359050610a7c81610a58565b92915050565b5f60208284031215610a9757610a96610a25565b5b5f610aa484828501610a6e565b91505092915050565b5f8115159050919050565b610ac181610aad565b82525050565b5f602082019050610ada5f830184610ab8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112610b0157610b00610ae0565b5b8235905067ffffffffffffffff811115610b1e57610b1d610ae4565b5b602083019150836020820283011115610b3a57610b39610ae8565b5b9250929050565b5f8083601f840112610b5657610b55610ae0565b5b8235905067ffffffffffffffff811115610b7357610b72610ae4565b5b602083019150836020820283011115610b8f57610b8e610ae8565b5b9250929050565b5f805f8060408587031215610bae57610bad610a25565b5b5f85013567ffffffffffffffff811115610bcb57610bca610a29565b5b610bd787828801610aec565b9450945050602085013567ffffffffffffffff811115610bfa57610bf9610a29565b5b610c0687828801610b41565b925092505092959194509250565b610c1d81610a2d565b82525050565b5f602082019050610c365f830184610c14565b92915050565b5f8083601f840112610c5157610c50610ae0565b5b8235905067ffffffffffffffff811115610c6e57610c6d610ae4565b5b602083019150836001820283011115610c8a57610c89610ae8565b5b9250929050565b5f8060208385031215610ca757610ca6610a25565b5b5f83013567ffffffffffffffff811115610cc457610cc3610a29565b5b610cd085828601610c3c565b92509250509250929050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610d0582610cdc565b9050919050565b610d1581610cfb565b82525050565b5f602082019050610d2e5f830184610d0c565b92915050565b610d3d81610cfb565b8114610d47575f80fd5b50565b5f81359050610d5881610d34565b92915050565b5f805f60408486031215610d7557610d74610a25565b5b5f610d8286828701610d4a565b935050602084013567ffffffffffffffff811115610da357610da2610a29565b5b610daf86828701610c3c565b92509250509250925092565b5f60208284031215610dd057610dcf610a25565b5b5f610ddd84828501610d4a565b91505092915050565b5f819050919050565b610df881610de6565b82525050565b5f602082019050610e115f830184610def565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b610e4d81610aad565b8114610e57575f80fd5b50565b5f81359050610e6881610e44565b92915050565b5f60208284031215610e8357610e82610a25565b5b5f610e9084828501610e5a565b91505092915050565b5f610ea382610cdc565b9050919050565b610eb381610e99565b8114610ebd575f80fd5b50565b5f81359050610ece81610eaa565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610f1a82610ed4565b810181811067ffffffffffffffff82111715610f3957610f38610ee4565b5b80604052505050565b5f610f4b610a1c565b9050610f578282610f11565b919050565b5f67ffffffffffffffff821115610f7657610f75610ee4565b5b602082029050602081019050919050565b5f610f99610f9484610f5c565b610f42565b90508083825260208201905060208402830185811115610fbc57610fbb610ae8565b5b835b81811015610fe55780610fd18882610d4a565b845260208401935050602081019050610fbe565b5050509392505050565b5f82601f83011261100357611002610ae0565b5b8135611013848260208601610f87565b91505092915050565b5f806040838503121561103257611031610a25565b5b5f61103f85828601610ec0565b925050602083013567ffffffffffffffff8111156110605761105f610a29565b5b61106c85828601610fef565b915050925092905056fea2646970667358221220f8901ba0ad91db050edba1d0412882eecda8dba26237dd3383d77357c2f7173964736f6c634300081a0033",t=class t extends y.DeployableTarget{constructor(){super(...arguments),this.abi=c.S}async isAllowed(f,b){return await c.A2(this._config,{address:this.assertValidAddress(),args:[f,r.zeroHash],...this.optionallyAttachAccount(),...b})}async setDenied(f,b,d){return await this.awaitResult(this.setDeniedRaw(f,b,d))}async setDeniedRaw(f,b,d){const{request:a,result:e}=await c.k2(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...d});return{hash:await c.B2(this._config,a),result:e}}buildParameters(f,b){var s;const[d,a]=this.validateDeploymentConfig(f,b),e=d;if(!e.owner||e.owner===r.zeroAddress){const o=a.account?a.account.address:a.config?h.getAccount(a.config).address:(s=this._account)==null?void 0:s.address;if(o)e.owner=o;else throw new p.DeployableUnknownOwnerProvidedError}return{abi:c.S,bytecode:i,args:[u(e)],...this.optionallyAttachAccount(a.account)}}};t.base="0x7eb4E958D42b64fd1c4Ce947d05a755fCC7C30B7",t.registryType=w.RegistryType.ALLOW_LIST;let n=t;function u({owner:l,denied:f}){return r.encodeAbiParameters([{type:"address",name:"owner"},{type:"address[]",name:"denied"}],[l,f])}exports.SimpleDenyList=n;exports.bytecode=i;exports.prepareSimpleDenyListPayload=u;
2
- //# sourceMappingURL=SimpleDenyList-CqT0BMP7.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimpleDenyList-CqT0BMP7.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<\n Payload = SimpleDenyListPayload,\n> extends DeployableTarget<Payload | undefined, typeof simpleDenyListAbi> {\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?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [p, options] = this.validateDeploymentConfig(_payload, _options);\n const payload = p as SimpleDenyListPayload;\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","p","options","payload","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleDenyListPayload","RegistryType","SimpleDenyList","denied","encodeAbiParameters"],"mappings":"+5RA4EaA,EAAN,MAAMA,UAEHC,EAAAA,gBAAgE,CAFnE,aAAA,CAAA,MAAA,GAAA,SAAA,EAGL,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,EAAGC,CAAO,EAAI,KAAK,yBAAyBH,EAAUC,CAAQ,EAC/DG,EAAUF,EAChB,GAAI,CAACE,EAAQ,OAASA,EAAQ,QAAUC,EAAAA,YAAa,CACnD,MAAMC,EAAQH,EAAQ,QAClBA,EAAQ,QAAQ,QAChBA,EAAQ,OACNI,EAAA,WAAWJ,EAAQ,MAAM,EAAE,SAC3BK,EAAA,KAAK,WAAL,YAAAA,EAAe,QACrB,GAAIF,EACFF,EAAQ,MAAQE,MAEhB,OAAM,IAAIG,EAAoC,mCAElD,CACO,MAAA,CACL,IAAKpB,EAAA,EACL,SAAAqB,EACA,KAAM,CAACC,EAA6BP,CAAO,CAAC,EAC5C,GAAG,KAAK,wBAAwBD,EAAQ,OAAO,CAAA,CAEnD,CACF,EAnHyBhB,EAAA,KAAgB,6CASvCA,EAAuB,aAA6ByB,EAAa,aAAA,WApB5D,IAAMC,EAAN1B,EAwIA,SAASwB,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"}