Skip to content

Commit

Permalink
hardhat-verify set chainId public in Sourcify class
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocastignoli committed Dec 15, 2023
1 parent 03d2e4b commit b8c309a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/hardhat-verify/src/internal/sourcify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { ValidationResponse } from "./utilities";
export class Sourcify {
public apiUrl: string = "https://sourcify.dev/server";
public browserUrl: string = "https://repo.sourcify.dev";
private _chainId: number;
public chainId: number;

constructor(chainId: number, apiUrl?: string, browserUrl?: string) {
this._chainId = chainId;
this.chainId = chainId;
if (apiUrl !== undefined) {
this.apiUrl = apiUrl;
}
Expand All @@ -30,7 +30,7 @@ export class Sourcify {
public async isVerified(address: string) {
const parameters = new URLSearchParams({
addresses: address,
chainIds: `${this._chainId}`,
chainIds: `${this.chainId}`,
});

const url = new URL(`${this.apiUrl}/check-all-by-addresses`);
Expand Down Expand Up @@ -94,7 +94,7 @@ export class Sourcify {
const parameters: any = {
address,
files,
chain: `${this._chainId}`,
chain: `${this.chainId}`,
};

if (chosenContract !== undefined) {
Expand Down Expand Up @@ -139,7 +139,7 @@ export class Sourcify {
contractStatus === ContractStatus.PERFECT
? "full_match"
: "partial_match";
return `${this.browserUrl}/contracts/${matchType}/${this._chainId}/${address}/`;
return `${this.browserUrl}/contracts/${matchType}/${this.chainId}/${address}/`;
}
}

Expand Down

0 comments on commit b8c309a

Please sign in to comment.