matter-labs / block-explorer

zkSync Era Block Explorer
Apache License 2.0
127 stars 113 forks source link

feat: add abi json for verified contracts #320

Closed MexicanAce closed 5 days ago

MexicanAce commented 5 days ago

What ❔

Display the contract's ABI JSON if it's verified

Why ❔

This addresses #242 and allows users to easily copy/paste the ABI for easier development

Checklist

Evidence

Verified contract with a small ABI: image

Verified contract with a large ABI (Closed & Expanded): image image

Unverified contract: image

github-actions[bot] commented 5 days ago

API E2E Test Results

207 tests   207 ✅  19s ⏱️  14 suites    0 💤   1 files      0 ❌

Results for commit 1adfec26.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 5 days ago

Unit Test Results

    4 files    263 suites   11m 30s ⏱️ 2 125 tests 2 124 ✅ 1 💤 0 ❌ 2 337 runs  2 336 ✅ 1 💤 0 ❌

Results for commit 1adfec26.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 5 days ago

Visit the preview URL for this PR: https://staging-scan-v2--pr-320-ldal27ht.web.app

JackHamer09 commented 5 days ago

Do you think it would make sense to keep it in pretty format, for readability? JSON.stringify(abi, null, 2) This way you can search for specific piece of abi, e.g. specific function

MexicanAce commented 5 days ago

Do you think it would make sense to keep it in pretty format, for readability? JSON.stringify(abi, null, 2) This way you can search for specific piece of abi, e.g. specific function

We decided to keep this as close to Etherscan's implementation for a better UX

github-actions[bot] commented 5 days ago

:tada: This PR is included in version 2.52.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: