From 23e77e62ec3fc7a4d683dc544bef54e2d9e20430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaan=20Uzdo=C4=9Fan?= Date: Tue, 23 May 2023 10:58:07 +0200 Subject: [PATCH 1/4] Add debug lines for check-s3-backup --- scripts/check-s3-backup.mjs | 52 +++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/scripts/check-s3-backup.mjs b/scripts/check-s3-backup.mjs index 815a95a10..c62972dfa 100644 --- a/scripts/check-s3-backup.mjs +++ b/scripts/check-s3-backup.mjs @@ -37,16 +37,19 @@ const jobsWithArtifacts = [ "verification-e2e-goerli", ]; const circleCIJobsUrl = `https://circleci.com/api/v2/workflow/${workflowId}/job`; +console.log("Fetching jobs from: ", circleCIJobsUrl); const circleCIJobsUrlResult = await fetch(circleCIJobsUrl); const circleCIJobsUrlJson = await circleCIJobsUrlResult.json(); -const jobIds = circleCIJobsUrlJson.items - .filter((job) => jobsWithArtifacts.includes(job.name)) - .map((job) => job.id); +const jobs = circleCIJobsUrlJson.items.filter((job) => + jobsWithArtifacts.includes(job.name) +); // for each job id get the artifact and check the existance on s3 let existance = false; -for (const jobId of jobIds) { - const circleCIArtifactVerifiedContractUrl = `https://dl.circleci.com/private/output/job/${jobId}/artifacts/0/verified-contracts/saved.json`; +for (const job of jobs) { + console.log(`Checking job with name: ${job.name} and id: ${job.id}`); + const circleCIArtifactVerifiedContractUrl = `https://dl.circleci.com/private/output/job/${job.id}/artifacts/0/verified-contracts/saved.json`; + console.log("Fetching artifact from: ", circleCIArtifactVerifiedContractUrl); const circleCIArtifactVerifiedContractResult = await fetch( circleCIArtifactVerifiedContractUrl ); @@ -54,25 +57,30 @@ for (const jobId of jobIds) { await circleCIArtifactVerifiedContractResult.json(); const { deploymentAddress, deploymentChain } = circleCIArtifactVerifiedContractJson; - if (deploymentAddress && deploymentChain) { - try { - const s3Object = await bareBonesS3.send( - new GetObjectCommand({ - Key: `stable/repository/contracts/full_match/${deploymentChain}/${deploymentAddress}/metadata.json`, - Bucket: "sourcify-backup-s3", - }) - ); - if (s3Object.ETag?.length > 0) { - existance = true; - break; - } - } catch (e) { - console.log(e); - console.log( - `not in backup: stable/repository/contracts/full_match/${deploymentChain}/${deploymentAddress}/metadata.json` - ); + if (!deploymentAddress || !deploymentChain) { + throw new Error( + `Deployment address or chain not found in job ${job.id} with name ${job.name}. Deployment address: ${deploymentAddress}, Deployment chain: ${deploymentChain}` + ); + } + + try { + const s3Object = await bareBonesS3.send( + new GetObjectCommand({ + Key: `stable/repository/contracts/full_match/${deploymentChain}/${deploymentAddress}/metadata.json`, + Bucket: "sourcify-backup-s3", + }) + ); + + if (s3Object.ETag?.length > 0) { + existance = true; + break; } + } catch (e) { + console.log(e); + console.log( + `not in backup: stable/repository/contracts/full_match/${deploymentChain}/${deploymentAddress}/metadata.json` + ); } } From 7c16ecf91415db99a39067f2b9b1bb352fabc204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaan=20Uzdo=C4=9Fan?= Date: Wed, 24 May 2023 11:32:54 +0200 Subject: [PATCH 2/4] Update matomo --- package-lock.json | 6 ++++-- ui/public/index.html | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 32c7c2865..e2e20348b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@ethereum-sourcify/bytecode-utils": "*", "@ethereum-sourcify/lib-sourcify": "*", "@types/node-fetch": "^2.5.7", - "abitype": "^0.8.0", + "abitype": "0.8.0", "bunyan": "^1.8.12", "commander": "^9.0.0", "cors": "^2.8.5", @@ -29515,7 +29515,7 @@ }, "packages/lib-sourcify": { "name": "@ethereum-sourcify/lib-sourcify", - "version": "1.0.0", + "version": "1.0.2", "license": "MIT", "dependencies": { "@ethereum-sourcify/bytecode-utils": "*", @@ -29525,6 +29525,7 @@ "@ethereumjs/statemanager": "^1.0.4", "@ethereumjs/util": "^8.0.5", "@ethereumjs/vm": "^6.4.1", + "@ethersproject/abi": "^5.7.0", "@ethersproject/address": "^5.7.0", "@ethersproject/bignumber": "^5.7.0", "@ethersproject/bytes": "^5.7.0", @@ -44049,6 +44050,7 @@ "@ethereumjs/statemanager": "^1.0.4", "@ethereumjs/util": "^8.0.5", "@ethereumjs/vm": "^6.4.1", + "@ethersproject/abi": "^5.7.0", "@ethersproject/address": "^5.7.0", "@ethersproject/bignumber": "^5.7.0", "@ethersproject/bytes": "^5.7.0", diff --git a/ui/public/index.html b/ui/public/index.html index 0cdb2aa57..74e452ce6 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -28,9 +28,9 @@ _paq.push(["trackPageView"]); _paq.push(["enableLinkTracking"]); (function () { - var u = "https://matomo.ethereum.org/"; + var u = "https://ethereumfoundation.matomo.cloud/"; _paq.push(["setTrackerUrl", u + "matomo.php"]); - _paq.push(["setSiteId", "30"]); + _paq.push(["setSiteId", "15"]); var d = document, g = d.createElement("script"), s = d.getElementsByTagName("script")[0]; From 92cf577de32d22f35a64daac0e066e93b4b68fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaan=20Uzdo=C4=9Fan?= Date: Wed, 24 May 2023 11:36:58 +0200 Subject: [PATCH 3/4] Fix matomo as secondary tracker --- ui/public/index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/public/index.html b/ui/public/index.html index 74e452ce6..2f9321995 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -28,9 +28,13 @@ _paq.push(["trackPageView"]); _paq.push(["enableLinkTracking"]); (function () { - var u = "https://ethereumfoundation.matomo.cloud/"; + var u = "https://matomo.ethereum.org/"; _paq.push(["setTrackerUrl", u + "matomo.php"]); - _paq.push(["setSiteId", "15"]); + _paq.push(["setSiteId", "30"]); + var secondaryTracker = + "https://ethereumfoundation.matomo.cloud/matomo.php"; + var secondaryWebsiteId = "15"; + _paq.push(["addTracker", secondaryTracker, secondaryWebsiteId]); var d = document, g = d.createElement("script"), s = d.getElementsByTagName("script")[0]; From af3f617694678a7287bb1b01e94333d4b04a5b47 Mon Sep 17 00:00:00 2001 From: oliviachef <116026363+oliviachef@users.noreply.github.com> Date: Fri, 26 May 2023 21:42:35 +0900 Subject: [PATCH 4/4] add-chain-2000 (dogechain) (#1039) * commit: add dogechain (2000) * commit: add dogechain tests (2000) * commit: update contract addy; * commit: fix; Co-authored-by: Marco Castignoli --------- Co-authored-by: Marco Castignoli --- src/sourcify-chains.ts | 8 ++++++++ test/chains/chain-tests.js | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/sourcify-chains.ts b/src/sourcify-chains.ts index 1b8733bae..3e0f264a2 100644 --- a/src/sourcify-chains.ts +++ b/src/sourcify-chains.ts @@ -790,6 +790,14 @@ const sourcifyChainsExtensions: SourcifyChainsExtensionsObject = { "https://explorer.plexfinance.us/" + BLOCKSCOUT_SUFFIX, txRegex: getBlockscoutRegex(), }, + "2000": { + // DogeChain Mainnet + supported: true, + monitored: false, + contractFetchAddress: + "https://explorer.dogechain.dog/" + BLOCKSCOUT_SUFFIX, + txRegex: getBlockscoutRegex(), + }, }; const sourcifyChainsMap: SourcifyChainMap = {}; diff --git a/test/chains/chain-tests.js b/test/chains/chain-tests.js index a26030f89..778a5d3e2 100644 --- a/test/chains/chain-tests.js +++ b/test/chains/chain-tests.js @@ -809,6 +809,15 @@ describe("Test Supported Chains", function () { ["shared/1_Storage.sol"], "shared/1_Storage.metadata.json" ); + + // DogeChain Mainnet + verifyContract( + "0x2a35F4AA0d3e417e8896E972f35dba4b39b6305e", + "2000", + "DogeChain Mainnet", + ["shared/1_Storage.sol"], + "shared/1_Storage.metadata.json" + ); // Finally check if all the "supported: true" chains have been tested it("should have tested all supported chains", function (done) {