-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ad73fb
commit f7e755b
Showing
6 changed files
with
79 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// hardhat import should be the first import in the file | ||
import * as hardhat from "hardhat"; | ||
|
||
const EXPECTED_ADDRESS = "0xc706EC7dfA5D4Dc87f29f859094165E8290530f5"; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function verifyPromise(address: string, constructorArguments?: Array<any>, libraries?: object): Promise<any> { | ||
return new Promise((resolve, reject) => { | ||
hardhat | ||
.run("verify:verify", { address, constructorArguments, libraries }) | ||
.then(() => resolve(`Successfully verified ${address}`)) | ||
.catch((e) => reject(`Failed to verify ${address}\nError: ${e.message}`)); | ||
}); | ||
} | ||
|
||
async function main() { | ||
if (process.env.CHAIN_ETH_NETWORK == "localhost") { | ||
console.log("Skip contract verification on localhost"); | ||
return; | ||
} | ||
|
||
const message = await verifyPromise(EXPECTED_ADDRESS); | ||
console.log(message.status == "fulfilled" ? message.value : message.reason); | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((err) => { | ||
console.error("Error:", err.message || err); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -752,6 +752,26 @@ | |
sinon-chai "^3.7.0" | ||
undici "^5.14.0" | ||
|
||
"@matterlabs/[email protected]": | ||
version "0.6.1" | ||
resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-verify/-/hardhat-zksync-verify-0.6.1.tgz#3fd83f4177ac0b138656ed93d4756ec27f1d329d" | ||
integrity sha512-W9gI4k1UnuQ2MaBnK1f7E8Z2C4uHxpeDkzmB/ZCKClai2A3vK2jAbfqiQbX0HvuLq2OOq4dbx83KehAXjXoHlw== | ||
dependencies: | ||
"@ethersproject/abi" "^5.1.2" | ||
"@ethersproject/address" "5.7.0" | ||
"@matterlabs/hardhat-zksync-solc" "^1.1.4" | ||
"@nomicfoundation/hardhat-verify" "^2.0.0" | ||
"@openzeppelin/contracts" "^4.9.2" | ||
axios "^1.6.2" | ||
cbor "^8.1.0" | ||
chai "^4.3.6" | ||
chalk "4.1.2" | ||
debug "^4.1.1" | ||
hardhat "^2.14.0" | ||
sinon "^17.0.1" | ||
sinon-chai "^3.7.0" | ||
zksync-ethers "^5.0.0" | ||
|
||
"@matterlabs/hardhat-zksync-verify@^0.2.0": | ||
version "0.2.2" | ||
resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-verify/-/hardhat-zksync-verify-0.2.2.tgz#daa34bc4404096ed0f44461ee366c1cb0e5a4f2f" | ||
|
@@ -7517,6 +7537,13 @@ yocto-queue@^1.0.0: | |
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" | ||
integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== | ||
|
||
zksync-ethers@^5.0.0: | ||
version "5.8.0" | ||
resolved "https://registry.yarnpkg.com/zksync-ethers/-/zksync-ethers-5.8.0.tgz#ff054345048f851c33cb6efcf2094f40d4da6063" | ||
integrity sha512-/4qI5UElh0lspu0ew2IXBCO+O9kXEzZOM7JqvlfRWWGIUKZ+EDXnjIPgkH0y5/MnMT3FDq9koAAUCyZVWqHUJg== | ||
dependencies: | ||
ethers "~5.7.0" | ||
|
||
"zksync-ethers@https://github.com/zksync-sdk/zksync-ethers#ethers-v5-feat/bridgehub": | ||
version "5.1.0" | ||
resolved "https://github.com/zksync-sdk/zksync-ethers#28ccbe7d67b170c202b17475e06a82002e6e3acc" | ||
|