From a9ef26c3382a8b254ac1707d69a87d6dc6f08fc5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 19:52:40 +0000 Subject: [PATCH 01/36] Bump @craco/craco from 6.2.0 to 6.3.0 (#63) --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0669c20..b15a8e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@blackbox-vision/react-qr-reader": "^5.0.0", "@chainlink/contracts": "^0.2.1", - "@craco/craco": "^6.2.0", + "@craco/craco": "^6.3.0", "@fontsource/fira-code": "^4.5.1", "@fontsource/roboto": "^4.5.0", "@fontsource/roboto-mono": "^4.5.0", @@ -1247,9 +1247,9 @@ } }, "node_modules/@craco/craco": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@craco/craco/-/craco-6.2.0.tgz", - "integrity": "sha512-kLc4GSdgR9D5JiZmSxtzbvBKcUFSJqMXImRjjYf5pacwiyAs3XfQwai7T+pExfLQNUnytgkL8jRFUJeYrkVr7g==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@craco/craco/-/craco-6.3.0.tgz", + "integrity": "sha512-SCnfEQxT/6NAbU/3sIWw7gQXtzjjiTp/EZFdJTd8inPURILIy0YajrC2p8qBG2KhFo5cwgOrEDyaGyAFvvuyuA==", "dependencies": { "cross-spawn": "^7.0.0", "lodash": "^4.17.15", @@ -20567,9 +20567,9 @@ } }, "@craco/craco": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@craco/craco/-/craco-6.2.0.tgz", - "integrity": "sha512-kLc4GSdgR9D5JiZmSxtzbvBKcUFSJqMXImRjjYf5pacwiyAs3XfQwai7T+pExfLQNUnytgkL8jRFUJeYrkVr7g==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@craco/craco/-/craco-6.3.0.tgz", + "integrity": "sha512-SCnfEQxT/6NAbU/3sIWw7gQXtzjjiTp/EZFdJTd8inPURILIy0YajrC2p8qBG2KhFo5cwgOrEDyaGyAFvvuyuA==", "requires": { "cross-spawn": "^7.0.0", "lodash": "^4.17.15", @@ -33010,4 +33010,4 @@ "version": "0.1.0" } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index d2925fe..0ea2bc1 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "@blackbox-vision/react-qr-reader": "^5.0.0", "@chainlink/contracts": "^0.2.1", - "@craco/craco": "^6.2.0", + "@craco/craco": "^6.3.0", "@fontsource/fira-code": "^4.5.1", "@fontsource/roboto": "^4.5.0", "@fontsource/roboto-mono": "^4.5.0", From e6d4a22c0692cf515092be95b7ac15fa2fe73393 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 19:54:26 +0000 Subject: [PATCH 02/36] Bump typescript from 4.4.2 to 4.4.3 (#65) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index b15a8e9..3e3e7b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "react-scripts": "4.0.3", "react-syntax-highlighter": "^15.4.4", "serve": "^12.0.0", - "typescript": "^4.4.2", + "typescript": "^4.4.3", "use-keyboard-shortcut": "^1.0.6", "web-vitals": "^1.0.1" }, @@ -18242,9 +18242,9 @@ } }, "node_modules/typescript": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", - "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -31974,9 +31974,9 @@ } }, "typescript": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", - "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==" + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==" }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4" diff --git a/package.json b/package.json index 0ea2bc1..a489ed9 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "react-scripts": "4.0.3", "react-syntax-highlighter": "^15.4.4", "serve": "^12.0.0", - "typescript": "^4.4.2", + "typescript": "^4.4.3", "use-keyboard-shortcut": "^1.0.6", "web-vitals": "^1.0.1" }, From 69890f5e04062b2834d860fb02f3c6117216895b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 20:08:21 +0000 Subject: [PATCH 03/36] Bump serve from 12.0.0 to 12.0.1 (#62) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e3e7b1..b1667b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "react-router-dom": "^5.2.1", "react-scripts": "4.0.3", "react-syntax-highlighter": "^15.4.4", - "serve": "^12.0.0", + "serve": "^12.0.1", "typescript": "^4.4.3", "use-keyboard-shortcut": "^1.0.6", "web-vitals": "^1.0.1" @@ -16073,9 +16073,9 @@ } }, "node_modules/serve": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.0.tgz", - "integrity": "sha512-BkTsETQYynAZ7rXX414kg4X6EvuZQS3UVs1NY0VQYdRHSTYWPYcH38nnDh48D0x6ONuislgjag8uKlU2gTBImA==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.1.tgz", + "integrity": "sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw==", "dependencies": { "@zeit/schemas": "2.6.0", "ajv": "6.12.6", @@ -30436,9 +30436,9 @@ } }, "serve": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.0.tgz", - "integrity": "sha512-BkTsETQYynAZ7rXX414kg4X6EvuZQS3UVs1NY0VQYdRHSTYWPYcH38nnDh48D0x6ONuislgjag8uKlU2gTBImA==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.1.tgz", + "integrity": "sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw==", "requires": { "@zeit/schemas": "2.6.0", "ajv": "6.12.6", diff --git a/package.json b/package.json index a489ed9..327c0ea 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "react-router-dom": "^5.2.1", "react-scripts": "4.0.3", "react-syntax-highlighter": "^15.4.4", - "serve": "^12.0.0", + "serve": "^12.0.1", "typescript": "^4.4.3", "use-keyboard-shortcut": "^1.0.6", "web-vitals": "^1.0.1" From 4cdd630d277dd4a371f7eb6597be6b17b3b3882d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 20:12:24 +0000 Subject: [PATCH 04/36] Bump react-router-dom from 5.2.1 to 5.3.0 (#61) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index b1667b5..5ecd194 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "react-dom": "^17.0.2", "react-error-boundary": "^3.1.3", "react-image": "^4.0.3", - "react-router-dom": "^5.2.1", + "react-router-dom": "^5.3.0", "react-scripts": "4.0.3", "react-syntax-highlighter": "^15.4.4", "serve": "^12.0.1", @@ -14675,9 +14675,9 @@ } }, "node_modules/react-router-dom": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.1.tgz", - "integrity": "sha512-xhFFkBGVcIVPbWM2KEYzED+nuHQPmulVa7sqIs3ESxzYd1pYg8N8rxPnQ4T2o1zu/2QeDUWcaqST131SO1LR3w==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.0.tgz", + "integrity": "sha512-ObVBLjUZsphUUMVycibxgMdh5jJ1e3o+KpAZBVeHcNQZ4W+uUGGWsokurzlF4YOldQYRQL4y6yFRWM4m3svmuQ==", "dependencies": { "@babel/runtime": "^7.12.13", "history": "^4.9.0", @@ -29515,9 +29515,9 @@ } }, "react-router-dom": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.1.tgz", - "integrity": "sha512-xhFFkBGVcIVPbWM2KEYzED+nuHQPmulVa7sqIs3ESxzYd1pYg8N8rxPnQ4T2o1zu/2QeDUWcaqST131SO1LR3w==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.0.tgz", + "integrity": "sha512-ObVBLjUZsphUUMVycibxgMdh5jJ1e3o+KpAZBVeHcNQZ4W+uUGGWsokurzlF4YOldQYRQL4y6yFRWM4m3svmuQ==", "requires": { "@babel/runtime": "^7.12.13", "history": "^4.9.0", diff --git a/package.json b/package.json index 327c0ea..586c5e5 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "react-dom": "^17.0.2", "react-error-boundary": "^3.1.3", "react-image": "^4.0.3", - "react-router-dom": "^5.2.1", + "react-router-dom": "^5.3.0", "react-scripts": "4.0.3", "react-syntax-highlighter": "^15.4.4", "serve": "^12.0.1", From fd83de177ac2c6347627244327fd3b855d35d5cb Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 13 Sep 2021 17:29:36 -0300 Subject: [PATCH 05/36] Add TODOs for react-router-dom migration --- src/components/NavTab.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/NavTab.tsx b/src/components/NavTab.tsx index 83cf6d8..b8ff811 100644 --- a/src/components/NavTab.tsx +++ b/src/components/NavTab.tsx @@ -6,6 +6,8 @@ type NavTabProps = { href: string; }; +// TODO: migrate activeClassName because of: https://github.com/remix-run/react-router/releases/tag/v5.3.0 +// TODO: @types/react-router-dom still doesn't support function in className const NavTab: React.FC = ({ href, children }) => ( Date: Mon, 13 Sep 2021 20:39:16 +0000 Subject: [PATCH 06/36] Bump ethers from 5.4.1 to 5.4.6 (#56) --- package-lock.json | 200 ++++++++++++++++------------------------------ package.json | 2 +- 2 files changed, 68 insertions(+), 134 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5ecd194..9d80934 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@types/react-router-dom": "^5.1.8", "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", - "ethers": "^5.4.1", + "ethers": "^5.4.6", "highlightjs-solidity": "^1.2.0", "query-string": "^7.0.1", "react": "^17.0.2", @@ -1324,9 +1324,9 @@ } }, "node_modules/@ethersproject/abi": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.4.0.tgz", - "integrity": "sha512-9gU2H+/yK1j2eVMdzm6xvHSnMxk8waIHQGYCZg5uvAyH0rsAzxkModzBSpbAkAuhKFEovC2S9hM4nPuLym8IZw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.4.1.tgz", + "integrity": "sha512-9mhbjUk76BiSluiiW4BaYyI58KSbDMMQpCLdsAR+RsT2GyATiNYxVv+pGWRrekmsIdY3I+hOqsYQSTkc8L/mcg==", "funding": [ { "type": "individual", @@ -1350,9 +1350,9 @@ } }, "node_modules/@ethersproject/abstract-provider": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz", - "integrity": "sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.4.1.tgz", + "integrity": "sha512-3EedfKI3LVpjSKgAxoUaI+gB27frKsxzm+r21w9G60Ugk+3wVLQwhi1LsEJAKNV7WoZc8CIpNrATlL1QFABjtQ==", "funding": [ { "type": "individual", @@ -1511,9 +1511,9 @@ } }, "node_modules/@ethersproject/contracts": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.4.0.tgz", - "integrity": "sha512-hkO3L3IhS1Z3ZtHtaAG/T87nQ7KiPV+/qnvutag35I0IkiQ8G3ZpCQ9NNOpSCzn4pWSW4CfzmtE02FcqnLI+hw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.4.1.tgz", + "integrity": "sha512-m+z2ZgPy4pyR15Je//dUaymRUZq5MtDajF6GwFbGAVmKz/RF+DNIPwF0k5qEcL3wPGVqUjFg2/krlCRVTU4T5w==", "funding": [ { "type": "individual", @@ -1641,9 +1641,9 @@ } }, "node_modules/@ethersproject/logger": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.4.0.tgz", - "integrity": "sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.4.1.tgz", + "integrity": "sha512-DZ+bRinnYLPw1yAC64oRl0QyVZj43QeHIhVKfD/+YwSz4wsv1pfwb5SOFjz+r710YEWzU6LrhuSjpSO+6PeE4A==", "funding": [ { "type": "individual", @@ -1656,9 +1656,9 @@ ] }, "node_modules/@ethersproject/networks": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.4.1.tgz", - "integrity": "sha512-8SvowCKz9Uf4xC5DTKI8+il8lWqOr78kmiqAVLYT9lzB8aSmJHQMD1GSuJI0CW4hMAnzocpGpZLgiMdzsNSPig==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.4.2.tgz", + "integrity": "sha512-eekOhvJyBnuibfJnhtK46b8HimBc5+4gqpvd1/H9LEl7Q7/qhsIhM81dI9Fcnjpk3jB1aTy6bj0hz3cifhNeYw==", "funding": [ { "type": "individual", @@ -1693,9 +1693,9 @@ } }, "node_modules/@ethersproject/properties": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.4.0.tgz", - "integrity": "sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.4.1.tgz", + "integrity": "sha512-cyCGlF8wWlIZyizsj2PpbJ9I7rIlUAfnHYwy/T90pdkSn/NFTa5YWZx2wTJBe9V7dD65dcrrEMisCRUJiq6n3w==", "funding": [ { "type": "individual", @@ -1711,9 +1711,9 @@ } }, "node_modules/@ethersproject/providers": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.4.1.tgz", - "integrity": "sha512-p06eiFKz8nu/5Ju0kIX024gzEQIgE5pvvGrBCngpyVjpuLtUIWT3097Agw4mTn9/dEA0FMcfByzFqacBMSgCVg==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.4.5.tgz", + "integrity": "sha512-1GkrvkiAw3Fj28cwi1Sqm8ED1RtERtpdXmRfwIBGmqBSN5MoeRUHuwHPppMtbPayPgpFcvD7/Gdc9doO5fGYgw==", "funding": [ { "type": "individual", @@ -8119,9 +8119,9 @@ } }, "node_modules/ethers": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.1.tgz", - "integrity": "sha512-SrcddMdCgP1hukDvCPd87Aipbf4NWjQvdfAbZ65XSZGbfyuYPtIrUJPDH5B1SBRsdlfiEgX3eoz28DdBDzMNFg==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.6.tgz", + "integrity": "sha512-F7LXARyB/Px3AQC6/QKedWZ8eqCkgOLORqL4B/F0Mag/K+qJSFGqsR36EaOZ6fKg3ZonI+pdbhb4A8Knt/43jQ==", "funding": [ { "type": "individual", @@ -8133,25 +8133,25 @@ } ], "dependencies": { - "@ethersproject/abi": "5.4.0", - "@ethersproject/abstract-provider": "5.4.0", - "@ethersproject/abstract-signer": "5.4.0", + "@ethersproject/abi": "5.4.1", + "@ethersproject/abstract-provider": "5.4.1", + "@ethersproject/abstract-signer": "5.4.1", "@ethersproject/address": "5.4.0", "@ethersproject/base64": "5.4.0", "@ethersproject/basex": "5.4.0", - "@ethersproject/bignumber": "5.4.0", + "@ethersproject/bignumber": "5.4.1", "@ethersproject/bytes": "5.4.0", "@ethersproject/constants": "5.4.0", - "@ethersproject/contracts": "5.4.0", + "@ethersproject/contracts": "5.4.1", "@ethersproject/hash": "5.4.0", "@ethersproject/hdnode": "5.4.0", "@ethersproject/json-wallets": "5.4.0", "@ethersproject/keccak256": "5.4.0", - "@ethersproject/logger": "5.4.0", - "@ethersproject/networks": "5.4.1", + "@ethersproject/logger": "5.4.1", + "@ethersproject/networks": "5.4.2", "@ethersproject/pbkdf2": "5.4.0", - "@ethersproject/properties": "5.4.0", - "@ethersproject/providers": "5.4.1", + "@ethersproject/properties": "5.4.1", + "@ethersproject/providers": "5.4.5", "@ethersproject/random": "5.4.0", "@ethersproject/rlp": "5.4.0", "@ethersproject/sha2": "5.4.0", @@ -8165,48 +8165,6 @@ "@ethersproject/wordlists": "5.4.0" } }, - "node_modules/ethers/node_modules/@ethersproject/abstract-signer": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz", - "integrity": "sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abstract-provider": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0" - } - }, - "node_modules/ethers/node_modules/@ethersproject/bignumber": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.0.tgz", - "integrity": "sha512-OXUu9f9hO3vGRIPxU40cignXZVaYyfx6j9NNMjebKdnaCL3anCLSSy8/b8d03vY6dh7duCC0kW72GEC4tZer2w==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "bn.js": "^4.11.9" - } - }, "node_modules/eventemitter3": { "version": "4.0.7", "license": "MIT" @@ -20617,9 +20575,9 @@ } }, "@ethersproject/abi": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.4.0.tgz", - "integrity": "sha512-9gU2H+/yK1j2eVMdzm6xvHSnMxk8waIHQGYCZg5uvAyH0rsAzxkModzBSpbAkAuhKFEovC2S9hM4nPuLym8IZw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.4.1.tgz", + "integrity": "sha512-9mhbjUk76BiSluiiW4BaYyI58KSbDMMQpCLdsAR+RsT2GyATiNYxVv+pGWRrekmsIdY3I+hOqsYQSTkc8L/mcg==", "requires": { "@ethersproject/address": "^5.4.0", "@ethersproject/bignumber": "^5.4.0", @@ -20633,9 +20591,9 @@ } }, "@ethersproject/abstract-provider": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz", - "integrity": "sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.4.1.tgz", + "integrity": "sha512-3EedfKI3LVpjSKgAxoUaI+gB27frKsxzm+r21w9G60Ugk+3wVLQwhi1LsEJAKNV7WoZc8CIpNrATlL1QFABjtQ==", "requires": { "@ethersproject/bignumber": "^5.4.0", "@ethersproject/bytes": "^5.4.0", @@ -20714,9 +20672,9 @@ } }, "@ethersproject/contracts": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.4.0.tgz", - "integrity": "sha512-hkO3L3IhS1Z3ZtHtaAG/T87nQ7KiPV+/qnvutag35I0IkiQ8G3ZpCQ9NNOpSCzn4pWSW4CfzmtE02FcqnLI+hw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.4.1.tgz", + "integrity": "sha512-m+z2ZgPy4pyR15Je//dUaymRUZq5MtDajF6GwFbGAVmKz/RF+DNIPwF0k5qEcL3wPGVqUjFg2/krlCRVTU4T5w==", "requires": { "@ethersproject/abi": "^5.4.0", "@ethersproject/abstract-provider": "^5.4.0", @@ -20794,14 +20752,14 @@ } }, "@ethersproject/logger": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.4.0.tgz", - "integrity": "sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ==" + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.4.1.tgz", + "integrity": "sha512-DZ+bRinnYLPw1yAC64oRl0QyVZj43QeHIhVKfD/+YwSz4wsv1pfwb5SOFjz+r710YEWzU6LrhuSjpSO+6PeE4A==" }, "@ethersproject/networks": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.4.1.tgz", - "integrity": "sha512-8SvowCKz9Uf4xC5DTKI8+il8lWqOr78kmiqAVLYT9lzB8aSmJHQMD1GSuJI0CW4hMAnzocpGpZLgiMdzsNSPig==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.4.2.tgz", + "integrity": "sha512-eekOhvJyBnuibfJnhtK46b8HimBc5+4gqpvd1/H9LEl7Q7/qhsIhM81dI9Fcnjpk3jB1aTy6bj0hz3cifhNeYw==", "requires": { "@ethersproject/logger": "^5.4.0" } @@ -20816,17 +20774,17 @@ } }, "@ethersproject/properties": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.4.0.tgz", - "integrity": "sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.4.1.tgz", + "integrity": "sha512-cyCGlF8wWlIZyizsj2PpbJ9I7rIlUAfnHYwy/T90pdkSn/NFTa5YWZx2wTJBe9V7dD65dcrrEMisCRUJiq6n3w==", "requires": { "@ethersproject/logger": "^5.4.0" } }, "@ethersproject/providers": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.4.1.tgz", - "integrity": "sha512-p06eiFKz8nu/5Ju0kIX024gzEQIgE5pvvGrBCngpyVjpuLtUIWT3097Agw4mTn9/dEA0FMcfByzFqacBMSgCVg==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.4.5.tgz", + "integrity": "sha512-1GkrvkiAw3Fj28cwi1Sqm8ED1RtERtpdXmRfwIBGmqBSN5MoeRUHuwHPppMtbPayPgpFcvD7/Gdc9doO5fGYgw==", "requires": { "@ethersproject/abstract-provider": "^5.4.0", "@ethersproject/abstract-signer": "^5.4.0", @@ -25120,29 +25078,29 @@ "version": "1.8.1" }, "ethers": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.1.tgz", - "integrity": "sha512-SrcddMdCgP1hukDvCPd87Aipbf4NWjQvdfAbZ65XSZGbfyuYPtIrUJPDH5B1SBRsdlfiEgX3eoz28DdBDzMNFg==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.6.tgz", + "integrity": "sha512-F7LXARyB/Px3AQC6/QKedWZ8eqCkgOLORqL4B/F0Mag/K+qJSFGqsR36EaOZ6fKg3ZonI+pdbhb4A8Knt/43jQ==", "requires": { - "@ethersproject/abi": "5.4.0", - "@ethersproject/abstract-provider": "5.4.0", - "@ethersproject/abstract-signer": "5.4.0", + "@ethersproject/abi": "5.4.1", + "@ethersproject/abstract-provider": "5.4.1", + "@ethersproject/abstract-signer": "5.4.1", "@ethersproject/address": "5.4.0", "@ethersproject/base64": "5.4.0", "@ethersproject/basex": "5.4.0", - "@ethersproject/bignumber": "5.4.0", + "@ethersproject/bignumber": "5.4.1", "@ethersproject/bytes": "5.4.0", "@ethersproject/constants": "5.4.0", - "@ethersproject/contracts": "5.4.0", + "@ethersproject/contracts": "5.4.1", "@ethersproject/hash": "5.4.0", "@ethersproject/hdnode": "5.4.0", "@ethersproject/json-wallets": "5.4.0", "@ethersproject/keccak256": "5.4.0", - "@ethersproject/logger": "5.4.0", - "@ethersproject/networks": "5.4.1", + "@ethersproject/logger": "5.4.1", + "@ethersproject/networks": "5.4.2", "@ethersproject/pbkdf2": "5.4.0", - "@ethersproject/properties": "5.4.0", - "@ethersproject/providers": "5.4.1", + "@ethersproject/properties": "5.4.1", + "@ethersproject/providers": "5.4.5", "@ethersproject/random": "5.4.0", "@ethersproject/rlp": "5.4.0", "@ethersproject/sha2": "5.4.0", @@ -25154,30 +25112,6 @@ "@ethersproject/wallet": "5.4.0", "@ethersproject/web": "5.4.0", "@ethersproject/wordlists": "5.4.0" - }, - "dependencies": { - "@ethersproject/abstract-signer": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz", - "integrity": "sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew==", - "requires": { - "@ethersproject/abstract-provider": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0" - } - }, - "@ethersproject/bignumber": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.0.tgz", - "integrity": "sha512-OXUu9f9hO3vGRIPxU40cignXZVaYyfx6j9NNMjebKdnaCL3anCLSSy8/b8d03vY6dh7duCC0kW72GEC4tZer2w==", - "requires": { - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "bn.js": "^4.11.9" - } - } } }, "eventemitter3": { diff --git a/package.json b/package.json index 586c5e5..67637e3 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/react-router-dom": "^5.1.8", "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", - "ethers": "^5.4.1", + "ethers": "^5.4.6", "highlightjs-solidity": "^1.2.0", "query-string": "^7.0.1", "react": "^17.0.2", From d5e9f303a1aa8cf77a1d420cb34cbd180231b48b Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 13 Sep 2021 22:24:22 -0300 Subject: [PATCH 07/36] Fix fetch cancellation --- src/useSourcify.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/useSourcify.ts b/src/useSourcify.ts index e8806b9..bab8423 100644 --- a/src/useSourcify.ts +++ b/src/useSourcify.ts @@ -47,8 +47,9 @@ export const useSourcify = ( if (!checksummedAddress || chainId === undefined) { return; } - setRawMetadata(undefined); + + const abortController = new AbortController(); const fetchMetadata = async () => { try { const contractMetadataURL = sourcifyMetadata( @@ -56,7 +57,9 @@ export const useSourcify = ( chainId, source ); - const result = await fetch(contractMetadataURL); + const result = await fetch(contractMetadataURL, { + signal: abortController.signal, + }); if (result.ok) { const _metadata = await result.json(); setRawMetadata(_metadata); @@ -69,6 +72,10 @@ export const useSourcify = ( } }; fetchMetadata(); + + return () => { + abortController.abort(); + }; }, [checksummedAddress, chainId, source]); return rawMetadata; @@ -88,6 +95,7 @@ export const useContract = ( return; } + const abortController = new AbortController(); const readContent = async () => { const normalizedFilename = filename.replaceAll(/[@:]/g, "_"); const url = sourcifySourceFile( @@ -96,13 +104,17 @@ export const useContract = ( normalizedFilename, sourcifySource ); - const res = await fetch(url); + const res = await fetch(url, { signal: abortController.signal }); if (res.ok) { const _content = await res.text(); setContent(_content); } }; readContent(); + + return () => { + abortController.abort(); + }; }, [checksummedAddress, networkId, filename, source.content, sourcifySource]); return content; From 9f818d36b2efbfc001de7611cda06138da52bc62 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Wed, 15 Sep 2021 14:43:36 -0300 Subject: [PATCH 08/36] First working prototype --- src/Transaction.tsx | 10 ++++++++++ src/transaction/Details.tsx | 23 +++++++++++++++++++++++ src/useSourcify.ts | 31 ++++++++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/src/Transaction.tsx b/src/Transaction.tsx index e204633..1857f72 100644 --- a/src/Transaction.tsx +++ b/src/Transaction.tsx @@ -11,6 +11,8 @@ import { RuntimeContext } from "./useRuntime"; import { SelectionContext, useSelection } from "./useSelection"; import { useInternalOperations, useTxData } from "./useErigonHooks"; import { useETHUSDOracle } from "./usePriceOracle"; +import { useSourcify, useTransactionDescription } from "./useSourcify"; +import { SourcifySource } from "./url"; type TransactionParams = { txhash: string; @@ -44,6 +46,13 @@ const Transaction: React.FC = () => { txData?.confirmedData?.blockNumber ); + const metadata = useSourcify( + txData?.to, + provider?.network.chainId, + SourcifySource.CUSTOM_SNAPSHOT_SERVER // TODO: use dynamic selector + ); + const txDesc = useTransactionDescription(metadata, txData); + return ( Transaction Details @@ -71,6 +80,7 @@ const Transaction: React.FC = () => {
= ({ txData, + txDesc, internalOps, sendsEthToMiner, ethUSDPrice, @@ -333,6 +336,26 @@ const Details: React.FC = ({ value={inputMode === 0 ? txData.data : utfInput} readOnly /> + {txDesc && ( + + + + + + + + + {txDesc.args.map((r, i) => ( + + + + + + + ))} + +
#nametypevalue
{i}{txDesc.functionFragment.inputs[i].name}{txDesc.functionFragment.inputs[i].type}{r}
+ )} diff --git a/src/useSourcify.ts b/src/useSourcify.ts index bab8423..398953a 100644 --- a/src/useSourcify.ts +++ b/src/useSourcify.ts @@ -1,4 +1,6 @@ -import { useState, useEffect } from "react"; +import { useState, useEffect, useMemo } from "react"; +import { Interface } from "@ethersproject/abi"; +import { TransactionData } from "./types"; import { sourcifyMetadata, SourcifySource, sourcifySourceFile } from "./url"; export type Metadata = { @@ -119,3 +121,30 @@ export const useContract = ( return content; }; + +export const useTransactionDescription = ( + metadata: Metadata | null | undefined, + txData: TransactionData | null | undefined +) => { + const txDesc = useMemo(() => { + if (!metadata || !txData) { + return undefined; + } + + const abi = metadata.output.abi; + const intf = new Interface(abi as any); + console.log(intf); + return intf.parseTransaction({ + data: txData.data, + value: txData.value, + }); + }, [metadata, txData]); + + console.log(metadata); + console.log(txDesc); + if (txDesc?.functionFragment) { + console.log(txDesc.functionFragment.inputs); + console.log(txDesc.args.toString()); + } + return txDesc; +}; From f02258b25d3618630005817b03494920a362dbd6 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Wed, 15 Sep 2021 15:34:49 -0300 Subject: [PATCH 09/36] Migrate code to headless-ui --- src/transaction/Details.tsx | 110 ++++++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 43 deletions(-) diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index d6cf61c..cca0ea1 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -1,7 +1,8 @@ -import React, { useMemo, useState } from "react"; +import React, { useMemo } from "react"; import { TransactionDescription } from "@ethersproject/abi"; import { BigNumber } from "@ethersproject/bignumber"; import { toUtf8String } from "@ethersproject/strings"; +import { Tab } from "@headlessui/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCheckCircle } from "@fortawesome/free-solid-svg-icons/faCheckCircle"; import { faCube } from "@fortawesome/free-solid-svg-icons/faCube"; @@ -48,7 +49,6 @@ const Details: React.FC = ({ const hasEIP1559 = txData.confirmedData?.blockBaseFeePerGas !== undefined && txData.confirmedData?.blockBaseFeePerGas !== null; - const [inputMode, setInputMode] = useState(0); const utfInput = useMemo(() => { try { @@ -312,51 +312,75 @@ const Details: React.FC = ({ )} -
-
- - -
-