@openzeppelin/upgrades-core 1.17.0 → 1.18.0
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/usage-error.d.ts +9 -0
- package/dist/usage-error.d.ts.map +1 -1
- package/dist/usage-error.js +16 -1
- package/dist/usage-error.js.map +1 -1
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/overrides.d.ts +34 -3
- package/dist/validate/overrides.d.ts.map +1 -1
- package/dist/validate/overrides.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -0
- package/src/usage-error.ts +22 -0
- package/src/validate/index.ts +1 -1
- package/src/validate/overrides.ts +39 -3
package/dist/index.d.ts
CHANGED
|
@@ -19,5 +19,5 @@ export { isTransparentOrUUPSProxy, isBeaconProxy, isTransparentProxy } from './e
|
|
|
19
19
|
export { getImplementationAddressFromBeacon, getImplementationAddressFromProxy } from './impl-address';
|
|
20
20
|
export { isBeacon } from './beacon';
|
|
21
21
|
export { addProxyToManifest } from './add-proxy-to-manifest';
|
|
22
|
-
export { BeaconProxyUnsupportedError, LoadProxyUnsupportedError, PrepareUpgradeUnsupportedError, DeployBeaconProxyUnsupportedError, DeployBeaconProxyImplUnknownError, DeployBeaconProxyKindError, ForceImportUnsupportedError, assertNotProxy, } from './usage-error';
|
|
22
|
+
export { BeaconProxyUnsupportedError, LoadProxyUnsupportedError, PrepareUpgradeUnsupportedError, DeployBeaconProxyUnsupportedError, DeployBeaconProxyImplUnknownError, DeployBeaconProxyKindError, ForceImportUnsupportedError, NoContractImportError, ValidateUpdateRequiresKindError, assertNotProxy, } from './usage-error';
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
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zB,8BAA8B,EAC9B,iCAAiC,EACjC,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,+BAA+B,EAC/B,cAAc,GACf,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.assertNotProxy = exports.ForceImportUnsupportedError = exports.DeployBeaconProxyKindError = exports.DeployBeaconProxyImplUnknownError = exports.DeployBeaconProxyUnsupportedError = exports.PrepareUpgradeUnsupportedError = exports.LoadProxyUnsupportedError = exports.BeaconProxyUnsupportedError = exports.addProxyToManifest = exports.isBeacon = exports.getImplementationAddressFromProxy = exports.getImplementationAddressFromBeacon = exports.isTransparentProxy = exports.isBeaconProxy = exports.isTransparentOrUUPSProxy = exports.UpgradeableContract = exports.detectProxyKind = exports.processProxyKind = exports.setProxyKind = exports.logWarning = exports.getStorageLayoutForAddress = exports.DeploymentNotFound = exports.migrateManifest = exports.Manifest = exports.isEmptySlot = exports.toFallbackEip1967Hash = exports.toEip1967Hash = exports.getImplementationAddress = exports.getBeaconAddress = exports.getAdminAddress = exports.EIP1967ImplementationNotFound = exports.EIP1967BeaconNotFound = exports.fetchOrDeployGetDeployment = exports.fetchOrDeployAdmin = exports.fetchOrDeploy = void 0;
|
|
17
|
+
exports.assertNotProxy = exports.ValidateUpdateRequiresKindError = exports.NoContractImportError = exports.ForceImportUnsupportedError = exports.DeployBeaconProxyKindError = exports.DeployBeaconProxyImplUnknownError = exports.DeployBeaconProxyUnsupportedError = exports.PrepareUpgradeUnsupportedError = exports.LoadProxyUnsupportedError = exports.BeaconProxyUnsupportedError = exports.addProxyToManifest = exports.isBeacon = exports.getImplementationAddressFromProxy = exports.getImplementationAddressFromBeacon = exports.isTransparentProxy = exports.isBeaconProxy = exports.isTransparentOrUUPSProxy = exports.UpgradeableContract = exports.detectProxyKind = exports.processProxyKind = exports.setProxyKind = exports.logWarning = exports.getStorageLayoutForAddress = exports.DeploymentNotFound = exports.migrateManifest = exports.Manifest = exports.isEmptySlot = exports.toFallbackEip1967Hash = exports.toEip1967Hash = exports.getImplementationAddress = exports.getBeaconAddress = exports.getAdminAddress = exports.EIP1967ImplementationNotFound = exports.EIP1967BeaconNotFound = exports.fetchOrDeployGetDeployment = exports.fetchOrDeployAdmin = exports.fetchOrDeploy = void 0;
|
|
18
18
|
__exportStar(require("./validate"), exports);
|
|
19
19
|
var impl_store_1 = require("./impl-store");
|
|
20
20
|
Object.defineProperty(exports, "fetchOrDeploy", { enumerable: true, get: function () { return impl_store_1.fetchOrDeploy; } });
|
|
@@ -71,5 +71,7 @@ Object.defineProperty(exports, "DeployBeaconProxyUnsupportedError", { enumerable
|
|
|
71
71
|
Object.defineProperty(exports, "DeployBeaconProxyImplUnknownError", { enumerable: true, get: function () { return usage_error_1.DeployBeaconProxyImplUnknownError; } });
|
|
72
72
|
Object.defineProperty(exports, "DeployBeaconProxyKindError", { enumerable: true, get: function () { return usage_error_1.DeployBeaconProxyKindError; } });
|
|
73
73
|
Object.defineProperty(exports, "ForceImportUnsupportedError", { enumerable: true, get: function () { return usage_error_1.ForceImportUnsupportedError; } });
|
|
74
|
+
Object.defineProperty(exports, "NoContractImportError", { enumerable: true, get: function () { return usage_error_1.NoContractImportError; } });
|
|
75
|
+
Object.defineProperty(exports, "ValidateUpdateRequiresKindError", { enumerable: true, get: function () { return usage_error_1.ValidateUpdateRequiresKindError; } });
|
|
74
76
|
Object.defineProperty(exports, "assertNotProxy", { enumerable: true, get: function () { return usage_error_1.assertNotProxy; } });
|
|
75
77
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,2CAA6F;AAApF,2GAAA,aAAa,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAAE,wHAAA,0BAA0B,OAAA;AACtE,4CAA0B;AAC1B,4CAA0B;AAC1B,uCASoB;AARlB,iHAAA,qBAAqB,OAAA;AACrB,yHAAA,6BAA6B,OAAA;AAC7B,2GAAA,eAAe,OAAA;AACf,4GAAA,gBAAgB,OAAA;AAChB,oHAAA,wBAAwB,OAAA;AACxB,yGAAA,aAAa,OAAA;AACb,iHAAA,qBAAqB,OAAA;AACrB,uGAAA,WAAW,OAAA;AAEb,6CAA2B;AAC3B,gDAA8B;AAC9B,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,0CAAwB;AAExB,uCAOoB;AAHlB,oGAAA,QAAQ,OAAA;AACR,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAGpB,qEAAuE;AAA9D,qIAAA,0BAA0B,OAAA;AAEnC,mEAAiD;AAEjD,mCAAyC;AAAhC,iGAAA,UAAU,OAAA;AACnB,2CAA+E;AAAtE,0GAAA,YAAY,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAAE,6GAAA,eAAe,OAAA;AAExD,2CAAmD;AAA1C,iHAAA,mBAAmB,OAAA;AAE5B,iDAA8F;AAArF,yHAAA,wBAAwB,OAAA;AAAE,8GAAA,aAAa,OAAA;AAAE,mHAAA,kBAAkB,OAAA;AACpE,+CAAuG;AAA9F,kIAAA,kCAAkC,OAAA;AAAE,iIAAA,iCAAiC,OAAA;AAC9E,mCAAoC;AAA3B,kGAAA,QAAQ,OAAA;AACjB,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAE3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,2CAA6F;AAApF,2G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AA,qBAAqB,OAAA;AACrB,8HAAA,+BAA+B,OAAA;AAC/B,6GAAA,cAAc,OAAA"}
|
package/dist/usage-error.d.ts
CHANGED
|
@@ -17,8 +17,17 @@ export declare class LoadProxyUnsupportedError extends UpgradesError {
|
|
|
17
17
|
export declare class PrepareUpgradeUnsupportedError extends UpgradesError {
|
|
18
18
|
constructor(proxyOrBeaconAddress: string);
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated No longer used since forceImport() supports importing any contract.
|
|
22
|
+
*/
|
|
20
23
|
export declare class ForceImportUnsupportedError extends UpgradesError {
|
|
21
24
|
constructor(proxyOrBeaconAddress: string);
|
|
22
25
|
}
|
|
26
|
+
export declare class NoContractImportError extends UpgradesError {
|
|
27
|
+
constructor(address: string);
|
|
28
|
+
}
|
|
29
|
+
export declare class ValidateUpdateRequiresKindError extends UpgradesError {
|
|
30
|
+
constructor();
|
|
31
|
+
}
|
|
23
32
|
export declare function assertNotProxy(provider: EthereumProvider, address: string): Promise<void>;
|
|
24
33
|
//# sourceMappingURL=usage-error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-error.d.ts","sourceRoot":"","sources":["../src/usage-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA6D,aAAa,EAAE,MAAM,GAAG,CAAC;AAE/G,qBAAa,2BAA4B,SAAQ,aAAa;;CAO7D;AAED,qBAAa,0BAA2B,SAAQ,aAAa;gBAC/C,IAAI,EAAE,MAAM;CAMzB;AAED,qBAAa,iCAAkC,SAAQ,aAAa;gBACtD,aAAa,EAAE,MAAM;CAGlC;AAED,qBAAa,iCAAkC,SAAQ,aAAa;gBACtD,WAAW,EAAE,MAAM;CAMhC;AAED,qBAAa,yBAA0B,SAAQ,aAAa;gBAC9C,YAAY,EAAE,MAAM;CAMjC;AAED,qBAAa,8BAA+B,SAAQ,aAAa;gBACnD,oBAAoB,EAAE,MAAM;CAMzC;AAED,qBAAa,2BAA4B,SAAQ,aAAa;gBAChD,oBAAoB,EAAE,MAAM;CAMzC;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,iBAc/E"}
|
|
1
|
+
{"version":3,"file":"usage-error.d.ts","sourceRoot":"","sources":["../src/usage-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA6D,aAAa,EAAE,MAAM,GAAG,CAAC;AAE/G,qBAAa,2BAA4B,SAAQ,aAAa;;CAO7D;AAED,qBAAa,0BAA2B,SAAQ,aAAa;gBAC/C,IAAI,EAAE,MAAM;CAMzB;AAED,qBAAa,iCAAkC,SAAQ,aAAa;gBACtD,aAAa,EAAE,MAAM;CAGlC;AAED,qBAAa,iCAAkC,SAAQ,aAAa;gBACtD,WAAW,EAAE,MAAM;CAMhC;AAED,qBAAa,yBAA0B,SAAQ,aAAa;gBAC9C,YAAY,EAAE,MAAM;CAMjC;AAED,qBAAa,8BAA+B,SAAQ,aAAa;gBACnD,oBAAoB,EAAE,MAAM;CAMzC;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,aAAa;gBAChD,oBAAoB,EAAE,MAAM;CAMzC;AAED,qBAAa,qBAAsB,SAAQ,aAAa;gBAC1C,OAAO,EAAE,MAAM;CAM5B;AAED,qBAAa,+BAAgC,SAAQ,aAAa;;CAQjE;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,iBAc/E"}
|
package/dist/usage-error.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertNotProxy = exports.ForceImportUnsupportedError = exports.PrepareUpgradeUnsupportedError = exports.LoadProxyUnsupportedError = exports.DeployBeaconProxyImplUnknownError = exports.DeployBeaconProxyUnsupportedError = exports.DeployBeaconProxyKindError = exports.BeaconProxyUnsupportedError = void 0;
|
|
3
|
+
exports.assertNotProxy = exports.ValidateUpdateRequiresKindError = exports.NoContractImportError = exports.ForceImportUnsupportedError = exports.PrepareUpgradeUnsupportedError = exports.LoadProxyUnsupportedError = exports.DeployBeaconProxyImplUnknownError = exports.DeployBeaconProxyUnsupportedError = exports.DeployBeaconProxyKindError = exports.BeaconProxyUnsupportedError = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
5
|
class BeaconProxyUnsupportedError extends _1.UpgradesError {
|
|
6
6
|
constructor() {
|
|
@@ -38,12 +38,27 @@ class PrepareUpgradeUnsupportedError extends _1.UpgradesError {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
exports.PrepareUpgradeUnsupportedError = PrepareUpgradeUnsupportedError;
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated No longer used since forceImport() supports importing any contract.
|
|
43
|
+
*/
|
|
41
44
|
class ForceImportUnsupportedError extends _1.UpgradesError {
|
|
42
45
|
constructor(proxyOrBeaconAddress) {
|
|
43
46
|
super(`Contract at address ${proxyOrBeaconAddress} doesn't look like a supported proxy or beacon`, () => `Only transparent, UUPS, or beacon proxies or beacons can be used with the forceImport() function.`);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
exports.ForceImportUnsupportedError = ForceImportUnsupportedError;
|
|
50
|
+
class NoContractImportError extends _1.UpgradesError {
|
|
51
|
+
constructor(address) {
|
|
52
|
+
super(`No contract at address ${address}`, () => `The address could not be imported because no contract was found at the address.`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.NoContractImportError = NoContractImportError;
|
|
56
|
+
class ValidateUpdateRequiresKindError extends _1.UpgradesError {
|
|
57
|
+
constructor() {
|
|
58
|
+
super('The `kind` option must be provided', () => 'When validating an upgrade from an implementation address, pass in the `kind` option for the kind of proxy that you are using.');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.ValidateUpdateRequiresKindError = ValidateUpdateRequiresKindError;
|
|
47
62
|
async function assertNotProxy(provider, address) {
|
|
48
63
|
if (await (0, _1.isTransparentOrUUPSProxy)(provider, address)) {
|
|
49
64
|
throw new _1.UpgradesError('Address is a transparent or UUPS proxy which cannot be upgraded using upgradeBeacon().', () => 'Use upgradeProxy() instead.');
|
package/dist/usage-error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-error.js","sourceRoot":"","sources":["../src/usage-error.ts"],"names":[],"mappings":";;;AAAA,wBAA+G;AAE/G,MAAa,2BAA4B,SAAQ,gBAAa;IAC5D;QACE,KAAK,CACH,6DAA6D,EAC7D,GAAG,EAAE,CAAC,sEAAsE,CAC7E,CAAC;IACJ,CAAC;CACF;AAPD,kEAOC;AAED,MAAa,0BAA2B,SAAQ,gBAAa;IAC3D,YAAY,IAAY;QACtB,KAAK,CACH,2BAA2B,IAAI,GAAG,EAClC,GAAG,EAAE,CAAC,6EAA6E,CACpF,CAAC;IACJ,CAAC;CACF;AAPD,gEAOC;AAED,MAAa,iCAAkC,SAAQ,gBAAa;IAClE,YAAY,aAAqB;QAC/B,KAAK,CAAC,eAAe,aAAa,6BAA6B,EAAE,GAAG,EAAE,CAAC,uCAAuC,CAAC,CAAC;IAClH,CAAC;CACF;AAJD,8EAIC;AAED,MAAa,iCAAkC,SAAQ,gBAAa;IAClE,YAAY,WAAmB;QAC7B,KAAK,CACH,sCAAsC,WAAW,aAAa,EAC9D,GAAG,EAAE,CAAC,wGAAwG,CAC/G,CAAC;IACJ,CAAC;CACF;AAPD,8EAOC;AAED,MAAa,yBAA0B,SAAQ,gBAAa;IAC1D,YAAY,YAAoB;QAC9B,KAAK,CACH,eAAe,YAAY,sCAAsC,EACjE,GAAG,EAAE,CAAC,wFAAwF,CAC/F,CAAC;IACJ,CAAC;CACF;AAPD,8DAOC;AAED,MAAa,8BAA+B,SAAQ,gBAAa;IAC/D,YAAY,oBAA4B;QACtC,KAAK,CACH,uBAAuB,oBAAoB,gDAAgD,EAC3F,GAAG,EAAE,CAAC,sGAAsG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B,CACpC,CAAC;KACH;SAAM,IAAI,MAAM,IAAA,gBAAa,EAAC,QAAQ,EAAE,OAAO,CAAC,EAAE;QACjD,MAAM,aAAa,GAAG,MAAM,IAAA,mBAAgB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAChE,MAAM,IAAI,gBAAa,CACrB,8DAA8D,EAC9D,GAAG,EAAE,CACH,gIAAgI,aAAa,WAAW,CAC3J,CAAC;KACH;AACH,CAAC;AAdD,wCAcC"}
|
package/dist/validate/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { validate, ValidationRunData, ContractValidation } from './run';
|
|
2
|
-
export { ValidationOptions, withValidationDefaults } from './overrides';
|
|
2
|
+
export { ProxyKindOption, StandaloneValidationOptions, ValidationOptions, withValidationDefaults } from './overrides';
|
|
3
3
|
export { ValidationErrors } from './error';
|
|
4
4
|
export { RunValidation, ValidationLog, Validation, ValidationResult } from './compat';
|
|
5
5
|
export { ValidationData, ValidationDataCurrent, isCurrentValidationData, concatRunData } from './data';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACtH,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvG,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":";;;AAAA,6BAAwE;AAA/D,+FAAA,QAAQ,OAAA;AACjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":";;;AAAA,6BAAwE;AAA/D,+FAAA,QAAQ,OAAA;AACjB,yCAAsH;AAA5C,mHAAA,sBAAsB,OAAA;AAChG,iCAA2C;AAAlC,yGAAA,gBAAgB,OAAA;AAEzB,+BAAuG;AAAvD,+GAAA,uBAAuB,OAAA;AAAE,qGAAA,aAAa,OAAA;AACtF,iCASiB;AARf,2GAAA,kBAAkB,OAAA;AAClB,wHAAA,+BAA+B,OAAA;AAC/B,yGAAA,gBAAgB,OAAA;AAChB,0GAAA,iBAAiB,OAAA;AACjB,4GAAA,mBAAmB,OAAA;AACnB,kGAAA,SAAS,OAAA;AACT,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AAEhB,mCAA0D;AAAjD,wHAAA,8BAA8B,OAAA;AAEvC,0BAA0B;AAC1B,oCAA+C;AAAtC,sGAAA,eAAe,OAAA"}
|
|
@@ -1,13 +1,44 @@
|
|
|
1
1
|
import { ValidationError } from './run';
|
|
2
2
|
import { ProxyDeployment } from '../manifest';
|
|
3
3
|
export { silenceWarnings } from '../utils/log';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Option for the kind of proxy that will be used.
|
|
6
|
+
*/
|
|
7
|
+
export interface ProxyKindOption {
|
|
8
|
+
/**
|
|
9
|
+
* The kind of proxy to deploy, upgrade or import, or the kind of proxy that the implementation will be used with. Defaults to `"transparent"`.
|
|
10
|
+
*/
|
|
11
|
+
kind?: ProxyDeployment['kind'];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Validation options in a standalone context (without storage layout comparisons with a previous implementation).
|
|
15
|
+
*/
|
|
16
|
+
export interface StandaloneValidationOptions extends ProxyKindOption {
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Equivalent to including "struct-definition" and "enum-definition" in unsafeAllow. No longer necessary.
|
|
19
|
+
*/
|
|
5
20
|
unsafeAllowCustomTypes?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Equivalent to including `"external-library-linking"` in {@link unsafeAllow}.
|
|
23
|
+
*/
|
|
6
24
|
unsafeAllowLinkedLibraries?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Selectively disable one or more validation errors.
|
|
27
|
+
*/
|
|
28
|
+
unsafeAllow?: ValidationError['kind'][];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Validation options in the context of an upgrade (with storage layout comparisions with a previous implementation).
|
|
32
|
+
*/
|
|
33
|
+
export interface ValidationOptions extends StandaloneValidationOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Configure storage layout check to allow variable renaming.
|
|
36
|
+
*/
|
|
7
37
|
unsafeAllowRenames?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Upgrades the proxy or beacon without first checking for storage layout compatibility errors. This is a dangerous option meant to be used as a last resort.
|
|
40
|
+
*/
|
|
8
41
|
unsafeSkipStorageCheck?: boolean;
|
|
9
|
-
unsafeAllow?: ValidationError['kind'][];
|
|
10
|
-
kind?: ProxyDeployment['kind'];
|
|
11
42
|
}
|
|
12
43
|
export declare const ValidationErrorUnsafeMessages: Record<ValidationError['kind'], string[]>;
|
|
13
44
|
export declare function withValidationDefaults(opts: ValidationOptions): Required<ValidationOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../src/validate/overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../src/validate/overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,eAAe;IAClE;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,2BAA2B;IACpE;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CA0BnF,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CA2B3F;AAED,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,eAAe,EAAE,EACzB,IAAI,EAAE,iBAAiB,GACtB,eAAe,EAAE,CAwBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../src/validate/overrides.ts"],"names":[],"mappings":";;;AAEA,sCAA0C;AAE1C,0BAA0B;AAC1B,oCAA+C;AAAtC,sGAAA,eAAe,OAAA;
|
|
1
|
+
{"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../src/validate/overrides.ts"],"names":[],"mappings":";;;AAEA,sCAA0C;AAE1C,0BAA0B;AAC1B,oCAA+C;AAAtC,sGAAA,eAAe,OAAA;AA+CX,QAAA,6BAA6B,GAA8C;IACtF,2BAA2B,EAAE;QAC3B,mEAAmE;QACnE,mEAAmE;KACpE;IACD,0BAA0B,EAAE,CAAC,kEAAkE,CAAC;IAChG,0BAA0B,EAAE;QAC1B,gGAAgG;QAChG,iFAAiF;KAClF;IACD,mBAAmB,EAAE;QACnB,8FAA8F;QAC9F,+EAA+E;KAChF;IACD,iBAAiB,EAAE;QACjB,0FAA0F;QAC1F,+EAA+E;KAChF;IACD,WAAW,EAAE,CAAC,qDAAqD,CAAC;IACpE,YAAY,EAAE,CAAC,sDAAsD,CAAC;IACtE,YAAY,EAAE,CAAC,sDAAsD,CAAC;IACtE,0BAA0B,EAAE;QAC1B,kFAAkF;QAClF,yFAAyF;QACzF,gFAAgF;KACjF;CACF,CAAC;AAEF,SAAgB,sBAAsB,CAAC,IAAuB;IAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;IAC3C,MAAM,sBAAsB,GAC1B,IAAI,CAAC,sBAAsB;QAC3B,CAAC,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,WAAW,CAAC,QAA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;gBAC7B,MAAM,WAAW,GAAG,SAAS,KAAK,KAAK,CAAC,IAAI,CAAC;gBAC7C,eAAe,GAAG,eAAe,IAAI,WAAW,CAAC;gBACjD,OAAO,CAAC,WAAW,CAAC;YACtB,CAAC,CAAC,CAAC;YAEH,IAAI,eAAe,IAAI,gBAAgB,EAAE;gBACvC,IAAA,gBAAU,EAAC,oCAAoC,YAAY,EAAE,EAAE,gBAAgB,CAAC,CAAC;aAClF;SACF;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA5BD,8CA4BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openzeppelin/upgrades-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "https://github.com/OpenZeppelin/openzeppelin-upgrades/tree/master/packages/core",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"proper-lockfile": "^4.1.1",
|
|
59
59
|
"solidity-ast": "^0.4.15"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "a152e12fcb622faa49ceb51ba4c695a46c3f8106"
|
|
62
62
|
}
|
package/src/index.ts
CHANGED
package/src/usage-error.ts
CHANGED
|
@@ -51,6 +51,9 @@ export class PrepareUpgradeUnsupportedError extends UpgradesError {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated No longer used since forceImport() supports importing any contract.
|
|
56
|
+
*/
|
|
54
57
|
export class ForceImportUnsupportedError extends UpgradesError {
|
|
55
58
|
constructor(proxyOrBeaconAddress: string) {
|
|
56
59
|
super(
|
|
@@ -60,6 +63,25 @@ export class ForceImportUnsupportedError extends UpgradesError {
|
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
|
|
66
|
+
export class NoContractImportError extends UpgradesError {
|
|
67
|
+
constructor(address: string) {
|
|
68
|
+
super(
|
|
69
|
+
`No contract at address ${address}`,
|
|
70
|
+
() => `The address could not be imported because no contract was found at the address.`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export class ValidateUpdateRequiresKindError extends UpgradesError {
|
|
76
|
+
constructor() {
|
|
77
|
+
super(
|
|
78
|
+
'The `kind` option must be provided',
|
|
79
|
+
() =>
|
|
80
|
+
'When validating an upgrade from an implementation address, pass in the `kind` option for the kind of proxy that you are using.',
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
63
85
|
export async function assertNotProxy(provider: EthereumProvider, address: string) {
|
|
64
86
|
if (await isTransparentOrUUPSProxy(provider, address)) {
|
|
65
87
|
throw new UpgradesError(
|
package/src/validate/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { validate, ValidationRunData, ContractValidation } from './run';
|
|
2
|
-
export { ValidationOptions, withValidationDefaults } from './overrides';
|
|
2
|
+
export { ProxyKindOption, StandaloneValidationOptions, ValidationOptions, withValidationDefaults } from './overrides';
|
|
3
3
|
export { ValidationErrors } from './error';
|
|
4
4
|
export { RunValidation, ValidationLog, Validation, ValidationResult } from './compat';
|
|
5
5
|
export { ValidationData, ValidationDataCurrent, isCurrentValidationData, concatRunData } from './data';
|
|
@@ -5,13 +5,49 @@ import { logWarning } from '../utils/log';
|
|
|
5
5
|
// Backwards compatibility
|
|
6
6
|
export { silenceWarnings } from '../utils/log';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Option for the kind of proxy that will be used.
|
|
10
|
+
*/
|
|
11
|
+
export interface ProxyKindOption {
|
|
12
|
+
/**
|
|
13
|
+
* The kind of proxy to deploy, upgrade or import, or the kind of proxy that the implementation will be used with. Defaults to `"transparent"`.
|
|
14
|
+
*/
|
|
15
|
+
kind?: ProxyDeployment['kind'];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Validation options in a standalone context (without storage layout comparisons with a previous implementation).
|
|
20
|
+
*/
|
|
21
|
+
export interface StandaloneValidationOptions extends ProxyKindOption {
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Equivalent to including "struct-definition" and "enum-definition" in unsafeAllow. No longer necessary.
|
|
24
|
+
*/
|
|
9
25
|
unsafeAllowCustomTypes?: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Equivalent to including `"external-library-linking"` in {@link unsafeAllow}.
|
|
29
|
+
*/
|
|
10
30
|
unsafeAllowLinkedLibraries?: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Selectively disable one or more validation errors.
|
|
34
|
+
*/
|
|
35
|
+
unsafeAllow?: ValidationError['kind'][];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Validation options in the context of an upgrade (with storage layout comparisions with a previous implementation).
|
|
40
|
+
*/
|
|
41
|
+
export interface ValidationOptions extends StandaloneValidationOptions {
|
|
42
|
+
/**
|
|
43
|
+
* Configure storage layout check to allow variable renaming.
|
|
44
|
+
*/
|
|
11
45
|
unsafeAllowRenames?: boolean;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Upgrades the proxy or beacon without first checking for storage layout compatibility errors. This is a dangerous option meant to be used as a last resort.
|
|
49
|
+
*/
|
|
12
50
|
unsafeSkipStorageCheck?: boolean;
|
|
13
|
-
unsafeAllow?: ValidationError['kind'][];
|
|
14
|
-
kind?: ProxyDeployment['kind'];
|
|
15
51
|
}
|
|
16
52
|
|
|
17
53
|
export const ValidationErrorUnsafeMessages: Record<ValidationError['kind'], string[]> = {
|