From d26fc6660acadd680c65f3a18bbf4c367ddf8893 Mon Sep 17 00:00:00 2001 From: dule-git <61541725+dule-git@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:34:26 +0100 Subject: [PATCH] Add public ABI verification for LensTestnet (#255) Add public ABI verification for LensTestnet version packages --- .changeset/short-onions-knock.md | 6 ++++++ .../src/internal/core/services/TenderlyService.ts | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/short-onions-knock.md diff --git a/.changeset/short-onions-knock.md b/.changeset/short-onions-knock.md new file mode 100644 index 00000000..8966258f --- /dev/null +++ b/.changeset/short-onions-knock.md @@ -0,0 +1,6 @@ +--- +"@tenderly/hardhat-integration": minor +"@tenderly/api-client": minor +--- + +Implemented private and public ABI verification for Lens Testnet diff --git a/packages/tenderly-core/src/internal/core/services/TenderlyService.ts b/packages/tenderly-core/src/internal/core/services/TenderlyService.ts index 0e086881..7d840809 100644 --- a/packages/tenderly-core/src/internal/core/services/TenderlyService.ts +++ b/packages/tenderly-core/src/internal/core/services/TenderlyService.ts @@ -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); @@ -274,15 +274,19 @@ export class TenderlyService { private async verifyContractABIOnProject( username: string, project: string, + verificationType: string, request: VerifyContractABIRequest, ) :Promise { 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, }, ); @@ -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; }