@layerzerolabs/dw-model 0.2.21 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +109 -101
- 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/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/{XODRZ5LJ.js → IUFXXZ2R.js} +3 -3
- package/dist/{XODRZ5LJ.js.map → IUFXXZ2R.js.map} +1 -1
- package/dist/NCHH4VK3.cjs +4 -0
- package/dist/NCHH4VK3.cjs.map +1 -0
- package/dist/{ZQQ6EIFU.js → P5T6325Z.js} +7 -4
- package/dist/P5T6325Z.js.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/UD4ETBQ6.cjs +92 -0
- package/dist/UD4ETBQ6.cjs.map +1 -0
- package/dist/{ZTLVAMWX.cjs → XW5NASKO.cjs} +6 -3
- package/dist/XW5NASKO.cjs.map +1 -0
- package/dist/ZIK3I5PO.js +84 -0
- package/dist/ZIK3I5PO.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 +47 -34
- 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 +16 -16
- package/dist/deploy/workflow.d.ts +3 -6
- package/dist/deploy/workflow.d.ts.map +1 -1
- package/dist/deploy/workflow.js +1 -1
- package/dist/index.cjs +123 -70
- 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 +5 -1
- 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
|
@@ -39,6 +39,11 @@ export declare const generateHasRoleSchema: <const T extends readonly [string, .
|
|
|
39
39
|
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
40
40
|
accountAddress: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
41
41
|
}) => Promise<boolean>, unknown>>;
|
|
42
|
+
export declare const generateGetRoleMembersSchema: <const T extends readonly [string, ...string[]]>(roles: T) => z.ZodType<(args_0: {
|
|
43
|
+
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
44
|
+
}) => Promise<import("@layerzerolabs/common-chain-model").NormalizedHexString[]>, unknown, z.core.$ZodTypeInternals<(args_0: {
|
|
45
|
+
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
46
|
+
}) => Promise<import("@layerzerolabs/common-chain-model").NormalizedHexString[]>, unknown>>;
|
|
42
47
|
export declare const generateRoleManagementSchemas: <const T extends readonly [string, ...string[]]>(roles: T) => {
|
|
43
48
|
createSetRoleTransactions: z.ZodType<(args_0: {
|
|
44
49
|
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
@@ -81,6 +86,53 @@ export declare const generateRoleManagementSchemas: <const T extends readonly [s
|
|
|
81
86
|
accountAddress: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
82
87
|
}) => Promise<boolean>, unknown>>;
|
|
83
88
|
};
|
|
89
|
+
export declare const generateEnumerableRoleManagementSchemas: <const T extends readonly [string, ...string[]]>(roles: T) => {
|
|
90
|
+
getRoleMembers: z.ZodType<(args_0: {
|
|
91
|
+
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
92
|
+
}) => Promise<import("@layerzerolabs/common-chain-model").NormalizedHexString[]>, unknown, z.core.$ZodTypeInternals<(args_0: {
|
|
93
|
+
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
94
|
+
}) => Promise<import("@layerzerolabs/common-chain-model").NormalizedHexString[]>, unknown>>;
|
|
95
|
+
createSetRoleTransactions: z.ZodType<(args_0: {
|
|
96
|
+
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
97
|
+
accountAddress: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
98
|
+
shouldGrant: boolean;
|
|
99
|
+
}) => Promise<import("@layerzerolabs/gated-transaction").GatedTransaction<string, {
|
|
100
|
+
chainName: string;
|
|
101
|
+
timestamps: {
|
|
102
|
+
created: number;
|
|
103
|
+
nonceAcquired?: number | undefined;
|
|
104
|
+
signed?: number | undefined;
|
|
105
|
+
sent?: number | undefined;
|
|
106
|
+
confirmed?: number | undefined;
|
|
107
|
+
};
|
|
108
|
+
properties?: Record<string, any> | undefined;
|
|
109
|
+
type?: string | undefined;
|
|
110
|
+
parallelizingKey?: string | undefined;
|
|
111
|
+
}, (...args: any[]) => any, (txs: any, ...args: any[]) => Promise<any>, import("@layerzerolabs/gated-transaction").GatedTransactionDependencies>[]>, unknown, z.core.$ZodTypeInternals<(args_0: {
|
|
112
|
+
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
113
|
+
accountAddress: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
114
|
+
shouldGrant: boolean;
|
|
115
|
+
}) => Promise<import("@layerzerolabs/gated-transaction").GatedTransaction<string, {
|
|
116
|
+
chainName: string;
|
|
117
|
+
timestamps: {
|
|
118
|
+
created: number;
|
|
119
|
+
nonceAcquired?: number | undefined;
|
|
120
|
+
signed?: number | undefined;
|
|
121
|
+
sent?: number | undefined;
|
|
122
|
+
confirmed?: number | undefined;
|
|
123
|
+
};
|
|
124
|
+
properties?: Record<string, any> | undefined;
|
|
125
|
+
type?: string | undefined;
|
|
126
|
+
parallelizingKey?: string | undefined;
|
|
127
|
+
}, (...args: any[]) => any, (txs: any, ...args: any[]) => Promise<any>, import("@layerzerolabs/gated-transaction").GatedTransactionDependencies>[]>, unknown>>;
|
|
128
|
+
hasRole: z.ZodType<(args_0: {
|
|
129
|
+
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
130
|
+
accountAddress: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
131
|
+
}) => Promise<boolean>, unknown, z.core.$ZodTypeInternals<(args_0: {
|
|
132
|
+
role: ({ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: { [k_1 in T[number]]: k_1; }[k]; } : never)[T[number]];
|
|
133
|
+
accountAddress: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
134
|
+
}) => Promise<boolean>, unknown>>;
|
|
135
|
+
};
|
|
84
136
|
export declare const createSetRoleTransactionsWithSpecializedInputSchema: z.ZodType<(args_0: {
|
|
85
137
|
address: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
86
138
|
}, args_1: {
|
|
@@ -129,6 +181,16 @@ export declare const hasRoleWithSpecializedInputSchema: z.ZodType<(args_0: {
|
|
|
129
181
|
role: string;
|
|
130
182
|
accountAddress: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
131
183
|
}) => Promise<boolean>, unknown>>;
|
|
184
|
+
export declare const getRoleMembersWithSpecializedInputSchema: z.ZodType<(args_0: {
|
|
185
|
+
address: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
186
|
+
}, args_1: {
|
|
187
|
+
role: string;
|
|
188
|
+
}) => Promise<import("@layerzerolabs/common-chain-model").NormalizedHexString[]>, unknown, z.core.$ZodTypeInternals<(args_0: {
|
|
189
|
+
address: import("@layerzerolabs/common-chain-model").NormalizedHexString;
|
|
190
|
+
}, args_1: {
|
|
191
|
+
role: string;
|
|
192
|
+
}) => Promise<import("@layerzerolabs/common-chain-model").NormalizedHexString[]>, unknown>>;
|
|
132
193
|
export type CreateSetRoleTransactionsWithSpecializedInput = z.infer<typeof createSetRoleTransactionsWithSpecializedInputSchema>;
|
|
133
194
|
export type HasRoleWithSpecializedInput = z.infer<typeof hasRoleWithSpecializedInputSchema>;
|
|
195
|
+
export type GetRoleMembersWithSpecializedInput = z.infer<typeof getRoleMembersWithSpecializedInputSchema>;
|
|
134
196
|
//# sourceMappingURL=schemata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemata.d.ts","sourceRoot":"","sources":["../../src/role-management/schemata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,uCAAuC,GAChD,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EAE9C,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8JAgBN,CAAC;AAEP,eAAO,MAAM,qBAAqB,GAAI,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC;;;;;;iCASxF,CAAC;AAEP,eAAO,MAAM,6BAA6B,GAAI,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EACxF,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIV,CAAC;AAEH,eAAO,MAAM,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8JAiB9D,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;;;;;iCAW5C,CAAC;AAEH,MAAM,MAAM,6CAA6C,GAAG,CAAC,CAAC,KAAK,CAC/D,OAAO,mDAAmD,CAC7D,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"schemata.d.ts","sourceRoot":"","sources":["../../src/role-management/schemata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,uCAAuC,GAChD,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EAE9C,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8JAgBN,CAAC;AAEP,eAAO,MAAM,qBAAqB,GAAI,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC;;;;;;iCASxF,CAAC;AAEP,eAAO,MAAM,4BAA4B,GAAI,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EACvF,OAAO,CAAC;;;;2FASN,CAAC;AAEP,eAAO,MAAM,6BAA6B,GAAI,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EACxF,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIV,CAAC;AAEH,eAAO,MAAM,uCAAuC,GAChD,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EAE9C,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIV,CAAC;AAEH,eAAO,MAAM,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8JAiB9D,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;;;;;iCAW5C,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;2FAUnD,CAAC;AAEH,MAAM,MAAM,6CAA6C,GAAG,CAAC,CAAC,KAAK,CAC/D,OAAO,mDAAmD,CAC7D,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,wCAAwC,CAClD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createSetRoleTransactionsWithSpecializedInputSchema, generateCreateSetRoleTransactionsSchema, generateHasRoleSchema, generateRoleManagementSchemas, hasRoleWithSpecializedInputSchema } from '../
|
|
1
|
+
export { createSetRoleTransactionsWithSpecializedInputSchema, generateCreateSetRoleTransactionsSchema, generateEnumerableRoleManagementSchemas, generateGetRoleMembersSchema, generateHasRoleSchema, generateRoleManagementSchemas, getRoleMembersWithSpecializedInputSchema, hasRoleWithSpecializedInputSchema } from '../3XCIUHJG.js';
|
|
2
2
|
import '../VUOMXK5T.js';
|
|
3
3
|
//# sourceMappingURL=schemata.js.map
|
|
4
4
|
//# sourceMappingURL=schemata.js.map
|
package/dist/upgrade/index.cjs
CHANGED
|
@@ -1,46 +1,74 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../IN5O3BJZ.cjs');
|
|
4
|
-
var
|
|
4
|
+
var S5CHYZ3I_cjs = require('../S5CHYZ3I.cjs');
|
|
5
5
|
require('../YJF4D23A.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "EvmProxyType", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return S5CHYZ3I_cjs.EvmProxyType; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "ProxyType", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return S5CHYZ3I_cjs.ProxyType; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "SEPARATE_PROXY_ADMIN_TYPES", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return S5CHYZ3I_cjs.SEPARATE_PROXY_ADMIN_TYPES; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "TUP_PROXY_TYPES", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return S5CHYZ3I_cjs.TUP_PROXY_TYPES; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "UUPS_PROXY_TYPES", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return S5CHYZ3I_cjs.UUPS_PROXY_TYPES; }
|
|
16
28
|
});
|
|
17
29
|
Object.defineProperty(exports, "UpgradeType", {
|
|
18
30
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
31
|
+
get: function () { return S5CHYZ3I_cjs.UpgradeType; }
|
|
20
32
|
});
|
|
21
33
|
Object.defineProperty(exports, "codeUpgradeableConfigSchema", {
|
|
22
34
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
35
|
+
get: function () { return S5CHYZ3I_cjs.codeUpgradeableConfigSchema; }
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "initializeDataResultSchema", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return S5CHYZ3I_cjs.initializeDataResultSchema; }
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "isTupProxy", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () { return S5CHYZ3I_cjs.isTupProxy; }
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "isUupsProxy", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return S5CHYZ3I_cjs.isUupsProxy; }
|
|
24
48
|
});
|
|
25
49
|
Object.defineProperty(exports, "notUpgradeableConfigSchema", {
|
|
26
50
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
51
|
+
get: function () { return S5CHYZ3I_cjs.notUpgradeableConfigSchema; }
|
|
28
52
|
});
|
|
29
53
|
Object.defineProperty(exports, "proxyConfigSchema", {
|
|
30
54
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
55
|
+
get: function () { return S5CHYZ3I_cjs.proxyConfigSchema; }
|
|
32
56
|
});
|
|
33
57
|
Object.defineProperty(exports, "proxyTypeSchema", {
|
|
34
58
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
59
|
+
get: function () { return S5CHYZ3I_cjs.proxyTypeSchema; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "requiresSeparateProxyAdminDeploy", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return S5CHYZ3I_cjs.requiresSeparateProxyAdminDeploy; }
|
|
36
64
|
});
|
|
37
65
|
Object.defineProperty(exports, "upgradeTypeSchema", {
|
|
38
66
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
67
|
+
get: function () { return S5CHYZ3I_cjs.upgradeTypeSchema; }
|
|
40
68
|
});
|
|
41
69
|
Object.defineProperty(exports, "upgradeableConfigSchema", {
|
|
42
70
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
71
|
+
get: function () { return S5CHYZ3I_cjs.upgradeableConfigSchema; }
|
|
44
72
|
});
|
|
45
73
|
//# sourceMappingURL=index.cjs.map
|
|
46
74
|
//# sourceMappingURL=index.cjs.map
|
package/dist/upgrade/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../ZCFXJFGI.js';
|
|
2
|
-
export { EvmProxyType, ProxyType, UpgradeType, codeUpgradeableConfigSchema, notUpgradeableConfigSchema, proxyConfigSchema, proxyTypeSchema, upgradeTypeSchema, upgradeableConfigSchema } from '../
|
|
2
|
+
export { EvmProxyType, ProxyType, SEPARATE_PROXY_ADMIN_TYPES, TUP_PROXY_TYPES, UUPS_PROXY_TYPES, UpgradeType, codeUpgradeableConfigSchema, initializeDataResultSchema, isTupProxy, isUupsProxy, notUpgradeableConfigSchema, proxyConfigSchema, proxyTypeSchema, requiresSeparateProxyAdminDeploy, upgradeTypeSchema, upgradeableConfigSchema } from '../46VB3YIH.js';
|
|
3
3
|
import '../VUOMXK5T.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/upgrade/types.cjs
CHANGED
|
@@ -1,45 +1,73 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var S5CHYZ3I_cjs = require('../S5CHYZ3I.cjs');
|
|
4
4
|
require('../YJF4D23A.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "EvmProxyType", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return S5CHYZ3I_cjs.EvmProxyType; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "ProxyType", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return S5CHYZ3I_cjs.ProxyType; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "SEPARATE_PROXY_ADMIN_TYPES", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return S5CHYZ3I_cjs.SEPARATE_PROXY_ADMIN_TYPES; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "TUP_PROXY_TYPES", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return S5CHYZ3I_cjs.TUP_PROXY_TYPES; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "UUPS_PROXY_TYPES", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return S5CHYZ3I_cjs.UUPS_PROXY_TYPES; }
|
|
15
27
|
});
|
|
16
28
|
Object.defineProperty(exports, "UpgradeType", {
|
|
17
29
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
30
|
+
get: function () { return S5CHYZ3I_cjs.UpgradeType; }
|
|
19
31
|
});
|
|
20
32
|
Object.defineProperty(exports, "codeUpgradeableConfigSchema", {
|
|
21
33
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
34
|
+
get: function () { return S5CHYZ3I_cjs.codeUpgradeableConfigSchema; }
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "initializeDataResultSchema", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () { return S5CHYZ3I_cjs.initializeDataResultSchema; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "isTupProxy", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return S5CHYZ3I_cjs.isTupProxy; }
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "isUupsProxy", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () { return S5CHYZ3I_cjs.isUupsProxy; }
|
|
23
47
|
});
|
|
24
48
|
Object.defineProperty(exports, "notUpgradeableConfigSchema", {
|
|
25
49
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
50
|
+
get: function () { return S5CHYZ3I_cjs.notUpgradeableConfigSchema; }
|
|
27
51
|
});
|
|
28
52
|
Object.defineProperty(exports, "proxyConfigSchema", {
|
|
29
53
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
54
|
+
get: function () { return S5CHYZ3I_cjs.proxyConfigSchema; }
|
|
31
55
|
});
|
|
32
56
|
Object.defineProperty(exports, "proxyTypeSchema", {
|
|
33
57
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
58
|
+
get: function () { return S5CHYZ3I_cjs.proxyTypeSchema; }
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "requiresSeparateProxyAdminDeploy", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return S5CHYZ3I_cjs.requiresSeparateProxyAdminDeploy; }
|
|
35
63
|
});
|
|
36
64
|
Object.defineProperty(exports, "upgradeTypeSchema", {
|
|
37
65
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
66
|
+
get: function () { return S5CHYZ3I_cjs.upgradeTypeSchema; }
|
|
39
67
|
});
|
|
40
68
|
Object.defineProperty(exports, "upgradeableConfigSchema", {
|
|
41
69
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
70
|
+
get: function () { return S5CHYZ3I_cjs.upgradeableConfigSchema; }
|
|
43
71
|
});
|
|
44
72
|
//# sourceMappingURL=types.cjs.map
|
|
45
73
|
//# sourceMappingURL=types.cjs.map
|
package/dist/upgrade/types.d.ts
CHANGED
|
@@ -1,28 +1,70 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
+
import type { DecimalString, HexString } from '@layerzerolabs/typescript-utils';
|
|
3
|
+
/**
|
|
4
|
+
* Result type for `getInitializeData` function pointer.
|
|
5
|
+
* Contains the encoded initialization data and an optional gas limit override.
|
|
6
|
+
*/
|
|
7
|
+
export interface InitializeDataResult {
|
|
8
|
+
/** Encoded initialization data (e.g., encodeFunctionData for initialize(...)) */
|
|
9
|
+
data: HexString;
|
|
10
|
+
/** Optional gas limit override for the initialization transaction */
|
|
11
|
+
gasLimit?: DecimalString;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* `InitializeDataResult` schema.
|
|
15
|
+
*/
|
|
16
|
+
export declare const initializeDataResultSchema: z.ZodObject<{
|
|
17
|
+
data: z.ZodType<`0x${string}`, unknown, z.core.$ZodTypeInternals<`0x${string}`, unknown>>;
|
|
18
|
+
gasLimit: z.ZodOptional<z.ZodType<DecimalString, unknown, z.core.$ZodTypeInternals<DecimalString, unknown>>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
2
20
|
export declare enum UpgradeType {
|
|
3
21
|
NOT_UPGRADEABLE = "NOT_UPGRADEABLE",
|
|
4
22
|
PROXY = "PROXY",
|
|
5
23
|
CODE_UPGRADE = "CODE_UPGRADE"
|
|
6
24
|
}
|
|
7
25
|
export declare enum EvmProxyType {
|
|
8
|
-
|
|
9
|
-
|
|
26
|
+
TRANSPARENT_UPGRADEABLE_V5 = "TRANSPARENT_UPGRADEABLE_V5",
|
|
27
|
+
UNIVERSAL_UPGRADEABLE_V5 = "UNIVERSAL_UPGRADEABLE_V5",
|
|
28
|
+
OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4 = "OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4",
|
|
29
|
+
TRANSPARENT_UPGRADEABLE_V4 = "TRANSPARENT_UPGRADEABLE_V4",
|
|
30
|
+
UNIVERSAL_UPGRADEABLE_V4 = "UNIVERSAL_UPGRADEABLE_V4"
|
|
10
31
|
}
|
|
32
|
+
/** UUPS-based proxy types (no separate `ProxyAdmin`). */
|
|
33
|
+
export declare const UUPS_PROXY_TYPES: ReadonlySet<EvmProxyType>;
|
|
34
|
+
/** TUP-based proxy types (have a `ProxyAdmin` with `getOwner`/`setOwner`). */
|
|
35
|
+
export declare const TUP_PROXY_TYPES: ReadonlySet<EvmProxyType>;
|
|
36
|
+
/** Proxy types that deploy a separate `ProxyAdmin` contract (v4 variants only). */
|
|
37
|
+
export declare const SEPARATE_PROXY_ADMIN_TYPES: ReadonlySet<EvmProxyType>;
|
|
38
|
+
/** Whether the proxy type is UUPS (Universal Upgradeable Proxy Standard). */
|
|
39
|
+
export declare const isUupsProxy: (proxyType: EvmProxyType) => boolean;
|
|
40
|
+
/** Whether the proxy type is TUP (Transparent Upgradeable Proxy). */
|
|
41
|
+
export declare const isTupProxy: (proxyType: EvmProxyType) => boolean;
|
|
42
|
+
/** Whether the proxy type requires a separate `ProxyAdmin` deployment (v4 variants). */
|
|
43
|
+
export declare const requiresSeparateProxyAdminDeploy: (proxyType: EvmProxyType) => boolean;
|
|
11
44
|
export declare const ProxyType: {
|
|
12
|
-
|
|
13
|
-
|
|
45
|
+
TRANSPARENT_UPGRADEABLE_V5: EvmProxyType.TRANSPARENT_UPGRADEABLE_V5;
|
|
46
|
+
UNIVERSAL_UPGRADEABLE_V5: EvmProxyType.UNIVERSAL_UPGRADEABLE_V5;
|
|
47
|
+
OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4: EvmProxyType.OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4;
|
|
48
|
+
TRANSPARENT_UPGRADEABLE_V4: EvmProxyType.TRANSPARENT_UPGRADEABLE_V4;
|
|
49
|
+
UNIVERSAL_UPGRADEABLE_V4: EvmProxyType.UNIVERSAL_UPGRADEABLE_V4;
|
|
14
50
|
};
|
|
15
51
|
export type ProxyType = (typeof ProxyType)[keyof typeof ProxyType];
|
|
16
52
|
export declare const upgradeTypeSchema: z.ZodEnum<typeof UpgradeType>;
|
|
17
53
|
export declare const proxyTypeSchema: z.ZodEnum<{
|
|
18
|
-
|
|
19
|
-
|
|
54
|
+
TRANSPARENT_UPGRADEABLE_V5: EvmProxyType.TRANSPARENT_UPGRADEABLE_V5;
|
|
55
|
+
UNIVERSAL_UPGRADEABLE_V5: EvmProxyType.UNIVERSAL_UPGRADEABLE_V5;
|
|
56
|
+
OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4: EvmProxyType.OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4;
|
|
57
|
+
TRANSPARENT_UPGRADEABLE_V4: EvmProxyType.TRANSPARENT_UPGRADEABLE_V4;
|
|
58
|
+
UNIVERSAL_UPGRADEABLE_V4: EvmProxyType.UNIVERSAL_UPGRADEABLE_V4;
|
|
20
59
|
}>;
|
|
21
60
|
export declare const proxyConfigSchema: z.ZodObject<{
|
|
22
61
|
upgradeType: z.ZodLiteral<UpgradeType.PROXY>;
|
|
23
62
|
proxyType: z.ZodEnum<{
|
|
24
|
-
|
|
25
|
-
|
|
63
|
+
TRANSPARENT_UPGRADEABLE_V5: EvmProxyType.TRANSPARENT_UPGRADEABLE_V5;
|
|
64
|
+
UNIVERSAL_UPGRADEABLE_V5: EvmProxyType.UNIVERSAL_UPGRADEABLE_V5;
|
|
65
|
+
OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4: EvmProxyType.OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4;
|
|
66
|
+
TRANSPARENT_UPGRADEABLE_V4: EvmProxyType.TRANSPARENT_UPGRADEABLE_V4;
|
|
67
|
+
UNIVERSAL_UPGRADEABLE_V4: EvmProxyType.UNIVERSAL_UPGRADEABLE_V4;
|
|
26
68
|
}>;
|
|
27
69
|
}, z.core.$strip>;
|
|
28
70
|
export type ProxyUpgradeableConfig = z.infer<typeof proxyConfigSchema>;
|
|
@@ -37,8 +79,11 @@ export type CodeUpgradeableConfig = z.infer<typeof codeUpgradeableConfigSchema>;
|
|
|
37
79
|
export declare const upgradeableConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
38
80
|
upgradeType: z.ZodLiteral<UpgradeType.PROXY>;
|
|
39
81
|
proxyType: z.ZodEnum<{
|
|
40
|
-
|
|
41
|
-
|
|
82
|
+
TRANSPARENT_UPGRADEABLE_V5: EvmProxyType.TRANSPARENT_UPGRADEABLE_V5;
|
|
83
|
+
UNIVERSAL_UPGRADEABLE_V5: EvmProxyType.UNIVERSAL_UPGRADEABLE_V5;
|
|
84
|
+
OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4: EvmProxyType.OPTIMIZED_TRANSPARENT_UPGRADEABLE_V4;
|
|
85
|
+
TRANSPARENT_UPGRADEABLE_V4: EvmProxyType.TRANSPARENT_UPGRADEABLE_V4;
|
|
86
|
+
UNIVERSAL_UPGRADEABLE_V4: EvmProxyType.UNIVERSAL_UPGRADEABLE_V4;
|
|
42
87
|
}>;
|
|
43
88
|
}, z.core.$strip>, z.ZodObject<{
|
|
44
89
|
upgradeType: z.ZodLiteral<UpgradeType.NOT_UPGRADEABLE>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/upgrade/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/upgrade/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,iFAAiF;IACjF,IAAI,EAAE,SAAS,CAAC;IAChB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;iBAGrC,CAAC;AAEH,oBAAY,WAAW;IAEnB,eAAe,oBAAoB;IAEnC,KAAK,UAAU;IAEf,YAAY,iBAAiB;CAChC;AAED,oBAAY,YAAY;IAEpB,0BAA0B,+BAA+B;IAEzD,wBAAwB,6BAA6B;IAErD,oCAAoC,yCAAyC;IAE7E,0BAA0B,+BAA+B;IAEzD,wBAAwB,6BAA6B;CACxD;AAED,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,YAAY,CAGrD,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,YAAY,CAIpD,CAAC;AAEH,mFAAmF;AACnF,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,YAAY,CAG/D,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,WAAW,GAAI,WAAW,YAAY,KAAG,OAA0C,CAAC;AAEjG,qEAAqE;AACrE,eAAO,MAAM,UAAU,GAAI,WAAW,YAAY,KAAG,OAAyC,CAAC;AAE/F,wFAAwF;AACxF,eAAO,MAAM,gCAAgC,GAAI,WAAW,YAAY,KAAG,OAC9B,CAAC;AAE9C,eAAO,MAAM,SAAS;;;;;;CAErB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,eAAO,MAAM,iBAAiB,+BAAsB,CAAC;AAErD,eAAO,MAAM,eAAe;;;;;;EAAoB,CAAC;AACjD,eAAO,MAAM,iBAAiB;;;;;;;;;iBAG5B,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEvE,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;kCAIlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
package/dist/upgrade/types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EvmProxyType, ProxyType, UpgradeType, codeUpgradeableConfigSchema, notUpgradeableConfigSchema, proxyConfigSchema, proxyTypeSchema, upgradeTypeSchema, upgradeableConfigSchema } from '../
|
|
1
|
+
export { EvmProxyType, ProxyType, SEPARATE_PROXY_ADMIN_TYPES, TUP_PROXY_TYPES, UUPS_PROXY_TYPES, UpgradeType, codeUpgradeableConfigSchema, initializeDataResultSchema, isTupProxy, isUupsProxy, notUpgradeableConfigSchema, proxyConfigSchema, proxyTypeSchema, requiresSeparateProxyAdminDeploy, upgradeTypeSchema, upgradeableConfigSchema } from '../46VB3YIH.js';
|
|
2
2
|
import '../VUOMXK5T.js';
|
|
3
3
|
//# sourceMappingURL=types.js.map
|
|
4
4
|
//# sourceMappingURL=types.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/dw-model",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"zod": "4.3.5",
|
|
18
|
-
"@layerzerolabs/common-chain-model": "0.2.
|
|
19
|
-
"@layerzerolabs/
|
|
20
|
-
"@layerzerolabs/layerzero-definitions": "0.2.
|
|
21
|
-
"@layerzerolabs/typescript-utils": "0.2.
|
|
22
|
-
"@layerzerolabs/
|
|
23
|
-
"@layerzerolabs/
|
|
18
|
+
"@layerzerolabs/common-chain-model": "0.2.23",
|
|
19
|
+
"@layerzerolabs/common-error-utils": "0.2.23",
|
|
20
|
+
"@layerzerolabs/layerzero-definitions": "0.2.23",
|
|
21
|
+
"@layerzerolabs/typescript-utils": "0.2.23",
|
|
22
|
+
"@layerzerolabs/gated-transaction": "0.2.23",
|
|
23
|
+
"@layerzerolabs/zod-utils": "0.2.23"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@mysten/sui": "^1.35.0",
|
|
27
27
|
"tsup": "^8.4.0",
|
|
28
28
|
"vitest": "^3.2.3",
|
|
29
|
-
"@layerzerolabs/tsup-configuration": "0.2.
|
|
30
|
-
"@layerzerolabs/typescript-configuration": "0.2.
|
|
29
|
+
"@layerzerolabs/tsup-configuration": "0.2.23",
|
|
30
|
+
"@layerzerolabs/typescript-configuration": "0.2.23"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "restricted",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
import { ChainName } from '@layerzerolabs/layerzero-definitions';
|
|
4
|
+
import { customSchema, functionSchema } from '@layerzerolabs/zod-utils';
|
|
5
|
+
|
|
6
|
+
import type { ArtifactWithType } from './artifact';
|
|
7
|
+
import { ArtifactType, artifactWithTypeSchema, deploymentArtifactSchema } from './artifact';
|
|
8
|
+
import type { BaseResource, ResolvedResource } from './resources';
|
|
9
|
+
import { getVerificationInfoBaseArgs, saveVerificationInfoBaseArgs } from './workflow';
|
|
10
|
+
|
|
11
|
+
export const resourceRefSchema = z.object({
|
|
12
|
+
resourceId: z.string(),
|
|
13
|
+
// some resources can have multiple realIDs, leave this undefined for the default
|
|
14
|
+
resourceSubKey: z.string().optional(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// the real realID that might exist
|
|
18
|
+
export const realIdSchema = z.object({
|
|
19
|
+
realIdKey: z.string(),
|
|
20
|
+
// some realIDs are scoped to a chain, some aren't
|
|
21
|
+
chainName: z.enum(ChainName).optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const artifactRegistryActivityFactorySchema = z.object({
|
|
25
|
+
getArtifact: functionSchema({
|
|
26
|
+
input: z.tuple([
|
|
27
|
+
z.object({
|
|
28
|
+
ref: resourceRefSchema,
|
|
29
|
+
artifactType: z.enum(ArtifactType),
|
|
30
|
+
}),
|
|
31
|
+
]),
|
|
32
|
+
output: z.promise(artifactWithTypeSchema.optional()),
|
|
33
|
+
// typing to make it generic on artifact type
|
|
34
|
+
}) as z.ZodType<
|
|
35
|
+
<Type extends ArtifactType>(args: {
|
|
36
|
+
artifactType: Type;
|
|
37
|
+
ref: z.infer<typeof resourceRefSchema>;
|
|
38
|
+
}) => Promise<Extract<ArtifactWithType, { artifactType: Type }> | undefined>
|
|
39
|
+
>,
|
|
40
|
+
|
|
41
|
+
saveArtifact: functionSchema({
|
|
42
|
+
input: z.tuple([
|
|
43
|
+
z.object({
|
|
44
|
+
ref: resourceRefSchema,
|
|
45
|
+
artifact: artifactWithTypeSchema,
|
|
46
|
+
}),
|
|
47
|
+
]),
|
|
48
|
+
output: z.promise(z.void()),
|
|
49
|
+
}),
|
|
50
|
+
|
|
51
|
+
// these internally are the same as getArtifact/saveArtifact, just specific argument shapes to match
|
|
52
|
+
// the function pointer expected by the DeployOrchestratorWorkflow
|
|
53
|
+
// we can refactor DeployOrchestratorWorkflow to remove this
|
|
54
|
+
getDeployment: functionSchema({
|
|
55
|
+
input: z.tuple([
|
|
56
|
+
z.object({
|
|
57
|
+
resource: customSchema<BaseResource | ResolvedResource<BaseResource>>(),
|
|
58
|
+
}),
|
|
59
|
+
z.object({
|
|
60
|
+
contractName: z.string(),
|
|
61
|
+
}),
|
|
62
|
+
]),
|
|
63
|
+
output: z.promise(deploymentArtifactSchema.optional()),
|
|
64
|
+
}),
|
|
65
|
+
|
|
66
|
+
saveDeployment: functionSchema({
|
|
67
|
+
input: z.tuple([
|
|
68
|
+
z.object({
|
|
69
|
+
resource: customSchema<BaseResource | ResolvedResource<BaseResource>>(),
|
|
70
|
+
}),
|
|
71
|
+
z.object({
|
|
72
|
+
contractName: z.string(),
|
|
73
|
+
deploymentInfo: deploymentArtifactSchema,
|
|
74
|
+
}),
|
|
75
|
+
]),
|
|
76
|
+
output: z.promise(z.void()),
|
|
77
|
+
}),
|
|
78
|
+
|
|
79
|
+
getVerificationInfo: functionSchema({
|
|
80
|
+
input: z.tuple([
|
|
81
|
+
z.object({
|
|
82
|
+
resource: customSchema<BaseResource | ResolvedResource<BaseResource>>(),
|
|
83
|
+
}),
|
|
84
|
+
getVerificationInfoBaseArgs,
|
|
85
|
+
]),
|
|
86
|
+
output: z.promise(z.any()),
|
|
87
|
+
}),
|
|
88
|
+
|
|
89
|
+
saveVerificationInfo: functionSchema({
|
|
90
|
+
input: z.tuple([
|
|
91
|
+
z.object({
|
|
92
|
+
resource: customSchema<BaseResource | ResolvedResource<BaseResource>>(),
|
|
93
|
+
}),
|
|
94
|
+
saveVerificationInfoBaseArgs,
|
|
95
|
+
]),
|
|
96
|
+
output: z.promise(z.void()),
|
|
97
|
+
}),
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export interface ArtifactRegistry extends z.infer<typeof artifactRegistryActivityFactorySchema> {}
|
package/src/deploy/index.ts
CHANGED
|
@@ -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
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
deploymentArtifactSchema,
|
|
11
11
|
fullDeploymentArtifactSchema,
|
|
12
12
|
identityOnlyDeploymentArtifactSchema,
|
|
13
|
+
verificationArtifactSchema,
|
|
13
14
|
} from './artifact';
|
|
14
15
|
|
|
15
16
|
export type { SuiObjectChange };
|
|
@@ -107,7 +108,10 @@ export const createVerificationInfoBaseArgs = z.object({
|
|
|
107
108
|
});
|
|
108
109
|
export type CreateVerificationInfoBaseArgs = z.infer<typeof createVerificationInfoBaseArgs>;
|
|
109
110
|
|
|
110
|
-
export const saveVerificationInfoBaseArgs =
|
|
111
|
+
export const saveVerificationInfoBaseArgs = z.object({
|
|
112
|
+
deploymentInfo: fullDeploymentArtifactSchema,
|
|
113
|
+
verificationInfo: verificationArtifactSchema,
|
|
114
|
+
});
|
|
111
115
|
|
|
112
116
|
export type SaveVerificationInfoBaseArgs = z.infer<typeof saveVerificationInfoBaseArgs>;
|
|
113
117
|
|