Skip to content

Commit

Permalink
chore: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
juliopavila committed Aug 20, 2024
1 parent 45acf00 commit b91a708
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
2 changes: 0 additions & 2 deletions packages/contracts/tasks/deploy-mastercopy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @format */

import { task, types } from "hardhat/config";

import {
Expand Down
16 changes: 2 additions & 14 deletions packages/contracts/tasks/verify-mastercopy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,10 @@ import {
} from "@gnosis-guild/zodiac-core";
import path from "path";
import fs from "fs";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { cwd } from "process";

const { ETHERSCAN_API_KEY } = process.env;

/**
* Simulates the SDK's `defaultBuildDir` functionality, pointing to the contract artifacts directory.
*
* @returns {string} The absolute path to the contract artifacts directory.
*/
function getBuildDir(): string {
return path.join(cwd(), "build", "artifacts", "contracts");
}

/**
* Simulates the SDK's `defaultMastercopyArtifactsFile`, pointing to the mastercopies.json file.
*
Expand All @@ -44,18 +34,16 @@ task(
}

const chainId = String((await hre.ethers.provider.getNetwork()).chainId);
await verifyLatestMastercopyFromDisk(hre, chainId, contractVersion);
await verifyLatestMastercopyFromDisk(chainId, contractVersion);
});

/**
* Verifies the latest mastercopy from disk, handling multiple contracts and versions.
*
* @param {HardhatRuntimeEnvironment} hre - The Hardhat runtime environment.
* @param {string} chainId - The chain ID of the network.
* @param {string} [version] - The specific version of the contract to verify.
*/
async function verifyLatestMastercopyFromDisk(
hre: HardhatRuntimeEnvironment,
chainId: string,
version?: string
) {
Expand Down Expand Up @@ -115,4 +103,4 @@ async function verifyLatestMastercopyFromDisk(
});

fs.unlinkSync(tempFilePath);
}
}

0 comments on commit b91a708

Please sign in to comment.