@boostxyz/sdk 0.0.0-alpha.6 → 0.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +1 -1
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +3 -2
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +32 -34
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.d.ts +2 -2
- package/dist/AllowLists/AllowList.js +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +3 -3
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +1 -1
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +33 -1
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +286 -241
- 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 +14 -0
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +21 -5
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.js +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +8 -2
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +6 -0
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -1
- package/dist/Deployable/DeployableTarget.d.ts +4 -3
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +30 -27
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.js +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.js +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.js +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.js +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.js +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +1 -1
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +14 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +30 -21
- package/dist/errors.js.map +1 -1
- package/dist/{generated-Cd-Fe7W7.cjs → generated-BzszviNp.cjs} +3 -3
- package/dist/{generated-Cd-Fe7W7.cjs.map → generated-BzszviNp.cjs.map} +1 -1
- package/dist/{generated-DGpIVcv5.js → generated-Cbv8zFkf.js} +286 -278
- package/dist/{generated-DGpIVcv5.js.map → generated-Cbv8zFkf.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +105 -104
- package/package.json +1 -1
- package/src/Actions/EventAction.ts +10 -4
- package/src/AllowLists/SimpleAllowList.ts +3 -2
- package/src/BoostCore.ts +76 -13
- package/src/BoostRegistry.ts +21 -0
- package/src/Deployable/Deployable.ts +8 -2
- package/src/Deployable/DeployableTarget.ts +17 -4
- package/src/errors.ts +18 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BoostRegistry.d.ts","sourceRoot":"","sources":["../src/BoostRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAQjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAET,MAAM,MAAM,CAAC;AACd,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,OACP,CAAC;AAE/B;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,CAC1B,KAAK,SAAS,iBAAiB,CAAC,OAAO,gBAAgB,CAAC,GAAG,iBAAiB,CAC1E,OAAO,gBAAgB,CACxB,IACC,UAAU,CAAC,OAAO,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,WAAW,4BAA6B,SAAQ,iBAAiB;IACrE;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAeD;;;;;;;GAOG;AACH,MAAM,WAAW,+BAAgC,SAAQ,iBAAiB;IACxE;;;OAGG;IACH,OAAO,EAAE,IAAI,CAAC;CAC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ACU,qBAAqB,CAChC,UAAU,EAAE,GAAG,EACf,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,uBAAuB,CAAC;IAWvE;;;;;;;;OAQG;IACU,QAAQ,CACnB,UAAU,EAAE,GAAG,EACf,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,UAAU,CAAC;IAW1D;;;;;;;;OAQG;IACU,SAAS,CACpB,QAAQ,EAAE,OAAO,EACjB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,WAAW,CAAC;IAW3D;;;;;;;;;;;OAWG;IACU,kBAAkB,CAC7B,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,OAAO,EACjB,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,oBAAoB,CAAC;IAWpE;;;;;;;;;OASG;IACU,aAAa,CACxB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,eAAe,CAAC;IAW/D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,KAAK,EAAE,EAClB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;CAU3B"}
|
package/dist/BoostRegistry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as
|
|
1
|
+
import { h as n, I as o, N as l, d as h, g as t, i as y, m as i, e as u } from "./generated-Cbv8zFkf.js";
|
|
2
2
|
import { isAddress as g } from "viem";
|
|
3
3
|
import { Deployable as A } from "./Deployable/Deployable.js";
|
|
4
4
|
import { RegistryType as x } from "./utils.js";
|
|
@@ -54,7 +54,7 @@ class V extends A {
|
|
|
54
54
|
* @returns {unknown}
|
|
55
55
|
*/
|
|
56
56
|
async registerRaw(b, f, a, e) {
|
|
57
|
-
const { request: c, result: s } = await
|
|
57
|
+
const { request: c, result: s } = await n(
|
|
58
58
|
this._config,
|
|
59
59
|
{
|
|
60
60
|
address: this.assertValidAddress(),
|
|
@@ -64,7 +64,23 @@ class V extends A {
|
|
|
64
64
|
...e
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
return { hash: await
|
|
67
|
+
return { hash: await o(this._config, c), result: s };
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Initialize a new instance of a registered base implementation, returning the provided target with a new address set on it.
|
|
71
|
+
* This method is the same as `clone`, but serves to make its function more obvious as to why you'd need to use it.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
* @async
|
|
75
|
+
* @template {DeployableTarget} Target
|
|
76
|
+
* @param {string} displayName - The display name for the clone
|
|
77
|
+
* @param {Target} target - An instance of a target contract to clone and initialize
|
|
78
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
|
|
79
|
+
* @returns {Target} - The provided instance, but with a new address attached.
|
|
80
|
+
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
81
|
+
*/
|
|
82
|
+
async initialize(b, f, a) {
|
|
83
|
+
return this.clone(b, f, a);
|
|
68
84
|
}
|
|
69
85
|
/**
|
|
70
86
|
* Deploy a new instance of a registered base implementation, returning the provided target with a new address set on it.
|
|
@@ -196,7 +212,7 @@ class V extends A {
|
|
|
196
212
|
* @returns {Promise<Hex>} - The unique identifier for the clone
|
|
197
213
|
*/
|
|
198
214
|
async getCloneIdentifier(b, f, a, e, c) {
|
|
199
|
-
return
|
|
215
|
+
return i(this._config, {
|
|
200
216
|
address: this.assertValidAddress(),
|
|
201
217
|
args: [b, f, a, e],
|
|
202
218
|
...this.optionallyAttachAccount(),
|
|
@@ -215,7 +231,7 @@ class V extends A {
|
|
|
215
231
|
* @returns {Promise<Hex>} - The unique identifier for the implementation
|
|
216
232
|
*/
|
|
217
233
|
async getIdentifier(b, f, a) {
|
|
218
|
-
return
|
|
234
|
+
return i(this._config, {
|
|
219
235
|
address: this.assertValidAddress(),
|
|
220
236
|
args: [b, f],
|
|
221
237
|
...this.optionallyAttachAccount(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BoostRegistry.js","sources":["../src/BoostRegistry.ts"],"sourcesContent":["import {\n boostRegistryAbi,\n readBoostRegistryGetBaseImplementation,\n readBoostRegistryGetCloneIdentifier,\n readBoostRegistryGetClones,\n simulateBoostRegistryDeployClone,\n simulateBoostRegistryRegister,\n writeBoostRegistryDeployClone,\n writeBoostRegistryRegister,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/BoostRegistry.sol/BoostRegistry.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n isAddress,\n} from 'viem';\nimport {\n Deployable,\n type DeployableOptions,\n type GenericDeployableParams,\n} from './Deployable/Deployable';\nimport type { DeployableTarget } from './Deployable/DeployableTarget';\nimport {\n type GenericLog,\n type HashAndSimulatedResult,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from './utils';\n\nexport { RegistryType, boostRegistryAbi };\n\n/**\n * The fixed address for the Boost Registry.\n * By default, `new BoostRegistry` will use this address if not otherwise provided.\n *\n * @type {Address}\n */\nexport const BOOST_REGISTRY_ADDRESS: Address = import.meta.env\n .VITE_BOOST_REGISTRY_ADDRESS;\n\n/**\n * A record of `BoostRegistry` event names to `AbiEvent` objects for use with `getLogs`\n *\n * @export\n * @typedef {BoostRegistryLog}\n * @template {ContractEventName<typeof boostRegistryAbi>} [event=ContractEventName<\n * typeof boostRegistryAbi\n * >]\n */\nexport type BoostRegistryLog<\n event extends ContractEventName<typeof boostRegistryAbi> = ContractEventName<\n typeof boostRegistryAbi\n >,\n> = GenericLog<typeof boostRegistryAbi, event>;\n\n/**\n * Instantiation options for a previously deployed Boost Registry\n *\n * @export\n * @interface BoostRegistryDeployedOptions\n * @typedef {BoostRegistryDeployedOptions}\n * @extends {DeployableOptions}\n */\nexport interface BoostRegistryDeployedOptions extends DeployableOptions {\n /**\n * The address for a Boost Registry, if different than `BOOST_REGISTRY_ADDRESS`\n *\n * @type {?Address}\n */\n address?: Address;\n}\n\n/**\n * A typeguard to determine if instantiation is using a custom address.\n *\n * @param {*} opts\n * @returns {opts is BoostRegistryDeployedOptions}\n */\nfunction isBoostRegistryDeployed(\n // biome-ignore lint/suspicious/noExplicitAny: type guard\n opts: any,\n): opts is BoostRegistryDeployedOptions {\n return opts.address && isAddress(opts.address);\n}\n\n/**\n * The Boost Registry does not take any construction arguments, so if you'd like to deploy a new Boost Registry, pass an explicit null to the `address` field.\n *\n * @export\n * @interface BoostRegistryOptionsWithPayload\n * @typedef {BoostRegistryOptionsWithPayload}\n * @extends {DeployableOptions}\n */\nexport interface BoostRegistryOptionsWithPayload extends DeployableOptions {\n /**\n *\n * @type {null}\n */\n address: null;\n}\n\n/**\n * A typeguard to determine if the user is intending to deploy a new Boost Registry before usage\n *\n * @param {*} opts\n * @returns {opts is BoostRegistryOptionsWithPayload}\n */\nfunction isBoostRegistryDeployable(\n // biome-ignore lint/suspicious/noExplicitAny: type guard\n opts: any,\n): opts is BoostRegistryOptionsWithPayload {\n return opts.address === null;\n}\n\n/**\n * Instantiation options for a Boost Registry.\n *\n * @example\n * To target Boost's Registry, omit the address field.\n * Otherwise, supply a custom address to a previously deployed custom Boost Registry.\n * You can also pass `{ address: null }` if you are intending to deploy a new Boost Registry.\n * ```ts\n * let registry = new BoostRegistry({ config, account })\n * // or\n * registry = new BoostRegistry({ config, account, address: CUSTOM_ADDRESS })\n * // or\n * registry = new BoostRegistry({ config, account, address: null })\n * await registry.deploy()\n * ```\n *\n * @export\n * @typedef {BoostRegistryConfig}\n */\nexport type BoostRegistryConfig =\n | BoostRegistryDeployedOptions\n | BoostRegistryOptionsWithPayload;\n\n/**\n * Constructs a new Boost Registry. A registry for base implementations and cloned instances.\n * This contract is used to register base implementations and deploy new instances of those implementations for use within the Boost protocol.\n *\n * @see {@link BoostRegistryConfig}\n * @export\n * @class BoostRegistry\n * @typedef {BoostRegistry}\n * @extends {Deployable<never[]>}\n */\nexport class BoostRegistry extends Deployable<\n never[],\n typeof boostRegistryAbi\n> {\n /**\n * Creates an instance of BoostRegistry.\n *\n * @see {@link BoostRegistryConfig}\n * @constructor\n * @param {BoostRegistryConfig} param0\n * @param {Config} param0.config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {?Account} [param0.account] - [Viem Local Account](https://viem.sh/docs/accounts/local)\n * @param {({ address?: Address; } | {})} param0....options\n */\n constructor({ config, account, ...options }: BoostRegistryConfig) {\n if (isBoostRegistryDeployed(options) && options.address) {\n super({ account, config }, options.address);\n } else if (isBoostRegistryDeployable(options)) {\n super({ account, config }, []);\n } else {\n super({ account, config }, BOOST_REGISTRY_ADDRESS);\n }\n }\n\n /**\n * Register a new base implementation of a given type\n *\n * @public\n * @async\n * @param {RegistryType} registryType - The base type for the implementation\n * @param {string} name - A name for the implementation (must be unique within the given type)\n * @param {Address} implementation - The address of the implementation contract\n * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params] - Optional params to provide the underlying Viem contract call\n * @returns {unknown}\n * @example\n * ```ts\n * await registry.register(ContractAction.registryType, 'ContractAction', ContractAction.base)\n * ```\n */\n public async register(\n registryType: RegistryType,\n name: string,\n implementation: Address,\n params?: WriteParams<typeof boostRegistryAbi, 'register'>,\n ) {\n return this.awaitResult(\n this.registerRaw(registryType, name, implementation, params),\n );\n }\n\n /**\n * @see {@link register}\n * @public\n * @async\n * @param {RegistryType} registryType\n * @param {string} name\n * @param {Address} implementation\n * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params]\n * @returns {unknown}\n */\n public async registerRaw(\n registryType: RegistryType,\n name: string,\n implementation: Address,\n params?: WriteParams<typeof boostRegistryAbi, 'register'>,\n ) {\n const { request, result } = await simulateBoostRegistryRegister(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [registryType, name, implementation],\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 writeBoostRegistryRegister(this._config, request);\n return { hash, result };\n }\n\n /**\n * Deploy a new instance of a registered base implementation, returning the provided target with a new address set on it.\n *\n * @public\n * @async\n * @template {DeployableTarget} Target\n * @param {string} displayName - The display name for the clone\n * @param {Target} target - An instance of a target contract to clone and initialize\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {Target} - The provided instance, but with a new address attached.\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async clone<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<Target> {\n const instance = await this.deployClone(displayName, target, params);\n return target.at(instance);\n }\n\n /**\n *\n * @see {@link clone}\n * @public\n * @async\n * @template {DeployableTarget} Target\n * @param {string} displayName\n * @param {Target} target\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {Target}\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async deployClone<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<Address> {\n return this.awaitResult(this.deployCloneRaw(displayName, target, params));\n }\n\n /**\n * @see {@link clone}\n * @public\n * @async\n * @param {string} displayName\n * @param {DeployableTarget} target\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {unknown} - The transaction hash\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async deployCloneRaw<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<HashAndSimulatedResult<Address>> {\n const payload = target.buildParameters(undefined, {\n config: this._config,\n account: this._account,\n });\n const { request, result } = await simulateBoostRegistryDeployClone(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [\n target.registryType,\n target.base,\n displayName,\n payload.args.at(0)!,\n ],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeBoostRegistryDeployClone(this._config, request);\n return { hash, result };\n }\n\n /**\n * Get the address of a registered base implementation.\n * This function will revert if the implementation is not registered\n *\n * @public\n * @async\n * @param {Hex} identifier - The unique identifier for the implementation (see {getIdentifier})\n * @param {?ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>} [params]\n * @returns {unknown} - The address of the implementation\n */\n public async getBaseImplementation(\n identifier: Hex,\n params?: ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>,\n ) {\n return readBoostRegistryGetBaseImplementation(this._config, {\n address: this.assertValidAddress(),\n args: [identifier],\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 * Get the address of a deployed clone by its identifier (index in incentives array)\n *\n * @public\n * @async\n * @param {Hex} identifier - The unique identifier for the deployed clone (see {getCloneIdentifier})\n * @param {?ReadParams<typeof boostRegistryAbi, 'getClone'>} [params]\n * @returns {Promise<Address>} - The address of the deployed clone\n */\n public async getClone(\n identifier: Hex,\n params?: ReadParams<typeof boostRegistryAbi, 'getClone'>,\n ) {\n return readBoostRegistryGetBaseImplementation(this._config, {\n address: this.assertValidAddress(),\n args: [identifier],\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 * Get the list of identifiers of deployed clones for a given deployer\n *\n * @public\n * @async\n * @param {Address} deployer - The address of the deployer\n * @param {?ReadParams<typeof boostRegistryAbi, 'getClones'>} [params]\n * @returns {Promise<Address[]>} - The list of deployed clones for the given deployer\n */\n public async getClones(\n deployer: Address,\n params?: ReadParams<typeof boostRegistryAbi, 'getClones'>,\n ) {\n return readBoostRegistryGetClones(this._config, {\n address: this.assertValidAddress(),\n args: [deployer],\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 * Build the identifier for a clone of a base implementation\n *\n * @public\n * @async\n * @param {RegistryType} registryType - The base type for the implementation\n * @param {Address} base - The address of the base implementation\n * @param {Address} deployer - The address of the deployer\n * @param {string} displayName - The display name of the clone\n * @param {?ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>} [params]\n * @returns {Promise<Hex>} - The unique identifier for the clone\n */\n public async getCloneIdentifier(\n registryType: RegistryType,\n base: Address,\n deployer: Address,\n displayName: string,\n params?: ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>,\n ) {\n return readBoostRegistryGetCloneIdentifier(this._config, {\n address: this.assertValidAddress(),\n args: [registryType, base, deployer, displayName],\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 * Build the identifier for a base implementation\n *\n * @public\n * @async\n * @param {RegistryType} registryType - The base type for the implementation\n * @param {string} displayName - The name of the implementation\n * @param {?ReadParams<typeof boostRegistryAbi, 'getIdentifier'>} [params]\n * @returns {Promise<Hex>} - The unique identifier for the implementation\n */\n public async getIdentifier(\n registryType: RegistryType,\n displayName: string,\n params?: ReadParams<typeof boostRegistryAbi, 'getIdentifier'>,\n ) {\n return readBoostRegistryGetCloneIdentifier(this._config, {\n address: this.assertValidAddress(),\n args: [registryType, displayName],\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 * @inheritdoc\n *\n * @public\n * @param {?never[]} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: never[],\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [, options] = this.validateDeploymentConfig([], _options);\n return {\n abi: boostRegistryAbi,\n bytecode: bytecode as Hex,\n // biome-ignore lint/suspicious/noExplicitAny: Registry doesn't construct or initialize\n args: [] as any,\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["BOOST_REGISTRY_ADDRESS","isBoostRegistryDeployed","opts","isAddress","isBoostRegistryDeployable","BoostRegistry","Deployable","config","account","options","registryType","name","implementation","params","request","result","simulateBoostRegistryRegister","writeBoostRegistryRegister","displayName","target","instance","payload","simulateBoostRegistryDeployClone","writeBoostRegistryDeployClone","identifier","readBoostRegistryGetBaseImplementation","deployer","readBoostRegistryGetClones","base","readBoostRegistryGetCloneIdentifier","_payload","_options","boostRegistryAbi","bytecode"],"mappings":";;;;oubAuCaA,IAAkC;AAyC/C,SAASC,EAEPC,GACsC;AACtC,SAAOA,EAAK,WAAWC,EAAUD,EAAK,OAAO;AAC/C;AAwBA,SAASE,EAEPF,GACyC;AACzC,SAAOA,EAAK,YAAY;AAC1B;AAmCO,MAAMG,UAAsBC,EAGjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,YAAY,EAAE,QAAAC,GAAQ,SAAAC,GAAS,GAAGC,KAAgC;AAChE,IAAIR,EAAwBQ,CAAO,KAAKA,EAAQ,UAC9C,MAAM,EAAE,SAAAD,GAAS,QAAAD,EAAO,GAAGE,EAAQ,OAAO,IACjCL,EAA0BK,CAAO,IAC1C,MAAM,EAAE,SAAAD,GAAS,QAAAD,EAAO,GAAG,CAAE,CAAA,IAE7B,MAAM,EAAE,SAAAC,GAAS,QAAAD,EAAO,GAAGP,CAAsB;AAAA,EAErD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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;AAAA;AAAA;AAAA;AAAA,EAcA,MAAa,mBACXH,GACAkB,GACAF,GACAR,GACAL,GACA;AACO,WAAAgB,EAAoC,KAAK,SAAS;AAAA,MACvD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACnB,GAAckB,GAAMF,GAAUR,CAAW;AAAA,MAChD,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIL;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAa,cACXH,GACAQ,GACAL,GACA;AACO,WAAAgB,EAAoC,KAAK,SAAS;AAAA,MACvD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACnB,GAAcQ,CAAW;AAAA,MAChC,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIL;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdiB,GACAC,GACyB;AACnB,UAAA,CAAA,EAAGtB,CAAO,IAAI,KAAK,yBAAyB,CAAA,GAAIsB,CAAQ;AACvD,WAAA;AAAA,MACL,KAAKC;AAAAA,MACL,UAAAC;AAAA;AAAA,MAEA,MAAM,CAAC;AAAA,MACP,GAAG,KAAK,wBAAwBxB,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;"}
|
|
1
|
+
{"version":3,"file":"BoostRegistry.js","sources":["../src/BoostRegistry.ts"],"sourcesContent":["import {\n boostRegistryAbi,\n readBoostRegistryGetBaseImplementation,\n readBoostRegistryGetCloneIdentifier,\n readBoostRegistryGetClones,\n simulateBoostRegistryDeployClone,\n simulateBoostRegistryRegister,\n writeBoostRegistryDeployClone,\n writeBoostRegistryRegister,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/BoostRegistry.sol/BoostRegistry.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n isAddress,\n} from 'viem';\nimport {\n Deployable,\n type DeployableOptions,\n type GenericDeployableParams,\n} from './Deployable/Deployable';\nimport type { DeployableTarget } from './Deployable/DeployableTarget';\nimport {\n type GenericLog,\n type HashAndSimulatedResult,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from './utils';\n\nexport { RegistryType, boostRegistryAbi };\n\n/**\n * The fixed address for the Boost Registry.\n * By default, `new BoostRegistry` will use this address if not otherwise provided.\n *\n * @type {Address}\n */\nexport const BOOST_REGISTRY_ADDRESS: Address = import.meta.env\n .VITE_BOOST_REGISTRY_ADDRESS;\n\n/**\n * A record of `BoostRegistry` event names to `AbiEvent` objects for use with `getLogs`\n *\n * @export\n * @typedef {BoostRegistryLog}\n * @template {ContractEventName<typeof boostRegistryAbi>} [event=ContractEventName<\n * typeof boostRegistryAbi\n * >]\n */\nexport type BoostRegistryLog<\n event extends ContractEventName<typeof boostRegistryAbi> = ContractEventName<\n typeof boostRegistryAbi\n >,\n> = GenericLog<typeof boostRegistryAbi, event>;\n\n/**\n * Instantiation options for a previously deployed Boost Registry\n *\n * @export\n * @interface BoostRegistryDeployedOptions\n * @typedef {BoostRegistryDeployedOptions}\n * @extends {DeployableOptions}\n */\nexport interface BoostRegistryDeployedOptions extends DeployableOptions {\n /**\n * The address for a Boost Registry, if different than `BOOST_REGISTRY_ADDRESS`\n *\n * @type {?Address}\n */\n address?: Address;\n}\n\n/**\n * A typeguard to determine if instantiation is using a custom address.\n *\n * @param {*} opts\n * @returns {opts is BoostRegistryDeployedOptions}\n */\nfunction isBoostRegistryDeployed(\n // biome-ignore lint/suspicious/noExplicitAny: type guard\n opts: any,\n): opts is BoostRegistryDeployedOptions {\n return opts.address && isAddress(opts.address);\n}\n\n/**\n * The Boost Registry does not take any construction arguments, so if you'd like to deploy a new Boost Registry, pass an explicit null to the `address` field.\n *\n * @export\n * @interface BoostRegistryOptionsWithPayload\n * @typedef {BoostRegistryOptionsWithPayload}\n * @extends {DeployableOptions}\n */\nexport interface BoostRegistryOptionsWithPayload extends DeployableOptions {\n /**\n *\n * @type {null}\n */\n address: null;\n}\n\n/**\n * A typeguard to determine if the user is intending to deploy a new Boost Registry before usage\n *\n * @param {*} opts\n * @returns {opts is BoostRegistryOptionsWithPayload}\n */\nfunction isBoostRegistryDeployable(\n // biome-ignore lint/suspicious/noExplicitAny: type guard\n opts: any,\n): opts is BoostRegistryOptionsWithPayload {\n return opts.address === null;\n}\n\n/**\n * Instantiation options for a Boost Registry.\n *\n * @example\n * To target Boost's Registry, omit the address field.\n * Otherwise, supply a custom address to a previously deployed custom Boost Registry.\n * You can also pass `{ address: null }` if you are intending to deploy a new Boost Registry.\n * ```ts\n * let registry = new BoostRegistry({ config, account })\n * // or\n * registry = new BoostRegistry({ config, account, address: CUSTOM_ADDRESS })\n * // or\n * registry = new BoostRegistry({ config, account, address: null })\n * await registry.deploy()\n * ```\n *\n * @export\n * @typedef {BoostRegistryConfig}\n */\nexport type BoostRegistryConfig =\n | BoostRegistryDeployedOptions\n | BoostRegistryOptionsWithPayload;\n\n/**\n * Constructs a new Boost Registry. A registry for base implementations and cloned instances.\n * This contract is used to register base implementations and deploy new instances of those implementations for use within the Boost protocol.\n *\n * @see {@link BoostRegistryConfig}\n * @export\n * @class BoostRegistry\n * @typedef {BoostRegistry}\n * @extends {Deployable<never[]>}\n */\nexport class BoostRegistry extends Deployable<\n never[],\n typeof boostRegistryAbi\n> {\n /**\n * Creates an instance of BoostRegistry.\n *\n * @see {@link BoostRegistryConfig}\n * @constructor\n * @param {BoostRegistryConfig} param0\n * @param {Config} param0.config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {?Account} [param0.account] - [Viem Local Account](https://viem.sh/docs/accounts/local)\n * @param {({ address?: Address; } | {})} param0....options\n */\n constructor({ config, account, ...options }: BoostRegistryConfig) {\n if (isBoostRegistryDeployed(options) && options.address) {\n super({ account, config }, options.address);\n } else if (isBoostRegistryDeployable(options)) {\n super({ account, config }, []);\n } else {\n super({ account, config }, BOOST_REGISTRY_ADDRESS);\n }\n }\n\n /**\n * Register a new base implementation of a given type\n *\n * @public\n * @async\n * @param {RegistryType} registryType - The base type for the implementation\n * @param {string} name - A name for the implementation (must be unique within the given type)\n * @param {Address} implementation - The address of the implementation contract\n * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params] - Optional params to provide the underlying Viem contract call\n * @returns {unknown}\n * @example\n * ```ts\n * await registry.register(ContractAction.registryType, 'ContractAction', ContractAction.base)\n * ```\n */\n public async register(\n registryType: RegistryType,\n name: string,\n implementation: Address,\n params?: WriteParams<typeof boostRegistryAbi, 'register'>,\n ) {\n return this.awaitResult(\n this.registerRaw(registryType, name, implementation, params),\n );\n }\n\n /**\n * @see {@link register}\n * @public\n * @async\n * @param {RegistryType} registryType\n * @param {string} name\n * @param {Address} implementation\n * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params]\n * @returns {unknown}\n */\n public async registerRaw(\n registryType: RegistryType,\n name: string,\n implementation: Address,\n params?: WriteParams<typeof boostRegistryAbi, 'register'>,\n ) {\n const { request, result } = await simulateBoostRegistryRegister(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [registryType, name, implementation],\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 writeBoostRegistryRegister(this._config, request);\n return { hash, result };\n }\n\n /**\n * Initialize a new instance of a registered base implementation, returning the provided target with a new address set on it.\n * This method is the same as `clone`, but serves to make its function more obvious as to why you'd need to use it.\n *\n * @public\n * @async\n * @template {DeployableTarget} Target\n * @param {string} displayName - The display name for the clone\n * @param {Target} target - An instance of a target contract to clone and initialize\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {Target} - The provided instance, but with a new address attached.\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async initialize<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<Target> {\n return this.clone(displayName, target, params);\n }\n\n /**\n * Deploy a new instance of a registered base implementation, returning the provided target with a new address set on it.\n *\n * @public\n * @async\n * @template {DeployableTarget} Target\n * @param {string} displayName - The display name for the clone\n * @param {Target} target - An instance of a target contract to clone and initialize\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {Target} - The provided instance, but with a new address attached.\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async clone<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<Target> {\n const instance = await this.deployClone(displayName, target, params);\n return target.at(instance);\n }\n\n /**\n *\n * @see {@link clone}\n * @public\n * @async\n * @template {DeployableTarget} Target\n * @param {string} displayName\n * @param {Target} target\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {Target}\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async deployClone<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<Address> {\n return this.awaitResult(this.deployCloneRaw(displayName, target, params));\n }\n\n /**\n * @see {@link clone}\n * @public\n * @async\n * @param {string} displayName\n * @param {DeployableTarget} target\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {unknown} - The transaction hash\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async deployCloneRaw<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<HashAndSimulatedResult<Address>> {\n const payload = target.buildParameters(undefined, {\n config: this._config,\n account: this._account,\n });\n const { request, result } = await simulateBoostRegistryDeployClone(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [\n target.registryType,\n target.base,\n displayName,\n payload.args.at(0)!,\n ],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeBoostRegistryDeployClone(this._config, request);\n return { hash, result };\n }\n\n /**\n * Get the address of a registered base implementation.\n * This function will revert if the implementation is not registered\n *\n * @public\n * @async\n * @param {Hex} identifier - The unique identifier for the implementation (see {getIdentifier})\n * @param {?ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>} [params]\n * @returns {unknown} - The address of the implementation\n */\n public async getBaseImplementation(\n identifier: Hex,\n params?: ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>,\n ) {\n return readBoostRegistryGetBaseImplementation(this._config, {\n address: this.assertValidAddress(),\n args: [identifier],\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 * Get the address of a deployed clone by its identifier (index in incentives array)\n *\n * @public\n * @async\n * @param {Hex} identifier - The unique identifier for the deployed clone (see {getCloneIdentifier})\n * @param {?ReadParams<typeof boostRegistryAbi, 'getClone'>} [params]\n * @returns {Promise<Address>} - The address of the deployed clone\n */\n public async getClone(\n identifier: Hex,\n params?: ReadParams<typeof boostRegistryAbi, 'getClone'>,\n ) {\n return readBoostRegistryGetBaseImplementation(this._config, {\n address: this.assertValidAddress(),\n args: [identifier],\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 * Get the list of identifiers of deployed clones for a given deployer\n *\n * @public\n * @async\n * @param {Address} deployer - The address of the deployer\n * @param {?ReadParams<typeof boostRegistryAbi, 'getClones'>} [params]\n * @returns {Promise<Address[]>} - The list of deployed clones for the given deployer\n */\n public async getClones(\n deployer: Address,\n params?: ReadParams<typeof boostRegistryAbi, 'getClones'>,\n ) {\n return readBoostRegistryGetClones(this._config, {\n address: this.assertValidAddress(),\n args: [deployer],\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 * Build the identifier for a clone of a base implementation\n *\n * @public\n * @async\n * @param {RegistryType} registryType - The base type for the implementation\n * @param {Address} base - The address of the base implementation\n * @param {Address} deployer - The address of the deployer\n * @param {string} displayName - The display name of the clone\n * @param {?ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>} [params]\n * @returns {Promise<Hex>} - The unique identifier for the clone\n */\n public async getCloneIdentifier(\n registryType: RegistryType,\n base: Address,\n deployer: Address,\n displayName: string,\n params?: ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>,\n ) {\n return readBoostRegistryGetCloneIdentifier(this._config, {\n address: this.assertValidAddress(),\n args: [registryType, base, deployer, displayName],\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 * Build the identifier for a base implementation\n *\n * @public\n * @async\n * @param {RegistryType} registryType - The base type for the implementation\n * @param {string} displayName - The name of the implementation\n * @param {?ReadParams<typeof boostRegistryAbi, 'getIdentifier'>} [params]\n * @returns {Promise<Hex>} - The unique identifier for the implementation\n */\n public async getIdentifier(\n registryType: RegistryType,\n displayName: string,\n params?: ReadParams<typeof boostRegistryAbi, 'getIdentifier'>,\n ) {\n return readBoostRegistryGetCloneIdentifier(this._config, {\n address: this.assertValidAddress(),\n args: [registryType, displayName],\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 * @inheritdoc\n *\n * @public\n * @param {?never[]} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: never[],\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [, options] = this.validateDeploymentConfig([], _options);\n return {\n abi: boostRegistryAbi,\n bytecode: bytecode as Hex,\n // biome-ignore lint/suspicious/noExplicitAny: Registry doesn't construct or initialize\n args: [] as any,\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["BOOST_REGISTRY_ADDRESS","isBoostRegistryDeployed","opts","isAddress","isBoostRegistryDeployable","BoostRegistry","Deployable","config","account","options","registryType","name","implementation","params","request","result","simulateBoostRegistryRegister","writeBoostRegistryRegister","displayName","target","instance","payload","simulateBoostRegistryDeployClone","writeBoostRegistryDeployClone","identifier","readBoostRegistryGetBaseImplementation","deployer","readBoostRegistryGetClones","base","readBoostRegistryGetCloneIdentifier","_payload","_options","boostRegistryAbi","bytecode"],"mappings":";;;;oubAuCaA,IAAkC;AAyC/C,SAASC,EAEPC,GACsC;AACtC,SAAOA,EAAK,WAAWC,EAAUD,EAAK,OAAO;AAC/C;AAwBA,SAASE,EAEPF,GACyC;AACzC,SAAOA,EAAK,YAAY;AAC1B;AAmCO,MAAMG,UAAsBC,EAGjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,YAAY,EAAE,QAAAC,GAAQ,SAAAC,GAAS,GAAGC,KAAgC;AAChE,IAAIR,EAAwBQ,CAAO,KAAKA,EAAQ,UAC9C,MAAM,EAAE,SAAAD,GAAS,QAAAD,EAAO,GAAGE,EAAQ,OAAO,IACjCL,EAA0BK,CAAO,IAC1C,MAAM,EAAE,SAAAD,GAAS,QAAAD,EAAO,GAAG,CAAE,CAAA,IAE7B,MAAM,EAAE,SAAAC,GAAS,QAAAD,EAAO,GAAGP,CAAsB;AAAA,EAErD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAi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,CAACD,CAAQ;AAAA,MACf,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIb;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAa,mBACXH,GACAkB,GACAF,GACAR,GACAL,GACA;AACO,WAAAgB,EAAoC,KAAK,SAAS;AAAA,MACvD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACnB,GAAckB,GAAMF,GAAUR,CAAW;AAAA,MAChD,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIL;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAa,cACXH,GACAQ,GACAL,GACA;AACO,WAAAgB,EAAoC,KAAK,SAAS;AAAA,MACvD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACnB,GAAcQ,CAAW;AAAA,MAChC,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIL;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdiB,GACAC,GACyB;AACnB,UAAA,CAAA,EAAGtB,CAAO,IAAI,KAAK,yBAAyB,CAAA,GAAIsB,CAAQ;AACvD,WAAA;AAAA,MACL,KAAKC;AAAAA,MACL,UAAAC;AAAA;AAAA,MAEA,MAAM,CAAC;AAAA,MACP,GAAG,KAAK,wBAAwBxB,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;"}
|
package/dist/Budgets/Budget.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-BzszviNp.cjs"),d=require("../componentInterfaces-CKCBwG16.cjs"),u=require("@wagmi/core"),g=require("../errors.cjs"),a=require("./ManagedBudget.cjs"),e={[d.AManagedBudget]:a.ManagedBudget};async function i(t,n){const r=await u.readContract(t.config,{abi:c.z,functionName:"getComponentInterface",address:n}),o=e[r];if(!o)throw new g.InvalidComponentInterfaceError(Object.keys(e),r);return new o(t,n)}exports.ManagedBudget=a.ManagedBudget;exports.BudgetByComponentInterface=e;exports.budgetFromAddress=i;
|
|
2
2
|
//# sourceMappingURL=Budget.cjs.map
|
package/dist/Budgets/Budget.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a } from "../generated-
|
|
1
|
+
import { a } from "../generated-Cbv8zFkf.js";
|
|
2
2
|
import { c as m } from "../componentInterfaces-DYkaxBda.js";
|
|
3
3
|
import { readContract as c } from "@wagmi/core";
|
|
4
4
|
import { InvalidComponentInterfaceError as f } from "../errors.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../generated-Cd-Fe7W7.cjs"),g=require("@wagmi/core"),A=require("viem"),y=require("../Deployable/DeployableTarget.cjs"),l=require("../errors.cjs"),i=require("../utils.cjs"),p="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6134c9806100bd5f395ff3fe608060405260043610610207575f3560e01c806361400c9911610117578063ec87621c1161009f578063f8724aba1161006e578063f8724aba1461076e578063f9a802c3146107aa578063fa4ca9b1146107e6578063fe9fbb8014610822578063fee81cf41461085e5761020e565b8063ec87621c146106d0578063f04e283e146106fa578063f23a6e6114610716578063f2fde38b146107525761020e565b806380fd6005116100e657806380fd6005146105de5780638da5cb5b14610606578063bc197c8114610630578063d2514e841461066c578063e6670829146106a85761020e565b806361400c9914610532578063715018a61461056e57806375b238fc14610578578063774c33ab146105a25761020e565b80634359d28a1161019a5780634a4ee7b1116101695780634a4ee7b114610464578063514e62fc1461048057806354d1f13d146104bc578063578bcf35146104c65780635aef467a146105025761020e565b80634359d28a1461039c578063439fab91146103c4578063451cc191146103ec578063474f5a44146104285761020e565b80631cd64df4116101d65780631cd64df4146102f0578063256929621461032c57806328d6183b146103365780632de94807146103605761020e565b806301ffc9a71461024057806310098ad51461027c578063183a4f6e146102b85780631c10893f146102d45761020e565b3661020e57005b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b34801561024b575f80fd5b50610266600480360381019061026191906124b2565b61089a565b60405161027391906124f7565b60405180910390f35b348015610287575f80fd5b506102a2600480360381019061029d919061256a565b6109e3565b6040516102af91906125ad565b60405180910390f35b6102d260048036038101906102cd91906125f0565b610a4e565b005b6102ee60048036038101906102e9919061261b565b610a5b565b005b3480156102fb575f80fd5b506103166004803603810190610311919061261b565b610a71565b60405161032391906124f7565b60405180910390f35b610334610a87565b005b348015610341575f80fd5b5061034a610ad8565b6040516103579190612668565b60405180910390f35b34801561036b575f80fd5b506103866004803603810190610381919061256a565b610aff565b60405161039391906125ad565b60405180910390f35b3480156103a7575f80fd5b506103c260048036038101906103bd9190612737565b610b18565b005b3480156103cf575f80fd5b506103ea60048036038101906103e5919061280a565b610c26565b005b3480156103f7575f80fd5b50610412600480360381019061040d919061280a565b610d1e565b60405161041f91906125ad565b60405180910390f35b348015610433575f80fd5b5061044e6004803603810190610449919061280a565b610d25565b60405161045b91906124f7565b60405180910390f35b61047e6004803603810190610479919061261b565b610f0f565b005b34801561048b575f80fd5b506104a660048036038101906104a1919061261b565b610f25565b6040516104b391906124f7565b60405180910390f35b6104c4610f3c565b005b3480156104d1575f80fd5b506104ec60048036038101906104e7919061256a565b610f75565b6040516104f991906125ad565b60405180910390f35b61051c6004803603810190610517919061280a565b610fba565b60405161052991906124f7565b60405180910390f35b34801561053d575f80fd5b50610558600480360381019061055391906128aa565b61132a565b60405161056591906124f7565b60405180910390f35b61057661138e565b005b348015610583575f80fd5b5061058c6113a1565b60405161059991906125ad565b60405180910390f35b3480156105ad575f80fd5b506105c860048036038101906105c3919061261b565b6113a6565b6040516105d591906125ad565b60405180910390f35b3480156105e9575f80fd5b5061060460048036038101906105ff919061294a565b6113fc565b005b348015610611575f80fd5b5061061a6114b2565b60405161062791906129d7565b60405180910390f35b34801561063b575f80fd5b50610656600480360381019061065191906129f0565b6114da565b6040516106639190612668565b60405180910390f35b348015610677575f80fd5b50610692600480360381019061068d919061256a565b6114f1565b60405161069f91906125ad565b60405180910390f35b3480156106b3575f80fd5b506106ce60048036038101906106c9919061294a565b611549565b005b3480156106db575f80fd5b506106e46115ff565b6040516106f191906125ad565b60405180910390f35b610714600480360381019061070f919061256a565b611604565b005b348015610721575f80fd5b5061073c60048036038101906107379190612ac7565b611642565b6040516107499190612668565b60405180910390f35b61076c6004803603810190610767919061256a565b611657565b005b348015610779575f80fd5b50610794600480360381019061078f919061261b565b611680565b6040516107a191906125ad565b60405180910390f35b3480156107b5575f80fd5b506107d060048036038101906107cb919061261b565b611702565b6040516107dd91906125ad565b60405180910390f35b3480156107f1575f80fd5b5061080c6004803603810190610807919061280a565b6117db565b60405161081991906124f7565b60405180910390f35b34801561082d575f80fd5b506108486004803603810190610843919061256a565b611a57565b60405161085591906124f7565b60405180910390f35b348015610869575f80fd5b50610884600480360381019061087f919061256a565b611aaa565b60405161089191906125ad565b60405180910390f35b5f7fa0109882000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061096457507f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109cc57507f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109dc57506109db82611ac3565b5b9050919050565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a4557610a40308373ffffffffffffffffffffffffffffffffffffffff16611b3c90919063ffffffff16565b610a47565b475b9050919050565b610a583382611b6f565b50565b610a63611b7e565b610a6d8282611bb5565b5050565b5f8182610a7d85610aff565b1614905092915050565b5f610a90611bc5565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7fa010988200000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b6002610b2381611bcf565b828290508585905014610b62576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610c1e575f848483818110610b8357610b82612b5d565b5b9050602002016020810190610b989190612bb4565b90506001151581151503610bdd57610bd8878784818110610bbc57610bbb612b5d565b5b9050602002016020810190610bd1919061256a565b6001611bb5565b610c10565b610c0f878784818110610bf357610bf2612b5d565b5b9050602002016020810190610c08919061256a565b6001611b6f565b5b508080600101915050610b64565b505050505050565b5f610c2f611c04565b90508054600382558015610c615760018160011c14303b10610c585763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610c729190612e88565b9050610c80815f0151611c2d565b5f5b816020015151811015610ce257610cd582602001518281518110610ca957610ca8612b5d565b5b602002602001015183604001518381518110610cc857610cc7612b5d565b5b6020026020010151611d03565b8080600101915050610c82565b50508015610d19576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f92915050565b5f6002610d3181611bcf565b5f8484810190610d419190613033565b90505f6002811115610d5657610d5561307a565b5b815f01516002811115610d6c57610d6b61307a565b5b1480610d9f575060016002811115610d8757610d8661307a565b5b815f01516002811115610d9d57610d9c61307a565b5b145b15610df8575f8160600151806020019051810190610dbd91906130f4565b9050610df2826020015183604001515f845f015114610ddf57835f0151610ded565b610dec85602001516109e3565b5b611d44565b50610f02565b600280811115610e0b57610e0a61307a565b5b815f01516002811115610e2157610e2061307a565b5b03610ef8575f8160600151806020019051810190610e3f9190613218565b9050610ef282602001518360400151835f01515f856020015114610e67578460200151610ee8565b856020015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e30875f01516040518363ffffffff1660e01b8152600401610ea892919061325f565b602060405180830381865afa158015610ec3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ee79190613286565b5b8560400151611f5c565b50610f01565b5f925050610f08565b5b60019250505b5092915050565b610f17611b7e565b610f218282611b6f565b5050565b5f8082610f3185610aff565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b5f808383810190610fcb9190613033565b90505f6002811115610fe057610fdf61307a565b5b815f01516002811115610ff657610ff561307a565b5b0361106c575f816060015180602001905181019061101491906130f4565b9050805f01513414611066578160200151815f01516040517fcece04c500000000000000000000000000000000000000000000000000000000815260040161105d92919061325f565b60405180910390fd5b5061131e565b600160028111156110805761107f61307a565b5b815f015160028111156110965761109561307a565b5b03611171575f81606001518060200190518101906110b491906130f4565b90506110ee826040015130835f0151856020015173ffffffffffffffffffffffffffffffffffffffff16612188909392919063ffffffff16565b805f015161111f30846020015173ffffffffffffffffffffffffffffffffffffffff16611b3c90919063ffffffff16565b101561116b578160200151815f01516040517fcece04c500000000000000000000000000000000000000000000000000000000815260040161116292919061325f565b60405180910390fd5b5061131d565b6002808111156111845761118361307a565b5b815f0151600281111561119a5761119961307a565b5b03611313575f81606001518060200190518101906111b89190613218565b9050816020015173ffffffffffffffffffffffffffffffffffffffff1663f242432a836040015130845f0151856020015186604001516040518663ffffffff1660e01b815260040161120e959493929190613303565b5f604051808303815f87803b158015611225575f80fd5b505af1158015611237573d5f803e3d5ffd5b505050508060200151826020015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e30845f01516040518363ffffffff1660e01b815260040161128192919061325f565b602060405180830381865afa15801561129c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112c09190613286565b101561130d57816020015181602001516040517fcece04c500000000000000000000000000000000000000000000000000000000815260040161130492919061325f565b60405180910390fd5b5061131c565b5f915050611324565b5b5b60019150505b92915050565b5f805f90505b838390508110156113825761136884848381811061135157611350612b5d565b5b90506020028101906113639190613367565b6117db565b611375575f915050611388565b8080600101915050611330565b50600190505b92915050565b611396611b7e565b61139f5f6121e2565b565b600281565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8381526020019081526020015f2054905092915050565b600261140781611bcf565b828290508585905014611446576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156114aa5761149d86868381811061146957611468612b5d565b5b905060200201602081019061147e919061256a565b85858481811061149157611490612b5d565b5b90506020020135611b6f565b8080600101915050611448565b505050505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f63bc197c8160e01b905098975050505050505050565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054611538836109e3565b61154291906133f6565b9050919050565b600261155481611bcf565b828290508585905014611593576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156115f7576115ea8686838181106115b6576115b5612b5d565b5b90506020020160208101906115cb919061256a565b8585848181106115de576115dd612b5d565b5b90506020020135611bb5565b8080600101915050611595565b505050505050565b600181565b61160c611b7e565b63389a75e1600c52805f526020600c20805442111561163257636f5e88185f526004601cfd5b5f81555061163f816121e2565b50565b5f63f23a6e6160e01b90509695505050505050565b61165f611b7e565b8060601b61167457637448fbae5f526004601cfd5b61167d816121e2565b50565b5f8273ffffffffffffffffffffffffffffffffffffffff1662fdd58e30846040518363ffffffff1660e01b81526004016116bb92919061325f565b602060405180830381865afa1580156116d6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116fa9190613286565b905092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8381526020019081526020015f20548373ffffffffffffffffffffffffffffffffffffffff1662fdd58e30856040518363ffffffff1660e01b815260040161178a92919061325f565b602060405180830381865afa1580156117a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117c99190613286565b6117d391906133f6565b905092915050565b5f60016002176117ea81611bcf565b5f84848101906117fa9190613033565b9050600160028111156118105761180f61307a565b5b815f015160028111156118265761182561307a565b5b148061185857505f60028111156118405761183f61307a565b5b815f015160028111156118565761185561307a565b5b145b156118f8575f816060015180602001905181019061187691906130f4565b90505f61188683602001516109e3565b905080825f015111156118db57826020015181835f01516040517f5c54305e0000000000000000000000000000000000000000000000000000000081526004016118d293929190613429565b60405180910390fd5b6118f183602001518460400151845f0151611d44565b5050611a4a565b60028081111561190b5761190a61307a565b5b815f015160028111156119215761192061307a565b5b03611a40575f816060015180602001905181019061193f9190613218565b90505f826020015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e30845f01516040518363ffffffff1660e01b815260040161198392919061325f565b602060405180830381865afa15801561199e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119c29190613286565b90508082602001511115611a195782602001518183602001516040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401611a1093929190613429565b60405180910390fd5b611a3983602001518460400151845f015185602001518660400151611f5c565b5050611a49565b5f925050611a50565b5b60019250505b5092915050565b5f8173ffffffffffffffffffffffffffffffffffffffff16611a776114b2565b73ffffffffffffffffffffffffffffffffffffffff161480611aa35750611aa2826002600117610f25565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fea5ad34e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b355750611b34826122a8565b5b9050919050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b611b7a82825f612321565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611bb3576382b429005f526004601cfd5b565b611bc182826001612321565b5050565b5f6202a300905090565b638b78c6d819543314611c0157638b78c6d8600c52335f52806020600c205416611c00576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611c35612379565b15611cad577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415611c6f57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611d00565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b3068929eee149b4bd212685403611d625763ab143c065f526004601cfd5b3068929eee149b4bd21268555f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611de2578282826040517fbf182be8000000000000000000000000000000000000000000000000000000008152600401611dd99392919061345e565b60405180910390fd5b611deb836109e3565b811115611e3b5782611dfc846109e3565b826040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401611e3293929190613429565b60405180910390fd5b805f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254611e8691906133f6565b925050819055505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611ecf57611eca828261237d565b611efb565b611efa82828573ffffffffffffffffffffffffffffffffffffffff1661239a9092919063ffffffff16565b5b8273ffffffffffffffffffffffffffffffffffffffff167fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd435428383604051611f4392919061325f565b60405180910390a23868929eee149b4bd2126855505050565b3068929eee149b4bd212685403611f7a5763ab143c065f526004601cfd5b3068929eee149b4bd21268555f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611ffa578484836040517fbf182be8000000000000000000000000000000000000000000000000000000008152600401611ff19392919061345e565b60405180910390fd5b6120048584611680565b82111561205557846120168685611680565b836040517f5c54305e00000000000000000000000000000000000000000000000000000000815260040161204c93929190613429565b60405180910390fd5b8160015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8581526020019081526020015f205f8282546120b091906133f6565b925050819055508473ffffffffffffffffffffffffffffffffffffffff1663f242432a30868686866040518663ffffffff1660e01b81526004016120f8959493929190613303565b5f604051808303815f87803b15801561210f575f80fd5b505af1158015612121573d5f803e3d5ffd5b505050508473ffffffffffffffffffffffffffffffffffffffff167fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542858460405161216d92919061325f565b60405180910390a23868929eee149b4bd21268555050505050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f511417166121d357637939f4245f526004601cfd5b5f606052806040525050505050565b6121ea612379565b1561224f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506122a5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061231a5750612319826123e3565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361234357848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f385f3884865af16123965763b12d13eb5f526004601cfd5b5050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166123da576390b8ec185f526004601cfd5b5f603452505050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6124918161245d565b811461249b575f80fd5b50565b5f813590506124ac81612488565b92915050565b5f602082840312156124c7576124c6612455565b5b5f6124d48482850161249e565b91505092915050565b5f8115159050919050565b6124f1816124dd565b82525050565b5f60208201905061250a5f8301846124e8565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61253982612510565b9050919050565b6125498161252f565b8114612553575f80fd5b50565b5f8135905061256481612540565b92915050565b5f6020828403121561257f5761257e612455565b5b5f61258c84828501612556565b91505092915050565b5f819050919050565b6125a781612595565b82525050565b5f6020820190506125c05f83018461259e565b92915050565b6125cf81612595565b81146125d9575f80fd5b50565b5f813590506125ea816125c6565b92915050565b5f6020828403121561260557612604612455565b5b5f612612848285016125dc565b91505092915050565b5f806040838503121561263157612630612455565b5b5f61263e85828601612556565b925050602061264f858286016125dc565b9150509250929050565b6126628161245d565b82525050565b5f60208201905061267b5f830184612659565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126126a2576126a1612681565b5b8235905067ffffffffffffffff8111156126bf576126be612685565b5b6020830191508360208202830111156126db576126da612689565b5b9250929050565b5f8083601f8401126126f7576126f6612681565b5b8235905067ffffffffffffffff81111561271457612713612685565b5b6020830191508360208202830111156127305761272f612689565b5b9250929050565b5f805f806040858703121561274f5761274e612455565b5b5f85013567ffffffffffffffff81111561276c5761276b612459565b5b6127788782880161268d565b9450945050602085013567ffffffffffffffff81111561279b5761279a612459565b5b6127a7878288016126e2565b925092505092959194509250565b5f8083601f8401126127ca576127c9612681565b5b8235905067ffffffffffffffff8111156127e7576127e6612685565b5b60208301915083600182028301111561280357612802612689565b5b9250929050565b5f80602083850312156128205761281f612455565b5b5f83013567ffffffffffffffff81111561283d5761283c612459565b5b612849858286016127b5565b92509250509250929050565b5f8083601f84011261286a57612869612681565b5b8235905067ffffffffffffffff81111561288757612886612685565b5b6020830191508360208202830111156128a3576128a2612689565b5b9250929050565b5f80602083850312156128c0576128bf612455565b5b5f83013567ffffffffffffffff8111156128dd576128dc612459565b5b6128e985828601612855565b92509250509250929050565b5f8083601f84011261290a57612909612681565b5b8235905067ffffffffffffffff81111561292757612926612685565b5b60208301915083602082028301111561294357612942612689565b5b9250929050565b5f805f806040858703121561296257612961612455565b5b5f85013567ffffffffffffffff81111561297f5761297e612459565b5b61298b8782880161268d565b9450945050602085013567ffffffffffffffff8111156129ae576129ad612459565b5b6129ba878288016128f5565b925092505092959194509250565b6129d18161252f565b82525050565b5f6020820190506129ea5f8301846129c8565b92915050565b5f805f805f805f8060a0898b031215612a0c57612a0b612455565b5b5f612a198b828c01612556565b9850506020612a2a8b828c01612556565b975050604089013567ffffffffffffffff811115612a4b57612a4a612459565b5b612a578b828c016128f5565b9650965050606089013567ffffffffffffffff811115612a7a57612a79612459565b5b612a868b828c016128f5565b9450945050608089013567ffffffffffffffff811115612aa957612aa8612459565b5b612ab58b828c016127b5565b92509250509295985092959890939650565b5f805f805f8060a08789031215612ae157612ae0612455565b5b5f612aee89828a01612556565b9650506020612aff89828a01612556565b9550506040612b1089828a016125dc565b9450506060612b2189828a016125dc565b935050608087013567ffffffffffffffff811115612b4257612b41612459565b5b612b4e89828a016127b5565b92509250509295509295509295565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b612b93816124dd565b8114612b9d575f80fd5b50565b5f81359050612bae81612b8a565b92915050565b5f60208284031215612bc957612bc8612455565b5b5f612bd684828501612ba0565b91505092915050565b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612c2982612be3565b810181811067ffffffffffffffff82111715612c4857612c47612bf3565b5b80604052505050565b5f612c5a61244c565b9050612c668282612c20565b919050565b5f80fd5b5f67ffffffffffffffff821115612c8957612c88612bf3565b5b602082029050602081019050919050565b5f612cac612ca784612c6f565b612c51565b90508083825260208201905060208402830185811115612ccf57612cce612689565b5b835b81811015612cf85780612ce48882612556565b845260208401935050602081019050612cd1565b5050509392505050565b5f82601f830112612d1657612d15612681565b5b8135612d26848260208601612c9a565b91505092915050565b5f67ffffffffffffffff821115612d4957612d48612bf3565b5b602082029050602081019050919050565b5f612d6c612d6784612d2f565b612c51565b90508083825260208201905060208402830185811115612d8f57612d8e612689565b5b835b81811015612db85780612da488826125dc565b845260208401935050602081019050612d91565b5050509392505050565b5f82601f830112612dd657612dd5612681565b5b8135612de6848260208601612d5a565b91505092915050565b5f60608284031215612e0457612e03612bdf565b5b612e0e6060612c51565b90505f612e1d84828501612556565b5f83015250602082013567ffffffffffffffff811115612e4057612e3f612c6b565b5b612e4c84828501612d02565b602083015250604082013567ffffffffffffffff811115612e7057612e6f612c6b565b5b612e7c84828501612dc2565b60408301525092915050565b5f60208284031215612e9d57612e9c612455565b5b5f82013567ffffffffffffffff811115612eba57612eb9612459565b5b612ec684828501612def565b91505092915050565b60038110612edb575f80fd5b50565b5f81359050612eec81612ecf565b92915050565b5f80fd5b5f67ffffffffffffffff821115612f1057612f0f612bf3565b5b612f1982612be3565b9050602081019050919050565b828183375f83830152505050565b5f612f46612f4184612ef6565b612c51565b905082815260208101848484011115612f6257612f61612ef2565b5b612f6d848285612f26565b509392505050565b5f82601f830112612f8957612f88612681565b5b8135612f99848260208601612f34565b91505092915050565b5f60808284031215612fb757612fb6612bdf565b5b612fc16080612c51565b90505f612fd084828501612ede565b5f830152506020612fe384828501612556565b6020830152506040612ff784828501612556565b604083015250606082013567ffffffffffffffff81111561301b5761301a612c6b565b5b61302784828501612f75565b60608301525092915050565b5f6020828403121561304857613047612455565b5b5f82013567ffffffffffffffff81111561306557613064612459565b5b61307184828501612fa2565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f815190506130b5816125c6565b92915050565b5f602082840312156130d0576130cf612bdf565b5b6130da6020612c51565b90505f6130e9848285016130a7565b5f8301525092915050565b5f6020828403121561310957613108612455565b5b5f613116848285016130bb565b91505092915050565b8281835e5f83830152505050565b5f61313f61313a84612ef6565b612c51565b90508281526020810184848401111561315b5761315a612ef2565b5b61316684828561311f565b509392505050565b5f82601f83011261318257613181612681565b5b815161319284826020860161312d565b91505092915050565b5f606082840312156131b0576131af612bdf565b5b6131ba6060612c51565b90505f6131c9848285016130a7565b5f8301525060206131dc848285016130a7565b602083015250604082015167ffffffffffffffff811115613200576131ff612c6b565b5b61320c8482850161316e565b60408301525092915050565b5f6020828403121561322d5761322c612455565b5b5f82015167ffffffffffffffff81111561324a57613249612459565b5b6132568482850161319b565b91505092915050565b5f6040820190506132725f8301856129c8565b61327f602083018461259e565b9392505050565b5f6020828403121561329b5761329a612455565b5b5f6132a8848285016130a7565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f6132d5826132b1565b6132df81856132bb565b93506132ef81856020860161311f565b6132f881612be3565b840191505092915050565b5f60a0820190506133165f8301886129c8565b61332360208301876129c8565b613330604083018661259e565b61333d606083018561259e565b818103608083015261334f81846132cb565b90509695505050505050565b5f80fd5b5f80fd5b5f80fd5b5f80833560016020038436030381126133835761338261335b565b5b80840192508235915067ffffffffffffffff8211156133a5576133a461335f565b5b6020830192506001820236038313156133c1576133c0613363565b5b509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61340082612595565b915061340b83612595565b9250828201905080821115613423576134226133c9565b5b92915050565b5f60608201905061343c5f8301866129c8565b613449602083018561259e565b613456604083018461259e565b949350505050565b5f6060820190506134715f8301866129c8565b61347e60208301856129c8565b61348b604083018461259e565b94935050505056fea2646970667358221220c1bfb1478642fd79fec67a73804426335fe572337323b77d0ae5af9397dc0e4c64736f6c634300081a0033",o={MANAGER:1n,ADMIN:2n};function u(s){return s.tokenId===void 0}function w(s){return s.tokenId!==void 0}function r(s){if(u(s))return i.prepareFungibleTransfer(s);if(w(s))return i.prepareERC1155Transfer(s);throw new l.UnknownTransferPayloadSupplied(s)}const n=class n extends y.DeployableTarget{constructor(){super(...arguments),this.abi=e.p}async allocate(f,b){return this.awaitResult(this.allocateRaw(f,b))}async allocateRaw(f,b){const{request:a,result:d}=await e.Xw(this._config,{address:this.assertValidAddress(),args:[r(f)],...this.optionallyAttachAccount(),...b});return{hash:await e._w(this._config,a),result:d}}async clawback(f,b){return this.awaitResult(this.clawbackRaw(f,b))}async clawbackRaw(f,b){const{request:a,result:d}=await e.eT(this._config,{address:this.assertValidAddress(),args:[r(f)],...this.optionallyAttachAccount(),...b});return{hash:await e.Lw(this._config,a),result:d}}async disburse(f,b){return this.awaitResult(this.disburseRaw(f,b))}async disburseRaw(f,b){const{request:a,result:d}=await e.nT(this._config,{address:this.assertValidAddress(),args:[r(f)],...this.optionallyAttachAccount(),...b});return{hash:await e.Dw(this._config,a),result:d}}async disburseBatch(f,b){return this.awaitResult(this.disburseBatchRaw(f,b))}async disburseBatchRaw(f,b){const{request:a,result:d}=await e.aT(this._config,{address:this.assertValidAddress(),args:[f.map(r)],...this.optionallyAttachAccount(),...b});return{hash:await e.Pw(this._config,a),result:d}}async setAuthorized(f,b,a){return this.awaitResult(this.setAuthorizedRaw(f,b,a))}async setAuthorizedRaw(f,b,a){const{request:d,result:c}=await e.yT(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a});return{hash:await e.Qw(this._config,d),result:c}}async grantRoles(f,b,a){return this.awaitResult(this.grantRolesRaw(f,b,a))}async grantRolesRaw(f,b,a){const{request:d,result:c}=await e.iT(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a});return{hash:await e.qw(this._config,d),result:c}}async revokeRoles(f,b,a){return this.awaitResult(this.revokeRolesRaw(f,b,a))}async revokeRolesRaw(f,b,a){const{request:d,result:c}=await e.lT(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a});return{hash:await e.Ww(this._config,d),result:c}}async rolesOf(f,b){const a=await e.xw(this._config,{address:this.assertValidAddress(),args:[f],...this.optionallyAttachAccount(),...b});return[o.MANAGER,o.ADMIN].filter(d=>(a&d)===d)}hasAnyRole(f,b,a){return e.Ow(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a})}hasAllRoles(f,b,a){return e.Mw(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a})}isAuthorized(f,b){return e.Cw(this._config,{address:this.assertValidAddress(),args:[f],...this.optionallyAttachAccount(),...b})}owner(f){return e.zw(this._config,{address:this.assertValidAddress(),args:[],...f})}total(f,b,a){return e.Hw(this._config,{address:this.assertValidAddress(),args:b?[f,b]:[f],...a})}available(f,b,a){return e.Nw(this._config,{address:this.assertValidAddress(),args:b?[f,b]:[f],...a})}distributed(f,b,a){return e.hw(this._config,{address:this.assertValidAddress(),args:b?[f,b]:[f],...a})}buildParameters(f,b){var c;const[a,d]=this.validateDeploymentConfig(f,b);if(!a.owner||a.owner===A.zeroAddress){const t=d.account?d.account.address:d.config?g.getAccount(d.config).address:(c=this._account)==null?void 0:c.address;if(t)a.owner=t;else throw new l.DeployableUnknownOwnerProvidedError}return{abi:e.p,bytecode:p,args:[i.prepareManagedBudgetPayload(a)],...this.optionallyAttachAccount(d.account)}}};n.base="0x0b51f997fa15867134fA34366FCeA63Bee93C087",n.registryType=i.RegistryType.BUDGET;let h=n;exports.managedBudgetAbi=e.p;exports.ManagedBudget=h;exports.ManagedBudgetRoles=o;exports.isERC1155TransferPayload=w;exports.isFungibleTransfer=u;exports.prepareTransfer=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../generated-BzszviNp.cjs"),g=require("@wagmi/core"),A=require("viem"),y=require("../Deployable/DeployableTarget.cjs"),l=require("../errors.cjs"),i=require("../utils.cjs"),p="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6134c9806100bd5f395ff3fe608060405260043610610207575f3560e01c806361400c9911610117578063ec87621c1161009f578063f8724aba1161006e578063f8724aba1461076e578063f9a802c3146107aa578063fa4ca9b1146107e6578063fe9fbb8014610822578063fee81cf41461085e5761020e565b8063ec87621c146106d0578063f04e283e146106fa578063f23a6e6114610716578063f2fde38b146107525761020e565b806380fd6005116100e657806380fd6005146105de5780638da5cb5b14610606578063bc197c8114610630578063d2514e841461066c578063e6670829146106a85761020e565b806361400c9914610532578063715018a61461056e57806375b238fc14610578578063774c33ab146105a25761020e565b80634359d28a1161019a5780634a4ee7b1116101695780634a4ee7b114610464578063514e62fc1461048057806354d1f13d146104bc578063578bcf35146104c65780635aef467a146105025761020e565b80634359d28a1461039c578063439fab91146103c4578063451cc191146103ec578063474f5a44146104285761020e565b80631cd64df4116101d65780631cd64df4146102f0578063256929621461032c57806328d6183b146103365780632de94807146103605761020e565b806301ffc9a71461024057806310098ad51461027c578063183a4f6e146102b85780631c10893f146102d45761020e565b3661020e57005b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b34801561024b575f80fd5b50610266600480360381019061026191906124b2565b61089a565b60405161027391906124f7565b60405180910390f35b348015610287575f80fd5b506102a2600480360381019061029d919061256a565b6109e3565b6040516102af91906125ad565b60405180910390f35b6102d260048036038101906102cd91906125f0565b610a4e565b005b6102ee60048036038101906102e9919061261b565b610a5b565b005b3480156102fb575f80fd5b506103166004803603810190610311919061261b565b610a71565b60405161032391906124f7565b60405180910390f35b610334610a87565b005b348015610341575f80fd5b5061034a610ad8565b6040516103579190612668565b60405180910390f35b34801561036b575f80fd5b506103866004803603810190610381919061256a565b610aff565b60405161039391906125ad565b60405180910390f35b3480156103a7575f80fd5b506103c260048036038101906103bd9190612737565b610b18565b005b3480156103cf575f80fd5b506103ea60048036038101906103e5919061280a565b610c26565b005b3480156103f7575f80fd5b50610412600480360381019061040d919061280a565b610d1e565b60405161041f91906125ad565b60405180910390f35b348015610433575f80fd5b5061044e6004803603810190610449919061280a565b610d25565b60405161045b91906124f7565b60405180910390f35b61047e6004803603810190610479919061261b565b610f0f565b005b34801561048b575f80fd5b506104a660048036038101906104a1919061261b565b610f25565b6040516104b391906124f7565b60405180910390f35b6104c4610f3c565b005b3480156104d1575f80fd5b506104ec60048036038101906104e7919061256a565b610f75565b6040516104f991906125ad565b60405180910390f35b61051c6004803603810190610517919061280a565b610fba565b60405161052991906124f7565b60405180910390f35b34801561053d575f80fd5b50610558600480360381019061055391906128aa565b61132a565b60405161056591906124f7565b60405180910390f35b61057661138e565b005b348015610583575f80fd5b5061058c6113a1565b60405161059991906125ad565b60405180910390f35b3480156105ad575f80fd5b506105c860048036038101906105c3919061261b565b6113a6565b6040516105d591906125ad565b60405180910390f35b3480156105e9575f80fd5b5061060460048036038101906105ff919061294a565b6113fc565b005b348015610611575f80fd5b5061061a6114b2565b60405161062791906129d7565b60405180910390f35b34801561063b575f80fd5b50610656600480360381019061065191906129f0565b6114da565b6040516106639190612668565b60405180910390f35b348015610677575f80fd5b50610692600480360381019061068d919061256a565b6114f1565b60405161069f91906125ad565b60405180910390f35b3480156106b3575f80fd5b506106ce60048036038101906106c9919061294a565b611549565b005b3480156106db575f80fd5b506106e46115ff565b6040516106f191906125ad565b60405180910390f35b610714600480360381019061070f919061256a565b611604565b005b348015610721575f80fd5b5061073c60048036038101906107379190612ac7565b611642565b6040516107499190612668565b60405180910390f35b61076c6004803603810190610767919061256a565b611657565b005b348015610779575f80fd5b50610794600480360381019061078f919061261b565b611680565b6040516107a191906125ad565b60405180910390f35b3480156107b5575f80fd5b506107d060048036038101906107cb919061261b565b611702565b6040516107dd91906125ad565b60405180910390f35b3480156107f1575f80fd5b5061080c6004803603810190610807919061280a565b6117db565b60405161081991906124f7565b60405180910390f35b34801561082d575f80fd5b506108486004803603810190610843919061256a565b611a57565b60405161085591906124f7565b60405180910390f35b348015610869575f80fd5b50610884600480360381019061087f919061256a565b611aaa565b60405161089191906125ad565b60405180910390f35b5f7fa0109882000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061096457507f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109cc57507f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109dc57506109db82611ac3565b5b9050919050565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a4557610a40308373ffffffffffffffffffffffffffffffffffffffff16611b3c90919063ffffffff16565b610a47565b475b9050919050565b610a583382611b6f565b50565b610a63611b7e565b610a6d8282611bb5565b5050565b5f8182610a7d85610aff565b1614905092915050565b5f610a90611bc5565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7fa010988200000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b6002610b2381611bcf565b828290508585905014610b62576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610c1e575f848483818110610b8357610b82612b5d565b5b9050602002016020810190610b989190612bb4565b90506001151581151503610bdd57610bd8878784818110610bbc57610bbb612b5d565b5b9050602002016020810190610bd1919061256a565b6001611bb5565b610c10565b610c0f878784818110610bf357610bf2612b5d565b5b9050602002016020810190610c08919061256a565b6001611b6f565b5b508080600101915050610b64565b505050505050565b5f610c2f611c04565b90508054600382558015610c615760018160011c14303b10610c585763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610c729190612e88565b9050610c80815f0151611c2d565b5f5b816020015151811015610ce257610cd582602001518281518110610ca957610ca8612b5d565b5b602002602001015183604001518381518110610cc857610cc7612b5d565b5b6020026020010151611d03565b8080600101915050610c82565b50508015610d19576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f92915050565b5f6002610d3181611bcf565b5f8484810190610d419190613033565b90505f6002811115610d5657610d5561307a565b5b815f01516002811115610d6c57610d6b61307a565b5b1480610d9f575060016002811115610d8757610d8661307a565b5b815f01516002811115610d9d57610d9c61307a565b5b145b15610df8575f8160600151806020019051810190610dbd91906130f4565b9050610df2826020015183604001515f845f015114610ddf57835f0151610ded565b610dec85602001516109e3565b5b611d44565b50610f02565b600280811115610e0b57610e0a61307a565b5b815f01516002811115610e2157610e2061307a565b5b03610ef8575f8160600151806020019051810190610e3f9190613218565b9050610ef282602001518360400151835f01515f856020015114610e67578460200151610ee8565b856020015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e30875f01516040518363ffffffff1660e01b8152600401610ea892919061325f565b602060405180830381865afa158015610ec3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ee79190613286565b5b8560400151611f5c565b50610f01565b5f925050610f08565b5b60019250505b5092915050565b610f17611b7e565b610f218282611b6f565b5050565b5f8082610f3185610aff565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b5f808383810190610fcb9190613033565b90505f6002811115610fe057610fdf61307a565b5b815f01516002811115610ff657610ff561307a565b5b0361106c575f816060015180602001905181019061101491906130f4565b9050805f01513414611066578160200151815f01516040517fcece04c500000000000000000000000000000000000000000000000000000000815260040161105d92919061325f565b60405180910390fd5b5061131e565b600160028111156110805761107f61307a565b5b815f015160028111156110965761109561307a565b5b03611171575f81606001518060200190518101906110b491906130f4565b90506110ee826040015130835f0151856020015173ffffffffffffffffffffffffffffffffffffffff16612188909392919063ffffffff16565b805f015161111f30846020015173ffffffffffffffffffffffffffffffffffffffff16611b3c90919063ffffffff16565b101561116b578160200151815f01516040517fcece04c500000000000000000000000000000000000000000000000000000000815260040161116292919061325f565b60405180910390fd5b5061131d565b6002808111156111845761118361307a565b5b815f0151600281111561119a5761119961307a565b5b03611313575f81606001518060200190518101906111b89190613218565b9050816020015173ffffffffffffffffffffffffffffffffffffffff1663f242432a836040015130845f0151856020015186604001516040518663ffffffff1660e01b815260040161120e959493929190613303565b5f604051808303815f87803b158015611225575f80fd5b505af1158015611237573d5f803e3d5ffd5b505050508060200151826020015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e30845f01516040518363ffffffff1660e01b815260040161128192919061325f565b602060405180830381865afa15801561129c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112c09190613286565b101561130d57816020015181602001516040517fcece04c500000000000000000000000000000000000000000000000000000000815260040161130492919061325f565b60405180910390fd5b5061131c565b5f915050611324565b5b5b60019150505b92915050565b5f805f90505b838390508110156113825761136884848381811061135157611350612b5d565b5b90506020028101906113639190613367565b6117db565b611375575f915050611388565b8080600101915050611330565b50600190505b92915050565b611396611b7e565b61139f5f6121e2565b565b600281565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8381526020019081526020015f2054905092915050565b600261140781611bcf565b828290508585905014611446576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156114aa5761149d86868381811061146957611468612b5d565b5b905060200201602081019061147e919061256a565b85858481811061149157611490612b5d565b5b90506020020135611b6f565b8080600101915050611448565b505050505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f63bc197c8160e01b905098975050505050505050565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054611538836109e3565b61154291906133f6565b9050919050565b600261155481611bcf565b828290508585905014611593576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156115f7576115ea8686838181106115b6576115b5612b5d565b5b90506020020160208101906115cb919061256a565b8585848181106115de576115dd612b5d565b5b90506020020135611bb5565b8080600101915050611595565b505050505050565b600181565b61160c611b7e565b63389a75e1600c52805f526020600c20805442111561163257636f5e88185f526004601cfd5b5f81555061163f816121e2565b50565b5f63f23a6e6160e01b90509695505050505050565b61165f611b7e565b8060601b61167457637448fbae5f526004601cfd5b61167d816121e2565b50565b5f8273ffffffffffffffffffffffffffffffffffffffff1662fdd58e30846040518363ffffffff1660e01b81526004016116bb92919061325f565b602060405180830381865afa1580156116d6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116fa9190613286565b905092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8381526020019081526020015f20548373ffffffffffffffffffffffffffffffffffffffff1662fdd58e30856040518363ffffffff1660e01b815260040161178a92919061325f565b602060405180830381865afa1580156117a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117c99190613286565b6117d391906133f6565b905092915050565b5f60016002176117ea81611bcf565b5f84848101906117fa9190613033565b9050600160028111156118105761180f61307a565b5b815f015160028111156118265761182561307a565b5b148061185857505f60028111156118405761183f61307a565b5b815f015160028111156118565761185561307a565b5b145b156118f8575f816060015180602001905181019061187691906130f4565b90505f61188683602001516109e3565b905080825f015111156118db57826020015181835f01516040517f5c54305e0000000000000000000000000000000000000000000000000000000081526004016118d293929190613429565b60405180910390fd5b6118f183602001518460400151845f0151611d44565b5050611a4a565b60028081111561190b5761190a61307a565b5b815f015160028111156119215761192061307a565b5b03611a40575f816060015180602001905181019061193f9190613218565b90505f826020015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e30845f01516040518363ffffffff1660e01b815260040161198392919061325f565b602060405180830381865afa15801561199e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119c29190613286565b90508082602001511115611a195782602001518183602001516040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401611a1093929190613429565b60405180910390fd5b611a3983602001518460400151845f015185602001518660400151611f5c565b5050611a49565b5f925050611a50565b5b60019250505b5092915050565b5f8173ffffffffffffffffffffffffffffffffffffffff16611a776114b2565b73ffffffffffffffffffffffffffffffffffffffff161480611aa35750611aa2826002600117610f25565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fea5ad34e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b355750611b34826122a8565b5b9050919050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b611b7a82825f612321565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611bb3576382b429005f526004601cfd5b565b611bc182826001612321565b5050565b5f6202a300905090565b638b78c6d819543314611c0157638b78c6d8600c52335f52806020600c205416611c00576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611c35612379565b15611cad577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415611c6f57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611d00565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b3068929eee149b4bd212685403611d625763ab143c065f526004601cfd5b3068929eee149b4bd21268555f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611de2578282826040517fbf182be8000000000000000000000000000000000000000000000000000000008152600401611dd99392919061345e565b60405180910390fd5b611deb836109e3565b811115611e3b5782611dfc846109e3565b826040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401611e3293929190613429565b60405180910390fd5b805f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254611e8691906133f6565b925050819055505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611ecf57611eca828261237d565b611efb565b611efa82828573ffffffffffffffffffffffffffffffffffffffff1661239a9092919063ffffffff16565b5b8273ffffffffffffffffffffffffffffffffffffffff167fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd435428383604051611f4392919061325f565b60405180910390a23868929eee149b4bd2126855505050565b3068929eee149b4bd212685403611f7a5763ab143c065f526004601cfd5b3068929eee149b4bd21268555f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611ffa578484836040517fbf182be8000000000000000000000000000000000000000000000000000000008152600401611ff19392919061345e565b60405180910390fd5b6120048584611680565b82111561205557846120168685611680565b836040517f5c54305e00000000000000000000000000000000000000000000000000000000815260040161204c93929190613429565b60405180910390fd5b8160015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8581526020019081526020015f205f8282546120b091906133f6565b925050819055508473ffffffffffffffffffffffffffffffffffffffff1663f242432a30868686866040518663ffffffff1660e01b81526004016120f8959493929190613303565b5f604051808303815f87803b15801561210f575f80fd5b505af1158015612121573d5f803e3d5ffd5b505050508473ffffffffffffffffffffffffffffffffffffffff167fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542858460405161216d92919061325f565b60405180910390a23868929eee149b4bd21268555050505050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f511417166121d357637939f4245f526004601cfd5b5f606052806040525050505050565b6121ea612379565b1561224f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506122a5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061231a5750612319826123e3565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361234357848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f385f3884865af16123965763b12d13eb5f526004601cfd5b5050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166123da576390b8ec185f526004601cfd5b5f603452505050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6124918161245d565b811461249b575f80fd5b50565b5f813590506124ac81612488565b92915050565b5f602082840312156124c7576124c6612455565b5b5f6124d48482850161249e565b91505092915050565b5f8115159050919050565b6124f1816124dd565b82525050565b5f60208201905061250a5f8301846124e8565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61253982612510565b9050919050565b6125498161252f565b8114612553575f80fd5b50565b5f8135905061256481612540565b92915050565b5f6020828403121561257f5761257e612455565b5b5f61258c84828501612556565b91505092915050565b5f819050919050565b6125a781612595565b82525050565b5f6020820190506125c05f83018461259e565b92915050565b6125cf81612595565b81146125d9575f80fd5b50565b5f813590506125ea816125c6565b92915050565b5f6020828403121561260557612604612455565b5b5f612612848285016125dc565b91505092915050565b5f806040838503121561263157612630612455565b5b5f61263e85828601612556565b925050602061264f858286016125dc565b9150509250929050565b6126628161245d565b82525050565b5f60208201905061267b5f830184612659565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126126a2576126a1612681565b5b8235905067ffffffffffffffff8111156126bf576126be612685565b5b6020830191508360208202830111156126db576126da612689565b5b9250929050565b5f8083601f8401126126f7576126f6612681565b5b8235905067ffffffffffffffff81111561271457612713612685565b5b6020830191508360208202830111156127305761272f612689565b5b9250929050565b5f805f806040858703121561274f5761274e612455565b5b5f85013567ffffffffffffffff81111561276c5761276b612459565b5b6127788782880161268d565b9450945050602085013567ffffffffffffffff81111561279b5761279a612459565b5b6127a7878288016126e2565b925092505092959194509250565b5f8083601f8401126127ca576127c9612681565b5b8235905067ffffffffffffffff8111156127e7576127e6612685565b5b60208301915083600182028301111561280357612802612689565b5b9250929050565b5f80602083850312156128205761281f612455565b5b5f83013567ffffffffffffffff81111561283d5761283c612459565b5b612849858286016127b5565b92509250509250929050565b5f8083601f84011261286a57612869612681565b5b8235905067ffffffffffffffff81111561288757612886612685565b5b6020830191508360208202830111156128a3576128a2612689565b5b9250929050565b5f80602083850312156128c0576128bf612455565b5b5f83013567ffffffffffffffff8111156128dd576128dc612459565b5b6128e985828601612855565b92509250509250929050565b5f8083601f84011261290a57612909612681565b5b8235905067ffffffffffffffff81111561292757612926612685565b5b60208301915083602082028301111561294357612942612689565b5b9250929050565b5f805f806040858703121561296257612961612455565b5b5f85013567ffffffffffffffff81111561297f5761297e612459565b5b61298b8782880161268d565b9450945050602085013567ffffffffffffffff8111156129ae576129ad612459565b5b6129ba878288016128f5565b925092505092959194509250565b6129d18161252f565b82525050565b5f6020820190506129ea5f8301846129c8565b92915050565b5f805f805f805f8060a0898b031215612a0c57612a0b612455565b5b5f612a198b828c01612556565b9850506020612a2a8b828c01612556565b975050604089013567ffffffffffffffff811115612a4b57612a4a612459565b5b612a578b828c016128f5565b9650965050606089013567ffffffffffffffff811115612a7a57612a79612459565b5b612a868b828c016128f5565b9450945050608089013567ffffffffffffffff811115612aa957612aa8612459565b5b612ab58b828c016127b5565b92509250509295985092959890939650565b5f805f805f8060a08789031215612ae157612ae0612455565b5b5f612aee89828a01612556565b9650506020612aff89828a01612556565b9550506040612b1089828a016125dc565b9450506060612b2189828a016125dc565b935050608087013567ffffffffffffffff811115612b4257612b41612459565b5b612b4e89828a016127b5565b92509250509295509295509295565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b612b93816124dd565b8114612b9d575f80fd5b50565b5f81359050612bae81612b8a565b92915050565b5f60208284031215612bc957612bc8612455565b5b5f612bd684828501612ba0565b91505092915050565b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612c2982612be3565b810181811067ffffffffffffffff82111715612c4857612c47612bf3565b5b80604052505050565b5f612c5a61244c565b9050612c668282612c20565b919050565b5f80fd5b5f67ffffffffffffffff821115612c8957612c88612bf3565b5b602082029050602081019050919050565b5f612cac612ca784612c6f565b612c51565b90508083825260208201905060208402830185811115612ccf57612cce612689565b5b835b81811015612cf85780612ce48882612556565b845260208401935050602081019050612cd1565b5050509392505050565b5f82601f830112612d1657612d15612681565b5b8135612d26848260208601612c9a565b91505092915050565b5f67ffffffffffffffff821115612d4957612d48612bf3565b5b602082029050602081019050919050565b5f612d6c612d6784612d2f565b612c51565b90508083825260208201905060208402830185811115612d8f57612d8e612689565b5b835b81811015612db85780612da488826125dc565b845260208401935050602081019050612d91565b5050509392505050565b5f82601f830112612dd657612dd5612681565b5b8135612de6848260208601612d5a565b91505092915050565b5f60608284031215612e0457612e03612bdf565b5b612e0e6060612c51565b90505f612e1d84828501612556565b5f83015250602082013567ffffffffffffffff811115612e4057612e3f612c6b565b5b612e4c84828501612d02565b602083015250604082013567ffffffffffffffff811115612e7057612e6f612c6b565b5b612e7c84828501612dc2565b60408301525092915050565b5f60208284031215612e9d57612e9c612455565b5b5f82013567ffffffffffffffff811115612eba57612eb9612459565b5b612ec684828501612def565b91505092915050565b60038110612edb575f80fd5b50565b5f81359050612eec81612ecf565b92915050565b5f80fd5b5f67ffffffffffffffff821115612f1057612f0f612bf3565b5b612f1982612be3565b9050602081019050919050565b828183375f83830152505050565b5f612f46612f4184612ef6565b612c51565b905082815260208101848484011115612f6257612f61612ef2565b5b612f6d848285612f26565b509392505050565b5f82601f830112612f8957612f88612681565b5b8135612f99848260208601612f34565b91505092915050565b5f60808284031215612fb757612fb6612bdf565b5b612fc16080612c51565b90505f612fd084828501612ede565b5f830152506020612fe384828501612556565b6020830152506040612ff784828501612556565b604083015250606082013567ffffffffffffffff81111561301b5761301a612c6b565b5b61302784828501612f75565b60608301525092915050565b5f6020828403121561304857613047612455565b5b5f82013567ffffffffffffffff81111561306557613064612459565b5b61307184828501612fa2565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f815190506130b5816125c6565b92915050565b5f602082840312156130d0576130cf612bdf565b5b6130da6020612c51565b90505f6130e9848285016130a7565b5f8301525092915050565b5f6020828403121561310957613108612455565b5b5f613116848285016130bb565b91505092915050565b8281835e5f83830152505050565b5f61313f61313a84612ef6565b612c51565b90508281526020810184848401111561315b5761315a612ef2565b5b61316684828561311f565b509392505050565b5f82601f83011261318257613181612681565b5b815161319284826020860161312d565b91505092915050565b5f606082840312156131b0576131af612bdf565b5b6131ba6060612c51565b90505f6131c9848285016130a7565b5f8301525060206131dc848285016130a7565b602083015250604082015167ffffffffffffffff811115613200576131ff612c6b565b5b61320c8482850161316e565b60408301525092915050565b5f6020828403121561322d5761322c612455565b5b5f82015167ffffffffffffffff81111561324a57613249612459565b5b6132568482850161319b565b91505092915050565b5f6040820190506132725f8301856129c8565b61327f602083018461259e565b9392505050565b5f6020828403121561329b5761329a612455565b5b5f6132a8848285016130a7565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f6132d5826132b1565b6132df81856132bb565b93506132ef81856020860161311f565b6132f881612be3565b840191505092915050565b5f60a0820190506133165f8301886129c8565b61332360208301876129c8565b613330604083018661259e565b61333d606083018561259e565b818103608083015261334f81846132cb565b90509695505050505050565b5f80fd5b5f80fd5b5f80fd5b5f80833560016020038436030381126133835761338261335b565b5b80840192508235915067ffffffffffffffff8211156133a5576133a461335f565b5b6020830192506001820236038313156133c1576133c0613363565b5b509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61340082612595565b915061340b83612595565b9250828201905080821115613423576134226133c9565b5b92915050565b5f60608201905061343c5f8301866129c8565b613449602083018561259e565b613456604083018461259e565b949350505050565b5f6060820190506134715f8301866129c8565b61347e60208301856129c8565b61348b604083018461259e565b94935050505056fea2646970667358221220c1bfb1478642fd79fec67a73804426335fe572337323b77d0ae5af9397dc0e4c64736f6c634300081a0033",o={MANAGER:1n,ADMIN:2n};function u(s){return s.tokenId===void 0}function w(s){return s.tokenId!==void 0}function r(s){if(u(s))return i.prepareFungibleTransfer(s);if(w(s))return i.prepareERC1155Transfer(s);throw new l.UnknownTransferPayloadSupplied(s)}const n=class n extends y.DeployableTarget{constructor(){super(...arguments),this.abi=e.p}async allocate(f,b){return this.awaitResult(this.allocateRaw(f,b))}async allocateRaw(f,b){const{request:a,result:d}=await e.Xw(this._config,{address:this.assertValidAddress(),args:[r(f)],...this.optionallyAttachAccount(),...b});return{hash:await e._w(this._config,a),result:d}}async clawback(f,b){return this.awaitResult(this.clawbackRaw(f,b))}async clawbackRaw(f,b){const{request:a,result:d}=await e.eT(this._config,{address:this.assertValidAddress(),args:[r(f)],...this.optionallyAttachAccount(),...b});return{hash:await e.Lw(this._config,a),result:d}}async disburse(f,b){return this.awaitResult(this.disburseRaw(f,b))}async disburseRaw(f,b){const{request:a,result:d}=await e.nT(this._config,{address:this.assertValidAddress(),args:[r(f)],...this.optionallyAttachAccount(),...b});return{hash:await e.Dw(this._config,a),result:d}}async disburseBatch(f,b){return this.awaitResult(this.disburseBatchRaw(f,b))}async disburseBatchRaw(f,b){const{request:a,result:d}=await e.aT(this._config,{address:this.assertValidAddress(),args:[f.map(r)],...this.optionallyAttachAccount(),...b});return{hash:await e.Pw(this._config,a),result:d}}async setAuthorized(f,b,a){return this.awaitResult(this.setAuthorizedRaw(f,b,a))}async setAuthorizedRaw(f,b,a){const{request:d,result:c}=await e.yT(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a});return{hash:await e.Qw(this._config,d),result:c}}async grantRoles(f,b,a){return this.awaitResult(this.grantRolesRaw(f,b,a))}async grantRolesRaw(f,b,a){const{request:d,result:c}=await e.iT(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a});return{hash:await e.qw(this._config,d),result:c}}async revokeRoles(f,b,a){return this.awaitResult(this.revokeRolesRaw(f,b,a))}async revokeRolesRaw(f,b,a){const{request:d,result:c}=await e.lT(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a});return{hash:await e.Ww(this._config,d),result:c}}async rolesOf(f,b){const a=await e.xw(this._config,{address:this.assertValidAddress(),args:[f],...this.optionallyAttachAccount(),...b});return[o.MANAGER,o.ADMIN].filter(d=>(a&d)===d)}hasAnyRole(f,b,a){return e.Ow(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a})}hasAllRoles(f,b,a){return e.Mw(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a})}isAuthorized(f,b){return e.Cw(this._config,{address:this.assertValidAddress(),args:[f],...this.optionallyAttachAccount(),...b})}owner(f){return e.zw(this._config,{address:this.assertValidAddress(),args:[],...f})}total(f,b,a){return e.Hw(this._config,{address:this.assertValidAddress(),args:b?[f,b]:[f],...a})}available(f,b,a){return e.Nw(this._config,{address:this.assertValidAddress(),args:b?[f,b]:[f],...a})}distributed(f,b,a){return e.hw(this._config,{address:this.assertValidAddress(),args:b?[f,b]:[f],...a})}buildParameters(f,b){var c;const[a,d]=this.validateDeploymentConfig(f,b);if(!a.owner||a.owner===A.zeroAddress){const t=d.account?d.account.address:d.config?g.getAccount(d.config).address:(c=this._account)==null?void 0:c.address;if(t)a.owner=t;else throw new l.DeployableUnknownOwnerProvidedError}return{abi:e.p,bytecode:p,args:[i.prepareManagedBudgetPayload(a)],...this.optionallyAttachAccount(d.account)}}};n.base="0x0b51f997fa15867134fA34366FCeA63Bee93C087",n.registryType=i.RegistryType.BUDGET;let h=n;exports.managedBudgetAbi=e.p;exports.ManagedBudget=h;exports.ManagedBudgetRoles=o;exports.isERC1155TransferPayload=w;exports.isFungibleTransfer=u;exports.prepareTransfer=r;
|
|
2
2
|
//# sourceMappingURL=ManagedBudget.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as i, n as h, _ as l, q as u, L as w, s as A, D as g, u as y, P as p, y as R, Q as _, w as m, x as T, B as V, C as q, E as v, O as D, F as k, H as C, J as E, R as P, U as x, V as z } from "../generated-
|
|
1
|
+
import { p as i, n as h, _ as l, q as u, L as w, s as A, D as g, u as y, P as p, y as R, Q as _, w as m, x as T, B as V, C as q, E as v, O as D, F as k, H as C, J as E, R as P, U as x, V as z } from "../generated-Cbv8zFkf.js";
|
|
2
2
|
import { getAccount as B } from "@wagmi/core";
|
|
3
3
|
import { zeroAddress as N } from "viem";
|
|
4
4
|
import { DeployableTarget as F } from "../Deployable/DeployableTarget.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deployable.cjs","sources":["../../src/Deployable/Deployable.ts"],"sourcesContent":["import { type Config, deployContract } from '@wagmi/core';\nimport type {\n Abi,\n Account,\n Address,\n ContractEventName,\n Hash,\n Hex,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableBuildParametersUnspecifiedError,\n DeployableMissingPayloadError,\n DeployableWagmiConfigurationRequiredError,\n} from '../errors';\nimport { getDeployedContractAddress } from '../utils';\nimport { Contract } from './Contract';\n\n/**\n * A base class representing a deployable contract, contains base implementations for deployment and initialization payload construction.\n *\n * @export\n * @typedef {GenericDeployableParams}\n */\nexport type GenericDeployableParams = Omit<\n Parameters<typeof deployContract>[1],\n 'args' | 'account'\n> & {\n args: [Hex, ...Array<Hex>];\n account?: Account;\n};\n\n/**\n * A generic type that encapsulates either an initialization payload for a contract, or a valid address for a previously deployed contract.\n *\n * @export\n * @typedef {DeployablePayloadOrAddress}\n * @template [Payload=unknown]\n */\nexport type DeployablePayloadOrAddress<Payload = unknown> = Payload | Address;\n\n/**\n * Instantion options for the base deployable.\n *\n * @export\n * @interface DeployableOptions\n * @typedef {DeployableOptions}\n */\nexport interface DeployableOptions {\n /**\n * [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n *\n * @see {@link Config}\n * @type {Config}\n */\n config: Config;\n /**\n * [Viem Local Account](https://viem.sh/docs/accounts/local), required if in a Node environment\n *\n * @see {@link Account}\n * @type {?Account}\n */\n account?: Account;\n}\n\n/**\n * A generic deployable contract that encapsulates common operations related to contract deployment\n *\n * @export\n * @class Deployable\n * @typedef {Deployable}\n * @template [Payload=unknown]\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=ContractEventName<ContractAbi>]\n * @extends {Contract<ContractAbi, ContractEvent>}\n */\nexport class Deployable<\n Payload,\n ContractAbi extends Abi,\n> extends Contract<ContractAbi> {\n /**\n * The deployable payload used either for contract construction or initialization\n *\n * @protected\n * @type {(Payload | undefined)}\n */\n protected _payload: Payload | undefined;\n /**\n * If it exists, [Viem Local Account](https://viem.sh/docs/accounts/local), if in a Node environment\n *\n * @protected\n * @type {?Account}\n */\n protected _account?: Account;\n\n /**\n * Creates an instance of Deployable.\n *\n * @constructor\n * @param {DeployableOptions} param0\n * @param {?Account} [param0.account]\n * @param {Config} param0.config\n * @param {DeployablePayloadOrAddress<Payload>} payload\n */\n constructor(\n { account, config }: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n ) {\n if (typeof payload === 'string') {\n super(config, payload as Address);\n } else {\n super(config, undefined);\n this._payload = payload as Payload;\n }\n if (account) this._account = account;\n }\n\n /**\n * Returns the attached deployable payload, if it exists\n *\n * @readonly\n * @type {Payload}\n */\n get payload() {\n return this._payload;\n }\n\n /**\n * Attaches a new payload for use with this deployable's initialization\n *\n * @public\n * @param {Payload} payload\n * @returns {this}\n */\n public withPayload(payload: Payload) {\n this._payload = payload;\n return this;\n }\n\n /**\n * High level deployment function to deploy and await the contract address.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n * @returns {unknown}\n */\n
|
|
1
|
+
{"version":3,"file":"Deployable.cjs","sources":["../../src/Deployable/Deployable.ts"],"sourcesContent":["import { type Config, deployContract } from '@wagmi/core';\nimport type {\n Abi,\n Account,\n Address,\n ContractEventName,\n Hash,\n Hex,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableBuildParametersUnspecifiedError,\n DeployableMissingPayloadError,\n DeployableWagmiConfigurationRequiredError,\n} from '../errors';\nimport { getDeployedContractAddress } from '../utils';\nimport { Contract } from './Contract';\n\n/**\n * A base class representing a deployable contract, contains base implementations for deployment and initialization payload construction.\n *\n * @export\n * @typedef {GenericDeployableParams}\n */\nexport type GenericDeployableParams = Omit<\n Parameters<typeof deployContract>[1],\n 'args' | 'account'\n> & {\n args: [Hex, ...Array<Hex>];\n account?: Account;\n};\n\n/**\n * A generic type that encapsulates either an initialization payload for a contract, or a valid address for a previously deployed contract.\n *\n * @export\n * @typedef {DeployablePayloadOrAddress}\n * @template [Payload=unknown]\n */\nexport type DeployablePayloadOrAddress<Payload = unknown> = Payload | Address;\n\n/**\n * Instantion options for the base deployable.\n *\n * @export\n * @interface DeployableOptions\n * @typedef {DeployableOptions}\n */\nexport interface DeployableOptions {\n /**\n * [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n *\n * @see {@link Config}\n * @type {Config}\n */\n config: Config;\n /**\n * [Viem Local Account](https://viem.sh/docs/accounts/local), required if in a Node environment\n *\n * @see {@link Account}\n * @type {?Account}\n */\n account?: Account;\n}\n\n/**\n * A generic deployable contract that encapsulates common operations related to contract deployment\n *\n * @export\n * @class Deployable\n * @typedef {Deployable}\n * @template [Payload=unknown]\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=ContractEventName<ContractAbi>]\n * @extends {Contract<ContractAbi, ContractEvent>}\n */\nexport class Deployable<\n Payload,\n ContractAbi extends Abi,\n> extends Contract<ContractAbi> {\n /**\n * The deployable payload used either for contract construction or initialization\n *\n * @protected\n * @type {(Payload | undefined)}\n */\n protected _payload: Payload | undefined;\n /**\n * If it exists, [Viem Local Account](https://viem.sh/docs/accounts/local), if in a Node environment\n *\n * @protected\n * @type {?Account}\n */\n protected _account?: Account;\n\n /**\n * Creates an instance of Deployable.\n *\n * @constructor\n * @param {DeployableOptions} param0\n * @param {?Account} [param0.account]\n * @param {Config} param0.config\n * @param {DeployablePayloadOrAddress<Payload>} payload\n */\n constructor(\n { account, config }: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n ) {\n if (typeof payload === 'string') {\n super(config, payload as Address);\n } else {\n super(config, undefined);\n this._payload = payload as Payload;\n }\n if (account) this._account = account;\n }\n\n /**\n * Returns the attached deployable payload, if it exists\n *\n * @readonly\n * @type {Payload}\n */\n get payload() {\n return this._payload;\n }\n\n /**\n * Attaches a new payload for use with this deployable's initialization\n *\n * @public\n * @param {Payload} payload\n * @returns {this}\n */\n public withPayload(payload: Payload) {\n this._payload = payload;\n return this;\n }\n\n /**\n * High level deployment function to deploy and await the contract address.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n * @returns {unknown}\n */\n protected async deploy(\n _payload?: Payload,\n _options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n const config = _options?.config || this._config;\n const address = await getDeployedContractAddress(\n config,\n this.deployRaw(_payload, _options),\n waitParams,\n );\n this._address = address;\n return this;\n }\n\n /**\n * The lower level contract deployment function that does not await for the transaction receipt.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n * @throws {@link DeployableAlreadyDeployedError}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return await deployContract(options.config, {\n ...this.buildParameters(payload),\n ...this.optionallyAttachAccount(options.account),\n });\n }\n\n /**\n * Internal function to attach the connected account to write methods to avoid manually passing in an account each call.\n *\n * @protected\n * @param {?Account} [account]\n * @returns {({ account: Account; } | { account?: undefined; })}\n */\n protected optionallyAttachAccount(account?: Account) {\n if (account) return { account };\n return this._account ? { account: this._account } : {};\n }\n\n /**\n * Base parameter constructor, should return a partial `viem.deployContract` parameters shape including abi, bytecode, and arguments, if any.\n * Expected to be overridden by protocol contracts.\n *\n * @public\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n throw new DeployableBuildParametersUnspecifiedError();\n }\n\n /**\n * Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const options = _options || {\n config: this._config,\n account: this._account,\n };\n if (!options) throw new DeployableWagmiConfigurationRequiredError();\n const payload = _payload || this._payload;\n return [payload, options] as [P, DeployableOptions];\n }\n}\n"],"names":["Deployable","Contract","account","config","payload","_payload","_options","waitParams","address","getDeployedContractAddress","DeployableAlreadyDeployedError","options","deployContract","DeployableBuildParametersUnspecifiedError","DeployableWagmiConfigurationRequiredError"],"mappings":"gMA6EO,MAAMA,UAGHC,EAAAA,QAAsB,CAyB9B,YACE,CAAE,QAAAC,EAAS,OAAAC,CAAA,EACXC,EACA,CACI,OAAOA,GAAY,SACrB,MAAMD,EAAQC,CAAkB,GAEhC,MAAMD,EAAQ,MAAS,EACvB,KAAK,SAAWC,GAEdF,IAAS,KAAK,SAAWA,EAC/B,CAQA,IAAI,SAAU,CACZ,OAAO,KAAK,QACd,CASO,YAAYE,EAAkB,CACnC,YAAK,SAAWA,EACT,IACT,CAeA,MAAgB,OACdC,EACAC,EACAC,EACA,CACM,MAAAJ,GAASG,GAAA,YAAAA,EAAU,SAAU,KAAK,QAClCE,EAAU,MAAMC,EAAA,2BACpBN,EACA,KAAK,UAAUE,EAAUC,CAAQ,EACjCC,CAAA,EAEF,YAAK,SAAWC,EACT,IACT,CAiBA,MAAgB,UACdH,EACAC,EACe,CACf,GAAI,KAAK,QAAe,MAAA,IAAII,EAA+B,+BAAA,KAAK,OAAO,EACvE,KAAM,CAACN,EAASO,CAAO,EAAI,KAAK,yBAC9BN,EACAC,CAAA,EAEK,OAAA,MAAMM,EAAAA,eAAeD,EAAQ,OAAQ,CAC1C,GAAG,KAAK,gBAAgBP,CAAO,EAC/B,GAAG,KAAK,wBAAwBO,EAAQ,OAAO,CAAA,CAChD,CACH,CASU,wBAAwBT,EAAmB,CAC/C,OAAAA,EAAgB,CAAE,QAAAA,CAAQ,EACvB,KAAK,SAAW,CAAE,QAAS,KAAK,UAAa,EACtD,CAWO,gBACLG,EACAC,EACyB,CACzB,MAAM,IAAIO,EAA0C,yCACtD,CAaU,yBACRR,EACAC,EACA,CACA,MAAMK,EAAUL,GAAY,CAC1B,OAAQ,KAAK,QACb,QAAS,KAAK,QAAA,EAEhB,GAAI,CAACK,EAAS,MAAM,IAAIG,EAA0C,0CAE3D,MAAA,CADST,GAAY,KAAK,SAChBM,CAAO,CAC1B,CACF"}
|
|
@@ -95,6 +95,9 @@ export declare class Deployable<Payload, ContractAbi extends Abi> extends Contra
|
|
|
95
95
|
withPayload(payload: Payload): this;
|
|
96
96
|
/**
|
|
97
97
|
* High level deployment function to deploy and await the contract address.
|
|
98
|
+
* This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,
|
|
99
|
+
* which makes it useless for Boost components.
|
|
100
|
+
* Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
|
|
98
101
|
*
|
|
99
102
|
* @public
|
|
100
103
|
* @async
|
|
@@ -103,9 +106,12 @@ export declare class Deployable<Payload, ContractAbi extends Abi> extends Contra
|
|
|
103
106
|
* @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)
|
|
104
107
|
* @returns {unknown}
|
|
105
108
|
*/
|
|
106
|
-
deploy(_payload?: Payload, _options?: DeployableOptions, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<this>;
|
|
109
|
+
protected deploy(_payload?: Payload, _options?: DeployableOptions, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<this>;
|
|
107
110
|
/**
|
|
108
111
|
* The lower level contract deployment function that does not await for the transaction receipt.
|
|
112
|
+
* This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,
|
|
113
|
+
* which makes it useless for Boost components.
|
|
114
|
+
* Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
|
|
109
115
|
*
|
|
110
116
|
* @public
|
|
111
117
|
* @async
|
|
@@ -116,7 +122,7 @@ export declare class Deployable<Payload, ContractAbi extends Abi> extends Contra
|
|
|
116
122
|
* @throws {@link DeployableWagmiConfigurationRequiredError}
|
|
117
123
|
* @throws {@link DeployableMissingPayloadError}
|
|
118
124
|
*/
|
|
119
|
-
deployRaw(_payload?: Payload, _options?: DeployableOptions): Promise<Hash>;
|
|
125
|
+
protected deployRaw(_payload?: Payload, _options?: DeployableOptions): Promise<Hash>;
|
|
120
126
|
/**
|
|
121
127
|
* Internal function to attach the connected account to write methods to avoid manually passing in an account each call.
|
|
122
128
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deployable.d.ts","sourceRoot":"","sources":["../../src/Deployable/Deployable.ts"],"names":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AO,wBAEV;IAED;;;;;;OAMG;IACI,WAAW,CAAC,OAAO,EAAE,OAAO;IAKnC;;;;;;;;;;;;OAYG;cACa,MAAM,CACpB,QAAQ,CAAC,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,UAAU,CAAC,EAAE,IAAI,CAAC,mCAAmC,EAAE,MAAM,CAAC;IAYhE;;;;;;;;;;;;;;OAcG;cACa,SAAS,CACvB,QAAQ,CAAC,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC,IAAI,CAAC;IAYhB;;;;;;OAMG;IACH,SAAS,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,OAAO;;;;;IAKnD;;;;;;;;OAQG;IACI,eAAe,CACpB,QAAQ,CAAC,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAI1B;;;;;;;;;;OAUG;IACH,SAAS,CAAC,wBAAwB,CAAC,CAAC,GAAG,OAAO,EAC5C,QAAQ,CAAC,EAAE,CAAC,EACZ,QAAQ,CAAC,EAAE,iBAAiB;CAU/B"}
|
|
@@ -36,6 +36,9 @@ class m extends d {
|
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* High level deployment function to deploy and await the contract address.
|
|
39
|
+
* This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,
|
|
40
|
+
* which makes it useless for Boost components.
|
|
41
|
+
* Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
|
|
39
42
|
*
|
|
40
43
|
* @public
|
|
41
44
|
* @async
|
|
@@ -54,6 +57,9 @@ class m extends d {
|
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* The lower level contract deployment function that does not await for the transaction receipt.
|
|
60
|
+
* This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,
|
|
61
|
+
* which makes it useless for Boost components.
|
|
62
|
+
* Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
|
|
57
63
|
*
|
|
58
64
|
* @public
|
|
59
65
|
* @async
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deployable.js","sources":["../../src/Deployable/Deployable.ts"],"sourcesContent":["import { type Config, deployContract } from '@wagmi/core';\nimport type {\n Abi,\n Account,\n Address,\n ContractEventName,\n Hash,\n Hex,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableBuildParametersUnspecifiedError,\n DeployableMissingPayloadError,\n DeployableWagmiConfigurationRequiredError,\n} from '../errors';\nimport { getDeployedContractAddress } from '../utils';\nimport { Contract } from './Contract';\n\n/**\n * A base class representing a deployable contract, contains base implementations for deployment and initialization payload construction.\n *\n * @export\n * @typedef {GenericDeployableParams}\n */\nexport type GenericDeployableParams = Omit<\n Parameters<typeof deployContract>[1],\n 'args' | 'account'\n> & {\n args: [Hex, ...Array<Hex>];\n account?: Account;\n};\n\n/**\n * A generic type that encapsulates either an initialization payload for a contract, or a valid address for a previously deployed contract.\n *\n * @export\n * @typedef {DeployablePayloadOrAddress}\n * @template [Payload=unknown]\n */\nexport type DeployablePayloadOrAddress<Payload = unknown> = Payload | Address;\n\n/**\n * Instantion options for the base deployable.\n *\n * @export\n * @interface DeployableOptions\n * @typedef {DeployableOptions}\n */\nexport interface DeployableOptions {\n /**\n * [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n *\n * @see {@link Config}\n * @type {Config}\n */\n config: Config;\n /**\n * [Viem Local Account](https://viem.sh/docs/accounts/local), required if in a Node environment\n *\n * @see {@link Account}\n * @type {?Account}\n */\n account?: Account;\n}\n\n/**\n * A generic deployable contract that encapsulates common operations related to contract deployment\n *\n * @export\n * @class Deployable\n * @typedef {Deployable}\n * @template [Payload=unknown]\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=ContractEventName<ContractAbi>]\n * @extends {Contract<ContractAbi, ContractEvent>}\n */\nexport class Deployable<\n Payload,\n ContractAbi extends Abi,\n> extends Contract<ContractAbi> {\n /**\n * The deployable payload used either for contract construction or initialization\n *\n * @protected\n * @type {(Payload | undefined)}\n */\n protected _payload: Payload | undefined;\n /**\n * If it exists, [Viem Local Account](https://viem.sh/docs/accounts/local), if in a Node environment\n *\n * @protected\n * @type {?Account}\n */\n protected _account?: Account;\n\n /**\n * Creates an instance of Deployable.\n *\n * @constructor\n * @param {DeployableOptions} param0\n * @param {?Account} [param0.account]\n * @param {Config} param0.config\n * @param {DeployablePayloadOrAddress<Payload>} payload\n */\n constructor(\n { account, config }: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n ) {\n if (typeof payload === 'string') {\n super(config, payload as Address);\n } else {\n super(config, undefined);\n this._payload = payload as Payload;\n }\n if (account) this._account = account;\n }\n\n /**\n * Returns the attached deployable payload, if it exists\n *\n * @readonly\n * @type {Payload}\n */\n get payload() {\n return this._payload;\n }\n\n /**\n * Attaches a new payload for use with this deployable's initialization\n *\n * @public\n * @param {Payload} payload\n * @returns {this}\n */\n public withPayload(payload: Payload) {\n this._payload = payload;\n return this;\n }\n\n /**\n * High level deployment function to deploy and await the contract address.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n * @returns {unknown}\n */\n
|
|
1
|
+
{"version":3,"file":"Deployable.js","sources":["../../src/Deployable/Deployable.ts"],"sourcesContent":["import { type Config, deployContract } from '@wagmi/core';\nimport type {\n Abi,\n Account,\n Address,\n ContractEventName,\n Hash,\n Hex,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableBuildParametersUnspecifiedError,\n DeployableMissingPayloadError,\n DeployableWagmiConfigurationRequiredError,\n} from '../errors';\nimport { getDeployedContractAddress } from '../utils';\nimport { Contract } from './Contract';\n\n/**\n * A base class representing a deployable contract, contains base implementations for deployment and initialization payload construction.\n *\n * @export\n * @typedef {GenericDeployableParams}\n */\nexport type GenericDeployableParams = Omit<\n Parameters<typeof deployContract>[1],\n 'args' | 'account'\n> & {\n args: [Hex, ...Array<Hex>];\n account?: Account;\n};\n\n/**\n * A generic type that encapsulates either an initialization payload for a contract, or a valid address for a previously deployed contract.\n *\n * @export\n * @typedef {DeployablePayloadOrAddress}\n * @template [Payload=unknown]\n */\nexport type DeployablePayloadOrAddress<Payload = unknown> = Payload | Address;\n\n/**\n * Instantion options for the base deployable.\n *\n * @export\n * @interface DeployableOptions\n * @typedef {DeployableOptions}\n */\nexport interface DeployableOptions {\n /**\n * [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n *\n * @see {@link Config}\n * @type {Config}\n */\n config: Config;\n /**\n * [Viem Local Account](https://viem.sh/docs/accounts/local), required if in a Node environment\n *\n * @see {@link Account}\n * @type {?Account}\n */\n account?: Account;\n}\n\n/**\n * A generic deployable contract that encapsulates common operations related to contract deployment\n *\n * @export\n * @class Deployable\n * @typedef {Deployable}\n * @template [Payload=unknown]\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=ContractEventName<ContractAbi>]\n * @extends {Contract<ContractAbi, ContractEvent>}\n */\nexport class Deployable<\n Payload,\n ContractAbi extends Abi,\n> extends Contract<ContractAbi> {\n /**\n * The deployable payload used either for contract construction or initialization\n *\n * @protected\n * @type {(Payload | undefined)}\n */\n protected _payload: Payload | undefined;\n /**\n * If it exists, [Viem Local Account](https://viem.sh/docs/accounts/local), if in a Node environment\n *\n * @protected\n * @type {?Account}\n */\n protected _account?: Account;\n\n /**\n * Creates an instance of Deployable.\n *\n * @constructor\n * @param {DeployableOptions} param0\n * @param {?Account} [param0.account]\n * @param {Config} param0.config\n * @param {DeployablePayloadOrAddress<Payload>} payload\n */\n constructor(\n { account, config }: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n ) {\n if (typeof payload === 'string') {\n super(config, payload as Address);\n } else {\n super(config, undefined);\n this._payload = payload as Payload;\n }\n if (account) this._account = account;\n }\n\n /**\n * Returns the attached deployable payload, if it exists\n *\n * @readonly\n * @type {Payload}\n */\n get payload() {\n return this._payload;\n }\n\n /**\n * Attaches a new payload for use with this deployable's initialization\n *\n * @public\n * @param {Payload} payload\n * @returns {this}\n */\n public withPayload(payload: Payload) {\n this._payload = payload;\n return this;\n }\n\n /**\n * High level deployment function to deploy and await the contract address.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n * @returns {unknown}\n */\n protected async deploy(\n _payload?: Payload,\n _options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n const config = _options?.config || this._config;\n const address = await getDeployedContractAddress(\n config,\n this.deployRaw(_payload, _options),\n waitParams,\n );\n this._address = address;\n return this;\n }\n\n /**\n * The lower level contract deployment function that does not await for the transaction receipt.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n * @throws {@link DeployableAlreadyDeployedError}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return await deployContract(options.config, {\n ...this.buildParameters(payload),\n ...this.optionallyAttachAccount(options.account),\n });\n }\n\n /**\n * Internal function to attach the connected account to write methods to avoid manually passing in an account each call.\n *\n * @protected\n * @param {?Account} [account]\n * @returns {({ account: Account; } | { account?: undefined; })}\n */\n protected optionallyAttachAccount(account?: Account) {\n if (account) return { account };\n return this._account ? { account: this._account } : {};\n }\n\n /**\n * Base parameter constructor, should return a partial `viem.deployContract` parameters shape including abi, bytecode, and arguments, if any.\n * Expected to be overridden by protocol contracts.\n *\n * @public\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n throw new DeployableBuildParametersUnspecifiedError();\n }\n\n /**\n * Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const options = _options || {\n config: this._config,\n account: this._account,\n };\n if (!options) throw new DeployableWagmiConfigurationRequiredError();\n const payload = _payload || this._payload;\n return [payload, options] as [P, DeployableOptions];\n }\n}\n"],"names":["Deployable","Contract","account","config","payload","_payload","_options","waitParams","address","getDeployedContractAddress","DeployableAlreadyDeployedError","options","deployContract","DeployableBuildParametersUnspecifiedError","DeployableWagmiConfigurationRequiredError"],"mappings":";;;;AA6EO,MAAMA,UAGHC,EAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyB9B,YACE,EAAE,SAAAC,GAAS,QAAAC,EAAA,GACXC,GACA;AACI,IAAA,OAAOA,KAAY,W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A;AAAA;AAAA;AAAA,EAWO,gBACLG,GACAC,GACyB;AACzB,UAAM,IAAIO,EAA0C;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaU,yBACRR,GACAC,GACA;AACA,UAAMK,IAAUL,KAAY;AAAA,MAC1B,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,IAAA;AAEhB,QAAI,CAACK;AAAS,YAAM,IAAIG,EAA0C;AAE3D,WAAA,CADST,KAAY,KAAK,UAChBM,CAAO;AAAA,EAC1B;AACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../generated-BzszviNp.cjs"),l=require("@wagmi/core"),i=require("viem"),c=require("../errors.cjs"),u=require("../utils.cjs"),h=require("./Deployable.cjs"),r=class r extends h.Deployable{constructor(s,e,t){super(s,e),this._isBase=!0,typeof e=="string"&&i.isAddress(e)&&e!==this.base&&e!==i.zeroAddress&&(t=!1),t!==void 0&&(this._isBase=t)}get isBase(){return this.address&&this.address!==this.base?!1:this._isBase}get base(){return this.constructor.base}get registryType(){return this.constructor.registryType}async deploy(s,e,t){return await super.deploy(s,e,t),this.assertValidAddress(),this}async deployRaw(s,e){if(this.address)throw new c.DeployableAlreadyDeployedError(this.address);const t=s||this._payload,o=(e==null?void 0:e.config)||this._config,{args:y,...d}=this.buildParameters(t);return await l.deployContract(o,{...d,...this.optionallyAttachAccount(e==null?void 0:e.account),args:[]})}async supportsInterface(s,e){return n.Xn(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...e,args:[s]})}async getComponentInterface(s){return n.Kn(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...s,args:[]})}validateDeploymentConfig(s,e){const t=s||this._payload;if(!t)throw new c.DeployableMissingPayloadError;return super.validateDeploymentConfig(t,e)}};r.base=i.zeroAddress,r.registryType=u.RegistryType.ACTION;let a=r;exports.DeployableTarget=a;
|
|
2
2
|
//# sourceMappingURL=DeployableTarget.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeployableTarget.cjs","sources":["../../src/Deployable/DeployableTarget.ts"],"sourcesContent":["import {\n type aCloneableAbi,\n readACloneableGetComponentInterface as 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 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 the address of the base implementation on chain, used when cloning base contracts.\n *\n * @static\n * @readonly\n * @type {Address}\n */\n static readonly base: Address = zeroAddress;\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
|
|
1
|
+
{"version":3,"file":"DeployableTarget.cjs","sources":["../../src/Deployable/DeployableTarget.ts"],"sourcesContent":["import {\n type aCloneableAbi,\n readACloneableGetComponentInterface as 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 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 the address of the base implementation on chain, used when cloning base contracts.\n *\n * @static\n * @readonly\n * @type {Address}\n */\n static readonly base: Address = zeroAddress;\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 protected _isBase = true;\n get isBase() {\n if (!!this.address && this.address !== this.base) return false;\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 !== this.base &&\n payload !== zeroAddress\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 address\n *\n * @public\n * @readonly\n * @type {Address}\n */\n public get base(): Address {\n return (this.constructor as typeof DeployableTarget).base;\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 {unknown}\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<typeof contractActionAbi, 'supportsInterface'>} [params]\n * @returns {unknown} - True if the contract supports the interface\n */\n public async supportsInterface(\n interfaceId: Hex,\n params?: ReadParams<typeof aCloneableAbi, 'supportsInterface'>,\n ) {\n return 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<typeof contractActionAbi, 'getComponentInterface'>} [params]\n * @returns {unknown}\n */\n public async getComponentInterface(\n params?: ReadParams<typeof aCloneableAbi, 'getComponentInterface'>,\n ) {\n return 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","waitParams","_payload","_options","DeployableAlreadyDeployedError","config","args","deployment","deployContract","interfaceId","params","readACloneableSupportsInterface","readACloneableGetComponentInterface","DeployableMissingPayloadError","RegistryType","DeployableTarget"],"mappings":"2PAmCaA,EAAN,MAAMA,UAGHC,EAAAA,UAAiC,CAqCzC,YACEC,EACAC,EACAC,EACA,CACA,MAAMF,EAASC,CAAO,EAnBxB,KAAU,QAAU,GAsBhB,OAAOA,GAAY,UACnBE,YAAUF,CAAO,GACjBA,IAAY,KAAK,MACjBA,IAAYG,EAAA,cAEHF,EAAA,IACPA,IAAW,SAAW,KAAK,QAAUA,EAC3C,CA5BA,IAAI,QAAS,CACX,OAAM,KAAK,SAAW,KAAK,UAAY,KAAK,KAAa,GAClD,KAAK,OACd,CAkCA,IAAW,MAAgB,CACzB,OAAQ,KAAK,YAAwC,IACvD,CASA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