Skip to content

Commit

Permalink
Add public ABI verification for LensTestnet (#255)
Browse files Browse the repository at this point in the history
Add public ABI verification for LensTestnet

version packages
  • Loading branch information
dule-git authored Nov 21, 2024
1 parent 4ec1bf5 commit d26fc66
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/short-onions-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@tenderly/hardhat-integration": minor
"@tenderly/api-client": minor
---

Implemented private and public ABI verification for Lens Testnet
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export class TenderlyService {
}

if (verificationType === VERIFICATION_TYPES.PUBLIC || verificationType === VERIFICATION_TYPES.PRIVATE) {
return this.verifyContractABIOnProject(username, project, request);
return this.verifyContractABIOnProject(username, project, verificationType, request);
}

return this.verifyContractABIOnVnet(username, project, request);
Expand All @@ -274,15 +274,19 @@ export class TenderlyService {
private async verifyContractABIOnProject(
username: string,
project: string,
verificationType: string,
request: VerifyContractABIRequest,
) :Promise<VerifyContractABIResponse> {
const tenderlyApi = TenderlyApiService.configureInstance();

const isPublicVerification = verificationType === VERIFICATION_TYPES.PUBLIC;

const res = await tenderlyApi.post(
`/api/v1/account/${username}/project/${project}/contract/${request.networkId}/${request.address}/abi`,
{
contract_name: request.contractName,
abi: request.abi,
is_public_verification: isPublicVerification,
},
);

Expand Down Expand Up @@ -326,7 +330,11 @@ export class TenderlyService {
throw new BytecodeMissingMethodSignaturesError(response.error);
}

console.log(`Contract ${request.address} verified with ABI on Vnet.`);
if (response.display_link) {
console.log(`Contract ${request.address} verified with ABI on Vnet. You can view the contract at:`, response.display_link);
} else {
console.log(`Contract ${request.address} verified with ABI on Vnet.`);
}

return response;
}
Expand Down

0 comments on commit d26fc66

Please sign in to comment.