Skip to content

Commit

Permalink
Add link-local-hardhat-tenderly command (#222)
Browse files Browse the repository at this point in the history
* move VersionCompatibilityChecker to package

* check if hardhat-tenderly version is outdated

* encapsulate compatibility version checks into functions

* add link-local-hardhat-tenderly command
  • Loading branch information
dule-git authored Sep 25, 2024
1 parent b75a6e9 commit dbda536
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const fs = require("fs");

main();

function main() {
setLinkPathForDependency("link:../../../packages/hre-extender-v1");
}

function setLinkPathForDependency(linkPath) {
const packageJson = JSON.parse(fs.readFileSync("package.json", 'utf8'));
packageJson.dependencies["@tenderly/hardhat-tenderly"] = linkPath;

fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2), 'utf8');
}
3 changes: 2 additions & 1 deletion examples/contract-verification/ethers-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"eslint": "eslint 'scripts/**/*.ts'",
"prettier": "prettier \"**/*.{js,md,json}\"",
"build": "tsc -b",
"link-local-hardhat-tenderly": "node --loader ts-node/esm link-local-hardhat-tenderly.js",
"public:greeter:automatic": "TENDERLY_PRIVATE_VERIFICATION=false TENDERLY_AUTOMATIC_VERIFICATION=true npx hardhat run scripts/greeter/automatic.ts",
"public:greeter:manual-simple": "TENDERLY_PRIVATE_VERIFICATION=false TENDERLY_AUTOMATIC_VERIFICATION=false npx hardhat run scripts/greeter/manual-simple.ts",
"public:greeter:manual-advanced": "TENDERLY_PRIVATE_VERIFICATION=false TENDERLY_AUTOMATIC_VERIFICATION=false npx hardhat run scripts/greeter/manual-advanced.ts",
Expand Down Expand Up @@ -62,4 +63,4 @@
"solidity-coverage": "^0.8.1",
"typechain": "^8.3.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const fs = require("fs");

main();

function main() {
setLinkPathForDependency("link:../../../packages/hre-extender-v2");
}

function setLinkPathForDependency(linkPath) {
const packageJson = JSON.parse(fs.readFileSync("package.json", 'utf8'));
packageJson.dependencies["@tenderly/hardhat-tenderly"] = linkPath;

fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2), 'utf8');
}
1 change: 1 addition & 0 deletions examples/contract-verification/ethers-v6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"prettier": "prettier \"**/*.{js,md,json}\"",
"build": "tsc -b",
"clean": "rm -rf node_modules && rm -rf dist",
"link-local-hardhat-tenderly": "node --loader ts-node/esm link-local-hardhat-tenderly.js",
"public:greeter:automatic": "TENDERLY_PRIVATE_VERIFICATION=false TENDERLY_AUTOMATIC_VERIFICATION=true npx hardhat run scripts/greeter/automatic.ts",
"public:greeter:manual-simple": "TENDERLY_PRIVATE_VERIFICATION=false TENDERLY_AUTOMATIC_VERIFICATION=false npx hardhat run scripts/greeter/manual-simple.ts",
"public:greeter:manual-advanced": "TENDERLY_PRIVATE_VERIFICATION=false TENDERLY_AUTOMATIC_VERIFICATION=false npx hardhat run scripts/greeter/manual-advanced.ts",
Expand Down

0 comments on commit dbda536

Please sign in to comment.