Skip to content

Commit

Permalink
Merge branch 'main' into templates
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Jul 20, 2023
2 parents a92bdae + d28a0fe commit 71b2d79
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tasks/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 71b2d79

Please sign in to comment.