From daae37a6ab684f74ef65eba34e95da8affd644e5 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sun, 12 Sep 2021 21:30:42 -0300 Subject: [PATCH 1/3] Add copy operation to abi --- src/address/Contracts.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/address/Contracts.tsx b/src/address/Contracts.tsx index fb2f3a7..07bf386 100644 --- a/src/address/Contracts.tsx +++ b/src/address/Contracts.tsx @@ -5,6 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown"; import ContentFrame from "../ContentFrame"; import InfoRow from "../components/InfoRow"; +import Copy from "../components/Copy"; import ABI from "./ABI"; import Contract from "./Contract"; import { RuntimeContext } from "../useRuntime"; @@ -91,7 +92,8 @@ const Contracts: React.FC = ({ {rawMetadata.output.abi && (
- ABI + ABI +
From 22fd8ad5c25135d25d346cbaa3e3fc6000446869 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sun, 12 Sep 2021 22:03:56 -0300 Subject: [PATCH 2/3] Use localhost gateway by default to avoid leaking queries by accident --- src/address/Contracts.tsx | 4 ++-- src/url.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/address/Contracts.tsx b/src/address/Contracts.tsx index 07bf386..4d322c3 100644 --- a/src/address/Contracts.tsx +++ b/src/address/Contracts.tsx @@ -43,13 +43,13 @@ const Contracts: React.FC = ({
- Resolve IPNS + Resolve IPNS @localhost:8080 gateway Sourcify Servers - Local Snapshot + Local Snapshot @localhost:3006
diff --git a/src/url.ts b/src/url.ts index ffbca9b..9b80e34 100644 --- a/src/url.ts +++ b/src/url.ts @@ -27,8 +27,7 @@ export enum SourcifySource { const sourcifyIPNS = "k51qzi5uqu5dll0ocge71eudqnrgnogmbr37gsgl12uubsinphjoknl6bbi41p"; -const ipfsGatewayPrefix = `https://ipfs.io/ipns/${sourcifyIPNS}`; -// const ipfsGatewayPrefix = "http://localhost:8080/ipfs/QmWQoGfrLcizHueg3YkgDCh1S7SkfSP9A7H8YeZmUDfbnn" +const ipfsGatewayPrefix = `http://localhost:8080/ipns/${sourcifyIPNS}`; const sourcifyHttpRepoPrefix = `https://repo.sourcify.dev`; const snapshotPrefix = "http://localhost:3006"; From 45920cb55f2b9f55dec3a98f0fac8f114b521173 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sun, 12 Sep 2021 22:12:52 -0300 Subject: [PATCH 3/3] Updated instructions --- docs/sourcify.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/sourcify.md b/docs/sourcify.md index f966517..cede6d3 100644 --- a/docs/sourcify.md +++ b/docs/sourcify.md @@ -10,6 +10,10 @@ This is the default integration method, we resolve the public Sourcify IPNS to g The downside is that recently verified contracts may not have yet been added to the root hash and republished into IPNS. +It assumes a local IPFS gateway at localhost:8080 to avoid leaking your queries to public gateways. + +> This option is actually not working, but it is provided for completeness, follow https://github.com/ethereum/sourcify/issues/495 + ## Direct HTTP connection to Sourcify's repository Standard HTTP connection to their repo at https://repo.sourcify.dev/ @@ -21,3 +25,19 @@ Fast access to fresh verified data. On the other hand it is less private and cen As a midterm solution, we are making available a snapshot docker image of their repository, containing only mainnet full verified contracts. This would allow you to play with existing contracts up to the snapshot date/time locally, not depending on their service or IPFS connectivity availability. + +> It is very likely this run mode will be deprecated in future. + +The Sourcify snapshot is provided as a nginx image at: https://hub.docker.com/repository/docker/otterscan/sourcify-snapshot + +You can run it with: + +``` +docker run --rm -d -p 3006:80 --name sourcify-snapshot otterscan/sourcify-snapshot:2021-09 +``` + +Stop it with: + +``` +docker stop sourcify-snapshot +```