@openzeppelin/upgrades-core 1.26.1 → 1.27.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/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.json +126 -0
- package/dist/cli/cli.d.ts +3 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +9 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/cli.test.d.ts +2 -0
- package/dist/cli/cli.test.d.ts.map +1 -0
- package/dist/cli/cli.test.js +52 -0
- package/dist/cli/cli.test.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +10 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/validate/build-info-file.d.ts +22 -0
- package/dist/cli/validate/build-info-file.d.ts.map +1 -0
- package/dist/cli/validate/build-info-file.js +110 -0
- package/dist/cli/validate/build-info-file.js.map +1 -0
- package/dist/cli/validate/build-info-file.test.d.ts +2 -0
- package/dist/cli/validate/build-info-file.test.d.ts.map +1 -0
- package/dist/cli/validate/build-info-file.test.js +175 -0
- package/dist/cli/validate/build-info-file.test.js.map +1 -0
- package/dist/cli/validate/contract-report.d.ts +31 -0
- package/dist/cli/validate/contract-report.d.ts.map +1 -0
- package/dist/cli/validate/contract-report.js +107 -0
- package/dist/cli/validate/contract-report.js.map +1 -0
- package/dist/cli/validate/error.d.ts +4 -0
- package/dist/cli/validate/error.d.ts.map +1 -0
- package/dist/cli/validate/error.js +8 -0
- package/dist/cli/validate/error.js.map +1 -0
- package/dist/cli/validate/project-report.d.ts +18 -0
- package/dist/cli/validate/project-report.d.ts.map +1 -0
- package/dist/cli/validate/project-report.js +42 -0
- package/dist/cli/validate/project-report.js.map +1 -0
- package/dist/cli/validate/project-report.test.d.ts +2 -0
- package/dist/cli/validate/project-report.test.d.ts.map +1 -0
- package/dist/cli/validate/project-report.test.js +90 -0
- package/dist/cli/validate/project-report.test.js.map +1 -0
- package/dist/cli/validate/upgradeability-assessment.d.ts +19 -0
- package/dist/cli/validate/upgradeability-assessment.d.ts.map +1 -0
- package/dist/cli/validate/upgradeability-assessment.js +103 -0
- package/dist/cli/validate/upgradeability-assessment.js.map +1 -0
- package/dist/cli/validate/validate-upgrade-safety.d.ts +16 -0
- package/dist/cli/validate/validate-upgrade-safety.d.ts.map +1 -0
- package/dist/cli/validate/validate-upgrade-safety.js +23 -0
- package/dist/cli/validate/validate-upgrade-safety.js.map +1 -0
- package/dist/cli/validate/validate-upgrade-safety.test.d.ts +2 -0
- package/dist/cli/validate/validate-upgrade-safety.test.d.ts.map +1 -0
- package/dist/cli/validate/validate-upgrade-safety.test.js +74 -0
- package/dist/cli/validate/validate-upgrade-safety.test.js.map +1 -0
- package/dist/cli/validate/validations.d.ts +11 -0
- package/dist/cli/validate/validations.d.ts.map +1 -0
- package/dist/cli/validate/validations.js +40 -0
- package/dist/cli/validate/validations.js.map +1 -0
- package/dist/cli/validate/validations.test.d.ts +2 -0
- package/dist/cli/validate/validations.test.d.ts.map +1 -0
- package/dist/cli/validate/validations.test.js +64 -0
- package/dist/cli/validate/validations.test.js.map +1 -0
- package/dist/cli/validate.d.ts +16 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +119 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/cli/validate.test.d.ts +2 -0
- package/dist/cli/validate.test.d.ts.map +1 -0
- package/dist/cli/validate.test.js +108 -0
- package/dist/cli/validate.test.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/manifest.test.js +2 -1
- package/dist/manifest.test.js.map +1 -1
- package/dist/utils/annotations.d.ts +16 -0
- package/dist/utils/annotations.d.ts.map +1 -0
- package/dist/utils/annotations.js +46 -0
- package/dist/utils/annotations.js.map +1 -0
- package/dist/utils/contract-name.d.ts +2 -0
- package/dist/utils/contract-name.d.ts.map +1 -0
- package/dist/utils/contract-name.js +8 -0
- package/dist/utils/contract-name.js.map +1 -0
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +2 -1
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/query.d.ts +8 -1
- package/dist/validate/query.d.ts.map +1 -1
- package/dist/validate/query.js +16 -3
- package/dist/validate/query.js.map +1 -1
- package/dist/validate/run.d.ts +1 -4
- package/dist/validate/run.d.ts.map +1 -1
- package/dist/validate/run.js +8 -38
- package/dist/validate/run.js.map +1 -1
- package/package.json +9 -3
- package/src/cli/cli.test.ts +57 -0
- package/src/cli/cli.test.ts.md +138 -0
- package/src/cli/cli.test.ts.snap +0 -0
- package/src/cli/cli.ts +9 -0
- package/src/cli/index.ts +3 -0
- package/src/cli/validate/build-info-file.test.ts +211 -0
- package/src/cli/validate/build-info-file.ts +145 -0
- package/src/cli/validate/contract-report.ts +130 -0
- package/src/cli/validate/error.ts +3 -0
- package/src/cli/validate/project-report.test.ts +124 -0
- package/src/cli/validate/project-report.test.ts.md +40 -0
- package/src/cli/validate/project-report.test.ts.snap +0 -0
- package/src/cli/validate/project-report.ts +44 -0
- package/src/cli/validate/upgradeability-assessment.ts +137 -0
- package/src/cli/validate/validate-upgrade-safety.test.ts +102 -0
- package/src/cli/validate/validate-upgrade-safety.test.ts.md +98 -0
- package/src/cli/validate/validate-upgrade-safety.test.ts.snap +0 -0
- package/src/cli/validate/validate-upgrade-safety.ts +29 -0
- package/src/cli/validate/validations.test.ts +72 -0
- package/src/cli/validate/validations.test.ts.md +87 -0
- package/src/cli/validate/validations.test.ts.snap +0 -0
- package/src/cli/validate/validations.ts +53 -0
- package/src/cli/validate.test.ts +112 -0
- package/src/cli/validate.ts +134 -0
- package/src/index.ts +2 -0
- package/src/manifest.test.ts +2 -1
- package/src/utils/annotations.ts +47 -0
- package/src/utils/contract-name.ts +3 -0
- package/src/validate/index.ts +1 -0
- package/src/validate/query.ts +16 -3
- package/src/validate/run.ts +5 -41
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "ITransparentUpgradeableProxy",
|
|
4
|
+
"sourceName": "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"anonymous": false,
|
|
8
|
+
"inputs": [
|
|
9
|
+
{
|
|
10
|
+
"indexed": false,
|
|
11
|
+
"internalType": "address",
|
|
12
|
+
"name": "previousAdmin",
|
|
13
|
+
"type": "address"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"indexed": false,
|
|
17
|
+
"internalType": "address",
|
|
18
|
+
"name": "newAdmin",
|
|
19
|
+
"type": "address"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"name": "AdminChanged",
|
|
23
|
+
"type": "event"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"anonymous": false,
|
|
27
|
+
"inputs": [
|
|
28
|
+
{
|
|
29
|
+
"indexed": true,
|
|
30
|
+
"internalType": "address",
|
|
31
|
+
"name": "beacon",
|
|
32
|
+
"type": "address"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"name": "BeaconUpgraded",
|
|
36
|
+
"type": "event"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"anonymous": false,
|
|
40
|
+
"inputs": [
|
|
41
|
+
{
|
|
42
|
+
"indexed": true,
|
|
43
|
+
"internalType": "address",
|
|
44
|
+
"name": "implementation",
|
|
45
|
+
"type": "address"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"name": "Upgraded",
|
|
49
|
+
"type": "event"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"inputs": [],
|
|
53
|
+
"name": "admin",
|
|
54
|
+
"outputs": [
|
|
55
|
+
{
|
|
56
|
+
"internalType": "address",
|
|
57
|
+
"name": "",
|
|
58
|
+
"type": "address"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"stateMutability": "view",
|
|
62
|
+
"type": "function"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"inputs": [
|
|
66
|
+
{
|
|
67
|
+
"internalType": "address",
|
|
68
|
+
"name": "",
|
|
69
|
+
"type": "address"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"name": "changeAdmin",
|
|
73
|
+
"outputs": [],
|
|
74
|
+
"stateMutability": "nonpayable",
|
|
75
|
+
"type": "function"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"inputs": [],
|
|
79
|
+
"name": "implementation",
|
|
80
|
+
"outputs": [
|
|
81
|
+
{
|
|
82
|
+
"internalType": "address",
|
|
83
|
+
"name": "",
|
|
84
|
+
"type": "address"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"stateMutability": "view",
|
|
88
|
+
"type": "function"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"inputs": [
|
|
92
|
+
{
|
|
93
|
+
"internalType": "address",
|
|
94
|
+
"name": "",
|
|
95
|
+
"type": "address"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"name": "upgradeTo",
|
|
99
|
+
"outputs": [],
|
|
100
|
+
"stateMutability": "nonpayable",
|
|
101
|
+
"type": "function"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"inputs": [
|
|
105
|
+
{
|
|
106
|
+
"internalType": "address",
|
|
107
|
+
"name": "",
|
|
108
|
+
"type": "address"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"internalType": "bytes",
|
|
112
|
+
"name": "",
|
|
113
|
+
"type": "bytes"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"name": "upgradeToAndCall",
|
|
117
|
+
"outputs": [],
|
|
118
|
+
"stateMutability": "payable",
|
|
119
|
+
"type": "function"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"bytecode": "0x",
|
|
123
|
+
"deployedBytecode": "0x",
|
|
124
|
+
"linkReferences": {},
|
|
125
|
+
"deployedLinkReferences": {}
|
|
126
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli/cli.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const validate_1 = require("./validate");
|
|
5
|
+
const run = async () => {
|
|
6
|
+
await (0, validate_1.main)(process.argv.slice(2));
|
|
7
|
+
};
|
|
8
|
+
void run();
|
|
9
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAkC;AAElC,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE;IACrB,MAAM,IAAA,eAAI,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,KAAK,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.test.d.ts","sourceRoot":"","sources":["../../src/cli/cli.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ava_1 = __importDefault(require("ava"));
|
|
7
|
+
const util_1 = require("util");
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const os_1 = __importDefault(require("os"));
|
|
12
|
+
const rimraf_1 = __importDefault(require("rimraf"));
|
|
13
|
+
const hardhat_1 = require("hardhat");
|
|
14
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
15
|
+
const rimraf = (0, util_1.promisify)(rimraf_1.default);
|
|
16
|
+
const CLI = 'node dist/cli/cli.js';
|
|
17
|
+
async function getTempDir(t) {
|
|
18
|
+
const temp = await fs_1.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'upgrades-core-test-'));
|
|
19
|
+
t.teardown(() => rimraf(temp));
|
|
20
|
+
return temp;
|
|
21
|
+
}
|
|
22
|
+
(0, ava_1.default)('help', async (t) => {
|
|
23
|
+
const output = (await execAsync(`${CLI} validate --help`)).stdout;
|
|
24
|
+
t.snapshot(output);
|
|
25
|
+
});
|
|
26
|
+
(0, ava_1.default)('no args', async (t) => {
|
|
27
|
+
const output = (await execAsync(CLI)).stdout;
|
|
28
|
+
t.snapshot(output);
|
|
29
|
+
});
|
|
30
|
+
(0, ava_1.default)('validate - errors', async (t) => {
|
|
31
|
+
const temp = await getTempDir(t);
|
|
32
|
+
const buildInfo = await hardhat_1.artifacts.getBuildInfo(`contracts/test/cli/Validate.sol:Safe`);
|
|
33
|
+
await fs_1.promises.writeFile(path_1.default.join(temp, 'validate.json'), JSON.stringify(buildInfo));
|
|
34
|
+
const error = await t.throwsAsync(execAsync(`${CLI} validate ${temp}`));
|
|
35
|
+
const expectation = [`Stdout: ${error.stdout}`, `Stderr: ${error.stderr}`];
|
|
36
|
+
t.snapshot(expectation.join('\n'));
|
|
37
|
+
});
|
|
38
|
+
(0, ava_1.default)('validate - no upgradeable', async (t) => {
|
|
39
|
+
const temp = await getTempDir(t);
|
|
40
|
+
const buildInfo = await hardhat_1.artifacts.getBuildInfo(`contracts/test/cli/Storage088.sol:Storage088`);
|
|
41
|
+
await fs_1.promises.writeFile(path_1.default.join(temp, 'validate.json'), JSON.stringify(buildInfo));
|
|
42
|
+
const output = (await execAsync(`${CLI} validate ${temp}`)).stdout;
|
|
43
|
+
t.snapshot(output);
|
|
44
|
+
});
|
|
45
|
+
(0, ava_1.default)('validate - ok', async (t) => {
|
|
46
|
+
const temp = await getTempDir(t);
|
|
47
|
+
const buildInfo = await hardhat_1.artifacts.getBuildInfo(`contracts/test/cli/Annotation.sol:Annotation`);
|
|
48
|
+
await fs_1.promises.writeFile(path_1.default.join(temp, 'validate.json'), JSON.stringify(buildInfo));
|
|
49
|
+
const output = (await execAsync(`${CLI} validate ${temp}`)).stdout;
|
|
50
|
+
t.snapshot(output);
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=cli.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.test.js","sourceRoot":"","sources":["../../src/cli/cli.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAA6C;AAC7C,+BAAiC;AACjC,iDAAqC;AACrC,2BAAoC;AACpC,gDAAwB;AACxB,4CAAoB;AACpB,oDAAiC;AACjC,qCAAoC;AAEpC,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAClC,MAAM,MAAM,GAAG,IAAA,gBAAS,EAAC,gBAAW,CAAC,CAAC;AAEtC,MAAM,GAAG,GAAG,sBAAsB,CAAC;AAEnC,KAAK,UAAU,UAAU,CAAC,CAAmB;IAC3C,MAAM,IAAI,GAAG,MAAM,aAAE,CAAC,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,MAAM,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,IAAA,aAAI,EAAC,MAAM,EAAE,KAAK,E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SAAS,GAAG,MAAM,mBAAS,CAAC,YAAY,CAAC,8CAA8C,CAAC,CAAC;IAC/F,MAAM,aAAE,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhF,MAAM,MAAM,GAAG,CAAC,MAAM,SAAS,CAAC,GAAG,GAAG,aAAa,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IACnE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,eAAe,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAC9B,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,SAAS,GAAG,MAAM,mBAAS,CAAC,YAAY,CAAC,8CAA8C,CAAC,CAAC;IAC/F,MAAM,aAAE,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhF,MAAM,MAAM,GAAG,CAAC,MAAM,SAAS,CAAC,GAAG,GAAG,aAAa,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IACnE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ValidateUpgradeSafetyOptions, validateUpgradeSafety } from './validate/validate-upgrade-safety';
|
|
2
|
+
export { ProjectReport } from './validate/project-report';
|
|
3
|
+
export { ReferenceContractNotFound } from './validate/upgradeability-assessment';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReferenceContractNotFound = exports.ProjectReport = exports.validateUpgradeSafety = void 0;
|
|
4
|
+
var validate_upgrade_safety_1 = require("./validate/validate-upgrade-safety");
|
|
5
|
+
Object.defineProperty(exports, "validateUpgradeSafety", { enumerable: true, get: function () { return validate_upgrade_safety_1.validateUpgradeSafety; } });
|
|
6
|
+
var project_report_1 = require("./validate/project-report");
|
|
7
|
+
Object.defineProperty(exports, "ProjectReport", { enumerable: true, get: function () { return project_report_1.ProjectReport; } });
|
|
8
|
+
var upgradeability_assessment_1 = require("./validate/upgradeability-assessment");
|
|
9
|
+
Object.defineProperty(exports, "ReferenceContractNotFound", { enumerable: true, get: function () { return upgradeability_assessment_1.ReferenceContractNotFound; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AAAA,8EAAyG;AAAlE,gIAAA,qBAAqB,OAAA;AAC5D,4DAA0D;AAAjD,+GAAA,aAAa,OAAA;AACtB,kFAAiF;AAAxE,sIAAA,yBAAyB,OAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SolcOutput, SolcInput } from '../..';
|
|
2
|
+
/**
|
|
3
|
+
* A build info file containing Solidity compiler input and output JSON objects.
|
|
4
|
+
*/
|
|
5
|
+
export interface BuildInfoFile {
|
|
6
|
+
/**
|
|
7
|
+
* The Solidity compiler input JSON object.
|
|
8
|
+
*/
|
|
9
|
+
input: SolcInput;
|
|
10
|
+
/**
|
|
11
|
+
* The Solidity compiler output JSON object.
|
|
12
|
+
*/
|
|
13
|
+
output: SolcOutput;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Gets the build info files from the build info directory.
|
|
17
|
+
*
|
|
18
|
+
* @param buildInfoDir Build info directory, or undefined to use the default Hardhat or Foundry build-info dir.
|
|
19
|
+
* @returns The build info files with Solidity compiler input and output.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getBuildInfoFiles(buildInfoDir?: string): Promise<BuildInfoFile[]>;
|
|
22
|
+
//# sourceMappingURL=build-info-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-info-file.d.ts","sourceRoot":"","sources":["../../../src/cli/validate/build-info-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAyB9C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,YAAY,CAAC,EAAE,MAAM,4BAI5D"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getBuildInfoFiles = void 0;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const error_1 = require("./error");
|
|
10
|
+
const HARDHAT_COMPILE_COMMAND = 'npx hardhat clean && npx hardhat compile';
|
|
11
|
+
const FOUNDRY_COMPILE_COMMAND = 'forge clean && forge build --build-info --extra-output storageLayout';
|
|
12
|
+
const STORAGE_LAYOUT_HELP = `\
|
|
13
|
+
If using Hardhat, include the 'storageLayout' output selection in your Hardhat config:
|
|
14
|
+
module.exports = {
|
|
15
|
+
solidity: {
|
|
16
|
+
settings: {
|
|
17
|
+
outputSelection: {
|
|
18
|
+
'*': {
|
|
19
|
+
'*': ['storageLayout'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
Then recompile your contracts with '${HARDHAT_COMPILE_COMMAND}' and try again.
|
|
26
|
+
|
|
27
|
+
If using Foundry, recompile your contracts with '${FOUNDRY_COMPILE_COMMAND}' and try again.`;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the build info files from the build info directory.
|
|
30
|
+
*
|
|
31
|
+
* @param buildInfoDir Build info directory, or undefined to use the default Hardhat or Foundry build-info dir.
|
|
32
|
+
* @returns The build info files with Solidity compiler input and output.
|
|
33
|
+
*/
|
|
34
|
+
async function getBuildInfoFiles(buildInfoDir) {
|
|
35
|
+
const dir = await findDir(buildInfoDir);
|
|
36
|
+
const jsonFiles = await getJsonFiles(dir);
|
|
37
|
+
return await readBuildInfo(jsonFiles);
|
|
38
|
+
}
|
|
39
|
+
exports.getBuildInfoFiles = getBuildInfoFiles;
|
|
40
|
+
async function findDir(buildInfoDir) {
|
|
41
|
+
if (buildInfoDir !== undefined && !(await hasJsonFiles(buildInfoDir))) {
|
|
42
|
+
throw new error_1.ValidateCommandError(`The directory '${buildInfoDir}' does not exist or does not contain any build info files.`, () => `Compile your contracts with '${HARDHAT_COMPILE_COMMAND}' or '${FOUNDRY_COMPILE_COMMAND}' and try again with the correct path to the build info directory.`);
|
|
43
|
+
}
|
|
44
|
+
const dir = buildInfoDir ?? (await findDefaultDir());
|
|
45
|
+
return dir;
|
|
46
|
+
}
|
|
47
|
+
async function findDefaultDir() {
|
|
48
|
+
const hardhatRelativeDir = path_1.default.join('artifacts', 'build-info');
|
|
49
|
+
const foundryRelativeDir = path_1.default.join('out', 'build-info');
|
|
50
|
+
const hardhatDir = path_1.default.join(process.cwd(), hardhatRelativeDir);
|
|
51
|
+
const foundryDir = path_1.default.join(process.cwd(), foundryRelativeDir);
|
|
52
|
+
const hasHardhatBuildInfo = await hasJsonFiles(hardhatDir);
|
|
53
|
+
const hasFoundryBuildInfo = await hasJsonFiles(foundryDir);
|
|
54
|
+
if (hasHardhatBuildInfo && hasFoundryBuildInfo) {
|
|
55
|
+
throw new error_1.ValidateCommandError(`Found both Hardhat and Foundry build info directories: '${hardhatRelativeDir}' and '${foundryRelativeDir}'.`, () => `Specify the build info directory that you want to validate.`);
|
|
56
|
+
}
|
|
57
|
+
else if (hasHardhatBuildInfo) {
|
|
58
|
+
return hardhatDir;
|
|
59
|
+
}
|
|
60
|
+
else if (hasFoundryBuildInfo) {
|
|
61
|
+
return foundryDir;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
throw new error_1.ValidateCommandError(`Could not find the default Hardhat or Foundry build info directory.`, () => `Compile your contracts with '${HARDHAT_COMPILE_COMMAND}' or '${FOUNDRY_COMPILE_COMMAND}', or specify the build info directory that you want to validate.`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function hasJsonFiles(dir) {
|
|
68
|
+
return (await exists(dir)) && (await getJsonFiles(dir)).length > 0;
|
|
69
|
+
}
|
|
70
|
+
async function exists(dir) {
|
|
71
|
+
try {
|
|
72
|
+
await fs_1.promises.access(dir);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
catch (e) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async function getJsonFiles(dir) {
|
|
80
|
+
const files = await fs_1.promises.readdir(dir);
|
|
81
|
+
const jsonFiles = files.filter(file => file.endsWith('.json'));
|
|
82
|
+
return jsonFiles.map(file => path_1.default.join(dir, file));
|
|
83
|
+
}
|
|
84
|
+
async function readBuildInfo(buildInfoFilePaths) {
|
|
85
|
+
const buildInfoFiles = [];
|
|
86
|
+
for (const buildInfoFilePath of buildInfoFilePaths) {
|
|
87
|
+
const buildInfoJson = await readJSON(buildInfoFilePath);
|
|
88
|
+
if (buildInfoJson.input === undefined || buildInfoJson.output === undefined) {
|
|
89
|
+
throw new error_1.ValidateCommandError(`Build info file ${buildInfoFilePath} must contain Solidity compiler input and output.`);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
if (!hasStorageLayoutSetting(buildInfoJson)) {
|
|
93
|
+
throw new error_1.ValidateCommandError(`Build info file ${buildInfoFilePath} does not contain storage layout.`, () => STORAGE_LAYOUT_HELP);
|
|
94
|
+
}
|
|
95
|
+
buildInfoFiles.push({
|
|
96
|
+
input: buildInfoJson.input,
|
|
97
|
+
output: buildInfoJson.output,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return buildInfoFiles;
|
|
102
|
+
}
|
|
103
|
+
function hasStorageLayoutSetting(buildInfoJson) {
|
|
104
|
+
const o = buildInfoJson.input.settings?.outputSelection;
|
|
105
|
+
return o?.['*']?.['*'] && (o['*']['*'].includes('storageLayout') || o['*']['*'].includes('*'));
|
|
106
|
+
}
|
|
107
|
+
async function readJSON(path) {
|
|
108
|
+
return JSON.parse(await fs_1.promises.readFile(path, 'utf8'));
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=build-info-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-info-file.js","sourceRoot":"","sources":["../../../src/cli/validate/build-info-file.ts"],"names":[],"mappings":";;;;;;AAEA,2BAAoC;AACpC,gDAAwB;AACxB,mCAA+C;AAE/C,MAAM,uBAAuB,GAAG,0CAA0C,CAAC;AAC3E,MAAM,uBAAuB,GAAG,sEAAsE,CAAC;AACvG,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;sCAaU,uBAAuB;;mDAEV,uBAAuB,kBAAkB,CAAC;AAiB7F;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CAAC,YAAqB;IAC3D,MAAM,GAA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M,KAAK,SAAS,EAAE;YAC3E,MAAM,IAAI,4BAAoB,CAC5B,mBAAmB,iBAAiB,mDAAmD,CACxF,CAAC;SACH;aAAM;YACL,IAAI,CAAC,uBAAuB,CAAC,aAAa,CAAC,EAAE;gBAC3C,MAAM,IAAI,4BAAoB,CAC5B,mBAAmB,iBAAiB,mCAAmC,EACvE,GAAG,EAAE,CAAC,mBAAmB,CAC1B,CAAC;aACH;YAED,cAAc,CAAC,IAAI,CAAC;gBAClB,KAAK,EAAE,aAAa,CAAC,KAAK;gBAC1B,MAAM,EAAE,aAAa,CAAC,MAAM;aAC7B,CAAC,CAAC;SACJ;KACF;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,SAAS,uBAAuB,CAAC,aAAkB;IACjD,MAAM,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,eAAe,CAAC;IACxD,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AACjG,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,aAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-info-file.test.d.ts","sourceRoot":"","sources":["../../../src/cli/validate/build-info-file.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ava_1 = __importDefault(require("ava"));
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const rimraf_1 = __importDefault(require("rimraf"));
|
|
9
|
+
const util_1 = __importDefault(require("util"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const os_1 = __importDefault(require("os"));
|
|
12
|
+
const build_info_file_1 = require("./build-info-file");
|
|
13
|
+
const rimraf = util_1.default.promisify(rimraf_1.default);
|
|
14
|
+
ava_1.default.beforeEach(async (t) => {
|
|
15
|
+
process.chdir(await fs_1.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), `upgrades-core-test-${t.title.replace(/\s/g, '-')}-`)));
|
|
16
|
+
});
|
|
17
|
+
ava_1.default.afterEach(async () => {
|
|
18
|
+
await rimraf(process.cwd());
|
|
19
|
+
});
|
|
20
|
+
const BUILD_INFO = {
|
|
21
|
+
input: {
|
|
22
|
+
language: 'Solidity',
|
|
23
|
+
sources: {
|
|
24
|
+
'mypath/MyContract.sol': {
|
|
25
|
+
content: 'contract MyContract {}',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
settings: {
|
|
29
|
+
outputSelection: {
|
|
30
|
+
'*': {
|
|
31
|
+
'*': ['storageLayout'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
output: {
|
|
37
|
+
sources: {
|
|
38
|
+
'mypath/MyContract.sol': {
|
|
39
|
+
ast: {},
|
|
40
|
+
id: 123,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
const BUILD_INFO_2 = {
|
|
46
|
+
input: {
|
|
47
|
+
language: 'Solidity',
|
|
48
|
+
sources: {
|
|
49
|
+
'mypath/MyContract.sol': {
|
|
50
|
+
content: 'contract MyContractModified {}',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
settings: {
|
|
54
|
+
outputSelection: {
|
|
55
|
+
'*': {
|
|
56
|
+
'*': ['storageLayout'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
output: {
|
|
62
|
+
sources: {
|
|
63
|
+
'mypath/MyContract.sol': {
|
|
64
|
+
ast: {},
|
|
65
|
+
id: 456,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
const BUILD_INFO_NO_LAYOUT = {
|
|
71
|
+
input: {
|
|
72
|
+
language: 'Solidity',
|
|
73
|
+
sources: {
|
|
74
|
+
'mypath/MyContract.sol': {
|
|
75
|
+
content: 'contract MyContract {}',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
settings: {
|
|
79
|
+
outputSelection: {
|
|
80
|
+
'*': {
|
|
81
|
+
'*': ['abi'],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
output: {
|
|
87
|
+
sources: {
|
|
88
|
+
'mypath/MyContract.sol': {
|
|
89
|
+
ast: {},
|
|
90
|
+
id: 123,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
ava_1.default.serial('get build info files - default hardhat', async (t) => {
|
|
96
|
+
await fs_1.promises.mkdir('artifacts/build-info', { recursive: true });
|
|
97
|
+
await fs_1.promises.mkdir('out/build-info', { recursive: true }); // should be ignored since it's empty
|
|
98
|
+
await fs_1.promises.writeFile('artifacts/build-info/build-info.json', JSON.stringify(BUILD_INFO));
|
|
99
|
+
await fs_1.promises.writeFile('artifacts/build-info/build-info-2.json', JSON.stringify(BUILD_INFO_2));
|
|
100
|
+
const buildInfoFiles = await (0, build_info_file_1.getBuildInfoFiles)();
|
|
101
|
+
assertBuildInfoFiles(t, buildInfoFiles);
|
|
102
|
+
});
|
|
103
|
+
ava_1.default.serial('get build info files - default foundry', async (t) => {
|
|
104
|
+
await fs_1.promises.mkdir('out/build-info', { recursive: true });
|
|
105
|
+
await fs_1.promises.mkdir('artifacts/build-info', { recursive: true }); // should be ignored since it's empty
|
|
106
|
+
await fs_1.promises.writeFile('out/build-info/build-info.json', JSON.stringify(BUILD_INFO));
|
|
107
|
+
await fs_1.promises.writeFile('out/build-info/build-info-2.json', JSON.stringify(BUILD_INFO_2));
|
|
108
|
+
const buildInfoFiles = await (0, build_info_file_1.getBuildInfoFiles)();
|
|
109
|
+
assertBuildInfoFiles(t, buildInfoFiles);
|
|
110
|
+
});
|
|
111
|
+
ava_1.default.serial('get build info files - both hardhat and foundry dirs exist', async (t) => {
|
|
112
|
+
await fs_1.promises.mkdir('artifacts/build-info', { recursive: true });
|
|
113
|
+
await fs_1.promises.writeFile('artifacts/build-info/build-info.json', JSON.stringify(BUILD_INFO));
|
|
114
|
+
await fs_1.promises.mkdir('out/build-info', { recursive: true });
|
|
115
|
+
await fs_1.promises.writeFile('out/build-info/build-info-2.json', JSON.stringify(BUILD_INFO_2));
|
|
116
|
+
const error = await t.throwsAsync((0, build_info_file_1.getBuildInfoFiles)());
|
|
117
|
+
t.true(error?.message.includes('Found both Hardhat and Foundry build info directories'));
|
|
118
|
+
});
|
|
119
|
+
ava_1.default.serial('get build info files - no default dirs exist', async (t) => {
|
|
120
|
+
const error = await t.throwsAsync((0, build_info_file_1.getBuildInfoFiles)());
|
|
121
|
+
t.true(error?.message.includes('Could not find the default Hardhat or Foundry build info directory'));
|
|
122
|
+
});
|
|
123
|
+
ava_1.default.serial('get build info files - override with custom relative path', async (t) => {
|
|
124
|
+
await fs_1.promises.mkdir('artifacts/build-info', { recursive: true });
|
|
125
|
+
await fs_1.promises.mkdir('out/build-info', { recursive: true });
|
|
126
|
+
await fs_1.promises.mkdir('custom/build-info', { recursive: true });
|
|
127
|
+
await fs_1.promises.writeFile('custom/build-info/build-info.json', JSON.stringify(BUILD_INFO));
|
|
128
|
+
await fs_1.promises.writeFile('custom/build-info/build-info-2.json', JSON.stringify(BUILD_INFO_2));
|
|
129
|
+
const buildInfoFiles = await (0, build_info_file_1.getBuildInfoFiles)('custom/build-info');
|
|
130
|
+
assertBuildInfoFiles(t, buildInfoFiles);
|
|
131
|
+
});
|
|
132
|
+
ava_1.default.serial('get build info files - override with custom absolute path', async (t) => {
|
|
133
|
+
await fs_1.promises.mkdir('artifacts/build-info', { recursive: true });
|
|
134
|
+
await fs_1.promises.mkdir('out/build-info', { recursive: true });
|
|
135
|
+
await fs_1.promises.mkdir('custom/build-info', { recursive: true });
|
|
136
|
+
await fs_1.promises.writeFile('custom/build-info/build-info.json', JSON.stringify(BUILD_INFO));
|
|
137
|
+
await fs_1.promises.writeFile('custom/build-info/build-info-2.json', JSON.stringify(BUILD_INFO_2));
|
|
138
|
+
const buildInfoFiles = await (0, build_info_file_1.getBuildInfoFiles)(path_1.default.join(process.cwd(), 'custom/build-info'));
|
|
139
|
+
assertBuildInfoFiles(t, buildInfoFiles);
|
|
140
|
+
});
|
|
141
|
+
ava_1.default.serial('invalid build info file', async (t) => {
|
|
142
|
+
await fs_1.promises.mkdir('invalid-build-info', { recursive: true });
|
|
143
|
+
await fs_1.promises.writeFile('invalid-build-info/invalid.json', JSON.stringify({ output: {} }));
|
|
144
|
+
const error = await t.throwsAsync((0, build_info_file_1.getBuildInfoFiles)('invalid-build-info'));
|
|
145
|
+
t.true(error?.message.includes('must contain Solidity compiler input and output'));
|
|
146
|
+
});
|
|
147
|
+
ava_1.default.serial('dir does not exist', async (t) => {
|
|
148
|
+
const error = await t.throwsAsync((0, build_info_file_1.getBuildInfoFiles)('invalid-dir'));
|
|
149
|
+
t.true(error?.message.includes('does not exist'));
|
|
150
|
+
});
|
|
151
|
+
ava_1.default.serial('no build info files', async (t) => {
|
|
152
|
+
await fs_1.promises.mkdir('empty-dir', { recursive: true });
|
|
153
|
+
await fs_1.promises.writeFile('empty-dir/notjson.txt', 'abc');
|
|
154
|
+
const error = await t.throwsAsync((0, build_info_file_1.getBuildInfoFiles)('empty-dir'));
|
|
155
|
+
t.true(error?.message.includes('does not contain any build info files'));
|
|
156
|
+
});
|
|
157
|
+
ava_1.default.serial('no storage layout', async (t) => {
|
|
158
|
+
await fs_1.promises.mkdir('no-storage-layout', { recursive: true });
|
|
159
|
+
await fs_1.promises.writeFile('no-storage-layout/build-info.json', JSON.stringify(BUILD_INFO_NO_LAYOUT));
|
|
160
|
+
const error = await t.throwsAsync((0, build_info_file_1.getBuildInfoFiles)('no-storage-layout'));
|
|
161
|
+
t.true(error?.message.includes('does not contain storage layout'));
|
|
162
|
+
});
|
|
163
|
+
function assertBuildInfoFiles(t, buildInfoFiles) {
|
|
164
|
+
t.is(buildInfoFiles.length, 2);
|
|
165
|
+
const buildInfoFile1 = buildInfoFiles.find(b => b.input.sources['mypath/MyContract.sol'].content === 'contract MyContract {}');
|
|
166
|
+
const buildInfoFile2 = buildInfoFiles.find(b => b.input.sources['mypath/MyContract.sol'].content === 'contract MyContractModified {}');
|
|
167
|
+
if (buildInfoFile1 === undefined || buildInfoFile2 === undefined) {
|
|
168
|
+
t.fail('build info files not found');
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
t.is(buildInfoFile1.output.sources['mypath/MyContract.sol'].id, 123);
|
|
172
|
+
t.is(buildInfoFile2.output.sources['mypath/MyContract.sol'].id, 456);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=build-info-file.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-info-file.test.js","sourceRoot":"","sources":["../../../src/cli/validate/build-info-file.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAA6C;AAE7C,2BAAoC;AACpC,oDAAiC;AACjC,gDAAwB;AACxB,gDAAwB;AACxB,4CAAoB;AACpB,uDAAqE;AAErE,MAAM,MAAM,GAAG,cAAI,CAAC,SAAS,CAAC,gBAAW,CAAC,CAAC;AAE3C,aAAI,CAAC,UAAU,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;IACxB,OA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,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;KACtC;SAAM;QACL,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QACrE,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;KACtE;AACH,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ValidateUpgradeSafetyOptions, UpgradeableContractErrorReport } from '../..';
|
|
2
|
+
import { Report } from '../../standalone';
|
|
3
|
+
import { SourceContract } from './validations';
|
|
4
|
+
import { LayoutCompatibilityReport } from '../../storage/report';
|
|
5
|
+
/**
|
|
6
|
+
* Report for an upgradeable contract.
|
|
7
|
+
* Contains the standalone report, and if there is a reference contract, the reference contract name and storage layout report.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UpgradeableContractReport implements Report {
|
|
10
|
+
readonly contract: string;
|
|
11
|
+
readonly reference: string | undefined;
|
|
12
|
+
readonly standaloneReport: UpgradeableContractErrorReport;
|
|
13
|
+
readonly storageLayoutReport: LayoutCompatibilityReport | undefined;
|
|
14
|
+
constructor(contract: string, reference: string | undefined, standaloneReport: UpgradeableContractErrorReport, storageLayoutReport: LayoutCompatibilityReport | undefined);
|
|
15
|
+
get ok(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Explain any errors in the report.
|
|
18
|
+
*/
|
|
19
|
+
explain(color?: boolean): string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets upgradeble contract reports for the upgradeable contracts in the given set of source contracts.
|
|
23
|
+
* Only contracts that are detected as upgradeable will be included in the reports.
|
|
24
|
+
* Reports include upgradeable contracts regardless of whether they pass or fail upgrade safety checks.
|
|
25
|
+
*
|
|
26
|
+
* @param sourceContracts The source contracts to check, which must include all contracts that are referenced by the given contracts. Can also include non-upgradeable contracts, which will be ignored.
|
|
27
|
+
* @param opts The validation options.
|
|
28
|
+
* @returns The upgradeable contract reports.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getContractReports(sourceContracts: SourceContract[], opts: ValidateUpgradeSafetyOptions): UpgradeableContractReport[];
|
|
31
|
+
//# sourceMappingURL=contract-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-report.d.ts","sourceRoot":"","sources":["../../../src/cli/validate/contract-report.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,4BAA4B,EAE5B,8BAA8B,EAE/B,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGjE;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,MAAM;IAEpD,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IACtC,QAAQ,CAAC,gBAAgB,EAAE,8BAA8B;IACzD,QAAQ,CAAC,mBAAmB,EAAE,yBAAyB,GAAG,SAAS;gBAH1D,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,gBAAgB,EAAE,8BAA8B,EAChD,mBAAmB,EAAE,yBAAyB,GAAG,SAAS;IAGrE,IAAI,EAAE,IAAI,OAAO,CAEhB;IAED;;OAEG;IACH,OAAO,CAAC,KAAK,UAAO,GAAG,MAAM;CAiB9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,4BAA4B,+BAgBvG"}
|