@layerzerolabs/dw-model 0.2.22 → 0.2.24
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/.turbo/turbo-build.log +75 -67
- package/.turbo/turbo-lint.log +1 -1
- package/dist/{UE2N6Q3B.js → 3XCIUHJG.js} +26 -3
- package/dist/3XCIUHJG.js.map +1 -0
- package/dist/46VB3YIH.js +62 -0
- package/dist/46VB3YIH.js.map +1 -0
- package/dist/5LI6RWBC.cjs +92 -0
- package/dist/5LI6RWBC.cjs.map +1 -0
- package/dist/CA6UC3D3.js +3 -0
- package/dist/CA6UC3D3.js.map +1 -0
- package/dist/{EXN4H4R3.cjs → CC5Y3WY7.cjs} +28 -2
- package/dist/CC5Y3WY7.cjs.map +1 -0
- package/dist/{ZTLVAMWX.cjs → GEY4XYOS.cjs} +10 -11
- package/dist/GEY4XYOS.cjs.map +1 -0
- package/dist/{XODRZ5LJ.js → IUFXXZ2R.js} +3 -3
- package/dist/{XODRZ5LJ.js.map → IUFXXZ2R.js.map} +1 -1
- package/dist/LNEYHCIG.js +84 -0
- package/dist/LNEYHCIG.js.map +1 -0
- package/dist/NCHH4VK3.cjs +4 -0
- package/dist/NCHH4VK3.cjs.map +1 -0
- package/dist/{4NI6WKDH.cjs → PUY2AOFE.cjs} +4 -4
- package/dist/{4NI6WKDH.cjs.map → PUY2AOFE.cjs.map} +1 -1
- package/dist/S5CHYZ3I.cjs +83 -0
- package/dist/S5CHYZ3I.cjs.map +1 -0
- package/dist/{ZQQ6EIFU.js → T2RJHADL.js} +12 -12
- package/dist/T2RJHADL.js.map +1 -0
- package/dist/deploy/factoryInterfaces.cjs +23 -0
- package/dist/deploy/factoryInterfaces.cjs.map +1 -0
- package/dist/deploy/factoryInterfaces.d.ts +271 -0
- package/dist/deploy/factoryInterfaces.d.ts.map +1 -0
- package/dist/deploy/factoryInterfaces.js +6 -0
- package/dist/deploy/factoryInterfaces.js.map +1 -0
- package/dist/deploy/index.cjs +49 -40
- package/dist/deploy/index.d.ts +1 -0
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/index.js +5 -4
- package/dist/deploy/resources.cjs +17 -17
- package/dist/deploy/resources.d.ts +5 -2
- package/dist/deploy/resources.d.ts.map +1 -1
- package/dist/deploy/resources.js +2 -2
- package/dist/deploy/workflow.cjs +18 -22
- package/dist/deploy/workflow.d.ts +34 -14
- package/dist/deploy/workflow.d.ts.map +1 -1
- package/dist/deploy/workflow.js +1 -1
- package/dist/index.cjs +125 -76
- package/dist/index.js +8 -7
- package/dist/role-management/index.cjs +18 -6
- package/dist/role-management/index.js +1 -1
- package/dist/role-management/schemata.cjs +18 -6
- package/dist/role-management/schemata.d.ts +62 -0
- package/dist/role-management/schemata.d.ts.map +1 -1
- package/dist/role-management/schemata.js +1 -1
- package/dist/upgrade/index.cjs +38 -10
- package/dist/upgrade/index.js +1 -1
- package/dist/upgrade/types.cjs +38 -10
- package/dist/upgrade/types.d.ts +55 -10
- package/dist/upgrade/types.d.ts.map +1 -1
- package/dist/upgrade/types.js +1 -1
- package/package.json +9 -9
- package/src/deploy/factoryInterfaces.ts +100 -0
- package/src/deploy/index.ts +1 -0
- package/src/deploy/resources.md +84 -0
- package/src/deploy/workflow.ts +11 -12
- package/src/role-management/schemata.ts +36 -0
- package/src/upgrade/types.ts +61 -4
- package/dist/EXN4H4R3.cjs.map +0 -1
- package/dist/NLDQ72XO.js +0 -3
- package/dist/NLDQ72XO.js.map +0 -1
- package/dist/RDYET6CZ.js +0 -38
- package/dist/RDYET6CZ.js.map +0 -1
- package/dist/TY2SXEDC.cjs +0 -4
- package/dist/TY2SXEDC.cjs.map +0 -1
- package/dist/UE2N6Q3B.js.map +0 -1
- package/dist/WYAGX6NX.cjs +0 -52
- package/dist/WYAGX6NX.cjs.map +0 -1
- package/dist/ZQQ6EIFU.js.map +0 -1
- package/dist/ZTLVAMWX.cjs.map +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# On the resource model
|
|
2
|
+
|
|
3
|
+
## Background
|
|
4
|
+
|
|
5
|
+
We started with a schema defining the config and another schema defining the
|
|
6
|
+
interface of the activity factory that deploys contracts.
|
|
7
|
+
|
|
8
|
+
The first problem with this is the duplication. The second problem with this is that you necessarily require
|
|
9
|
+
the workflow to be able to transform between these two schemata. For example, if deploying an OFT LUA requires
|
|
10
|
+
that we know the token address, the workflow must now have bespoke handling to inject this parameter into the activity factory.
|
|
11
|
+
|
|
12
|
+
From here, you make the optimization of treating config as source of truth, and having activity factories receive the config,
|
|
13
|
+
and additional arguments that they require and that are only known at workflow time/don't need to be in the config.
|
|
14
|
+
|
|
15
|
+
This, still, requires custom workflow for any ordering of dependencies, injecting of addresses, and does not provide any way
|
|
16
|
+
to compose the deployment of multiple contracts.
|
|
17
|
+
|
|
18
|
+
## Resources
|
|
19
|
+
|
|
20
|
+
Resources, then, are a generalization of this idea. A resource, at its most basic, is a configuration of a contract,
|
|
21
|
+
which can be `resolve()`d and passed to an activity factory to deploy. The resolution step is completely generic,
|
|
22
|
+
simply injecting its references to other resources.
|
|
23
|
+
|
|
24
|
+
## Resource registry
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
resourceRegistry: (resourceId: string, resourceSubkey?: string) => RealID;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The resource registry is responsible for understanding the status of reification of your resources.
|
|
31
|
+
That is, the resource registry is the exclusive entity that holds the "address" of your "contracts".
|
|
32
|
+
|
|
33
|
+
"Address" here is not meant literally. Rather, it is a generalization, `RealID`. A RealID
|
|
34
|
+
is an identifier for a deployed resource. "Deployment" here is is not meant literally.
|
|
35
|
+
For example, pushing mesh resources to LZ metadata is a deployment. Deployment _is_, however,
|
|
36
|
+
whatever action creates the canonical identifier for the registry.
|
|
37
|
+
|
|
38
|
+
In summary,
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
config === resource
|
|
42
|
+
address === realID
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Resource subkeys are suffixes that identify optional additional RealIDs associated with the same resource.
|
|
46
|
+
For example, an OFT may have a proxy, an implementation, and a proxy admin. One of these is the canonical RealID.
|
|
47
|
+
The canonical RealID is whichever RealID identifies the semantic entity, in this case whichever contract can lzReceive,
|
|
48
|
+
in this case the proxy. Therefore, this resource has
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
<resourceId> -> <realId> (proxy contract)
|
|
52
|
+
<resourceId/impl> -> <realId> (implementation contract)
|
|
53
|
+
<resourceId/proxy-admin> -> <realId> (proxy admin contract)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
These additional realIds are _not_ identifiers for the resource, but are persisted for contexts in which they might be relevant.
|
|
57
|
+
For any consumer who is unaware of the context of proxies, they need only identify the resource by its ID to receive the "correct"
|
|
58
|
+
semantic RealID. Of course correct depends on the context, which is why this strategy should be used carefully.
|
|
59
|
+
|
|
60
|
+
## Artifact registry
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
artifactRegistry: (realId: string) => Artifact
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Artifacts are metadata associated with some realId.
|
|
67
|
+
For example,
|
|
68
|
+
|
|
69
|
+
- The time a contract was deployed
|
|
70
|
+
- The number of optimizers runs on that contract
|
|
71
|
+
- Whether a contract has been pushed to metadata
|
|
72
|
+
|
|
73
|
+
Each artifact is separate and identified by an `ArtifactType`.
|
|
74
|
+
|
|
75
|
+
## Deployment flow
|
|
76
|
+
|
|
77
|
+
Topologically sort all resources in consideration, then sequentially map resource type -> factory.
|
|
78
|
+
Collect deployment transactions per factory, save RealID and optionally artifacts.
|
|
79
|
+
|
|
80
|
+
## Wiring flow
|
|
81
|
+
|
|
82
|
+
For each resource in consideration, fetch its RealID, specialize the relevant factory and operate.
|
|
83
|
+
Generally this will not require any artifact, unless the factory in question needs to obtain an artifact for specific purposes.
|
|
84
|
+
If it does, this will happen via backchannel lookup and will be hidden from the workflow.
|
package/src/deploy/workflow.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { SuiObjectChange } from '@mysten/sui/client';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { normalizedHexSchema } from '@layerzerolabs/common-chain-model';
|
|
5
|
+
import { successfulGatedTransactionSchema } from '@layerzerolabs/gated-transaction';
|
|
5
6
|
import { ChainName } from '@layerzerolabs/layerzero-definitions';
|
|
6
7
|
import { functionSchema } from '@layerzerolabs/zod-utils';
|
|
7
8
|
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
deploymentArtifactSchema,
|
|
11
12
|
fullDeploymentArtifactSchema,
|
|
12
13
|
identityOnlyDeploymentArtifactSchema,
|
|
14
|
+
verificationArtifactSchema,
|
|
13
15
|
} from './artifact';
|
|
14
16
|
|
|
15
17
|
export type { SuiObjectChange };
|
|
@@ -92,22 +94,19 @@ export const getVerificationInfoBaseArgs = z.object({
|
|
|
92
94
|
});
|
|
93
95
|
export type GetVerificationInfoBaseArgs = z.infer<typeof getVerificationInfoBaseArgs>;
|
|
94
96
|
|
|
95
|
-
export const
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
export const extractVerificationArtifactBaseArgs = z.object({
|
|
98
|
+
gtx: successfulGatedTransactionSchema(),
|
|
99
|
+
deploymentInfo: fullDeploymentArtifactSchema,
|
|
100
|
+
nonVerifyable: z.boolean().optional(),
|
|
98
101
|
});
|
|
99
|
-
export type
|
|
100
|
-
typeof
|
|
102
|
+
export type extractVerificationArtifactBaseArgs = z.infer<
|
|
103
|
+
typeof extractVerificationArtifactBaseArgs
|
|
101
104
|
>;
|
|
102
105
|
|
|
103
|
-
export const
|
|
104
|
-
deployedBytecode: hexSchema.optional(),
|
|
106
|
+
export const saveVerificationInfoBaseArgs = z.object({
|
|
105
107
|
deploymentInfo: fullDeploymentArtifactSchema,
|
|
106
|
-
|
|
108
|
+
verificationInfo: verificationArtifactSchema,
|
|
107
109
|
});
|
|
108
|
-
export type CreateVerificationInfoBaseArgs = z.infer<typeof createVerificationInfoBaseArgs>;
|
|
109
|
-
|
|
110
|
-
export const saveVerificationInfoBaseArgs = createVerificationInfoBaseArgs;
|
|
111
110
|
|
|
112
111
|
export type SaveVerificationInfoBaseArgs = z.infer<typeof saveVerificationInfoBaseArgs>;
|
|
113
112
|
|
|
@@ -36,6 +36,18 @@ export const generateHasRoleSchema = <const T extends readonly [string, ...strin
|
|
|
36
36
|
output: z.promise(z.boolean()),
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
export const generateGetRoleMembersSchema = <const T extends readonly [string, ...string[]]>(
|
|
40
|
+
roles: T,
|
|
41
|
+
) =>
|
|
42
|
+
functionSchema({
|
|
43
|
+
input: z.tuple([
|
|
44
|
+
z.object({
|
|
45
|
+
role: z.enum(roles),
|
|
46
|
+
}),
|
|
47
|
+
]),
|
|
48
|
+
output: z.promise(z.array(normalizedHexSchema)),
|
|
49
|
+
});
|
|
50
|
+
|
|
39
51
|
export const generateRoleManagementSchemas = <const T extends readonly [string, ...string[]]>(
|
|
40
52
|
roles: T,
|
|
41
53
|
) => ({
|
|
@@ -43,6 +55,15 @@ export const generateRoleManagementSchemas = <const T extends readonly [string,
|
|
|
43
55
|
hasRole: generateHasRoleSchema(roles),
|
|
44
56
|
});
|
|
45
57
|
|
|
58
|
+
export const generateEnumerableRoleManagementSchemas = <
|
|
59
|
+
const T extends readonly [string, ...string[]],
|
|
60
|
+
>(
|
|
61
|
+
roles: T,
|
|
62
|
+
) => ({
|
|
63
|
+
...generateRoleManagementSchemas(roles),
|
|
64
|
+
getRoleMembers: generateGetRoleMembersSchema(roles),
|
|
65
|
+
});
|
|
66
|
+
|
|
46
67
|
export const createSetRoleTransactionsWithSpecializedInputSchema = functionSchema({
|
|
47
68
|
input: z.tuple([
|
|
48
69
|
z.object({
|
|
@@ -75,7 +96,22 @@ export const hasRoleWithSpecializedInputSchema = functionSchema({
|
|
|
75
96
|
output: z.promise(z.boolean()),
|
|
76
97
|
});
|
|
77
98
|
|
|
99
|
+
export const getRoleMembersWithSpecializedInputSchema = functionSchema({
|
|
100
|
+
input: z.tuple([
|
|
101
|
+
z.object({
|
|
102
|
+
address: normalizedHexSchema,
|
|
103
|
+
}),
|
|
104
|
+
z.object({
|
|
105
|
+
role: z.string(),
|
|
106
|
+
}),
|
|
107
|
+
]),
|
|
108
|
+
output: z.promise(z.array(normalizedHexSchema)),
|
|
109
|
+
});
|
|
110
|
+
|
|
78
111
|
export type CreateSetRoleTransactionsWithSpecializedInput = z.infer<
|
|
79
112
|
typeof createSetRoleTransactionsWithSpecializedInputSchema
|
|
80
113
|
>;
|
|
81
114
|
export type HasRoleWithSpecializedInput = z.infer<typeof hasRoleWithSpecializedInputSchema>;
|
|
115
|
+
export type GetRoleMembersWithSpecializedInput = z.infer<
|
|
116
|
+
typeof getRoleMembersWithSpecializedInputSchema
|
|
117
|
+
>;
|
package/src/upgrade/types.ts
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
|
|
3
|
+
import { decimalStringSchema, hexSchema } from '@layerzerolabs/common-chain-model';
|
|
4
|
+
import type { DecimalString, HexString } from '@layerzerolabs/typescript-utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Result type for `getInitializeData` function pointer.
|
|
8
|
+
* Contains the encoded initialization data and an optional gas limit override.
|
|
9
|
+
*/
|
|
10
|
+
export interface InitializeDataResult {
|
|
11
|
+
/** Encoded initialization data (e.g., encodeFunctionData for initialize(...)) */
|
|
12
|
+
data: HexString;
|
|
13
|
+
/** Optional gas limit override for the initialization transaction */
|
|
14
|
+
gasLimit?: DecimalString;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* `InitializeDataResult` schema.
|
|
19
|
+
*/
|
|
20
|
+
export const initializeDataResultSchema = z.object({
|
|
21
|
+
data: hexSchema,
|
|
22
|
+
gasLimit: decimalStringSchema.optional(),
|
|
23
|
+
});
|
|
24
|
+
|
|
3
25
|
export enum UpgradeType {
|
|
4
26
|
// This doesn't necessarily prevent the contract from being upgraded
|
|
5
27
|
NOT_UPGRADEABLE = 'NOT_UPGRADEABLE',
|
|
@@ -10,12 +32,47 @@ export enum UpgradeType {
|
|
|
10
32
|
}
|
|
11
33
|
|
|
12
34
|
export enum EvmProxyType {
|
|
13
|
-
// TUP https://docs.openzeppelin.com/contracts/5.x/api/proxy#transparentupgradeableproxy
|
|
14
|
-
|
|
15
|
-
// UUPS https://docs.openzeppelin.com/contracts/5.x/api/proxy#uupsupgradeable
|
|
16
|
-
|
|
35
|
+
// TUP v5 https://docs.openzeppelin.com/contracts/5.x/api/proxy#transparentupgradeableproxy
|
|
36
|
+
TRANSPARENT_UPGRADEABLE_V5 = 'TRANSPARENT_UPGRADEABLE_V5',
|
|
37
|
+
// UUPS v5 https://docs.openzeppelin.com/contracts/5.x/api/proxy#uupsupgradeable
|
|
38
|
+
UNIVERSAL_UPGRADEABLE_V5 = 'UNIVERSAL_UPGRADEABLE_V5',
|
|
39
|
+
// OTUP v4 https://github.com/wighawag/hardhat-deploy/blob/v0.12.1/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol
|
|
40
|
+
OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4 = 'OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4',
|
|
41
|
+
// TUP v4 https://docs.openzeppelin.com/contracts/4.x/api/proxy#TransparentUpgradeableProxy
|
|
42
|
+
TRANSPARENT_UPGRADEABLE_V4 = 'TRANSPARENT_UPGRADEABLE_V4',
|
|
43
|
+
// UUPS v4 https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable
|
|
44
|
+
UNIVERSAL_UPGRADEABLE_V4 = 'UNIVERSAL_UPGRADEABLE_V4',
|
|
17
45
|
}
|
|
18
46
|
|
|
47
|
+
/** UUPS-based proxy types (no separate `ProxyAdmin`). */
|
|
48
|
+
export const UUPS_PROXY_TYPES: ReadonlySet<EvmProxyType> = new Set([
|
|
49
|
+
EvmProxyType.UNIVERSAL_UPGRADEABLE_V4,
|
|
50
|
+
EvmProxyType.UNIVERSAL_UPGRADEABLE_V5,
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
/** TUP-based proxy types (have a `ProxyAdmin` with `getOwner`/`setOwner`). */
|
|
54
|
+
export const TUP_PROXY_TYPES: ReadonlySet<EvmProxyType> = new Set([
|
|
55
|
+
EvmProxyType.TRANSPARENT_UPGRADEABLE_V4,
|
|
56
|
+
EvmProxyType.TRANSPARENT_UPGRADEABLE_V5,
|
|
57
|
+
EvmProxyType.OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4,
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
/** Proxy types that deploy a separate `ProxyAdmin` contract (v4 variants only). */
|
|
61
|
+
export const SEPARATE_PROXY_ADMIN_TYPES: ReadonlySet<EvmProxyType> = new Set([
|
|
62
|
+
EvmProxyType.TRANSPARENT_UPGRADEABLE_V4,
|
|
63
|
+
EvmProxyType.OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4,
|
|
64
|
+
]);
|
|
65
|
+
|
|
66
|
+
/** Whether the proxy type is UUPS (Universal Upgradeable Proxy Standard). */
|
|
67
|
+
export const isUupsProxy = (proxyType: EvmProxyType): boolean => UUPS_PROXY_TYPES.has(proxyType);
|
|
68
|
+
|
|
69
|
+
/** Whether the proxy type is TUP (Transparent Upgradeable Proxy). */
|
|
70
|
+
export const isTupProxy = (proxyType: EvmProxyType): boolean => TUP_PROXY_TYPES.has(proxyType);
|
|
71
|
+
|
|
72
|
+
/** Whether the proxy type requires a separate `ProxyAdmin` deployment (v4 variants). */
|
|
73
|
+
export const requiresSeparateProxyAdminDeploy = (proxyType: EvmProxyType): boolean =>
|
|
74
|
+
SEPARATE_PROXY_ADMIN_TYPES.has(proxyType);
|
|
75
|
+
|
|
19
76
|
export const ProxyType = {
|
|
20
77
|
...EvmProxyType,
|
|
21
78
|
};
|
package/dist/EXN4H4R3.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/role-management/schemata.ts"],"names":["generateCreateSetRoleTransactionsSchema","__name","roles","functionSchema","input","z","tuple","object","role","enum","accountAddress","normalizedHexSchema","shouldGrant","boolean","output","promise","gatedTransactionSchema","name","string","transactionSchema","array","generateHasRoleSchema","generateRoleManagementSchemas","createSetRoleTransactions","hasRole","createSetRoleTransactionsWithSpecializedInputSchema","address","hasRoleWithSpecializedInputSchema"],"mappings":";;;;;;;;AAMO,IAAMA,uCAAAA,mBAA0CC,mBAAA,CAAA,CAGnDC,KAAAA,KAEAC,uBAAAA,CAAe;AACXC,EAAAA,KAAAA,EAAOC,MAAEC,KAAAA,CAAM;AACXD,IAAAA,KAAAA,CAAEE,MAAAA,CAAO;MACLC,IAAAA,EAAMH,KAAAA,CAAEI,KAAKP,KAAAA,CAAAA;MACbQ,cAAAA,EAAgBC,oCAAAA;AAChBC,MAAAA,WAAAA,EAAaP,MAAEQ,OAAAA;KACnB;AACH,GAAA,CAAA;EACDC,MAAAA,EAAQT,KAAAA,CAAEU,QACNC,uCAAAA,CAAuB;AACnBC,IAAAA,IAAAA,EAAMZ,MAAEa,MAAAA,EAAM;AACdC,uBAAAA;GACJ,CAAA,CAAGC,OAAK;AAEhB,CAAA,CAAA,EAnBmD,yCAAA;AAqBhD,IAAMC,qBAAAA,mBAAwBpB,mBAAA,CAAA,CAAiDC,KAAAA,KAClFC,uBAAAA,CAAe;AACXC,EAAAA,KAAAA,EAAOC,MAAEC,KAAAA,CAAM;AACXD,IAAAA,KAAAA,CAAEE,MAAAA,CAAO;MACLC,IAAAA,EAAMH,KAAAA,CAAEI,KAAKP,KAAAA,CAAAA;MACbQ,cAAAA,EAAgBC;KACpB;AACH,GAAA,CAAA;AACDG,EAAAA,MAAAA,EAAQT,KAAAA,CAAEU,OAAAA,CAAQV,KAAAA,CAAEQ,OAAAA,EAAO;AAC/B,CAAA,CAAA,EATiC,uBAAA;AAW9B,IAAMS,6BAAAA,wCACTpB,KAAAA,MACE;AACFqB,EAAAA,yBAAAA,EAA2BvB,wCAAwCE,KAAAA,CAAAA;AACnEsB,EAAAA,OAAAA,EAASH,sBAAsBnB,KAAAA;AACnC,CAAA,CAAA,EAL6C,+BAAA;AAOtC,IAAMuB,sDAAsDtB,uBAAAA,CAAe;AAC9EC,EAAAA,KAAAA,EAAOC,MAAEC,KAAAA,CAAM;AACXD,IAAAA,KAAAA,CAAEE,MAAAA,CAAO;MACLmB,OAAAA,EAASf;KACb,CAAA;AACAN,IAAAA,KAAAA,CAAEE,MAAAA,CAAO;AACLC,MAAAA,IAAAA,EAAMH,MAAEa,MAAAA,EAAM;MACdR,cAAAA,EAAgBC,oCAAAA;AAChBC,MAAAA,WAAAA,EAAaP,MAAEQ,OAAAA;KACnB;AACH,GAAA,CAAA;EACDC,MAAAA,EAAQT,KAAAA,CAAEU,QACNC,uCAAAA,CAAuB;AACnBC,IAAAA,IAAAA,EAAMZ,MAAEa,MAAAA,EAAM;AACdC,uBAAAA;GACJ,CAAA,CAAGC,OAAK;AAEhB,CAAA;AAEO,IAAMO,oCAAoCxB,uBAAAA,CAAe;AAC5DC,EAAAA,KAAAA,EAAOC,MAAEC,KAAAA,CAAM;AACXD,IAAAA,KAAAA,CAAEE,MAAAA,CAAO;MACLmB,OAAAA,EAASf;KACb,CAAA;AACAN,IAAAA,KAAAA,CAAEE,MAAAA,CAAO;AACLC,MAAAA,IAAAA,EAAMH,MAAEa,MAAAA,EAAM;MACdR,cAAAA,EAAgBC;KACpB;AACH,GAAA,CAAA;AACDG,EAAAA,MAAAA,EAAQT,KAAAA,CAAEU,OAAAA,CAAQV,KAAAA,CAAEQ,OAAAA,EAAO;AAC/B,CAAA","file":"EXN4H4R3.cjs","sourcesContent":["import { z } from 'zod';\n\nimport { normalizedHexSchema, transactionSchema } from '@layerzerolabs/common-chain-model';\nimport { gatedTransactionSchema } from '@layerzerolabs/gated-transaction';\nimport { functionSchema } from '@layerzerolabs/zod-utils';\n\nexport const generateCreateSetRoleTransactionsSchema = <\n const T extends readonly [string, ...string[]],\n>(\n roles: T,\n) =>\n functionSchema({\n input: z.tuple([\n z.object({\n role: z.enum(roles),\n accountAddress: normalizedHexSchema,\n shouldGrant: z.boolean(),\n }),\n ]),\n output: z.promise(\n gatedTransactionSchema({\n name: z.string(),\n transactionSchema: transactionSchema,\n }).array(),\n ),\n });\n\nexport const generateHasRoleSchema = <const T extends readonly [string, ...string[]]>(roles: T) =>\n functionSchema({\n input: z.tuple([\n z.object({\n role: z.enum(roles),\n accountAddress: normalizedHexSchema,\n }),\n ]),\n output: z.promise(z.boolean()),\n });\n\nexport const generateRoleManagementSchemas = <const T extends readonly [string, ...string[]]>(\n roles: T,\n) => ({\n createSetRoleTransactions: generateCreateSetRoleTransactionsSchema(roles),\n hasRole: generateHasRoleSchema(roles),\n});\n\nexport const createSetRoleTransactionsWithSpecializedInputSchema = functionSchema({\n input: z.tuple([\n z.object({\n address: normalizedHexSchema,\n }),\n z.object({\n role: z.string(),\n accountAddress: normalizedHexSchema,\n shouldGrant: z.boolean(),\n }),\n ]),\n output: z.promise(\n gatedTransactionSchema({\n name: z.string(),\n transactionSchema: transactionSchema,\n }).array(),\n ),\n});\n\nexport const hasRoleWithSpecializedInputSchema = functionSchema({\n input: z.tuple([\n z.object({\n address: normalizedHexSchema,\n }),\n z.object({\n role: z.string(),\n accountAddress: normalizedHexSchema,\n }),\n ]),\n output: z.promise(z.boolean()),\n});\n\nexport type CreateSetRoleTransactionsWithSpecializedInput = z.infer<\n typeof createSetRoleTransactionsWithSpecializedInputSchema\n>;\nexport type HasRoleWithSpecializedInput = z.infer<typeof hasRoleWithSpecializedInputSchema>;\n"]}
|
package/dist/NLDQ72XO.js
DELETED
package/dist/NLDQ72XO.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"NLDQ72XO.js"}
|
package/dist/RDYET6CZ.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
|
|
3
|
-
// src/upgrade/types.ts
|
|
4
|
-
var UpgradeType = /* @__PURE__ */ (function(UpgradeType2) {
|
|
5
|
-
UpgradeType2["NOT_UPGRADEABLE"] = "NOT_UPGRADEABLE";
|
|
6
|
-
UpgradeType2["PROXY"] = "PROXY";
|
|
7
|
-
UpgradeType2["CODE_UPGRADE"] = "CODE_UPGRADE";
|
|
8
|
-
return UpgradeType2;
|
|
9
|
-
})({});
|
|
10
|
-
var EvmProxyType = /* @__PURE__ */ (function(EvmProxyType2) {
|
|
11
|
-
EvmProxyType2["TRANSPARENT_UPGRADEABLE"] = "TRANSPARENT_UPGRADEABLE";
|
|
12
|
-
EvmProxyType2["UNIVERSAL_UPGRADEABLE"] = "UNIVERSAL_UPGRADEABLE";
|
|
13
|
-
return EvmProxyType2;
|
|
14
|
-
})({});
|
|
15
|
-
var ProxyType = {
|
|
16
|
-
...EvmProxyType
|
|
17
|
-
};
|
|
18
|
-
var upgradeTypeSchema = z.enum(UpgradeType);
|
|
19
|
-
var proxyTypeSchema = z.enum(ProxyType);
|
|
20
|
-
var proxyConfigSchema = z.object({
|
|
21
|
-
upgradeType: z.literal("PROXY"),
|
|
22
|
-
proxyType: proxyTypeSchema
|
|
23
|
-
});
|
|
24
|
-
var notUpgradeableConfigSchema = z.object({
|
|
25
|
-
upgradeType: z.literal("NOT_UPGRADEABLE")
|
|
26
|
-
});
|
|
27
|
-
var codeUpgradeableConfigSchema = z.object({
|
|
28
|
-
upgradeType: z.literal("CODE_UPGRADE")
|
|
29
|
-
});
|
|
30
|
-
var upgradeableConfigSchema = z.discriminatedUnion("upgradeType", [
|
|
31
|
-
proxyConfigSchema,
|
|
32
|
-
notUpgradeableConfigSchema,
|
|
33
|
-
codeUpgradeableConfigSchema
|
|
34
|
-
]);
|
|
35
|
-
|
|
36
|
-
export { EvmProxyType, ProxyType, UpgradeType, codeUpgradeableConfigSchema, notUpgradeableConfigSchema, proxyConfigSchema, proxyTypeSchema, upgradeTypeSchema, upgradeableConfigSchema };
|
|
37
|
-
//# sourceMappingURL=RDYET6CZ.js.map
|
|
38
|
-
//# sourceMappingURL=RDYET6CZ.js.map
|
package/dist/RDYET6CZ.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/upgrade/types.ts"],"names":["UpgradeType","EvmProxyType","ProxyType","upgradeTypeSchema","z","enum","proxyTypeSchema","proxyConfigSchema","object","upgradeType","literal","proxyType","notUpgradeableConfigSchema","codeUpgradeableConfigSchema","upgradeableConfigSchema","discriminatedUnion"],"mappings":";;;AAEO,IAAKA,WAAAA,6BAAAA,YAAAA,EAAAA;;;;AAAAA,EAAAA,OAAAA,YAAAA;;AASL,IAAKC,YAAAA,6BAAAA,aAAAA,EAAAA;;;AAAAA,EAAAA,OAAAA,aAAAA;;AAOL,IAAMC,SAAAA,GAAY;EACrB,GAAGD;AACP;AAIO,IAAME,iBAAAA,GAAoBC,CAAAA,CAAEC,IAAAA,CAAKL,WAAAA;AAEjC,IAAMM,eAAAA,GAAkBF,CAAAA,CAAEC,IAAAA,CAAKH,SAAAA;AAC/B,IAAMK,iBAAAA,GAAoBH,EAAEI,MAAAA,CAAO;EACtCC,WAAAA,EAAaL,CAAAA,CAAEM,QAAO,OAAA,CAAA;EACtBC,SAAAA,EAAWL;AACf,CAAA;AAIO,IAAMM,0BAAAA,GAA6BR,EAAEI,MAAAA,CAAO;EAC/CC,WAAAA,EAAaL,CAAAA,CAAEM,QAAO,iBAAA;AAC1B,CAAA;AAIO,IAAMG,2BAAAA,GAA8BT,EAAEI,MAAAA,CAAO;EAChDC,WAAAA,EAAaL,CAAAA,CAAEM,QAAO,cAAA;AAC1B,CAAA;AAIO,IAAMI,uBAAAA,GAA0BV,CAAAA,CAAEW,kBAAAA,CAAmB,aAAA,EAAe;AACvER,EAAAA,iBAAAA;AACAK,EAAAA,0BAAAA;AACAC,EAAAA;AACH,CAAA","file":"RDYET6CZ.js","sourcesContent":["import z from 'zod';\n\nexport enum UpgradeType {\n // This doesn't necessarily prevent the contract from being upgraded\n NOT_UPGRADEABLE = 'NOT_UPGRADEABLE',\n // Deploy a separate 'proxy' contract that will route calls to a swappable implementation\n PROXY = 'PROXY',\n // This doesn't necessarily allow the contract to be upgraded\n CODE_UPGRADE = 'CODE_UPGRADE',\n}\n\nexport enum EvmProxyType {\n // TUP https://docs.openzeppelin.com/contracts/5.x/api/proxy#transparentupgradeableproxy\n TRANSPARENT_UPGRADEABLE = 'TRANSPARENT_UPGRADEABLE',\n // UUPS https://docs.openzeppelin.com/contracts/5.x/api/proxy#uupsupgradeable\n UNIVERSAL_UPGRADEABLE = 'UNIVERSAL_UPGRADEABLE',\n}\n\nexport const ProxyType = {\n ...EvmProxyType,\n};\n\nexport type ProxyType = (typeof ProxyType)[keyof typeof ProxyType];\n\nexport const upgradeTypeSchema = z.enum(UpgradeType);\n\nexport const proxyTypeSchema = z.enum(ProxyType);\nexport const proxyConfigSchema = z.object({\n upgradeType: z.literal(UpgradeType.PROXY),\n proxyType: proxyTypeSchema,\n});\n\nexport type ProxyUpgradeableConfig = z.infer<typeof proxyConfigSchema>;\n\nexport const notUpgradeableConfigSchema = z.object({\n upgradeType: z.literal(UpgradeType.NOT_UPGRADEABLE),\n});\n\nexport type NotUpgradeableConfig = z.infer<typeof notUpgradeableConfigSchema>;\n\nexport const codeUpgradeableConfigSchema = z.object({\n upgradeType: z.literal(UpgradeType.CODE_UPGRADE),\n});\n\nexport type CodeUpgradeableConfig = z.infer<typeof codeUpgradeableConfigSchema>;\n\nexport const upgradeableConfigSchema = z.discriminatedUnion('upgradeType', [\n proxyConfigSchema,\n notUpgradeableConfigSchema,\n codeUpgradeableConfigSchema,\n]);\n\nexport type UpgradeableConfig = z.infer<typeof upgradeableConfigSchema>;\n"]}
|
package/dist/TY2SXEDC.cjs
DELETED
package/dist/TY2SXEDC.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"TY2SXEDC.cjs"}
|
package/dist/UE2N6Q3B.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/role-management/schemata.ts"],"names":["generateCreateSetRoleTransactionsSchema","roles","functionSchema","input","z","tuple","object","role","enum","accountAddress","normalizedHexSchema","shouldGrant","boolean","output","promise","gatedTransactionSchema","name","string","transactionSchema","array","generateHasRoleSchema","generateRoleManagementSchemas","createSetRoleTransactions","hasRole","createSetRoleTransactionsWithSpecializedInputSchema","address","hasRoleWithSpecializedInputSchema"],"mappings":";;;;;;AAMO,IAAMA,uCAAAA,mBAA0C,MAAA,CAAA,CAGnDC,KAAAA,KAEAC,cAAAA,CAAe;AACXC,EAAAA,KAAAA,EAAOC,EAAEC,KAAAA,CAAM;AACXD,IAAAA,CAAAA,CAAEE,MAAAA,CAAO;MACLC,IAAAA,EAAMH,CAAAA,CAAEI,KAAKP,KAAAA,CAAAA;MACbQ,cAAAA,EAAgBC,mBAAAA;AAChBC,MAAAA,WAAAA,EAAaP,EAAEQ,OAAAA;KACnB;AACH,GAAA,CAAA;EACDC,MAAAA,EAAQT,CAAAA,CAAEU,QACNC,sBAAAA,CAAuB;AACnBC,IAAAA,IAAAA,EAAMZ,EAAEa,MAAAA,EAAM;AACdC,IAAAA;GACJ,CAAA,CAAGC,OAAK;AAEhB,CAAA,CAAA,EAnBmD,yCAAA;AAqBhD,IAAMC,qBAAAA,mBAAwB,MAAA,CAAA,CAAiDnB,KAAAA,KAClFC,cAAAA,CAAe;AACXC,EAAAA,KAAAA,EAAOC,EAAEC,KAAAA,CAAM;AACXD,IAAAA,CAAAA,CAAEE,MAAAA,CAAO;MACLC,IAAAA,EAAMH,CAAAA,CAAEI,KAAKP,KAAAA,CAAAA;MACbQ,cAAAA,EAAgBC;KACpB;AACH,GAAA,CAAA;AACDG,EAAAA,MAAAA,EAAQT,CAAAA,CAAEU,OAAAA,CAAQV,CAAAA,CAAEQ,OAAAA,EAAO;AAC/B,CAAA,CAAA,EATiC,uBAAA;AAW9B,IAAMS,6BAAAA,2BACTpB,KAAAA,MACE;AACFqB,EAAAA,yBAAAA,EAA2BtB,wCAAwCC,KAAAA,CAAAA;AACnEsB,EAAAA,OAAAA,EAASH,sBAAsBnB,KAAAA;AACnC,CAAA,CAAA,EAL6C,+BAAA;AAOtC,IAAMuB,sDAAsDtB,cAAAA,CAAe;AAC9EC,EAAAA,KAAAA,EAAOC,EAAEC,KAAAA,CAAM;AACXD,IAAAA,CAAAA,CAAEE,MAAAA,CAAO;MACLmB,OAAAA,EAASf;KACb,CAAA;AACAN,IAAAA,CAAAA,CAAEE,MAAAA,CAAO;AACLC,MAAAA,IAAAA,EAAMH,EAAEa,MAAAA,EAAM;MACdR,cAAAA,EAAgBC,mBAAAA;AAChBC,MAAAA,WAAAA,EAAaP,EAAEQ,OAAAA;KACnB;AACH,GAAA,CAAA;EACDC,MAAAA,EAAQT,CAAAA,CAAEU,QACNC,sBAAAA,CAAuB;AACnBC,IAAAA,IAAAA,EAAMZ,EAAEa,MAAAA,EAAM;AACdC,IAAAA;GACJ,CAAA,CAAGC,OAAK;AAEhB,CAAA;AAEO,IAAMO,oCAAoCxB,cAAAA,CAAe;AAC5DC,EAAAA,KAAAA,EAAOC,EAAEC,KAAAA,CAAM;AACXD,IAAAA,CAAAA,CAAEE,MAAAA,CAAO;MACLmB,OAAAA,EAASf;KACb,CAAA;AACAN,IAAAA,CAAAA,CAAEE,MAAAA,CAAO;AACLC,MAAAA,IAAAA,EAAMH,EAAEa,MAAAA,EAAM;MACdR,cAAAA,EAAgBC;KACpB;AACH,GAAA,CAAA;AACDG,EAAAA,MAAAA,EAAQT,CAAAA,CAAEU,OAAAA,CAAQV,CAAAA,CAAEQ,OAAAA,EAAO;AAC/B,CAAA","file":"UE2N6Q3B.js","sourcesContent":["import { z } from 'zod';\n\nimport { normalizedHexSchema, transactionSchema } from '@layerzerolabs/common-chain-model';\nimport { gatedTransactionSchema } from '@layerzerolabs/gated-transaction';\nimport { functionSchema } from '@layerzerolabs/zod-utils';\n\nexport const generateCreateSetRoleTransactionsSchema = <\n const T extends readonly [string, ...string[]],\n>(\n roles: T,\n) =>\n functionSchema({\n input: z.tuple([\n z.object({\n role: z.enum(roles),\n accountAddress: normalizedHexSchema,\n shouldGrant: z.boolean(),\n }),\n ]),\n output: z.promise(\n gatedTransactionSchema({\n name: z.string(),\n transactionSchema: transactionSchema,\n }).array(),\n ),\n });\n\nexport const generateHasRoleSchema = <const T extends readonly [string, ...string[]]>(roles: T) =>\n functionSchema({\n input: z.tuple([\n z.object({\n role: z.enum(roles),\n accountAddress: normalizedHexSchema,\n }),\n ]),\n output: z.promise(z.boolean()),\n });\n\nexport const generateRoleManagementSchemas = <const T extends readonly [string, ...string[]]>(\n roles: T,\n) => ({\n createSetRoleTransactions: generateCreateSetRoleTransactionsSchema(roles),\n hasRole: generateHasRoleSchema(roles),\n});\n\nexport const createSetRoleTransactionsWithSpecializedInputSchema = functionSchema({\n input: z.tuple([\n z.object({\n address: normalizedHexSchema,\n }),\n z.object({\n role: z.string(),\n accountAddress: normalizedHexSchema,\n shouldGrant: z.boolean(),\n }),\n ]),\n output: z.promise(\n gatedTransactionSchema({\n name: z.string(),\n transactionSchema: transactionSchema,\n }).array(),\n ),\n});\n\nexport const hasRoleWithSpecializedInputSchema = functionSchema({\n input: z.tuple([\n z.object({\n address: normalizedHexSchema,\n }),\n z.object({\n role: z.string(),\n accountAddress: normalizedHexSchema,\n }),\n ]),\n output: z.promise(z.boolean()),\n});\n\nexport type CreateSetRoleTransactionsWithSpecializedInput = z.infer<\n typeof createSetRoleTransactionsWithSpecializedInputSchema\n>;\nexport type HasRoleWithSpecializedInput = z.infer<typeof hasRoleWithSpecializedInputSchema>;\n"]}
|
package/dist/WYAGX6NX.cjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var z = require('zod');
|
|
4
|
-
|
|
5
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
-
|
|
7
|
-
var z__default = /*#__PURE__*/_interopDefault(z);
|
|
8
|
-
|
|
9
|
-
// src/upgrade/types.ts
|
|
10
|
-
var UpgradeType = /* @__PURE__ */ (function(UpgradeType2) {
|
|
11
|
-
UpgradeType2["NOT_UPGRADEABLE"] = "NOT_UPGRADEABLE";
|
|
12
|
-
UpgradeType2["PROXY"] = "PROXY";
|
|
13
|
-
UpgradeType2["CODE_UPGRADE"] = "CODE_UPGRADE";
|
|
14
|
-
return UpgradeType2;
|
|
15
|
-
})({});
|
|
16
|
-
var EvmProxyType = /* @__PURE__ */ (function(EvmProxyType2) {
|
|
17
|
-
EvmProxyType2["TRANSPARENT_UPGRADEABLE"] = "TRANSPARENT_UPGRADEABLE";
|
|
18
|
-
EvmProxyType2["UNIVERSAL_UPGRADEABLE"] = "UNIVERSAL_UPGRADEABLE";
|
|
19
|
-
return EvmProxyType2;
|
|
20
|
-
})({});
|
|
21
|
-
var ProxyType = {
|
|
22
|
-
...EvmProxyType
|
|
23
|
-
};
|
|
24
|
-
var upgradeTypeSchema = z__default.default.enum(UpgradeType);
|
|
25
|
-
var proxyTypeSchema = z__default.default.enum(ProxyType);
|
|
26
|
-
var proxyConfigSchema = z__default.default.object({
|
|
27
|
-
upgradeType: z__default.default.literal("PROXY"),
|
|
28
|
-
proxyType: proxyTypeSchema
|
|
29
|
-
});
|
|
30
|
-
var notUpgradeableConfigSchema = z__default.default.object({
|
|
31
|
-
upgradeType: z__default.default.literal("NOT_UPGRADEABLE")
|
|
32
|
-
});
|
|
33
|
-
var codeUpgradeableConfigSchema = z__default.default.object({
|
|
34
|
-
upgradeType: z__default.default.literal("CODE_UPGRADE")
|
|
35
|
-
});
|
|
36
|
-
var upgradeableConfigSchema = z__default.default.discriminatedUnion("upgradeType", [
|
|
37
|
-
proxyConfigSchema,
|
|
38
|
-
notUpgradeableConfigSchema,
|
|
39
|
-
codeUpgradeableConfigSchema
|
|
40
|
-
]);
|
|
41
|
-
|
|
42
|
-
exports.EvmProxyType = EvmProxyType;
|
|
43
|
-
exports.ProxyType = ProxyType;
|
|
44
|
-
exports.UpgradeType = UpgradeType;
|
|
45
|
-
exports.codeUpgradeableConfigSchema = codeUpgradeableConfigSchema;
|
|
46
|
-
exports.notUpgradeableConfigSchema = notUpgradeableConfigSchema;
|
|
47
|
-
exports.proxyConfigSchema = proxyConfigSchema;
|
|
48
|
-
exports.proxyTypeSchema = proxyTypeSchema;
|
|
49
|
-
exports.upgradeTypeSchema = upgradeTypeSchema;
|
|
50
|
-
exports.upgradeableConfigSchema = upgradeableConfigSchema;
|
|
51
|
-
//# sourceMappingURL=WYAGX6NX.cjs.map
|
|
52
|
-
//# sourceMappingURL=WYAGX6NX.cjs.map
|
package/dist/WYAGX6NX.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/upgrade/types.ts"],"names":["UpgradeType","EvmProxyType","ProxyType","upgradeTypeSchema","z","enum","proxyTypeSchema","proxyConfigSchema","object","upgradeType","literal","proxyType","notUpgradeableConfigSchema","codeUpgradeableConfigSchema","upgradeableConfigSchema","discriminatedUnion"],"mappings":";;;;;;;;;AAEO,IAAKA,WAAAA,6BAAAA,YAAAA,EAAAA;;;;AAAAA,EAAAA,OAAAA,YAAAA;;AASL,IAAKC,YAAAA,6BAAAA,aAAAA,EAAAA;;;AAAAA,EAAAA,OAAAA,aAAAA;;AAOL,IAAMC,SAAAA,GAAY;EACrB,GAAGD;AACP;AAIO,IAAME,iBAAAA,GAAoBC,kBAAAA,CAAEC,IAAAA,CAAKL,WAAAA;AAEjC,IAAMM,eAAAA,GAAkBF,kBAAAA,CAAEC,IAAAA,CAAKH,SAAAA;AAC/B,IAAMK,iBAAAA,GAAoBH,mBAAEI,MAAAA,CAAO;EACtCC,WAAAA,EAAaL,kBAAAA,CAAEM,QAAO,OAAA,CAAA;EACtBC,SAAAA,EAAWL;AACf,CAAA;AAIO,IAAMM,0BAAAA,GAA6BR,mBAAEI,MAAAA,CAAO;EAC/CC,WAAAA,EAAaL,kBAAAA,CAAEM,QAAO,iBAAA;AAC1B,CAAA;AAIO,IAAMG,2BAAAA,GAA8BT,mBAAEI,MAAAA,CAAO;EAChDC,WAAAA,EAAaL,kBAAAA,CAAEM,QAAO,cAAA;AAC1B,CAAA;AAIO,IAAMI,uBAAAA,GAA0BV,kBAAAA,CAAEW,kBAAAA,CAAmB,aAAA,EAAe;AACvER,EAAAA,iBAAAA;AACAK,EAAAA,0BAAAA;AACAC,EAAAA;AACH,CAAA","file":"WYAGX6NX.cjs","sourcesContent":["import z from 'zod';\n\nexport enum UpgradeType {\n // This doesn't necessarily prevent the contract from being upgraded\n NOT_UPGRADEABLE = 'NOT_UPGRADEABLE',\n // Deploy a separate 'proxy' contract that will route calls to a swappable implementation\n PROXY = 'PROXY',\n // This doesn't necessarily allow the contract to be upgraded\n CODE_UPGRADE = 'CODE_UPGRADE',\n}\n\nexport enum EvmProxyType {\n // TUP https://docs.openzeppelin.com/contracts/5.x/api/proxy#transparentupgradeableproxy\n TRANSPARENT_UPGRADEABLE = 'TRANSPARENT_UPGRADEABLE',\n // UUPS https://docs.openzeppelin.com/contracts/5.x/api/proxy#uupsupgradeable\n UNIVERSAL_UPGRADEABLE = 'UNIVERSAL_UPGRADEABLE',\n}\n\nexport const ProxyType = {\n ...EvmProxyType,\n};\n\nexport type ProxyType = (typeof ProxyType)[keyof typeof ProxyType];\n\nexport const upgradeTypeSchema = z.enum(UpgradeType);\n\nexport const proxyTypeSchema = z.enum(ProxyType);\nexport const proxyConfigSchema = z.object({\n upgradeType: z.literal(UpgradeType.PROXY),\n proxyType: proxyTypeSchema,\n});\n\nexport type ProxyUpgradeableConfig = z.infer<typeof proxyConfigSchema>;\n\nexport const notUpgradeableConfigSchema = z.object({\n upgradeType: z.literal(UpgradeType.NOT_UPGRADEABLE),\n});\n\nexport type NotUpgradeableConfig = z.infer<typeof notUpgradeableConfigSchema>;\n\nexport const codeUpgradeableConfigSchema = z.object({\n upgradeType: z.literal(UpgradeType.CODE_UPGRADE),\n});\n\nexport type CodeUpgradeableConfig = z.infer<typeof codeUpgradeableConfigSchema>;\n\nexport const upgradeableConfigSchema = z.discriminatedUnion('upgradeType', [\n proxyConfigSchema,\n notUpgradeableConfigSchema,\n codeUpgradeableConfigSchema,\n]);\n\nexport type UpgradeableConfig = z.infer<typeof upgradeableConfigSchema>;\n"]}
|
package/dist/ZQQ6EIFU.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/deploy/workflow.ts"],"names":["BaseDeploymentSchema","deploymentArtifactSchema","DeploymentInfoSchema","VerificationInfoSchema","z","object","contractName","enum","ChainName","address","normalizedHexSchema","abiEncodedConstructorArguments","failedDeployment","name","string","success","literal","error","successfulDeployment","deploymentInfo","deployWorkflowChainResultItemSchema","union","deployWorkflowChainResultSchema","results","array","default","deployWorkflowChainStateSchema","extend","srcChain","optional","status","deployWorkflowOrchestratorResultSchema","stateByChain","partialRecord","deployWorkflowOrchestratorStateSchema","getDeploymentBaseArgs","saveDeploymentBaseArgs","identityOnlyDeploymentArtifactSchema","getVerificationInfoBaseArgs","verificationDataFromDeploymentTransaction","deployedBytecode","hexSchema","deployerWallet","createVerificationInfoBaseArgs","fullDeploymentArtifactSchema","nonVerifyable","boolean","saveVerificationInfoBaseArgs","BaseDeploymentSavingArtifactsSchema","getDeployment","functionSchema","input","tuple","output","promise","saveDeployment","void","getVerificationInfo","any","saveVerificationInfo"],"mappings":";;;;;;AAkBO,IAAMA,oBAAAA,GAAuBC;AAU7B,IAAMC,oBAAAA,GAAuBF;AAG7B,IAAMG,sBAAAA,GAAyBC,EAAEC,MAAAA,CAAO;EAC3CC,YAAAA,EAAcF,CAAAA,CAAEG,KAAKC,SAAAA,CAAAA;EACrBC,OAAAA,EAASC,mBAAAA;EACTC,8BAAAA,EAAgC;AACpC,CAAA;AAEA,IA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A,CAAEkD,OAAAA,CAAQrD,wBAAAA,CAAyB4B,QAAAA,EAAQ;GACvD,CAAA;AACA0B,EAAAA,cAAAA,EAAgBL,cAAAA,CAAe;AAC3BC,IAAAA,KAAAA,EAAO/C,EAAEgD,KAAAA,CAAM;AAAChB,MAAAA;AAAuB,KAAA,CAAA;AACvCiB,IAAAA,MAAAA,EAAQjD,CAAAA,CAAEkD,OAAAA,CAAQlD,CAAAA,CAAEoD,IAAAA,EAAI;GAC5B,CAAA;AACAC,EAAAA,mBAAAA,EAAqBP,cAAAA,CAAe;AAChCC,IAAAA,KAAAA,EAAO/C,EAAEgD,KAAAA,CAAM;AAACd,MAAAA;AAA4B,KAAA,CAAA;AAC5Ce,IAAAA,MAAAA,EAAQjD,CAAAA,CAAEkD,OAAAA,CAAQlD,CAAAA,CAAEsD,GAAAA,EAAG;GAC3B,CAAA;AACAC,EAAAA,oBAAAA,EAAsBT,cAAAA,CAAe;AACjCC,IAAAA,KAAAA,EAAO/C,EAAEgD,KAAAA,CAAM;AAACL,MAAAA;AAA6B,KAAA,CAAA;AAC7CM,IAAAA,MAAAA,EAAQjD,CAAAA,CAAEkD,OAAAA,CAAQlD,CAAAA,CAAEoD,IAAAA,EAAI;GAC5B;AACJ,CAAA","file":"ZQQ6EIFU.js","sourcesContent":["import type { SuiObjectChange } from '@mysten/sui/client';\nimport { z } from 'zod';\n\nimport { hexSchema, normalizedHexSchema } from '@layerzerolabs/common-chain-model';\nimport { ChainName } from '@layerzerolabs/layerzero-definitions';\nimport { functionSchema } from '@layerzerolabs/zod-utils';\n\nimport type { DeploymentArtifact, SolanaDeploymentArtifactExtraInfo } from './artifact';\nimport {\n deploymentArtifactSchema,\n fullDeploymentArtifactSchema,\n identityOnlyDeploymentArtifactSchema,\n} from './artifact';\n\nexport type { SuiObjectChange };\n\n// exported for backwards compatibility, should use the new schemas\n/** @deprecated use deploymentArtifactSchema */\nexport const BaseDeploymentSchema = deploymentArtifactSchema;\n\n/** @deprecated use DeploymentArtifact */\nexport type DeploymentInfo = DeploymentArtifact;\n/** @deprecated */\nexport type SolanaDeploymentInfo = Omit<DeploymentArtifact, 'extraDeploymentInfo'> & {\n extraDeploymentInfo: SolanaDeploymentArtifactExtraInfo;\n};\n\n/** @deprecated use deploymentArtifactSchema */\nexport const DeploymentInfoSchema = BaseDeploymentSchema;\n\n// FIXME clean this up to use the new artifact schema\nexport const VerificationInfoSchema = z.object({\n contractName: z.enum(ChainName),\n address: normalizedHexSchema,\n abiEncodedConstructorArguments: true,\n});\n\nconst failedDeployment = z.object({\n name: z.string(),\n success: z.literal(false),\n error: z.string(),\n});\n\nconst successfulDeployment = z.object({\n name: z.string(),\n success: z.literal(true),\n deploymentInfo: DeploymentInfoSchema,\n});\n\nexport const deployWorkflowChainResultItemSchema = z.union([\n failedDeployment,\n successfulDeployment,\n]);\n\nexport const deployWorkflowChainResultSchema = z.object({\n results: z.array(deployWorkflowChainResultItemSchema).default([]),\n});\n\nexport const deployWorkflowChainStateSchema = deployWorkflowChainResultSchema.extend({\n srcChain: z.enum(ChainName).optional(),\n status: z.union([z.literal('RUNNING'), z.literal('COMPLETE')]).default('RUNNING'),\n});\n\nexport type DeployWorkflowChainState = z.infer<typeof deployWorkflowChainStateSchema>;\nexport type DeployWorkflowChainResult = z.infer<typeof deployWorkflowChainResultSchema>;\nexport type DeployWorkflowChainResultItem = z.infer<typeof deployWorkflowChainResultItemSchema>;\n\nexport const deployWorkflowOrchestratorResultSchema = z.object({\n stateByChain: z.partialRecord(z.enum(ChainName), deployWorkflowChainResultSchema).default({}),\n});\n\nexport const deployWorkflowOrchestratorStateSchema = deployWorkflowOrchestratorResultSchema.extend({\n status: z.union([z.literal('RUNNING'), z.literal('COMPLETE')]).default('RUNNING'),\n});\n\nexport type DeployWorkflowOrchestratorState = z.infer<typeof deployWorkflowOrchestratorStateSchema>;\nexport type DeployWorkflowOrchestratorResult = z.infer<\n typeof deployWorkflowOrchestratorResultSchema\n>;\n\nexport const getDeploymentBaseArgs = z.object({ contractName: z.string() });\nexport type GetDeploymentBaseArgs = z.infer<typeof getDeploymentBaseArgs>;\n\nexport const saveDeploymentBaseArgs = z.object({\n contractName: z.string(),\n deploymentInfo: identityOnlyDeploymentArtifactSchema,\n});\nexport type SaveDeploymentBaseArgs = z.infer<typeof saveDeploymentBaseArgs>;\n\nexport const getVerificationInfoBaseArgs = z.object({\n contractName: z.string(),\n});\nexport type GetVerificationInfoBaseArgs = z.infer<typeof getVerificationInfoBaseArgs>;\n\nexport const verificationDataFromDeploymentTransaction = z.object({\n deployedBytecode: hexSchema.optional(),\n deployerWallet: normalizedHexSchema.optional(),\n});\nexport type VerificationDataFromDeploymentTransaction = z.infer<\n typeof verificationDataFromDeploymentTransaction\n>;\n\nexport const createVerificationInfoBaseArgs = z.object({\n deployedBytecode: hexSchema.optional(),\n deploymentInfo: fullDeploymentArtifactSchema,\n nonVerifyable: z.boolean().optional(),\n});\nexport type CreateVerificationInfoBaseArgs = z.infer<typeof createVerificationInfoBaseArgs>;\n\nexport const saveVerificationInfoBaseArgs = createVerificationInfoBaseArgs;\n\nexport type SaveVerificationInfoBaseArgs = z.infer<typeof saveVerificationInfoBaseArgs>;\n\nexport const BaseDeploymentSavingArtifactsSchema = z.object({\n getDeployment: functionSchema({\n input: z.tuple([getDeploymentBaseArgs]),\n output: z.promise(deploymentArtifactSchema.optional()),\n }),\n saveDeployment: functionSchema({\n input: z.tuple([saveDeploymentBaseArgs]),\n output: z.promise(z.void()),\n }),\n getVerificationInfo: functionSchema({\n input: z.tuple([getVerificationInfoBaseArgs]),\n output: z.promise(z.any()),\n }),\n saveVerificationInfo: functionSchema({\n input: z.tuple([saveVerificationInfoBaseArgs]),\n output: z.promise(z.void()),\n }),\n});\n"]}
|
package/dist/ZTLVAMWX.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/deploy/workflow.ts"],"names":["BaseDeploymentSchema","deploymentArtifactSchema","DeploymentInfoSchema","VerificationInfoSchema","z","object","contractName","enum","ChainName","address","normalizedHexSchema","abiEncodedConstructorArguments","failedDeployment","name","string","success","literal","error","successfulDeployment","deploymentInfo","deployWorkflowChainResultItemSchema","union","deployWorkflowChainResultSchema","results","array","default","deployWorkflowChainStateSchema","extend","srcChain","optional","status","deployWorkflowOrchestratorResultSchema","stateByChain","partialRecord","deployWorkflowOrchestratorStateSchema","getDeploymentBaseArgs","saveDeploymentBaseArgs","identityOnlyDeploymentArtifactSchema","getVerificationInfoBaseArgs","verificationDataFromDeploymentTransaction","deployedBytecode","hexSchema","deployerWallet","createVerificationInfoBaseArgs","fullDeploymentArtifactSchema","nonVerifyable","boolean","saveVerificationInfoBaseArgs","BaseDeploymentSavingArtifactsSchema","getDeployment","functionSchema","input","tuple","output","promise","saveDeployment","void","getVerificationInfo","any","saveVerificationInfo"],"mappings":";;;;;;;;AAkBO,IAAMA,oBAAAA,GAAuBC;AAU7B,IAAMC,oBAAAA,GAAuBF;AAG7B,IAAMG,sBAAAA,GAAyBC,MAAEC,MAAAA,CAAO;EAC3CC,YAAAA,EAAcF,KAAAA,CAAEG,KAAKC,8BAAAA,CAAAA;EACrBC,OAAAA,EAASC,oCAAAA;EACTC,8BAAAA,EAAgC;AACpC,CAAA;AAEA,IAAMC,gBAAAA,GAAmBR,MAAEC,MAAAA,CAAO;AAC9BQ,EAAAA,IAAAA,EAAMT,MAAEU,MAAAA,EAAM;EACdC,OAAAA,EAASX,KAAAA,CAAEY,QAAQ,KAAA,CAAA;AACnBC,EAAAA,KAAAA,EAAOb,MAAEU,MAAAA;AACb,CAAA,CAAA;AAEA,IAAMI,oBAAAA,GAAuBd,MAAEC,MAAAA,CAAO;AAClCQ,EAAAA,IAAAA,EAAMT,MAAEU,MAAAA,EAAM;EACdC,OAAAA,EAASX,KAAAA,CAAEY,QAAQ,IAAA,CAAA;EACnBG,cAAAA,EAAgBjB;AACpB,CAAA,CAAA;AAEO,IAAMkB,mCAAAA,GAAsChB,MAAEiB,KAAAA,CAAM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AA,MAAAA,EAAQjD,KAAAA,CAAEkD,OAAAA,CAAQlD,KAAAA,CAAEsD,GAAAA,EAAG;GAC3B,CAAA;AACAC,EAAAA,oBAAAA,EAAsBT,uBAAAA,CAAe;AACjCC,IAAAA,KAAAA,EAAO/C,MAAEgD,KAAAA,CAAM;AAACL,MAAAA;AAA6B,KAAA,CAAA;AAC7CM,IAAAA,MAAAA,EAAQjD,KAAAA,CAAEkD,OAAAA,CAAQlD,KAAAA,CAAEoD,IAAAA,EAAI;GAC5B;AACJ,CAAA","file":"ZTLVAMWX.cjs","sourcesContent":["import type { SuiObjectChange } from '@mysten/sui/client';\nimport { z } from 'zod';\n\nimport { hexSchema, normalizedHexSchema } from '@layerzerolabs/common-chain-model';\nimport { ChainName } from '@layerzerolabs/layerzero-definitions';\nimport { functionSchema } from '@layerzerolabs/zod-utils';\n\nimport type { DeploymentArtifact, SolanaDeploymentArtifactExtraInfo } from './artifact';\nimport {\n deploymentArtifactSchema,\n fullDeploymentArtifactSchema,\n identityOnlyDeploymentArtifactSchema,\n} from './artifact';\n\nexport type { SuiObjectChange };\n\n// exported for backwards compatibility, should use the new schemas\n/** @deprecated use deploymentArtifactSchema */\nexport const BaseDeploymentSchema = deploymentArtifactSchema;\n\n/** @deprecated use DeploymentArtifact */\nexport type DeploymentInfo = DeploymentArtifact;\n/** @deprecated */\nexport type SolanaDeploymentInfo = Omit<DeploymentArtifact, 'extraDeploymentInfo'> & {\n extraDeploymentInfo: SolanaDeploymentArtifactExtraInfo;\n};\n\n/** @deprecated use deploymentArtifactSchema */\nexport const DeploymentInfoSchema = BaseDeploymentSchema;\n\n// FIXME clean this up to use the new artifact schema\nexport const VerificationInfoSchema = z.object({\n contractName: z.enum(ChainName),\n address: normalizedHexSchema,\n abiEncodedConstructorArguments: true,\n});\n\nconst failedDeployment = z.object({\n name: z.string(),\n success: z.literal(false),\n error: z.string(),\n});\n\nconst successfulDeployment = z.object({\n name: z.string(),\n success: z.literal(true),\n deploymentInfo: DeploymentInfoSchema,\n});\n\nexport const deployWorkflowChainResultItemSchema = z.union([\n failedDeployment,\n successfulDeployment,\n]);\n\nexport const deployWorkflowChainResultSchema = z.object({\n results: z.array(deployWorkflowChainResultItemSchema).default([]),\n});\n\nexport const deployWorkflowChainStateSchema = deployWorkflowChainResultSchema.extend({\n srcChain: z.enum(ChainName).optional(),\n status: z.union([z.literal('RUNNING'), z.literal('COMPLETE')]).default('RUNNING'),\n});\n\nexport type DeployWorkflowChainState = z.infer<typeof deployWorkflowChainStateSchema>;\nexport type DeployWorkflowChainResult = z.infer<typeof deployWorkflowChainResultSchema>;\nexport type DeployWorkflowChainResultItem = z.infer<typeof deployWorkflowChainResultItemSchema>;\n\nexport const deployWorkflowOrchestratorResultSchema = z.object({\n stateByChain: z.partialRecord(z.enum(ChainName), deployWorkflowChainResultSchema).default({}),\n});\n\nexport const deployWorkflowOrchestratorStateSchema = deployWorkflowOrchestratorResultSchema.extend({\n status: z.union([z.literal('RUNNING'), z.literal('COMPLETE')]).default('RUNNING'),\n});\n\nexport type DeployWorkflowOrchestratorState = z.infer<typeof deployWorkflowOrchestratorStateSchema>;\nexport type DeployWorkflowOrchestratorResult = z.infer<\n typeof deployWorkflowOrchestratorResultSchema\n>;\n\nexport const getDeploymentBaseArgs = z.object({ contractName: z.string() });\nexport type GetDeploymentBaseArgs = z.infer<typeof getDeploymentBaseArgs>;\n\nexport const saveDeploymentBaseArgs = z.object({\n contractName: z.string(),\n deploymentInfo: identityOnlyDeploymentArtifactSchema,\n});\nexport type SaveDeploymentBaseArgs = z.infer<typeof saveDeploymentBaseArgs>;\n\nexport const getVerificationInfoBaseArgs = z.object({\n contractName: z.string(),\n});\nexport type GetVerificationInfoBaseArgs = z.infer<typeof getVerificationInfoBaseArgs>;\n\nexport const verificationDataFromDeploymentTransaction = z.object({\n deployedBytecode: hexSchema.optional(),\n deployerWallet: normalizedHexSchema.optional(),\n});\nexport type VerificationDataFromDeploymentTransaction = z.infer<\n typeof verificationDataFromDeploymentTransaction\n>;\n\nexport const createVerificationInfoBaseArgs = z.object({\n deployedBytecode: hexSchema.optional(),\n deploymentInfo: fullDeploymentArtifactSchema,\n nonVerifyable: z.boolean().optional(),\n});\nexport type CreateVerificationInfoBaseArgs = z.infer<typeof createVerificationInfoBaseArgs>;\n\nexport const saveVerificationInfoBaseArgs = createVerificationInfoBaseArgs;\n\nexport type SaveVerificationInfoBaseArgs = z.infer<typeof saveVerificationInfoBaseArgs>;\n\nexport const BaseDeploymentSavingArtifactsSchema = z.object({\n getDeployment: functionSchema({\n input: z.tuple([getDeploymentBaseArgs]),\n output: z.promise(deploymentArtifactSchema.optional()),\n }),\n saveDeployment: functionSchema({\n input: z.tuple([saveDeploymentBaseArgs]),\n output: z.promise(z.void()),\n }),\n getVerificationInfo: functionSchema({\n input: z.tuple([getVerificationInfoBaseArgs]),\n output: z.promise(z.any()),\n }),\n saveVerificationInfo: functionSchema({\n input: z.tuple([saveVerificationInfoBaseArgs]),\n output: z.promise(z.void()),\n }),\n});\n"]}
|