From d28a0fe99321cae9361e5f8f9502db850ff6e2cb Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Thu, 20 Jul 2023 11:46:39 +0200 Subject: [PATCH] fix: use the new URL for verify (#19) --- tasks/verify.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tasks/verify.ts b/tasks/verify.ts index 6287f1a3..b55d9bd9 100644 --- a/tasks/verify.ts +++ b/tasks/verify.ts @@ -5,14 +5,17 @@ import { task } from "hardhat/config"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import { getFullyQualifiedName } from "hardhat/utils/contract-names"; -const verifyURL = "https://server.sourcify.athens2.zetachain.com/verify"; -const queryURL = - "https://repo.sourcify.athens2.zetachain.com/contracts/full_match/7001"; +const URL = "https://sourcify.dev/server"; const main = async (args: any, hre: HardhatRuntimeEnvironment) => { try { - const response = await axios.get(`${queryURL}/${args.contract}`); - if (response.status === 200) { + const checkURL = `${URL}/check-by-addresses`; + const params = { + addresses: args.contract, + chainIds: 7001, + }; + const res = await axios.get(checkURL, { params }); + if (res.status === 200 && res?.data[0]?.status == "perfect") { console.log(`✅ Contract has already been verified.`); return; } @@ -59,9 +62,9 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => { const headers = { headers: formData.getHeaders() }; try { - await axios.post(verifyURL, formData, headers); + await axios.post(URL, formData, headers); console.log( - `✅ Contract verified: https://explorer.zetachain.com/address/${args.contract}` + `✅ Contract verified: https://athens3.explorer.zetachain.com/address/${args.contract}` ); } catch (error: any) { console.error(