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/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` + ); } } 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) { diff --git a/ui/public/index.html b/ui/public/index.html index 0cdb2aa57..2f9321995 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -31,6 +31,10 @@ var u = "https://matomo.ethereum.org/"; _paq.push(["setTrackerUrl", u + "matomo.php"]); _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];