@gearbox-protocol/deploy-tools 1.5.2 → 1.5.4
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.js +35 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -276989,7 +276989,7 @@ var require_package2 = __commonJS({
|
|
|
276989
276989
|
module2.exports = {
|
|
276990
276990
|
name: "@gearbox-protocol/deploy-tools",
|
|
276991
276991
|
description: "Gearbox deploy tools",
|
|
276992
|
-
version: "1.5.
|
|
276992
|
+
version: "1.5.3",
|
|
276993
276993
|
homepage: "https://gearbox.fi",
|
|
276994
276994
|
keywords: [
|
|
276995
276995
|
"gearbox"
|
|
@@ -277723,7 +277723,7 @@ var import_bytecode_utils = __toESM(require_main());
|
|
|
277723
277723
|
var import_ethers = __toESM(require_lib39());
|
|
277724
277724
|
var import_sortedUniqBy = __toESM(require_sortedUniqBy());
|
|
277725
277725
|
var import_p_retry = __toESM(require_p_retry());
|
|
277726
|
-
var CREATE2_FACTORY_ADDR = "
|
|
277726
|
+
var CREATE2_FACTORY_ADDR = "0x45d146CAA25aa565Cfc7434926633f4F1C97c873";
|
|
277727
277727
|
var create2factory = new import_ethers.ethers.utils.Interface([
|
|
277728
277728
|
{
|
|
277729
277729
|
inputs: [
|
|
@@ -277899,7 +277899,18 @@ var _logger, _sandboxDir, _auditFile, auditFile_fn, _findMatches, findMatches_fn
|
|
|
277899
277899
|
var AuditChecker = class {
|
|
277900
277900
|
constructor(sandboxDir) {
|
|
277901
277901
|
__privateAdd(this, _auditFile);
|
|
277902
|
+
/**
|
|
277903
|
+
* Given file from transaction that we want to check for audits, will compare this file with all audits of this repo
|
|
277904
|
+
* @param file
|
|
277905
|
+
* @returns
|
|
277906
|
+
*/
|
|
277902
277907
|
__privateAdd(this, _findMatches);
|
|
277908
|
+
/**
|
|
277909
|
+
* Given file from transaction in question, will try to find the same file in audited repository and compare it's content
|
|
277910
|
+
* @param file
|
|
277911
|
+
* @param repoAudit
|
|
277912
|
+
* @returns
|
|
277913
|
+
*/
|
|
277903
277914
|
__privateAdd(this, _findMatch);
|
|
277904
277915
|
/**
|
|
277905
277916
|
* Will create '<repo>/<commitish>' dir in sandbox and checkout this repo @ this commit into this folder
|
|
@@ -277979,7 +277990,17 @@ findMatch_fn = async function(file, repoAudit) {
|
|
|
277979
277990
|
);
|
|
277980
277991
|
try {
|
|
277981
277992
|
const content = await (0, import_promises2.readFile)(filePath);
|
|
277982
|
-
|
|
277993
|
+
let matches = content.equals(file.buffer);
|
|
277994
|
+
if (matches) {
|
|
277995
|
+
__privateGet(this, _logger).trace(
|
|
277996
|
+
`file ${file.repo}/${file.path} matches with audit ${file.repo}@${commitish}`
|
|
277997
|
+
);
|
|
277998
|
+
} else {
|
|
277999
|
+
__privateGet(this, _logger).trace(
|
|
278000
|
+
`file ${file.repo}/${file.path} does not match match with audit ${file.repo}@${commitish}, checking variations...`
|
|
278001
|
+
);
|
|
278002
|
+
}
|
|
278003
|
+
return matches;
|
|
277983
278004
|
} catch (e) {
|
|
277984
278005
|
if ((e == null ? void 0 : e.code) !== "ENOENT") {
|
|
277985
278006
|
__privateGet(this, _logger).warn(e);
|
|
@@ -277992,13 +278013,17 @@ checkoutAudit_fn = async function(repo, audit) {
|
|
|
277992
278013
|
const committish = audit.type === "commit" ? audit.commit : audit.branch;
|
|
277993
278014
|
const dest = import_node_path2.default.resolve(__privateGet(this, _sandboxDir), repo, committish);
|
|
277994
278015
|
(0, import_node_fs.mkdirSync)(dest, { recursive: true });
|
|
277995
|
-
|
|
277996
|
-
|
|
277997
|
-
|
|
277998
|
-
|
|
277999
|
-
|
|
278000
|
-
|
|
278001
|
-
|
|
278016
|
+
try {
|
|
278017
|
+
await cloneRepo({
|
|
278018
|
+
repo: `@gearbox-protocol/${repo}`,
|
|
278019
|
+
sandboxDir: __privateGet(this, _sandboxDir),
|
|
278020
|
+
commit: committish,
|
|
278021
|
+
destDir: import_node_path2.default.join(repo, committish)
|
|
278022
|
+
});
|
|
278023
|
+
__privateGet(this, _logger).debug(`Checked out ${repo}@${committish} to ${dest}`);
|
|
278024
|
+
} catch (e) {
|
|
278025
|
+
__privateGet(this, _logger).warn(`checkout failed for ${repo}@${committish}: ${e}`);
|
|
278026
|
+
}
|
|
278002
278027
|
};
|
|
278003
278028
|
|
|
278004
278029
|
// src/safe-base.ts
|