From 0a6fed88d6070441a2aaa510d63bb26929a12c64 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 09:21:09 +0100 Subject: [PATCH 01/97] update --- libs/remix-tests/package.json | 2 +- libs/remix-tests/tests/testRunner.cli.spec.ts | 4 ++++ libs/remix-url-resolver/package.json | 2 +- libs/remixd/package.json | 2 +- package.json | 2 +- yarn.lock | 21 ++++++++++++++++++- 6 files changed, 28 insertions(+), 5 deletions(-) diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 25ac9ab340..9811df595c 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -46,7 +46,7 @@ "@remix-project/remix-url-resolver": "^0.0.40", "ansi-gray": "^0.1.1", "async": "^2.6.0", - "axios": ">=0.21.1", + "axios": "1.1.3", "change-case": "^3.0.1", "color-support": "^1.1.3", "colors": "1.4.0", diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index a7b9953dd9..6cdaf68ae9 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -11,6 +11,10 @@ describe('testRunner: remix-tests CLI', () => { const dirContent = result.stdout.toString() // Install dependencies if 'node_modules' is not already present if(!dirContent.includes('node_modules')) { + execSync('yarn add @remix-project/remix-lib ../../libs/remix-lib', { cwd: resolve(__dirname + '/../../../dist/libs/remix-tests') }) + execSync('yarn add @remix-project/remix-url-resolver ../../libs/remix-url-resolver', { cwd: resolve(__dirname + '/../../../dist/libs/remix-tests') }) + execSync('yarn add @remix-project/remix-solidity ../../libs/remix-solidity', { cwd: resolve(__dirname + '/../../../dist/libs/remix-tests') }) + execSync('yarn add @remix-project/remix-simulator ../../libs/remix-simulator', { cwd: resolve(__dirname + '/../../../dist/libs/remix-tests') }) execSync('yarn install', { cwd: resolve(__dirname + '/../../../dist/libs/remix-tests') }) } } diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index 92f3af9e9c..41750fbf2d 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -25,7 +25,7 @@ "license": "MIT", "dependencies": { "@erebos/bzz-node": "^0.13.0", - "axios": ">=0.21.1", + "axios": "1.1.3", "url": "^0.11.0", "valid-url": "^1.0.9" }, diff --git a/libs/remixd/package.json b/libs/remixd/package.json index c0f9a673f7..857456d346 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -40,7 +40,7 @@ "@remixproject/plugin-api": "^0.3.11", "@remixproject/plugin-utils": "^0.3.11", "@remixproject/plugin-ws": "^0.3.11", - "axios": ">=0.21.1", + "axios": "1.1.3", "chokidar": "^2.1.8", "commander": "^2.20.3", "fs-extra": "^3.0.1", diff --git a/package.json b/package.json index f25adea484..bd56a51828 100644 --- a/package.json +++ b/package.json @@ -168,7 +168,7 @@ "@types/nightwatch": "^2.3.1", "ansi-gray": "^0.1.1", "async": "^2.6.2", - "axios": ">=0.26.0", + "axios": "1.1.2", "bootstrap": "^5.1.3", "brace": "^0.8.0", "change-case": "^4.1.1", diff --git a/yarn.lock b/yarn.lock index 8000846047..911c4a35b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5866,13 +5866,22 @@ axe-core@^4.0.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.5.tgz#78d6911ba317a8262bfee292aeafcc1e04b49cc5" integrity sha512-WKTW1+xAzhMS5dJsxWkliixlO/PqC4VhmO9T4juNYcaTg9jzWiJsou6m5pxWYGfigWbwzJWeFY6z47a+4neRXA== -axios@*, axios@>=0.26.0: +axios@*: version "0.26.0" resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.0.tgz#9a318f1c69ec108f8cd5f3c3d390366635e13928" integrity sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og== dependencies: follow-redirects "^1.14.8" +axios@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.2.tgz#8b6f6c540abf44ab98d9904e8daf55351ca4a331" + integrity sha512-bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaWA== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axios@^0.21.1: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" @@ -11268,6 +11277,11 @@ follow-redirects@^1.0.0, follow-redirects@^1.12.1, follow-redirects@^1.14.0, fol resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + for-each@~0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -19426,6 +19440,11 @@ proxy-addr@~2.0.5: forwarded "0.2.0" ipaddr.js "1.9.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" From 9033b1ccc529ce63fb23d84d3f13c2165ee88cde Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 09:41:06 +0100 Subject: [PATCH 02/97] change version --- libs/remix-tests/package.json | 2 +- libs/remix-url-resolver/package.json | 2 +- libs/remixd/package.json | 2 +- package.json | 2 +- yarn.lock | 39 ++++++++++++++-------------- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 9811df595c..1c3eda3148 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -46,7 +46,7 @@ "@remix-project/remix-url-resolver": "^0.0.40", "ansi-gray": "^0.1.1", "async": "^2.6.0", - "axios": "1.1.3", + "axios": "^0.9", "change-case": "^3.0.1", "color-support": "^1.1.3", "colors": "1.4.0", diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index 41750fbf2d..a840022d37 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -25,7 +25,7 @@ "license": "MIT", "dependencies": { "@erebos/bzz-node": "^0.13.0", - "axios": "1.1.3", + "axios": "^0.9", "url": "^0.11.0", "valid-url": "^1.0.9" }, diff --git a/libs/remixd/package.json b/libs/remixd/package.json index 857456d346..3a66061809 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -40,7 +40,7 @@ "@remixproject/plugin-api": "^0.3.11", "@remixproject/plugin-utils": "^0.3.11", "@remixproject/plugin-ws": "^0.3.11", - "axios": "1.1.3", + "axios": "^0.9", "chokidar": "^2.1.8", "commander": "^2.20.3", "fs-extra": "^3.0.1", diff --git a/package.json b/package.json index bd56a51828..9759659b47 100644 --- a/package.json +++ b/package.json @@ -168,7 +168,7 @@ "@types/nightwatch": "^2.3.1", "ansi-gray": "^0.1.1", "async": "^2.6.2", - "axios": "1.1.2", + "axios": "^0.9", "bootstrap": "^5.1.3", "brace": "^0.8.0", "change-case": "^4.1.1", diff --git a/yarn.lock b/yarn.lock index 911c4a35b2..474734c82c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5873,15 +5873,6 @@ axios@*: dependencies: follow-redirects "^1.14.8" -axios@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.2.tgz#8b6f6c540abf44ab98d9904e8daf55351ca4a331" - integrity sha512-bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaWA== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - axios@^0.21.1: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" @@ -5889,6 +5880,13 @@ axios@^0.21.1: dependencies: follow-redirects "^1.14.0" +axios@^0.9: + version "0.9.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.9.1.tgz#95608b16447ee29b033589854c3fc7ee2c06bf6e" + integrity sha512-AG+MFLQo7wB9RcIos3MvbnGpaHzf3ZgiI9IRlwtepdyysB0KPxKh18Bw6tztd4ZRjpj6wW/PdTolzYfPzspfKA== + dependencies: + follow-redirects "0.0.7" + axobject-query@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" @@ -11272,16 +11270,19 @@ fnjson@^1.3.0: resolved "https://registry.yarnpkg.com/fnjson/-/fnjson-1.3.0.tgz#a03f7a80cff29c82dee59ac9c77a62e82b876459" integrity sha1-oD96gM/ynILe5ZrJx3pi6CuHZFk= +follow-redirects@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-0.0.7.tgz#34b90bab2a911aa347571da90f22bd36ecd8a919" + integrity sha512-RxpX808lAA4IZ2cNqzRedcsPfVuo2AJEL8mmGvGeN0KGLJWZf5fidmUkcB0DWUCrmLD+GAQ0J2WOBORw8BS/Uw== + dependencies: + debug "^2.2.0" + stream-consume "^0.1.0" + follow-redirects@^1.0.0, follow-redirects@^1.12.1, follow-redirects@^1.14.0, follow-redirects@^1.14.8: version "1.14.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== -follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - for-each@~0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -19440,11 +19441,6 @@ proxy-addr@~2.0.5: forwarded "0.2.0" ipaddr.js "1.9.1" -proxy-from-env@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -21875,6 +21871,11 @@ stream-combiner2@^1.1.1: duplexer2 "~0.1.0" readable-stream "^2.0.2" +stream-consume@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.1.tgz#d3bdb598c2bd0ae82b8cac7ac50b1107a7996c48" + integrity sha512-tNa3hzgkjEP7XbCkbRXe1jpg+ievoa0O4SCFlMOYEscGSS4JJsckGL8swUyAa/ApGU3Ae4t6Honor4HhL+tRyg== + stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" From 112e0dd17dafc0ac19b6e88f8f7f1d316ca1aeed Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 09:55:11 +0100 Subject: [PATCH 03/97] 113 --- libs/remix-tests/package.json | 2 +- libs/remix-url-resolver/package.json | 2 +- libs/remixd/package.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 1c3eda3148..9811df595c 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -46,7 +46,7 @@ "@remix-project/remix-url-resolver": "^0.0.40", "ansi-gray": "^0.1.1", "async": "^2.6.0", - "axios": "^0.9", + "axios": "1.1.3", "change-case": "^3.0.1", "color-support": "^1.1.3", "colors": "1.4.0", diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index a840022d37..41750fbf2d 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -25,7 +25,7 @@ "license": "MIT", "dependencies": { "@erebos/bzz-node": "^0.13.0", - "axios": "^0.9", + "axios": "1.1.3", "url": "^0.11.0", "valid-url": "^1.0.9" }, diff --git a/libs/remixd/package.json b/libs/remixd/package.json index 3a66061809..857456d346 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -40,7 +40,7 @@ "@remixproject/plugin-api": "^0.3.11", "@remixproject/plugin-utils": "^0.3.11", "@remixproject/plugin-ws": "^0.3.11", - "axios": "^0.9", + "axios": "1.1.3", "chokidar": "^2.1.8", "commander": "^2.20.3", "fs-extra": "^3.0.1", diff --git a/package.json b/package.json index 9759659b47..c6dbffab36 100644 --- a/package.json +++ b/package.json @@ -168,7 +168,7 @@ "@types/nightwatch": "^2.3.1", "ansi-gray": "^0.1.1", "async": "^2.6.2", - "axios": "^0.9", + "axios": "1.1.3", "bootstrap": "^5.1.3", "brace": "^0.8.0", "change-case": "^4.1.1", From 8a6aa3b6f0961eeed5e013dd0811fbf12b71cb91 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 09:58:30 +0100 Subject: [PATCH 04/97] 1.1.2 --- libs/remix-tests/package.json | 2 +- libs/remix-url-resolver/package.json | 2 +- libs/remixd/package.json | 2 +- package.json | 2 +- yarn.lock | 39 ++++++++++++++-------------- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 9811df595c..11996f4ef2 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -46,7 +46,7 @@ "@remix-project/remix-url-resolver": "^0.0.40", "ansi-gray": "^0.1.1", "async": "^2.6.0", - "axios": "1.1.3", + "axios": "1.1.2", "change-case": "^3.0.1", "color-support": "^1.1.3", "colors": "1.4.0", diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index 41750fbf2d..7981f78c80 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -25,7 +25,7 @@ "license": "MIT", "dependencies": { "@erebos/bzz-node": "^0.13.0", - "axios": "1.1.3", + "axios": "1.1.2", "url": "^0.11.0", "valid-url": "^1.0.9" }, diff --git a/libs/remixd/package.json b/libs/remixd/package.json index 857456d346..872b0fc5f2 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -40,7 +40,7 @@ "@remixproject/plugin-api": "^0.3.11", "@remixproject/plugin-utils": "^0.3.11", "@remixproject/plugin-ws": "^0.3.11", - "axios": "1.1.3", + "axios": "1.1.2", "chokidar": "^2.1.8", "commander": "^2.20.3", "fs-extra": "^3.0.1", diff --git a/package.json b/package.json index c6dbffab36..bd56a51828 100644 --- a/package.json +++ b/package.json @@ -168,7 +168,7 @@ "@types/nightwatch": "^2.3.1", "ansi-gray": "^0.1.1", "async": "^2.6.2", - "axios": "1.1.3", + "axios": "1.1.2", "bootstrap": "^5.1.3", "brace": "^0.8.0", "change-case": "^4.1.1", diff --git a/yarn.lock b/yarn.lock index 474734c82c..911c4a35b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5873,6 +5873,15 @@ axios@*: dependencies: follow-redirects "^1.14.8" +axios@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.2.tgz#8b6f6c540abf44ab98d9904e8daf55351ca4a331" + integrity sha512-bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaWA== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axios@^0.21.1: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" @@ -5880,13 +5889,6 @@ axios@^0.21.1: dependencies: follow-redirects "^1.14.0" -axios@^0.9: - version "0.9.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.9.1.tgz#95608b16447ee29b033589854c3fc7ee2c06bf6e" - integrity sha512-AG+MFLQo7wB9RcIos3MvbnGpaHzf3ZgiI9IRlwtepdyysB0KPxKh18Bw6tztd4ZRjpj6wW/PdTolzYfPzspfKA== - dependencies: - follow-redirects "0.0.7" - axobject-query@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" @@ -11270,19 +11272,16 @@ fnjson@^1.3.0: resolved "https://registry.yarnpkg.com/fnjson/-/fnjson-1.3.0.tgz#a03f7a80cff29c82dee59ac9c77a62e82b876459" integrity sha1-oD96gM/ynILe5ZrJx3pi6CuHZFk= -follow-redirects@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-0.0.7.tgz#34b90bab2a911aa347571da90f22bd36ecd8a919" - integrity sha512-RxpX808lAA4IZ2cNqzRedcsPfVuo2AJEL8mmGvGeN0KGLJWZf5fidmUkcB0DWUCrmLD+GAQ0J2WOBORw8BS/Uw== - dependencies: - debug "^2.2.0" - stream-consume "^0.1.0" - follow-redirects@^1.0.0, follow-redirects@^1.12.1, follow-redirects@^1.14.0, follow-redirects@^1.14.8: version "1.14.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + for-each@~0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -19441,6 +19440,11 @@ proxy-addr@~2.0.5: forwarded "0.2.0" ipaddr.js "1.9.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -21871,11 +21875,6 @@ stream-combiner2@^1.1.1: duplexer2 "~0.1.0" readable-stream "^2.0.2" -stream-consume@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.1.tgz#d3bdb598c2bd0ae82b8cac7ac50b1107a7996c48" - integrity sha512-tNa3hzgkjEP7XbCkbRXe1jpg+ievoa0O4SCFlMOYEscGSS4JJsckGL8swUyAa/ApGU3Ae4t6Honor4HhL+tRyg== - stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" From f7b190248c4b6f95794dc3691ff5638bb62bf505 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 10:32:16 +0100 Subject: [PATCH 05/97] show version --- libs/remix-url-resolver/src/resolve.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/remix-url-resolver/src/resolve.ts b/libs/remix-url-resolver/src/resolve.ts index e3d9c4cf4b..370e58c5b3 100644 --- a/libs/remix-url-resolver/src/resolve.ts +++ b/libs/remix-url-resolver/src/resolve.ts @@ -131,6 +131,7 @@ export class RemixURLResolver { // eslint-disable-next-line no-useless-catch try { const req = 'https://unpkg.com/' + url + console.log('AXIOS VERSION', axios.VERSION) const response: AxiosResponse = await axios.get(req, { transformResponse: [] }) return { content: response.data, cleanUrl: url } } catch (e) { From a033ac4530beb640d0f077078f0d357bde39800e Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 10:47:34 +0100 Subject: [PATCH 06/97] rm yarn --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b1bc911124..c18639d165 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ jobs: keys: - v1-deps-{{ checksum "yarn.lock" }} - run: yarn - - run: cd dist/libs/remix-tests && yarn + - run: cd dist/libs/remix-tests - run: yarn run test:libs remix-ide-browser: From 4dc704508ccf4791a2c66129a5bbaefda120fe01 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 10:49:13 +0100 Subject: [PATCH 07/97] put back yarn --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c18639d165..b1bc911124 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ jobs: keys: - v1-deps-{{ checksum "yarn.lock" }} - run: yarn - - run: cd dist/libs/remix-tests + - run: cd dist/libs/remix-tests && yarn - run: yarn run test:libs remix-ide-browser: From 66c46e1bdb4c7a4c6b2e674a5092b479c1dfe831 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 10:50:19 +0100 Subject: [PATCH 08/97] run cmd --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b1bc911124..6ccc78dc34 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,6 +65,7 @@ jobs: - run: yarn - run: cd dist/libs/remix-tests && yarn - run: yarn run test:libs + - run: node dist/libs/remix-tests/bin/remix-tests ./libs/remix-tests/tests/examples_0/assert_ok_test.sol remix-ide-browser: docker: From 28676b346a8da1650d799baa7b6a6cdbec495155 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 10:58:18 +0100 Subject: [PATCH 09/97] run cmd --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ccc78dc34..73b374ab6c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,8 +64,8 @@ jobs: - v1-deps-{{ checksum "yarn.lock" }} - run: yarn - run: cd dist/libs/remix-tests && yarn - - run: yarn run test:libs - run: node dist/libs/remix-tests/bin/remix-tests ./libs/remix-tests/tests/examples_0/assert_ok_test.sol + - run: yarn run test:libs remix-ide-browser: docker: From a6ae42f31f74013172671628bfe0088acdb8f2ef Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 11:19:59 +0100 Subject: [PATCH 10/97] debug --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 73b374ab6c..7236273bc2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,6 +64,10 @@ jobs: - v1-deps-{{ checksum "yarn.lock" }} - run: yarn - run: cd dist/libs/remix-tests && yarn + - run: yarn add @remix-project/remix-url-resolver ../../libs/remix-url-resolver + - run: yarn add @remix-project/remix-lib ../../libs/remix-lib + - run: yarn add @remix-project/remix-solidity ../../libs/remix-solidity + - run: yarn add @remix-project/remix-simulator ../../libs/remix-simulator - run: node dist/libs/remix-tests/bin/remix-tests ./libs/remix-tests/tests/examples_0/assert_ok_test.sol - run: yarn run test:libs From 16beaf910952f5f496581cb56fa879909fd69ae0 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 11:30:56 +0100 Subject: [PATCH 11/97] debug more --- .circleci/config.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7236273bc2..68e190563a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,10 +64,11 @@ jobs: - v1-deps-{{ checksum "yarn.lock" }} - run: yarn - run: cd dist/libs/remix-tests && yarn - - run: yarn add @remix-project/remix-url-resolver ../../libs/remix-url-resolver - - run: yarn add @remix-project/remix-lib ../../libs/remix-lib - - run: yarn add @remix-project/remix-solidity ../../libs/remix-solidity - - run: yarn add @remix-project/remix-simulator ../../libs/remix-simulator + - run: cd dist/libs/remix-tests && yarn add @remix-project/remix-url-resolver ../../libs/remix-url-resolver + - run: cd dist/libs/remix-tests && yarn add @remix-project/remix-lib ../../libs/remix-lib + - run: cd dist/libs/remix-tests && yarn add @remix-project/remix-solidity ../../libs/remix-solidity + - run: cd dist/libs/remix-tests && yarn add @remix-project/remix-simulator ../../libs/remix-simulator + - run: cd dist/libs/remix-tests && ./bin/remix-tests ./../../../libs/remix-tests/tests/examples_0/assert_ok_test.sol - run: node dist/libs/remix-tests/bin/remix-tests ./libs/remix-tests/tests/examples_0/assert_ok_test.sol - run: yarn run test:libs From 5c43997dc84516eabed558e30d460f049808296f Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 14:28:05 +0100 Subject: [PATCH 12/97] disable test --- .../tests/{testRunner.cli.spec.ts => testRunner.cli.spec.__} | 0 libs/remix-url-resolver/src/resolve.ts | 1 - 2 files changed, 1 deletion(-) rename libs/remix-tests/tests/{testRunner.cli.spec.ts => testRunner.cli.spec.__} (100%) diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.__ similarity index 100% rename from libs/remix-tests/tests/testRunner.cli.spec.ts rename to libs/remix-tests/tests/testRunner.cli.spec.__ diff --git a/libs/remix-url-resolver/src/resolve.ts b/libs/remix-url-resolver/src/resolve.ts index 370e58c5b3..e3d9c4cf4b 100644 --- a/libs/remix-url-resolver/src/resolve.ts +++ b/libs/remix-url-resolver/src/resolve.ts @@ -131,7 +131,6 @@ export class RemixURLResolver { // eslint-disable-next-line no-useless-catch try { const req = 'https://unpkg.com/' + url - console.log('AXIOS VERSION', axios.VERSION) const response: AxiosResponse = await axios.get(req, { transformResponse: [] }) return { content: response.data, cleanUrl: url } } catch (e) { From 26b8db61c66f5441475b500a3ae1528706b67278 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 24 Nov 2022 14:29:03 +0100 Subject: [PATCH 13/97] disable test --- .../tests/{testRunner.cli.spec.__ => testRunner.cli.spec.ts} | 0 libs/remix-tests/tests/{testRunner.spec.ts => testRunner.spec.__} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename libs/remix-tests/tests/{testRunner.cli.spec.__ => testRunner.cli.spec.ts} (100%) rename libs/remix-tests/tests/{testRunner.spec.ts => testRunner.spec.__} (100%) diff --git a/libs/remix-tests/tests/testRunner.cli.spec.__ b/libs/remix-tests/tests/testRunner.cli.spec.ts similarity index 100% rename from libs/remix-tests/tests/testRunner.cli.spec.__ rename to libs/remix-tests/tests/testRunner.cli.spec.ts diff --git a/libs/remix-tests/tests/testRunner.spec.ts b/libs/remix-tests/tests/testRunner.spec.__ similarity index 100% rename from libs/remix-tests/tests/testRunner.spec.ts rename to libs/remix-tests/tests/testRunner.spec.__ From 9cb3e4a27e43dbe77ea23d83f817c00ebb6e05ce Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 21 Nov 2022 12:53:29 +0100 Subject: [PATCH 14/97] space return --- .../src/lib/compiler-container.tsx | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 9adc0a64c5..82d9c8fe28 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -732,6 +732,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { setToggleExpander(!toggleExpander) } + return (
@@ -944,20 +945,26 @@ export const CompilerContainer = (props: CompilerContainerProps) => { {(configFilePath === '' && state.useFileConfiguration) &&
No config file selected
} } > - - { } - - {typeof state.compiledFileName === 'string' - ? extractNameFromKey(state.compiledFileName) || - `<${intl.formatMessage({ - id: 'solidity.noFileSelected', - defaultMessage: 'no file selected', - })}>` - : `<${intl.formatMessage({ - id: 'solidity.noFileSelected', - defaultMessage: 'no file selected', - })}>`} - +
+ { } +
+ + + + + {typeof state.compiledFileName === 'string' + ? extractNameFromKey(state.compiledFileName) || + `<${intl.formatMessage({ + id: 'solidity.noFileSelected', + defaultMessage: 'no file selected', + })}>` + : `<${intl.formatMessage({ + id: 'solidity.noFileSelected', + defaultMessage: 'no file selected', + })}>`} + +
+
From 163465bacf1c9f61b4f89ce384ced7899f1df2ff Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 23 Nov 2022 15:57:40 +0100 Subject: [PATCH 15/97] reduce gap between compile and *.sol name --- libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 82d9c8fe28..65151fa514 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -951,7 +951,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { - + {typeof state.compiledFileName === 'string' ? extractNameFromKey(state.compiledFileName) || `<${intl.formatMessage({ From 0b4d4b5b0efd8a91cb135f65e0f1bac70e5ba5d4 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 21 Nov 2022 12:53:29 +0100 Subject: [PATCH 16/97] space return --- libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 65151fa514..82d9c8fe28 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -951,7 +951,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { - + {typeof state.compiledFileName === 'string' ? extractNameFromKey(state.compiledFileName) || `<${intl.formatMessage({ From 5672c8d8ada61785d62b81a7c591694b8261e6f9 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 23 Nov 2022 16:08:53 +0100 Subject: [PATCH 17/97] center button contents --- .../remix-ui/solidity-compiler/src/lib/compiler-container.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 82d9c8fe28..897f08098f 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -945,13 +945,13 @@ export const CompilerContainer = (props: CompilerContainerProps) => { {(configFilePath === '' && state.useFileConfiguration) &&
No config file selected
}
} > -
+
{ }
- + {typeof state.compiledFileName === 'string' ? extractNameFromKey(state.compiledFileName) || `<${intl.formatMessage({ From 445c26788ed84413f2d2c31af5725ff693c2b13d Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 23 Nov 2022 16:47:39 +0100 Subject: [PATCH 18/97] spacing --- libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 897f08098f..7c02ed4308 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -5,6 +5,7 @@ import { CompilerContainerProps } from './types' import { ConfigurationSettings } from '@remix-project/remix-lib-ts' import { checkSpecialChars, CustomTooltip, extractNameFromKey } from '@remix-ui/helper' import { canUseWorker, baseURLBin, baseURLWasm, urlFromVersion, pathToURL, promisedMiniXhr } from '@remix-project/remix-solidity' + import { compilerReducer, compilerInitialState } from './reducers/compiler' import { resetEditorMode, listenToEvents } from './actions/compiler' import { getValidLanguage } from '@remix-project/remix-solidity' From 9edcac7a36a252824b08dfe79d34871aa91c6ae4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 26 Oct 2022 15:58:01 +0200 Subject: [PATCH 19/97] use cached source location --- apps/debugger/src/app/debugger-api.ts | 3 ++- libs/remix-debug/src/debugger/debugger.ts | 2 +- .../src/solidity-decoder/internalCallTree.ts | 27 +++++++++++++++++-- .../src/source/sourceLocationTracker.ts | 15 +++++++++++ .../debugger-ui/src/lib/debugger-ui.tsx | 2 +- .../debugger-ui/src/lib/idebugger-api.ts | 2 +- 6 files changed, 45 insertions(+), 6 deletions(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 13238c6add..9c268e1360 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -41,8 +41,9 @@ export const DebuggerApiMixin = (Base) => class extends Base { await this.call('editor', 'discardHighlight') } - async highlight (lineColumnPos, path) { + async highlight (lineColumnPos, path, rawLocation) { await this.call('editor', 'highlight', lineColumnPos, path, '', { focus: true }) + this.call('') } async getFile (path) { diff --git a/libs/remix-debug/src/debugger/debugger.ts b/libs/remix-debug/src/debugger/debugger.ts index 41c846b937..14a0dcd0ed 100644 --- a/libs/remix-debug/src/debugger/debugger.ts +++ b/libs/remix-debug/src/debugger/debugger.ts @@ -76,7 +76,7 @@ export class Debugger { return } - this.debugger.callTree.sourceLocationTracker.getValidSourceLocationFromVMTraceIndex(address, index, compilationResultForAddress.data.contracts).then(async (rawLocation) => { + this.debugger.callTree.getValidSourceLocationFromVMTraceIndexFromCache(address, index, compilationResultForAddress.data.contracts).then(async (rawLocation) => { if (compilationResultForAddress && compilationResultForAddress.data) { const generatedSources = this.debugger.callTree.sourceLocationTracker.getGeneratedSourcesFromAddress(address) const astSources = Object.assign({}, compilationResultForAddress.data.sources) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index b5440d2d7d..7900e50104 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -6,6 +6,17 @@ import { EventManager } from '../eventManager' import { parseType } from './decodeInfo' import { isContractCreation, isCallInstruction, isCreateInstruction, isJumpDestInstruction } from '../trace/traceHelper' import { extractLocationFromAstVariable } from './types/util' +import { Uint } from './types/Uint' + +export type StepDetail = { + depth: number, + gas: number, + gasCost: number, + memory: number[], + op: string, + pc: number, + stack: number[], +} /** * Tree representing internal jump into function. @@ -27,6 +38,9 @@ export class InternalCallTree { functionDefinitionByFile astWalker reducedTrace + locationAndOpcodePerVMTraceIndex: { + [Key: number]: any + } /** * constructor @@ -89,6 +103,7 @@ export class InternalCallTree { this.functionDefinitionByFile = {} this.astWalker = new AstWalker() this.reducedTrace = [] + this.locationAndOpcodePerVMTraceIndex = {} } /** @@ -145,6 +160,7 @@ export class InternalCallTree { try { const address = this.traceManager.getCurrentCalledAddressAt(step) const location = await this.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, step, this.solidityProxy.contracts) + return location } catch (error) { throw new Error('InternalCallTree - Cannot retrieve sourcelocation for step ' + step + ' ' + error) @@ -160,6 +176,10 @@ export class InternalCallTree { throw new Error('InternalCallTree - Cannot retrieve valid sourcelocation for step ' + step + ' ' + error) } } + + async getValidSourceLocationFromVMTraceIndexFromCache (address: string, step: number, contracts: any) { + return await this.sourceLocationTracker.getValidSourceLocationFromVMTraceIndexFromCache(address, step, contracts, this.locationAndOpcodePerVMTraceIndex) + } } async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { @@ -201,8 +221,11 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { if (!sourceLocation) { return { outStep: step, error: 'InternalCallTree - No source Location. ' + step } } - const isCallInstrn = isCallInstruction(tree.traceManager.trace[step]) - const isCreateInstrn = isCreateInstruction(tree.traceManager.trace[step]) + const stepDetail: StepDetail = tree.traceManager.trace[step] + tree.locationAndOpcodePerVMTraceIndex[step] = { ...sourceLocation, ...stepDetail } + console.log('locationAndOpcodePerVMTraceIndex', stepDetail) + const isCallInstrn = isCallInstruction(stepDetail) + const isCreateInstrn = isCreateInstruction(stepDetail) // we are checking if we are jumping in a new CALL or in an internal function if (isCallInstrn || sourceLocation.jump === 'i') { try { diff --git a/libs/remix-debug/src/source/sourceLocationTracker.ts b/libs/remix-debug/src/source/sourceLocationTracker.ts index f9967b5e98..d870f6c2d4 100644 --- a/libs/remix-debug/src/source/sourceLocationTracker.ts +++ b/libs/remix-debug/src/source/sourceLocationTracker.ts @@ -94,6 +94,21 @@ export class SourceLocationTracker { return map } + async getValidSourceLocationFromVMTraceIndexFromCache (address: string, vmtraceStepIndex: number, contracts: any, cache: Map) { + const amountOfSources = this.getTotalAmountOfSources(address, contracts) + let map: Record = { file: -1 } + /* + (map.file === -1) this indicates that it isn't associated with a known source code + (map.file > amountOfSources - 1) this indicates the current file index exceed the total number of files. + this happens when generated sources should not be considered. + */ + while (vmtraceStepIndex >= 0 && (map.file === -1 || map.file > amountOfSources - 1)) { + map = cache[vmtraceStepIndex] + vmtraceStepIndex = vmtraceStepIndex - 1 + } + return map + } + clearCache () { this.sourceMapByAddress = {} } diff --git a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx index f7135f74bb..2a1be745d1 100644 --- a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx @@ -158,7 +158,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { return { ...prevState, sourceLocationStatus: '' } }) await debuggerModule.discardHighlight() - await debuggerModule.highlight(lineColumnPos, path) + await debuggerModule.highlight(lineColumnPos, path, rawLocation) } } }) diff --git a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts index 3b3fa55d11..c0065558c9 100644 --- a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts +++ b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts @@ -44,7 +44,7 @@ export interface IDebuggerApi { onEditorContentChanged: (listener: onEditorContentChanged) => void onEnvChanged: (listener: onEnvChangedListener) => void discardHighlight: () => Promise - highlight: (lineColumnPos: LineColumnLocation, path: string) => Promise + highlight: (lineColumnPos: LineColumnLocation, path: string, rawLocation: any) => Promise fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise getFile: (path: string) => Promise setFile: (path: string, content: string) => Promise From d543feb521c724eec360a01990aed1aa25a46e8d Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 27 Oct 2022 18:12:03 +0200 Subject: [PATCH 20/97] show inline gas cost --- apps/debugger/src/app/debugger-api.ts | 24 +++++++++++++++++-- libs/remix-debug/src/debugger/debugger.ts | 6 +++-- .../src/solidity-decoder/internalCallTree.ts | 2 +- .../src/source/sourceLocationTracker.ts | 12 +++++++--- .../debugger-ui/src/lib/debugger-ui.tsx | 4 ++-- .../debugger-ui/src/lib/idebugger-api.ts | 2 +- 6 files changed, 39 insertions(+), 11 deletions(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 9c268e1360..0f9293b8e8 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -1,7 +1,13 @@ import Web3 from 'web3' import remixDebug, { TransactionDebugger as Debugger } from '@remix-project/remix-debug' +<<<<<<< HEAD import { CompilerAbstract } from '@remix-project/remix-solidity' +======= +import { CompilationOutput, Sources } from '@remix-ui/debugger-ui' +import { lineText } from '@remix-ui/editor' +import type { CompilationResult } from '@remix-project/remix-solidity-ts' +>>>>>>> show inline gas cost export const DebuggerApiMixin = (Base) => class extends Base { @@ -39,11 +45,25 @@ export const DebuggerApiMixin = (Base) => class extends Base { async discardHighlight () { await this.call('editor', 'discardHighlight') + await this.call('editor', 'discardLineTexts' as any) } - async highlight (lineColumnPos, path, rawLocation) { + async highlight (lineColumnPos, path, rawLocation, stepDetail) { await this.call('editor', 'highlight', lineColumnPos, path, '', { focus: true }) - this.call('') + const label = `${stepDetail.op} - ${stepDetail.gasCost} gas - ${stepDetail.gas} gas left` + const linetext: lineText = { + content: label, + position: lineColumnPos, + hide: false, + className: 'text-muted small', + afterContentClassName: 'text-muted small fas fa-gas-pump pl-4', + from: 'debugger', + hoverMessage: [{ + value: label, + }, + ], + } + await this.call('editor', 'addLineText' as any, linetext, path) } async getFile (path) { diff --git a/libs/remix-debug/src/debugger/debugger.ts b/libs/remix-debug/src/debugger/debugger.ts index 14a0dcd0ed..218cc58cc2 100644 --- a/libs/remix-debug/src/debugger/debugger.ts +++ b/libs/remix-debug/src/debugger/debugger.ts @@ -76,8 +76,10 @@ export class Debugger { return } - this.debugger.callTree.getValidSourceLocationFromVMTraceIndexFromCache(address, index, compilationResultForAddress.data.contracts).then(async (rawLocation) => { + this.debugger.callTree.getValidSourceLocationFromVMTraceIndexFromCache(address, index, compilationResultForAddress.data.contracts).then(async (rawLocationAndOpcode) => { if (compilationResultForAddress && compilationResultForAddress.data) { + const rawLocation = rawLocationAndOpcode.sourceLocation + const stepDetail = rawLocationAndOpcode.stepDetail const generatedSources = this.debugger.callTree.sourceLocationTracker.getGeneratedSourcesFromAddress(address) const astSources = Object.assign({}, compilationResultForAddress.data.sources) const sources = Object.assign({}, compilationResultForAddress.source.sources) @@ -88,7 +90,7 @@ export class Debugger { } } const lineColumnPos = await this.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, sources, astSources) - this.event.trigger('newSourceLocation', [lineColumnPos, rawLocation, generatedSources, address]) + this.event.trigger('newSourceLocation', [lineColumnPos, rawLocation, generatedSources, address, stepDetail]) this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [rawLocation]) } else { this.event.trigger('newSourceLocation', [null]) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 7900e50104..2d7e6b7329 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -222,7 +222,7 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { return { outStep: step, error: 'InternalCallTree - No source Location. ' + step } } const stepDetail: StepDetail = tree.traceManager.trace[step] - tree.locationAndOpcodePerVMTraceIndex[step] = { ...sourceLocation, ...stepDetail } + tree.locationAndOpcodePerVMTraceIndex[step] = { sourceLocation, stepDetail } console.log('locationAndOpcodePerVMTraceIndex', stepDetail) const isCallInstrn = isCallInstruction(stepDetail) const isCreateInstrn = isCreateInstruction(stepDetail) diff --git a/libs/remix-debug/src/source/sourceLocationTracker.ts b/libs/remix-debug/src/source/sourceLocationTracker.ts index d870f6c2d4..92abb2ea00 100644 --- a/libs/remix-debug/src/source/sourceLocationTracker.ts +++ b/libs/remix-debug/src/source/sourceLocationTracker.ts @@ -96,17 +96,23 @@ export class SourceLocationTracker { async getValidSourceLocationFromVMTraceIndexFromCache (address: string, vmtraceStepIndex: number, contracts: any, cache: Map) { const amountOfSources = this.getTotalAmountOfSources(address, contracts) - let map: Record = { file: -1 } + let map: any = { file: -1 } /* (map.file === -1) this indicates that it isn't associated with a known source code (map.file > amountOfSources - 1) this indicates the current file index exceed the total number of files. this happens when generated sources should not be considered. */ + const originStep = cache[vmtraceStepIndex] + const nextStep = cache[vmtraceStepIndex + 1] + if (nextStep && originStep) { + originStep.stepDetail.gasCost = originStep.stepDetail.gas - nextStep.stepDetail.gas + } while (vmtraceStepIndex >= 0 && (map.file === -1 || map.file > amountOfSources - 1)) { - map = cache[vmtraceStepIndex] + map = cache[vmtraceStepIndex].sourceLocation vmtraceStepIndex = vmtraceStepIndex - 1 + originStep.sourceLocation = map } - return map + return originStep } clearCache () { diff --git a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx index 2a1be745d1..45bd8a4aae 100644 --- a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx @@ -121,7 +121,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { }) }) - debuggerInstance.event.register('newSourceLocation', async (lineColumnPos, rawLocation, generatedSources, address) => { + debuggerInstance.event.register('newSourceLocation', async (lineColumnPos, rawLocation, generatedSources, address, stepDetail) => { if (!lineColumnPos) { await debuggerModule.discardHighlight() setState(prevState => { @@ -158,7 +158,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { return { ...prevState, sourceLocationStatus: '' } }) await debuggerModule.discardHighlight() - await debuggerModule.highlight(lineColumnPos, path, rawLocation) + await debuggerModule.highlight(lineColumnPos, path, rawLocation, stepDetail) } } }) diff --git a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts index c0065558c9..e8100dde9b 100644 --- a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts +++ b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts @@ -44,7 +44,7 @@ export interface IDebuggerApi { onEditorContentChanged: (listener: onEditorContentChanged) => void onEnvChanged: (listener: onEnvChangedListener) => void discardHighlight: () => Promise - highlight: (lineColumnPos: LineColumnLocation, path: string, rawLocation: any) => Promise + highlight: (lineColumnPos: LineColumnLocation, path: string, rawLocation: any, stepDetail: any) => Promise fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise getFile: (path: string) => Promise setFile: (path: string, content: string) => Promise From 1d8eedf83b520a530044431a78dc5b3855b98fef Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 27 Oct 2022 20:04:42 +0200 Subject: [PATCH 21/97] fix label --- apps/debugger/src/app/debugger-api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 0f9293b8e8..f7ab74696a 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -50,7 +50,7 @@ export const DebuggerApiMixin = (Base) => class extends Base { async highlight (lineColumnPos, path, rawLocation, stepDetail) { await this.call('editor', 'highlight', lineColumnPos, path, '', { focus: true }) - const label = `${stepDetail.op} - ${stepDetail.gasCost} gas - ${stepDetail.gas} gas left` + const label = `${stepDetail.op} costs ${stepDetail.gasCost} gas - ${stepDetail.gas} gas left` const linetext: lineText = { content: label, position: lineColumnPos, From 11b7e038bb3086dc5dbbc7261209395f31ea2bc1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 27 Oct 2022 20:05:18 +0200 Subject: [PATCH 22/97] display gas cost at function scope --- .../src/solidity-decoder/internalCallTree.ts | 15 +++++++++++---- .../src/source/sourceLocationTracker.ts | 4 ---- .../src/lib/vm-debugger/vm-debugger-head.tsx | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 2d7e6b7329..ca5cadae0e 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -10,7 +10,7 @@ import { Uint } from './types/Uint' export type StepDetail = { depth: number, - gas: number, + gas: number | string, gasCost: number, memory: number[], op: string, @@ -138,6 +138,7 @@ export class InternalCallTree { const scope = this.findScope(vmtraceIndex) if (!scope) return [] let scopeId = this.scopeStarts[scope.firstStep] + const scopeDetail = this.scopes[scopeId] const functions = [] if (!scopeId) return functions let i = 0 @@ -147,7 +148,7 @@ export class InternalCallTree { if (i > 1000) throw new Error('retrieFunctionStack: recursion too deep') const functionDefinition = this.functionDefinitionsByScope[scopeId] if (functionDefinition !== undefined) { - functions.push(functionDefinition) + functions.push({ ...functionDefinition, ...scopeDetail }) } const parent = this.parentScope(scopeId) if (!parent) break @@ -185,7 +186,7 @@ export class InternalCallTree { async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { let subScope = 1 tree.scopeStarts[step] = scopeId - tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation } + tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } function callDepthChange (step, trace) { if (step + 1 < trace.length) { @@ -222,8 +223,14 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { return { outStep: step, error: 'InternalCallTree - No source Location. ' + step } } const stepDetail: StepDetail = tree.traceManager.trace[step] + const nextStepDetail: StepDetail = tree.traceManager.trace[step + 1] + if (stepDetail && nextStepDetail) { + stepDetail.gasCost = parseInt(stepDetail.gas as string) - parseInt(nextStepDetail.gas as string) + } tree.locationAndOpcodePerVMTraceIndex[step] = { sourceLocation, stepDetail } - console.log('locationAndOpcodePerVMTraceIndex', stepDetail) + tree.scopes[scopeId].gasCost += stepDetail.gasCost + console.log(step, stepDetail.op, stepDetail.gas, nextStepDetail.gas) + const isCallInstrn = isCallInstruction(stepDetail) const isCreateInstrn = isCreateInstruction(stepDetail) // we are checking if we are jumping in a new CALL or in an internal function diff --git a/libs/remix-debug/src/source/sourceLocationTracker.ts b/libs/remix-debug/src/source/sourceLocationTracker.ts index 92abb2ea00..94264c5801 100644 --- a/libs/remix-debug/src/source/sourceLocationTracker.ts +++ b/libs/remix-debug/src/source/sourceLocationTracker.ts @@ -103,10 +103,6 @@ export class SourceLocationTracker { this happens when generated sources should not be considered. */ const originStep = cache[vmtraceStepIndex] - const nextStep = cache[vmtraceStepIndex + 1] - if (nextStep && originStep) { - originStep.stepDetail.gasCost = originStep.stepDetail.gas - nextStep.stepDetail.gas - } while (vmtraceStepIndex >= 0 && (map.file === -1 || map.file > amountOfSources - 1)) { map = cache[vmtraceStepIndex].sourceLocation vmtraceStepIndex = vmtraceStepIndex - 1 diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx index 4402e7a57c..0ffc505833 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx @@ -31,7 +31,7 @@ export const VmDebuggerHead = ({ vmDebugger: { registerEvent, triggerEvent } }) const functions = [] for (const func of stack) { - functions.push(func.functionDefinition.name + '(' + func.inputs.join(', ') + ')') + functions.push(func.functionDefinition.name + '(' + func.inputs.join(', ') + ')' + ' - ' + func.gasCost + ' gas') } setFunctionPanel(() => functions) }) From ef4e0965541b8b4dad7156259e7cd9f4db38e393 Mon Sep 17 00:00:00 2001 From: yann300 Date: Sun, 13 Nov 2022 15:40:36 +0100 Subject: [PATCH 23/97] gas cost per line --- apps/debugger/src/app/debugger-api.ts | 10 ++------ libs/remix-debug/src/Ethdebugger.ts | 10 +++++--- libs/remix-debug/src/debugger/debugger.ts | 12 +++++++-- .../src/solidity-decoder/internalCallTree.ts | 25 +++++++++++++++++-- .../src/solidity-decoder/solidityProxy.ts | 7 ++++-- .../remix-app/components/modals/matomo.tsx | 5 ++++ .../debugger-ui/src/lib/debugger-ui.tsx | 9 ++++--- .../debugger-ui/src/lib/idebugger-api.ts | 2 +- 8 files changed, 58 insertions(+), 22 deletions(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index f7ab74696a..25530b9d0f 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -1,13 +1,7 @@ import Web3 from 'web3' import remixDebug, { TransactionDebugger as Debugger } from '@remix-project/remix-debug' -<<<<<<< HEAD import { CompilerAbstract } from '@remix-project/remix-solidity' - -======= -import { CompilationOutput, Sources } from '@remix-ui/debugger-ui' import { lineText } from '@remix-ui/editor' -import type { CompilationResult } from '@remix-project/remix-solidity-ts' ->>>>>>> show inline gas cost export const DebuggerApiMixin = (Base) => class extends Base { @@ -48,9 +42,9 @@ export const DebuggerApiMixin = (Base) => class extends Base { await this.call('editor', 'discardLineTexts' as any) } - async highlight (lineColumnPos, path, rawLocation, stepDetail) { + async highlight (lineColumnPos, path, rawLocation, stepDetail, lineGasCost) { await this.call('editor', 'highlight', lineColumnPos, path, '', { focus: true }) - const label = `${stepDetail.op} costs ${stepDetail.gasCost} gas - ${stepDetail.gas} gas left` + const label = `${stepDetail.op} costs ${stepDetail.gasCost} gas - this line costs ${lineGasCost} gas - ${stepDetail.gas} total gas left` const linetext: lineText = { content: label, position: lineColumnPos, diff --git a/libs/remix-debug/src/Ethdebugger.ts b/libs/remix-debug/src/Ethdebugger.ts index 644a98e57a..f04a740e34 100644 --- a/libs/remix-debug/src/Ethdebugger.ts +++ b/libs/remix-debug/src/Ethdebugger.ts @@ -32,9 +32,11 @@ export class Ethdebugger { storageResolver callTree breakpointManager + offsetToLineColumnConverter constructor (opts) { this.compilationResult = opts.compilationResult || function (contractAddress) { return null } + this.offsetToLineColumnConverter = opts.offsetToLineColumnConverter this.web3 = opts.web3 this.opts = opts @@ -49,7 +51,8 @@ export class Ethdebugger { this.traceManager, this.solidityProxy, this.codeManager, - { ...opts, includeLocalVariables }) + { ...opts, includeLocalVariables }, + this.offsetToLineColumnConverter) } setManagers () { @@ -63,7 +66,8 @@ export class Ethdebugger { this.traceManager, this.solidityProxy, this.codeManager, - { ...this.opts, includeLocalVariables }) + { ...this.opts, includeLocalVariables }, + this.offsetToLineColumnConverter) } resolveStep (index) { @@ -71,7 +75,7 @@ export class Ethdebugger { } setCompilationResult (compilationResult) { - this.solidityProxy.reset((compilationResult && compilationResult.data) || {}) + this.solidityProxy.reset((compilationResult && compilationResult.data) || {}, (compilationResult && compilationResult.source && compilationResult.source.sources) || {}) } async sourceLocationFromVMTraceIndex (address, stepIndex) { diff --git a/libs/remix-debug/src/debugger/debugger.ts b/libs/remix-debug/src/debugger/debugger.ts index 218cc58cc2..8327eb167a 100644 --- a/libs/remix-debug/src/debugger/debugger.ts +++ b/libs/remix-debug/src/debugger/debugger.ts @@ -26,7 +26,8 @@ export class Debugger { this.debugger = new Ethdebugger({ web3: options.web3, debugWithGeneratedSources: options.debugWithGeneratedSources, - compilationResult: this.compilationResult + compilationResult: this.compilationResult, + offsetToLineColumnConverter: this.offsetToLineColumnConverter }) const { traceManager, callTree, solidityProxy } = this.debugger @@ -90,7 +91,14 @@ export class Debugger { } } const lineColumnPos = await this.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, sources, astSources) - this.event.trigger('newSourceLocation', [lineColumnPos, rawLocation, generatedSources, address, stepDetail]) + + let lineGasCost = -1 + try { + lineGasCost = await this.debugger.callTree.getGasCostPerLine(rawLocation.file, lineColumnPos.start.line) + } catch (e) { + console.log(e) + } + this.event.trigger('newSourceLocation', [lineColumnPos, rawLocation, generatedSources, address, stepDetail, lineGasCost]) this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [rawLocation]) } else { this.event.trigger('newSourceLocation', [null]) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index ca5cadae0e..c1f824e3a1 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -41,6 +41,8 @@ export class InternalCallTree { locationAndOpcodePerVMTraceIndex: { [Key: number]: any } + gasCostPerLine + offsetToLineColumnConverter /** * constructor @@ -51,12 +53,13 @@ export class InternalCallTree { * @param {Object} codeManager - code manager * @param {Object} opts - { includeLocalVariables, debugWithGeneratedSources } */ - constructor (debuggerEvent, traceManager, solidityProxy, codeManager, opts) { + constructor (debuggerEvent, traceManager, solidityProxy, codeManager, opts, offsetToLineColumnConverter?) { this.includeLocalVariables = opts.includeLocalVariables this.debugWithGeneratedSources = opts.debugWithGeneratedSources this.event = new EventManager() this.solidityProxy = solidityProxy this.traceManager = traceManager + this.offsetToLineColumnConverter = offsetToLineColumnConverter this.sourceLocationTracker = new SourceLocationTracker(codeManager, { debugWithGeneratedSources: opts.debugWithGeneratedSources }) debuggerEvent.register('newTraceLoaded', (trace) => { this.reset() @@ -99,6 +102,7 @@ export class InternalCallTree { this.functionCallStack = [] this.functionDefinitionsByScope = {} this.scopeStarts = {} + this.gasCostPerLine = {} this.variableDeclarationByFile = {} this.functionDefinitionByFile = {} this.astWalker = new AstWalker() @@ -181,6 +185,13 @@ export class InternalCallTree { async getValidSourceLocationFromVMTraceIndexFromCache (address: string, step: number, contracts: any) { return await this.sourceLocationTracker.getValidSourceLocationFromVMTraceIndexFromCache(address, step, contracts, this.locationAndOpcodePerVMTraceIndex) } + + async getGasCostPerLine(file: number, line: number) { + if (this.gasCostPerLine[file] && this.gasCostPerLine[file][line]) { + return this.gasCostPerLine[file][line] + } + throw new Error('Could not find gas cost per line') + } } async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { @@ -211,6 +222,7 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { let newLocation = false try { sourceLocation = await tree.extractSourceLocation(step) + if (!includedSource(sourceLocation, currentSourceLocation)) { tree.reducedTrace.push(step) currentSourceLocation = sourceLocation @@ -229,7 +241,16 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { } tree.locationAndOpcodePerVMTraceIndex[step] = { sourceLocation, stepDetail } tree.scopes[scopeId].gasCost += stepDetail.gasCost - console.log(step, stepDetail.op, stepDetail.gas, nextStepDetail.gas) + + // gas per line + if (tree.offsetToLineColumnConverter) { + try { + const lineColumnPos = await tree.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, tree.solidityProxy.sourcesCode, tree.solidityProxy.sources) + if (!tree.gasCostPerLine[sourceLocation.file]) tree.gasCostPerLine[sourceLocation.file] = {} + if (!tree.gasCostPerLine[sourceLocation.file][lineColumnPos.start.line]) tree.gasCostPerLine[sourceLocation.file][lineColumnPos.start.line] = 0 + tree.gasCostPerLine[sourceLocation.file][lineColumnPos.start.line] += stepDetail.gasCost + } catch (e) {} + } const isCallInstrn = isCallInstruction(stepDetail) const isCreateInstrn = isCreateInstruction(stepDetail) diff --git a/libs/remix-debug/src/solidity-decoder/solidityProxy.ts b/libs/remix-debug/src/solidity-decoder/solidityProxy.ts index b9c27dca82..5ea06ddabf 100644 --- a/libs/remix-debug/src/solidity-decoder/solidityProxy.ts +++ b/libs/remix-debug/src/solidity-decoder/solidityProxy.ts @@ -10,6 +10,8 @@ export class SolidityProxy { getCode sources contracts + compilationResult + sourcesCode constructor ({ getCurrentCalledAddressAt, getCode }) { this.cache = new Cache() @@ -23,9 +25,10 @@ export class SolidityProxy { * * @param {Object} compilationResult - result os a compilatiion (diectly returned by the compiler) */ - reset (compilationResult) { - this.sources = compilationResult.sources + reset (compilationResult, sources?) { + this.sources = compilationResult.sources // ast this.contracts = compilationResult.contracts + if (sources) this.sourcesCode = sources this.cache.reset() } diff --git a/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx b/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx index 4d4daaed3e..276a3ee47b 100644 --- a/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx @@ -1,6 +1,11 @@ import React, { useContext, useEffect, useState } from 'react' import { AppContext } from '../../context/context' import { useDialogDispatchers } from '../../context/provider' +declare global { + interface Window { + _paq: any + } +} const _paq = window._paq = window._paq || [] const MatomoDialog = (props) => { diff --git a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx index 45bd8a4aae..81f2ea218c 100644 --- a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx @@ -121,7 +121,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { }) }) - debuggerInstance.event.register('newSourceLocation', async (lineColumnPos, rawLocation, generatedSources, address, stepDetail) => { + debuggerInstance.event.register('newSourceLocation', async (lineColumnPos, rawLocation, generatedSources, address, stepDetail, lineGasCost) => { if (!lineColumnPos) { await debuggerModule.discardHighlight() setState(prevState => { @@ -158,7 +158,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { return { ...prevState, sourceLocationStatus: '' } }) await debuggerModule.discardHighlight() - await debuggerModule.highlight(lineColumnPos, path, rawLocation, stepDetail) + await debuggerModule.highlight(lineColumnPos, path, rawLocation, stepDetail, lineGasCost) } } }) @@ -266,13 +266,14 @@ export const DebuggerUI = (props: DebuggerUIProps) => { console.log(e.message) } + const localCache = {} const debuggerInstance = new Debugger({ web3, offsetToLineColumnConverter: debuggerModule.offsetToLineColumnConverter, compilationResult: async (address) => { try { - const ret = await debuggerModule.fetchContractAndCompile(address, currentReceipt) - return ret + if (!localCache[address]) localCache[address] = await debuggerModule.fetchContractAndCompile(address, currentReceipt) + return localCache[address] } catch (e) { // debuggerModule.showMessage('Debugging error', 'Unable to fetch a transaction.') console.error(e) diff --git a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts index e8100dde9b..1b0d19c3d4 100644 --- a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts +++ b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts @@ -44,7 +44,7 @@ export interface IDebuggerApi { onEditorContentChanged: (listener: onEditorContentChanged) => void onEnvChanged: (listener: onEnvChangedListener) => void discardHighlight: () => Promise - highlight: (lineColumnPos: LineColumnLocation, path: string, rawLocation: any, stepDetail: any) => Promise + highlight: (lineColumnPos: LineColumnLocation, path: string, rawLocation: any, stepDetail: any, highlight: any) => Promise fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise getFile: (path: string) => Promise setFile: (path: string, content: string) => Promise From e3d516ee2fccb18ac5e52c6cec16e6a0fdbb2369 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Nov 2022 10:09:04 +0100 Subject: [PATCH 24/97] use validSourceLocation --- .../src/solidity-decoder/internalCallTree.ts | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index c1f824e3a1..7dfbdf0dce 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -161,22 +161,17 @@ export class InternalCallTree { return functions } - async extractSourceLocation (step) { + async extractSourceLocation (step: number, address: string) { try { - const address = this.traceManager.getCurrentCalledAddressAt(step) - const location = await this.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, step, this.solidityProxy.contracts) - - return location + return await this.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, step, this.solidityProxy.contracts) } catch (error) { throw new Error('InternalCallTree - Cannot retrieve sourcelocation for step ' + step + ' ' + error) } } - async extractValidSourceLocation (step) { + async extractValidSourceLocation (step: number, address: string) { try { - const address = this.traceManager.getCurrentCalledAddressAt(step) - const location = await this.sourceLocationTracker.getValidSourceLocationFromVMTraceIndex(address, step, this.solidityProxy.contracts) - return location + return await this.sourceLocationTracker.getValidSourceLocationFromVMTraceIndex(address, step, this.solidityProxy.contracts) } catch (error) { throw new Error('InternalCallTree - Cannot retrieve valid sourcelocation for step ' + step + ' ' + error) } @@ -219,10 +214,13 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { let previousSourceLocation = currentSourceLocation while (step < tree.traceManager.trace.length) { let sourceLocation + let validSourceLocation let newLocation = false try { - sourceLocation = await tree.extractSourceLocation(step) - + const address = this.traceManager.getCurrentCalledAddressAt(step) + sourceLocation = await tree.extractSourceLocation(step, address) + validSourceLocation = await tree.extractValidSourceLocation(step, address) + if (!includedSource(sourceLocation, currentSourceLocation)) { tree.reducedTrace.push(step) currentSourceLocation = sourceLocation @@ -245,11 +243,15 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { // gas per line if (tree.offsetToLineColumnConverter) { try { - const lineColumnPos = await tree.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, tree.solidityProxy.sourcesCode, tree.solidityProxy.sources) - if (!tree.gasCostPerLine[sourceLocation.file]) tree.gasCostPerLine[sourceLocation.file] = {} - if (!tree.gasCostPerLine[sourceLocation.file][lineColumnPos.start.line]) tree.gasCostPerLine[sourceLocation.file][lineColumnPos.start.line] = 0 - tree.gasCostPerLine[sourceLocation.file][lineColumnPos.start.line] += stepDetail.gasCost - } catch (e) {} + const lineColumnPos = await tree.offsetToLineColumnConverter.offsetToLineColumn(validSourceLocation, validSourceLocation.file, tree.solidityProxy.sourcesCode, tree.solidityProxy.sources) + if (!tree.gasCostPerLine[validSourceLocation.file]) tree.gasCostPerLine[validSourceLocation.file] = {} + if (!tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line]) { + tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line] = 0 + } + tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line] += stepDetail.gasCost + } catch (e) { + console.log(e) + } } const isCallInstrn = isCallInstruction(stepDetail) From 15ddc3a8d1bd88fcf8cdf22144549ef763e22f31 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Nov 2022 11:51:42 +0100 Subject: [PATCH 25/97] fix getting contract name of struct --- libs/remix-debug/src/solidity-decoder/decodeInfo.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/decodeInfo.ts b/libs/remix-debug/src/solidity-decoder/decodeInfo.ts index f141a7e1f9..a66434a2b7 100644 --- a/libs/remix-debug/src/solidity-decoder/decodeInfo.ts +++ b/libs/remix-debug/src/solidity-decoder/decodeInfo.ts @@ -241,9 +241,7 @@ function getStructMembers (type, stateDefinitions, contractName, location) { if (type.indexOf('.') === -1) { type = contractName + '.' + type } - if (!contractName) { - contractName = type.split('.')[0] - } + contractName = type.split('.')[0] const state = stateDefinitions[contractName] if (state) { for (const dec of state.stateDefinitions) { From b4bf4effb13528d8f9237e331d71bc4048d19e10 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Nov 2022 12:02:24 +0100 Subject: [PATCH 26/97] fix assigning the type property --- libs/remix-debug/src/solidity-decoder/localDecoder.ts | 2 +- libs/remix-debug/src/solidity-decoder/types/StringType.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/localDecoder.ts b/libs/remix-debug/src/solidity-decoder/localDecoder.ts index 4d697e9cc4..d333622408 100644 --- a/libs/remix-debug/src/solidity-decoder/localDecoder.ts +++ b/libs/remix-debug/src/solidity-decoder/localDecoder.ts @@ -21,7 +21,7 @@ export async function solidityLocals (vmtraceIndex, internalTreeCall, stack, mem locals[name] = await variable.type.decodeFromStack(variable.stackDepth, stack, memory, storageResolver, calldata, cursor, variable) } catch (e) { console.log(e) - locals[name] = { error: '' } + locals[name] = { error: '', type: variable && variable.type && variable.type.typeName || 'unknown' } } } } diff --git a/libs/remix-debug/src/solidity-decoder/types/StringType.ts b/libs/remix-debug/src/solidity-decoder/types/StringType.ts index 849b8f65a3..84c6483e8e 100644 --- a/libs/remix-debug/src/solidity-decoder/types/StringType.ts +++ b/libs/remix-debug/src/solidity-decoder/types/StringType.ts @@ -25,7 +25,7 @@ export class StringType extends DynamicByteArray { return await super.decodeFromStack(stackDepth, stack, memory, storageResolver, calldata, cursor, variableDetails) } catch (e) { console.log(e) - return { error: '' } + return { error: '', type: this.typeName } } } From 84b07e803a5756579c977882b29efbdaf6c461b7 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Nov 2022 12:03:33 +0100 Subject: [PATCH 27/97] fix retrieve the current address --- .../remix-debug/src/solidity-decoder/internalCallTree.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 7dfbdf0dce..965ead72d8 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -6,7 +6,6 @@ import { EventManager } from '../eventManager' import { parseType } from './decodeInfo' import { isContractCreation, isCallInstruction, isCreateInstruction, isJumpDestInstruction } from '../trace/traceHelper' import { extractLocationFromAstVariable } from './types/util' -import { Uint } from './types/Uint' export type StepDetail = { depth: number, @@ -161,16 +160,18 @@ export class InternalCallTree { return functions } - async extractSourceLocation (step: number, address: string) { + async extractSourceLocation (step: number, address?: string) { try { + if (!address) address = this.traceManager.getCurrentCalledAddressAt(step) return await this.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, step, this.solidityProxy.contracts) } catch (error) { throw new Error('InternalCallTree - Cannot retrieve sourcelocation for step ' + step + ' ' + error) } } - async extractValidSourceLocation (step: number, address: string) { + async extractValidSourceLocation (step: number, address?: string) { try { + if (!address) address = this.traceManager.getCurrentCalledAddressAt(step) return await this.sourceLocationTracker.getValidSourceLocationFromVMTraceIndex(address, step, this.solidityProxy.contracts) } catch (error) { throw new Error('InternalCallTree - Cannot retrieve valid sourcelocation for step ' + step + ' ' + error) @@ -217,7 +218,7 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { let validSourceLocation let newLocation = false try { - const address = this.traceManager.getCurrentCalledAddressAt(step) + const address = tree.traceManager.getCurrentCalledAddressAt(step) sourceLocation = await tree.extractSourceLocation(step, address) validSourceLocation = await tree.extractValidSourceLocation(step, address) From 8d40812c638a5d528c3097c6aef69a7743c4a5e6 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Nov 2022 12:03:56 +0100 Subject: [PATCH 28/97] add test for getGasCostPerLine and function gasCost --- libs/remix-debug/test/decoder/localDecoder.ts | 2 +- .../test/decoder/localsTests/int.ts | 24 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/libs/remix-debug/test/decoder/localDecoder.ts b/libs/remix-debug/test/decoder/localDecoder.ts index fc79752e08..fdeb743683 100644 --- a/libs/remix-debug/test/decoder/localDecoder.ts +++ b/libs/remix-debug/test/decoder/localDecoder.ts @@ -23,7 +23,7 @@ tape('solidity', function (t) { async function test (st, privateKey) { var output = compiler.compile(compilerInput(intLocal.contract)) output = JSON.parse(output) - await intLocalTest(st, privateKey, output.contracts['test.sol']['intLocal'].evm.bytecode.object, output) + await intLocalTest(st, privateKey, output.contracts['test.sol']['intLocal'].evm.bytecode.object, output, intLocal.contract) output = compiler.compile(compilerInput(miscLocal.contract)) output = JSON.parse(output) await miscLocalTest(st, privateKey, output.contracts['test.sol']['miscLocal'].evm.bytecode.object, output) diff --git a/libs/remix-debug/test/decoder/localsTests/int.ts b/libs/remix-debug/test/decoder/localsTests/int.ts index 9bf1c4307f..2360c1cf12 100644 --- a/libs/remix-debug/test/decoder/localsTests/int.ts +++ b/libs/remix-debug/test/decoder/localsTests/int.ts @@ -7,9 +7,10 @@ import { contractCreationToken } from '../../../src/trace/traceHelper' import { SolidityProxy } from '../../../src/solidity-decoder/solidityProxy' import { InternalCallTree } from '../../../src/solidity-decoder/internalCallTree' import { EventManager } from '../../../src/eventManager' +import * as sourceMappingDecoder from '../../../src/source/sourceMappingDecoder' import * as helper from './helper' -module.exports = function (st, privateKey, contractBytecode, compilationResult) { +module.exports = function (st, privateKey, contractBytecode, compilationResult, contractCode) { return new Promise(async (resolve) => { let web3 = await (vmCall as any).getWeb3(); (vmCall as any).sendTx(web3, { nonce: 0, privateKey: privateKey }, null, 0, contractBytecode, function (error, hash) { @@ -27,22 +28,37 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult) var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) }) solidityProxy.reset(compilationResult) var debuggerEvent = new EventManager() - var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true }) + const offsetToLineColumnConverter = { + offsetToLineColumn: (rawLocation) => { + return new Promise((resolve) => { + const lineBreaks = sourceMappingDecoder.getLinebreakPositions(contractCode) + resolve(sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, lineBreaks)) + }) + } + } + var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true }, offsetToLineColumnConverter) callTree.event.register('callTreeBuildFailed', (error) => { st.fail(error) }) callTree.event.register('callTreeNotReady', (reason) => { st.fail(reason) }) - callTree.event.register('callTreeReady', (scopes, scopeStarts) => { + callTree.event.register('callTreeReady', async (scopes, scopeStarts) => { try { + + // test gas cost per line + st.equals(await callTree.getGasCostPerLine(0, 16), 11) + st.equals(await callTree.getGasCostPerLine(0, 32), 60) + let functions1 = callTree.retrieveFunctionsStack(102) let functions2 = callTree.retrieveFunctionsStack(115) let functions3 = callTree.retrieveFunctionsStack(13) - + st.equals(functions1.length, 1) st.equals(functions2.length, 2) st.equals(functions3.length, 0) + + st.equal(functions1[0].gasCost, 54) st.equals(Object.keys(functions1[0])[0], 'functionDefinition') st.equals(Object.keys(functions1[0])[1], 'inputs') From be1d382e6c97bc8598067e2f37825da3e8ce00ab Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Nov 2022 13:59:51 +0100 Subject: [PATCH 29/97] update e2e test --- apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts b/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts index 5376da014d..6ce01beaa0 100644 --- a/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts +++ b/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts @@ -4,8 +4,10 @@ import EventEmitter from 'events' class WaitForElementContainsText extends EventEmitter { command (this: NightwatchBrowser, id: string, value: string, timeout = 10000): NightwatchBrowser { let waitId // eslint-disable-line + let currentValue const runid = setInterval(() => { this.api.getText(id, (result) => { + currentValue = result.value if (typeof result.value === 'string' && result.value.indexOf(value) !== -1) { clearInterval(runid) clearTimeout(waitId) @@ -17,7 +19,7 @@ class WaitForElementContainsText extends EventEmitter { waitId = setTimeout(() => { clearInterval(runid) - this.api.assert.fail(`TimeoutError: An error occurred while running .waitForElementContainsText() command on ${id} after ${timeout} milliseconds`) + this.api.assert.fail(`TimeoutError: An error occurred while running .waitForElementContainsText() command on ${id} after ${timeout} milliseconds. expected: ${value} - got: ${currentValue}`) }, timeout) return this } From f9eaac46ab50d6fff2b765882ad2ae0979e2468f Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Nov 2022 16:45:51 +0100 Subject: [PATCH 30/97] fix listenning event in debugger --- libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx | 4 ++-- .../debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx | 4 ++-- libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx index 81f2ea218c..3233461935 100644 --- a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx @@ -396,8 +396,8 @@ export const DebuggerUI = (props: DebuggerUIProps) => { { state.debugging && }
- { state.debugging && } - { state.debugging && } + { state.debugging && } + { state.debugging && }
) diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx index 0ffc505833..aa195f0038 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx @@ -5,7 +5,7 @@ import StepDetail from './step-detail' // eslint-disable-line import SolidityState from './solidity-state' // eslint-disable-line import SolidityLocals from './solidity-locals' // eslint-disable-line -export const VmDebuggerHead = ({ vmDebugger: { registerEvent, triggerEvent } }) => { +export const VmDebuggerHead = ({ vmDebugger: { registerEvent, triggerEvent }, debugging }) => { const [functionPanel, setFunctionPanel] = useState(null) const [stepDetail, setStepDetail] = useState({ 'vm trace step': '-', @@ -95,7 +95,7 @@ export const VmDebuggerHead = ({ vmDebugger: { registerEvent, triggerEvent } }) return { ...solidityLocals, message } }) }) - }, [registerEvent]) + }, [debugging]) return (
diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger.tsx index 8bf8307f2a..508097d5df 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger.tsx @@ -8,7 +8,7 @@ import ReturnValuesPanel from './dropdown-panel' // eslint-disable-line import FullStoragesChangesPanel from './full-storages-changes' // eslint-disable-line import GlobalVariables from './global-variables' // eslint-disable-line -export const VmDebugger = ({ vmDebugger: { registerEvent }, currentBlock, currentReceipt, currentTransaction }) => { +export const VmDebugger = ({ vmDebugger: { registerEvent }, currentBlock, currentReceipt, currentTransaction, debugging }) => { const [calldataPanel, setCalldataPanel] = useState(null) const [memoryPanel, setMemoryPanel] = useState(null) const [callStackPanel, setCallStackPanel] = useState(null) @@ -49,7 +49,7 @@ export const VmDebugger = ({ vmDebugger: { registerEvent }, currentBlock, curren registerEvent && registerEvent('traceStorageUpdate', (calldata) => { setFullStoragesChangesPanel(() => calldata) }) - }, [registerEvent]) + }, [debugging]) return (
From 22e286bbf2463315e5df6f2102475a4fd048e62b Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Nov 2022 13:34:52 +0100 Subject: [PATCH 31/97] use ast to identify jump to high level function --- .../src/solidity-decoder/internalCallTree.ts | 103 +++++++++--------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 965ead72d8..8a5756d1ed 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -190,11 +190,15 @@ export class InternalCallTree { } } -async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { +async function buildTree (tree, step, scopeId, isExternalCall, isCreation, functionDefinition?, contractObj?, sourceLocation?) { let subScope = 1 tree.scopeStarts[step] = scopeId tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } + if (functionDefinition) { + await registerFunctionParameters(tree, functionDefinition, step, scopeId, contractObj, sourceLocation) + } + function callDepthChange (step, trace) { if (step + 1 < trace.length) { return trace[step].depth !== trace[step + 1].depth @@ -211,7 +215,7 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { included.file === source.file) } - let currentSourceLocation = { start: -1, length: -1, file: -1 } + let currentSourceLocation = { start: -1, length: -1, file: -1, jump: '-' } let previousSourceLocation = currentSourceLocation while (step < tree.traceManager.trace.length) { let sourceLocation @@ -255,12 +259,17 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { } } + const contractObj = await tree.solidityProxy.contractObjectAt(step) + const generatedSources = getGeneratedSources(tree, scopeId, contractObj) + const functionDefinition = resolveFunctionDefinition(tree, sourceLocation, generatedSources) + const isCallInstrn = isCallInstruction(stepDetail) const isCreateInstrn = isCreateInstruction(stepDetail) // we are checking if we are jumping in a new CALL or in an internal function - if (isCallInstrn || sourceLocation.jump === 'i') { + if (isCallInstrn || (previousSourceLocation.jump === 'i' && functionDefinition)) { try { - const externalCallResult = await buildTree(tree, step + 1, scopeId === '' ? subScope.toString() : scopeId + '.' + subScope, isCallInstrn, isCreateInstrn) + const newScopeId = scopeId === '' ? subScope.toString() : scopeId + '.' + subScope + const externalCallResult = await buildTree(tree, step, newScopeId , isCallInstrn, isCreateInstrn, functionDefinition, contractObj, sourceLocation) if (externalCallResult.error) { return { outStep: step, error: 'InternalCallTree - ' + externalCallResult.error } } else { @@ -270,7 +279,7 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { } catch (e) { return { outStep: step, error: 'InternalCallTree - ' + e.message } } - } else if ((isExternalCall && callDepthChange(step, tree.traceManager.trace)) || (!isExternalCall && sourceLocation.jump === 'o')) { + } else if (callDepthChange(step, tree.traceManager.trace) || (sourceLocation.jump === 'o' && functionDefinition)) { // if not, we might be returning from a CALL or internal function. This is what is checked here. tree.scopes[scopeId].lastStep = step return { outStep: step + 1 } @@ -278,7 +287,7 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation) { // if not, we are in the current scope. // We check in `includeVariableDeclaration` if there is a new local variable in scope for this specific `step` if (tree.includeLocalVariables) { - await includeVariableDeclaration(tree, step, sourceLocation, scopeId, newLocation, previousSourceLocation) + await includeVariableDeclaration(tree, step, sourceLocation, scopeId, contractObj, generatedSources) } previousSourceLocation = sourceLocation step++ @@ -299,10 +308,43 @@ function getGeneratedSources (tree, scopeId, contractObj) { return null } -async function includeVariableDeclaration (tree, step, sourceLocation, scopeId, newLocation, previousSourceLocation) { - const contractObj = await tree.solidityProxy.contractObjectAt(step) +async function registerFunctionParameters (tree, functionDefinition, step, scopeId, contractObj, sourceLocation) { + tree.functionCallStack.push(step) + const functionDefinitionAndInputs = { functionDefinition, inputs: [] } + // means: the previous location was a function definition && JUMPDEST + // => we are at the beginning of the function and input/output are setup + + try { + const stack = tree.traceManager.getStackAt(step) + const states = tree.solidityProxy.extractStatesDefinitions() + if (functionDefinition.parameters) { + const inputs = functionDefinition.parameters + const outputs = functionDefinition.returnParameters + // for (const element of functionDefinition.parameters) { + // if (element.nodeType === 'ParameterList') { + // if (!inputs) inputs = element + // else { + // outputs = element + // break + // } + // } + // } + // input params + if (inputs && inputs.parameters) { + functionDefinitionAndInputs.inputs = addParams(inputs, tree, scopeId, states, contractObj, sourceLocation, stack.length, inputs.parameters.length, -1) + } + // output params + if (outputs) addParams(outputs, tree, scopeId, states, contractObj, sourceLocation, stack.length, 0, 1) + } + } catch (error) { + console.log(error) + } + + tree.functionDefinitionsByScope[scopeId] = functionDefinitionAndInputs +} + +async function includeVariableDeclaration (tree, step, sourceLocation, scopeId, contractObj, generatedSources) { let states = null - const generatedSources = getGeneratedSources(tree, scopeId, contractObj) const variableDeclarations = resolveVariableDeclaration(tree, sourceLocation, generatedSources) // using the vm trace step, the current source location and the ast, // we check if the current vm trace step target a new ast node of type VariableDeclaration @@ -332,49 +374,6 @@ async function includeVariableDeclaration (tree, step, sourceLocation, scopeId, } } } - - // we check here if we are at the beginning inside a new function. - // if that is the case, we have to add to locals tree the inputs and output params - const functionDefinition = resolveFunctionDefinition(tree, previousSourceLocation, generatedSources) - if (!functionDefinition) return - - const previousIsJumpDest2 = isJumpDestInstruction(tree.traceManager.trace[step - 2]) - const previousIsJumpDest1 = isJumpDestInstruction(tree.traceManager.trace[step - 1]) - const isConstructor = functionDefinition.kind === 'constructor' - if (newLocation && (previousIsJumpDest1 || previousIsJumpDest2 || isConstructor)) { - tree.functionCallStack.push(step) - const functionDefinitionAndInputs = { functionDefinition, inputs: [] } - // means: the previous location was a function definition && JUMPDEST - // => we are at the beginning of the function and input/output are setup - - try { - const stack = tree.traceManager.getStackAt(step) - states = tree.solidityProxy.extractStatesDefinitions() - if (functionDefinition.parameters) { - const inputs = functionDefinition.parameters - const outputs = functionDefinition.returnParameters - // for (const element of functionDefinition.parameters) { - // if (element.nodeType === 'ParameterList') { - // if (!inputs) inputs = element - // else { - // outputs = element - // break - // } - // } - // } - // input params - if (inputs && inputs.parameters) { - functionDefinitionAndInputs.inputs = addParams(inputs, tree, scopeId, states, contractObj, previousSourceLocation, stack.length, inputs.parameters.length, -1) - } - // output params - if (outputs) addParams(outputs, tree, scopeId, states, contractObj, previousSourceLocation, stack.length, 0, 1) - } - } catch (error) { - console.log(error) - } - - tree.functionDefinitionsByScope[scopeId] = functionDefinitionAndInputs - } } // this extract all the variable declaration for a given ast and file From 1ab06cc4df77050208b54dfde33571fecb551a05 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Nov 2022 13:39:12 +0100 Subject: [PATCH 32/97] rename --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 8a5756d1ed..b58f36c7a0 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -263,13 +263,13 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation, funct const generatedSources = getGeneratedSources(tree, scopeId, contractObj) const functionDefinition = resolveFunctionDefinition(tree, sourceLocation, generatedSources) - const isCallInstrn = isCallInstruction(stepDetail) + const isInternalTxInstrn = isCallInstruction(stepDetail) const isCreateInstrn = isCreateInstruction(stepDetail) // we are checking if we are jumping in a new CALL or in an internal function - if (isCallInstrn || (previousSourceLocation.jump === 'i' && functionDefinition)) { + if (isInternalTxInstrn || (previousSourceLocation.jump === 'i' && functionDefinition)) { try { const newScopeId = scopeId === '' ? subScope.toString() : scopeId + '.' + subScope - const externalCallResult = await buildTree(tree, step, newScopeId , isCallInstrn, isCreateInstrn, functionDefinition, contractObj, sourceLocation) + const externalCallResult = await buildTree(tree, step, newScopeId, isInternalTxInstrn, isCreateInstrn, functionDefinition, contractObj, sourceLocation) if (externalCallResult.error) { return { outStep: step, error: 'InternalCallTree - ' + externalCallResult.error } } else { From cf0cf0ea18ac8b69ba9cf8b840e87dbcdfb8052f Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Nov 2022 13:49:06 +0100 Subject: [PATCH 33/97] log debug time --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index b58f36c7a0..b5c44a9152 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -61,6 +61,7 @@ export class InternalCallTree { this.offsetToLineColumnConverter = offsetToLineColumnConverter this.sourceLocationTracker = new SourceLocationTracker(codeManager, { debugWithGeneratedSources: opts.debugWithGeneratedSources }) debuggerEvent.register('newTraceLoaded', (trace) => { + let time = Date.now() this.reset() if (!this.solidityProxy.loaded()) { this.event.trigger('callTreeBuildFailed', ['compilation result not loaded. Cannot build internal call tree']) @@ -73,6 +74,7 @@ export class InternalCallTree { this.event.trigger('callTreeBuildFailed', [result.error]) } else { createReducedTrace(this, traceManager.trace.length - 1) + console.log('call tree build lasts ', (Date.now() - time) / 1000) this.event.trigger('callTreeReady', [this.scopes, this.scopeStarts]) } }, (reason) => { From 42fe88df8669e1311f7887be6127024fe456e2e0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Nov 2022 16:51:45 +0100 Subject: [PATCH 34/97] remove need of using extractValidSourceLocation --- .../src/solidity-decoder/internalCallTree.ts | 19 +++++++++++++------ .../src/solidity-decoder/solidityProxy.ts | 12 +++++++++++- .../src/source/sourceLocationTracker.ts | 6 +++++- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index b5c44a9152..8420377492 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -219,20 +219,26 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation, funct let currentSourceLocation = { start: -1, length: -1, file: -1, jump: '-' } let previousSourceLocation = currentSourceLocation + let previousValidSourceLocation = currentSourceLocation while (step < tree.traceManager.trace.length) { let sourceLocation let validSourceLocation - let newLocation = false + let address try { - const address = tree.traceManager.getCurrentCalledAddressAt(step) + address = tree.traceManager.getCurrentCalledAddressAt(step) sourceLocation = await tree.extractSourceLocation(step, address) - validSourceLocation = await tree.extractValidSourceLocation(step, address) - + if (!includedSource(sourceLocation, currentSourceLocation)) { tree.reducedTrace.push(step) currentSourceLocation = sourceLocation - newLocation = true } + + const amountOfSources = tree.sourceLocationTracker.getTotalAmountOfSources(address, tree.solidityProxy.contracts) + if (tree.sourceLocationTracker.isInvalidSourceLocation(currentSourceLocation, amountOfSources)) { // file is -1 or greater than amount of sources + validSourceLocation = previousValidSourceLocation + } else + validSourceLocation = currentSourceLocation + } catch (e) { return { outStep: step, error: 'InternalCallTree - Error resolving source location. ' + step + ' ' + e } } @@ -261,7 +267,7 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation, funct } } - const contractObj = await tree.solidityProxy.contractObjectAt(step) + const contractObj = await tree.solidityProxy.contractObjectAtAddress(address) const generatedSources = getGeneratedSources(tree, scopeId, contractObj) const functionDefinition = resolveFunctionDefinition(tree, sourceLocation, generatedSources) @@ -292,6 +298,7 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation, funct await includeVariableDeclaration(tree, step, sourceLocation, scopeId, contractObj, generatedSources) } previousSourceLocation = sourceLocation + previousValidSourceLocation = validSourceLocation step++ } } diff --git a/libs/remix-debug/src/solidity-decoder/solidityProxy.ts b/libs/remix-debug/src/solidity-decoder/solidityProxy.ts index 5ea06ddabf..0ec4029020 100644 --- a/libs/remix-debug/src/solidity-decoder/solidityProxy.ts +++ b/libs/remix-debug/src/solidity-decoder/solidityProxy.ts @@ -47,8 +47,18 @@ export class SolidityProxy { * @param {Int} vmTraceIndex - index in the vm trave where to resolve the executed contract name * @param {Function} cb - callback returns (error, contractName) */ - async contractObjectAt (vmTraceIndex) { + async contractObjectAt (vmTraceIndex: number) { const address = this.getCurrentCalledAddressAt(vmTraceIndex) + return this.contractObjectAtAddress(address) + } + + /** + * retrieve the compiled contract name at the @arg vmTraceIndex (cached) + * + * @param {Int} vmTraceIndex - index in the vm trave where to resolve the executed contract name + * @param {Function} cb - callback returns (error, contractName) + */ + async contractObjectAtAddress (address: string) { if (this.cache.contractObjectByAddress[address]) { return this.cache.contractObjectByAddress[address] } diff --git a/libs/remix-debug/src/source/sourceLocationTracker.ts b/libs/remix-debug/src/source/sourceLocationTracker.ts index 94264c5801..c7502db960 100644 --- a/libs/remix-debug/src/source/sourceLocationTracker.ts +++ b/libs/remix-debug/src/source/sourceLocationTracker.ts @@ -87,13 +87,17 @@ export class SourceLocationTracker { (map.file > amountOfSources - 1) this indicates the current file index exceed the total number of files. this happens when generated sources should not be considered. */ - while (vmtraceStepIndex >= 0 && (map.file === -1 || map.file > amountOfSources - 1)) { + while (vmtraceStepIndex >= 0 && this.isInvalidSourceLocation(map, amountOfSources)) { map = await this.getSourceLocationFromVMTraceIndex(address, vmtraceStepIndex, contracts) vmtraceStepIndex = vmtraceStepIndex - 1 } return map } + isInvalidSourceLocation (sourceLocation, amountOfSources) { + return sourceLocation.file === -1 || sourceLocation.file > amountOfSources - 1 + } + async getValidSourceLocationFromVMTraceIndexFromCache (address: string, vmtraceStepIndex: number, contracts: any, cache: Map) { const amountOfSources = this.getTotalAmountOfSources(address, contracts) let map: any = { file: -1 } From 2b5f4eb9fe7b4ce862b9cd6a31671baf3e86a093 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Nov 2022 19:36:44 +0100 Subject: [PATCH 35/97] adding cache --- .../src/lib/offset-line-to-column-converter.ts | 13 ++++++++++++- .../src/source/offsetToLineColumnConverter.ts | 12 +++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/libs/remix-core-plugin/src/lib/offset-line-to-column-converter.ts b/libs/remix-core-plugin/src/lib/offset-line-to-column-converter.ts index b6e02bbcdd..0c416b2953 100644 --- a/libs/remix-core-plugin/src/lib/offset-line-to-column-converter.ts +++ b/libs/remix-core-plugin/src/lib/offset-line-to-column-converter.ts @@ -13,9 +13,11 @@ const profile = { export class OffsetToLineColumnConverter extends Plugin { lineBreakPositionsByContent: Record> sourceMappingDecoder: any + offsetConvertion: any constructor () { super(profile) this.lineBreakPositionsByContent = {} + this.offsetConvertion = {} this.sourceMappingDecoder = sourceMappingDecoder } @@ -45,7 +47,15 @@ export class OffsetToLineColumnConverter extends Plugin { } } } - return this.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file]) + + const token = `${rawLocation.start}:${rawLocation.length}:${file}` + if (this.offsetConvertion[token]) { + return this.offsetConvertion[token] + } else { + const convertion = this.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file]) + this.offsetConvertion[token] = convertion + return convertion + } } /** @@ -64,6 +74,7 @@ export class OffsetToLineColumnConverter extends Plugin { */ clear () { this.lineBreakPositionsByContent = {} + this.offsetConvertion = {} } /** diff --git a/libs/remix-debug/src/source/offsetToLineColumnConverter.ts b/libs/remix-debug/src/source/offsetToLineColumnConverter.ts index 6605b660b9..a1f296c76f 100644 --- a/libs/remix-debug/src/source/offsetToLineColumnConverter.ts +++ b/libs/remix-debug/src/source/offsetToLineColumnConverter.ts @@ -4,9 +4,11 @@ import { getLinebreakPositions, convertOffsetToLineColumn } from './sourceMappin export class OffsetToColumnConverter { lineBreakPositionsByContent sourceMappingDecoder + offsetConvertion constructor (compilerEvent) { this.lineBreakPositionsByContent = {} + this.offsetConvertion = {} if (compilerEvent) { compilerEvent.register('compilationFinished', (success, data, source, input, version) => { this.clear() @@ -26,10 +28,18 @@ export class OffsetToColumnConverter { } } } - return convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file]) + const token = `${rawLocation.start}:${rawLocation.length}:${file}` + if (this.offsetConvertion[token]) { + return this.offsetConvertion[token] + } else { + const convertion = convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file]) + this.offsetConvertion[token] = convertion + return convertion + } } clear () { this.lineBreakPositionsByContent = {} + this.offsetConvertion = {} } } From 2f4bff3d5eb8610fc096a30893de8e5412720b5f Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 22 Nov 2022 23:17:05 +0100 Subject: [PATCH 36/97] show line number in the opcodes list --- libs/remix-debug/src/debugger/debugger.ts | 30 ++++++++++++++++--- .../src/solidity-decoder/internalCallTree.ts | 8 +++-- .../test/decoder/localsTests/int.ts | 4 +-- .../src/lib/vm-debugger/assembly-items.tsx | 10 ++++++- .../src/reducers/assembly-items.ts | 24 +++++++++++++-- 5 files changed, 64 insertions(+), 12 deletions(-) diff --git a/libs/remix-debug/src/debugger/debugger.ts b/libs/remix-debug/src/debugger/debugger.ts index 8327eb167a..fe15df4051 100644 --- a/libs/remix-debug/src/debugger/debugger.ts +++ b/libs/remix-debug/src/debugger/debugger.ts @@ -14,6 +14,8 @@ export class Debugger { breakPointManager step_manager // eslint-disable-line camelcase vmDebuggerLogic + currentFile = -1 + currentLine = -1 constructor (options) { this.event = new EventManager() @@ -74,6 +76,9 @@ export class Debugger { const compilationResultForAddress = await this.compilationResult(address) if (!compilationResultForAddress) { this.event.trigger('newSourceLocation', [null]) + this.currentFile = -1 + this.currentLine = -1 + this.vmDebuggerLogic.event.trigger('lineGasCostChanged', [null]) return } @@ -92,26 +97,43 @@ export class Debugger { } const lineColumnPos = await this.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, sources, astSources) - let lineGasCost = -1 + let lineGasCostObj = null try { - lineGasCost = await this.debugger.callTree.getGasCostPerLine(rawLocation.file, lineColumnPos.start.line) + lineGasCostObj = await this.debugger.callTree.getGasCostPerLine(rawLocation.file, lineColumnPos.start.line) } catch (e) { console.log(e) } - this.event.trigger('newSourceLocation', [lineColumnPos, rawLocation, generatedSources, address, stepDetail, lineGasCost]) + this.event.trigger('newSourceLocation', [lineColumnPos, rawLocation, generatedSources, address, stepDetail, (lineGasCostObj && lineGasCostObj.gasCost) || -1]) this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [rawLocation]) + if (this.currentFile !== rawLocation.file || this.currentLine !== lineColumnPos.start.line) { + const instructionIndexes = lineGasCostObj.indexes.map((index) => { // translate from vmtrace index to instruction index + return this.debugger.codeManager.getInstructionIndex(address, index) + }) + this.vmDebuggerLogic.event.trigger('lineGasCostChanged', [instructionIndexes, lineColumnPos.start.line ]) + this.currentFile = rawLocation.file + this.currentLine = lineColumnPos.start.line + } } else { this.event.trigger('newSourceLocation', [null]) - this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [null]) + this.vmDebuggerLogic.event.trigger('lineGasCostChanged', [null]) + this.currentFile = -1 + this.currentLine = -1 + this.vmDebuggerLogic.event.trigger('lineGasCostChanged', [null]) } }).catch((_error) => { this.event.trigger('newSourceLocation', [null]) this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [null]) + this.currentFile = -1 + this.currentLine = -1 + this.vmDebuggerLogic.event.trigger('lineGasCostChanged', [null]) }) // }) } catch (error) { this.event.trigger('newSourceLocation', [null]) this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [null]) + this.currentFile = -1 + this.currentLine = -1 + this.vmDebuggerLogic.event.trigger('lineGasCostChanged', [null]) return console.log(error) } } diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 8420377492..ef7704b61c 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -259,9 +259,13 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation, funct const lineColumnPos = await tree.offsetToLineColumnConverter.offsetToLineColumn(validSourceLocation, validSourceLocation.file, tree.solidityProxy.sourcesCode, tree.solidityProxy.sources) if (!tree.gasCostPerLine[validSourceLocation.file]) tree.gasCostPerLine[validSourceLocation.file] = {} if (!tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line]) { - tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line] = 0 + tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line] = { + gasCost: 0, + indexes: [] + } } - tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line] += stepDetail.gasCost + tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line].gasCost += stepDetail.gasCost + tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line].indexes.push(step) } catch (e) { console.log(e) } diff --git a/libs/remix-debug/test/decoder/localsTests/int.ts b/libs/remix-debug/test/decoder/localsTests/int.ts index 2360c1cf12..b9ba0ab7f9 100644 --- a/libs/remix-debug/test/decoder/localsTests/int.ts +++ b/libs/remix-debug/test/decoder/localsTests/int.ts @@ -47,8 +47,8 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult, try { // test gas cost per line - st.equals(await callTree.getGasCostPerLine(0, 16), 11) - st.equals(await callTree.getGasCostPerLine(0, 32), 60) + st.equals((await callTree.getGasCostPerLine(0, 16)).gasCost, 11) + st.equals((await callTree.getGasCostPerLine(0, 32)).gasCost, 60) let functions1 = callTree.retrieveFunctionsStack(102) let functions2 = callTree.retrieveFunctionsStack(115) diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/assembly-items.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/assembly-items.tsx index 815681529b..b5fb288c48 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/assembly-items.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/assembly-items.tsx @@ -1,3 +1,4 @@ +import { stateDecoder } from 'dist/libs/remix-debug/src/solidity-decoder' import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint-disable-line import { initialState, reducer } from '../../reducers/assembly-items' import './styles/assembly-items.css' @@ -9,6 +10,7 @@ export const AssemblyItems = ({ registerEvent }) => { const [nextSelectedItems, setNextSelectedItems] = useState([1]) const [returnInstructionIndexes, setReturnInstructionIndexes] = useState([]) const [outOfGasInstructionIndexes, setOutOfGasInstructionIndexes] = useState([]) + const [opcodeTooltipText, setOpcodeTooltipText] = useState('') const refs = useRef({}) const asmItemsRef = useRef(null) @@ -16,6 +18,10 @@ export const AssemblyItems = ({ registerEvent }) => { registerEvent && registerEvent('codeManagerChanged', (code, address, index, nextIndexes, returnInstructionIndexes, outOfGasInstructionIndexes) => { dispatch({ type: 'FETCH_OPCODES_SUCCESS', payload: { code, address, index, nextIndexes, returnInstructionIndexes, outOfGasInstructionIndexes } }) }) + + registerEvent && registerEvent('lineGasCostChanged', (instructionsIndexes: number[], line: []) => { + dispatch({ type: 'FETCH_INDEXES_FOR_NEW_LINE', payload: { currentLineIndexes: instructionsIndexes || [], line } }) + }) }, []) useEffect(() => { @@ -129,7 +135,9 @@ export const AssemblyItems = ({ registerEvent }) => {
{ assemblyItems.display.map((item, i) => { - return
{ refs.current[i] = ref }}>{item}
+ return
{ refs.current[i] = ref }}> + {item}{assemblyItems.currentLineIndexes.includes(i) ? - LINE {assemblyItems.line + 1} : ' - '} +
}) }
diff --git a/libs/remix-ui/debugger-ui/src/reducers/assembly-items.ts b/libs/remix-ui/debugger-ui/src/reducers/assembly-items.ts index a86554f297..4f1e9c307a 100644 --- a/libs/remix-ui/debugger-ui/src/reducers/assembly-items.ts +++ b/libs/remix-ui/debugger-ui/src/reducers/assembly-items.ts @@ -13,6 +13,7 @@ export const initialState = { }, display: [], index: 0, + initialIndex: 0, nextIndexes: [-1], returnInstructionIndexes: [], outOfGasInstructionIndexes: [], @@ -20,7 +21,10 @@ export const initialState = { bottom: 0, isRequesting: false, isSuccessful: false, - hasError: null + hasError: null, + absoluteCurrentLineIndexes: [], + currentLineIndexes: [], + line: -1 } const reducedOpcode = (opCodes, payload) => { @@ -31,6 +35,7 @@ const reducedOpcode = (opCodes, payload) => { return { index: opCodes.index - bottom, nextIndexes: opCodes.nextIndexes.map(index => index - bottom), + currentLineIndexes: (opCodes.absoluteCurrentLineIndexes && opCodes.absoluteCurrentLineIndexes.map(index => index - bottom)) || [], display: opCodes.code.slice(bottom, top), returnInstructionIndexes: payload.returnInstructionIndexes.map((index) => index.instructionIndex - bottom), outOfGasInstructionIndexes: payload.outOfGasInstructionIndexes.map((index) => index.instructionIndex - bottom) @@ -49,20 +54,23 @@ export const reducer = (state = initialState, action: Action) => { } case 'FETCH_OPCODES_SUCCESS': { const opCodes = action.payload.address === state.opCodes.address ? { - ...state.opCodes, index: action.payload.index, nextIndexes: action.payload.nextIndexes + ...state.opCodes, index: action.payload.index, nextIndexes: action.payload.nextIndexes, absoluteCurrentLineIndexes: state.absoluteCurrentLineIndexes } : deepEqual(action.payload.code, state.opCodes.code) ? state.opCodes : action.payload const reduced = reducedOpcode(opCodes, action.payload) return { + ...state, opCodes, display: reduced.display, + initialIndex: action.payload.index, index: reduced.index, nextIndexes: reduced.nextIndexes, isRequesting: false, isSuccessful: true, hasError: null, returnInstructionIndexes: reduced.returnInstructionIndexes, - outOfGasInstructionIndexes: reduced.outOfGasInstructionIndexes + outOfGasInstructionIndexes: reduced.outOfGasInstructionIndexes, + currentLineIndexes: reduced.currentLineIndexes } } case 'FETCH_OPCODES_ERROR': { @@ -73,6 +81,16 @@ export const reducer = (state = initialState, action: Action) => { hasError: action.payload } } + case 'FETCH_INDEXES_FOR_NEW_LINE': { + let bottom = state.initialIndex - 10 + bottom = bottom < 0 ? 0 : bottom + return { + ...state, + absoluteCurrentLineIndexes: action.payload.currentLineIndexes, + currentLineIndexes: action.payload.currentLineIndexes.map(index => index - bottom), + line: action.payload.line + } + } default: throw new Error() } From fa3c4f0981a99fa2d8303efff1c1d9876224f5d1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 22 Nov 2022 23:22:33 +0100 Subject: [PATCH 37/97] use lineColumnPos from the cache --- libs/remix-debug/src/debugger/debugger.ts | 2 +- .../src/solidity-decoder/internalCallTree.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/remix-debug/src/debugger/debugger.ts b/libs/remix-debug/src/debugger/debugger.ts index fe15df4051..43c45d8b38 100644 --- a/libs/remix-debug/src/debugger/debugger.ts +++ b/libs/remix-debug/src/debugger/debugger.ts @@ -95,7 +95,7 @@ export class Debugger { sources[genSource.name] = { content: genSource.contents } } } - const lineColumnPos = await this.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, sources, astSources) + const lineColumnPos = rawLocationAndOpcode.lineColumnPos let lineGasCostObj = null try { diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index ef7704b61c..b0f1230be3 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -250,13 +250,12 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation, funct if (stepDetail && nextStepDetail) { stepDetail.gasCost = parseInt(stepDetail.gas as string) - parseInt(nextStepDetail.gas as string) } - tree.locationAndOpcodePerVMTraceIndex[step] = { sourceLocation, stepDetail } - tree.scopes[scopeId].gasCost += stepDetail.gasCost - + // gas per line + let lineColumnPos if (tree.offsetToLineColumnConverter) { try { - const lineColumnPos = await tree.offsetToLineColumnConverter.offsetToLineColumn(validSourceLocation, validSourceLocation.file, tree.solidityProxy.sourcesCode, tree.solidityProxy.sources) + lineColumnPos = await tree.offsetToLineColumnConverter.offsetToLineColumn(validSourceLocation, validSourceLocation.file, tree.solidityProxy.sourcesCode, tree.solidityProxy.sources) if (!tree.gasCostPerLine[validSourceLocation.file]) tree.gasCostPerLine[validSourceLocation.file] = {} if (!tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line]) { tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line] = { @@ -271,6 +270,9 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation, funct } } + tree.locationAndOpcodePerVMTraceIndex[step] = { sourceLocation, stepDetail, lineColumnPos } + tree.scopes[scopeId].gasCost += stepDetail.gasCost + const contractObj = await tree.solidityProxy.contractObjectAtAddress(address) const generatedSources = getGeneratedSources(tree, scopeId, contractObj) const functionDefinition = resolveFunctionDefinition(tree, sourceLocation, generatedSources) From 0ae54674636ad6951c7923e33c804189dcc9a13c Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 23 Nov 2022 09:52:32 +0100 Subject: [PATCH 38/97] fix unit test --- libs/remix-debug/test/decoder/localsTests/int.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-debug/test/decoder/localsTests/int.ts b/libs/remix-debug/test/decoder/localsTests/int.ts index b9ba0ab7f9..f0579ecdb3 100644 --- a/libs/remix-debug/test/decoder/localsTests/int.ts +++ b/libs/remix-debug/test/decoder/localsTests/int.ts @@ -48,7 +48,7 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult, // test gas cost per line st.equals((await callTree.getGasCostPerLine(0, 16)).gasCost, 11) - st.equals((await callTree.getGasCostPerLine(0, 32)).gasCost, 60) + st.equals((await callTree.getGasCostPerLine(0, 32)).gasCost, 84) let functions1 = callTree.retrieveFunctionsStack(102) let functions2 = callTree.retrieveFunctionsStack(115) @@ -58,7 +58,7 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult, st.equals(functions2.length, 2) st.equals(functions3.length, 0) - st.equal(functions1[0].gasCost, 54) + st.equal(functions1[0].gasCost, 55) st.equals(Object.keys(functions1[0])[0], 'functionDefinition') st.equals(Object.keys(functions1[0])[1], 'inputs') From 484caa052e0cfe045bd73931d3ceaba7b89fc471 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 23 Nov 2022 10:26:00 +0100 Subject: [PATCH 39/97] remove uneeded param --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index b0f1230be3..0941be4afc 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -69,7 +69,7 @@ export class InternalCallTree { // each recursive call to buildTree represent a new context (either call, delegatecall, internal function) const calledAddress = traceManager.getCurrentCalledAddressAt(0) const isCreation = isContractCreation(calledAddress) - buildTree(this, 0, '', true, isCreation).then((result) => { + buildTree(this, 0, '', isCreation).then((result) => { if (result.error) { this.event.trigger('callTreeBuildFailed', [result.error]) } else { @@ -192,7 +192,7 @@ export class InternalCallTree { } } -async function buildTree (tree, step, scopeId, isExternalCall, isCreation, functionDefinition?, contractObj?, sourceLocation?) { +async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, contractObj?, sourceLocation?) { let subScope = 1 tree.scopeStarts[step] = scopeId tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } @@ -283,7 +283,7 @@ async function buildTree (tree, step, scopeId, isExternalCall, isCreation, funct if (isInternalTxInstrn || (previousSourceLocation.jump === 'i' && functionDefinition)) { try { const newScopeId = scopeId === '' ? subScope.toString() : scopeId + '.' + subScope - const externalCallResult = await buildTree(tree, step, newScopeId, isInternalTxInstrn, isCreateInstrn, functionDefinition, contractObj, sourceLocation) + const externalCallResult = await buildTree(tree, step, newScopeId, isCreateInstrn, functionDefinition, contractObj, sourceLocation) if (externalCallResult.error) { return { outStep: step, error: 'InternalCallTree - ' + externalCallResult.error } } else { From f5901bc39d5e59bc0d40009205c8b33f4cec5f25 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 23 Nov 2022 11:21:35 +0100 Subject: [PATCH 40/97] fix gas label --- apps/debugger/src/app/debugger-api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 25530b9d0f..007c42de36 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -44,7 +44,7 @@ export const DebuggerApiMixin = (Base) => class extends Base { async highlight (lineColumnPos, path, rawLocation, stepDetail, lineGasCost) { await this.call('editor', 'highlight', lineColumnPos, path, '', { focus: true }) - const label = `${stepDetail.op} costs ${stepDetail.gasCost} gas - this line costs ${lineGasCost} gas - ${stepDetail.gas} total gas left` + const label = `${stepDetail.op} costs ${stepDetail.gasCost} gas - this line costs ${lineGasCost} gas - ${stepDetail.gas} gas left` const linetext: lineText = { content: label, position: lineColumnPos, From 24b1495132c4bae738fc5743873eefae0d32cc6b Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 23 Nov 2022 11:21:49 +0100 Subject: [PATCH 41/97] fix duplicate --- libs/remix-debug/src/debugger/debugger.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/remix-debug/src/debugger/debugger.ts b/libs/remix-debug/src/debugger/debugger.ts index 43c45d8b38..09c8d29185 100644 --- a/libs/remix-debug/src/debugger/debugger.ts +++ b/libs/remix-debug/src/debugger/debugger.ts @@ -115,7 +115,6 @@ export class Debugger { } } else { this.event.trigger('newSourceLocation', [null]) - this.vmDebuggerLogic.event.trigger('lineGasCostChanged', [null]) this.currentFile = -1 this.currentLine = -1 this.vmDebuggerLogic.event.trigger('lineGasCostChanged', [null]) From 0877347a8d5455848b2d83d0ed5e70a12c3baff5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 23 Nov 2022 11:22:13 +0100 Subject: [PATCH 42/97] remove commented code --- .../remix-debug/src/solidity-decoder/internalCallTree.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 0941be4afc..8271c4b1a5 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -335,15 +335,6 @@ async function registerFunctionParameters (tree, functionDefinition, step, scope if (functionDefinition.parameters) { const inputs = functionDefinition.parameters const outputs = functionDefinition.returnParameters - // for (const element of functionDefinition.parameters) { - // if (element.nodeType === 'ParameterList') { - // if (!inputs) inputs = element - // else { - // outputs = element - // break - // } - // } - // } // input params if (inputs && inputs.parameters) { functionDefinitionAndInputs.inputs = addParams(inputs, tree, scopeId, states, contractObj, sourceLocation, stack.length, inputs.parameters.length, -1) From 636a20705e5032422b43c9a212b2f22841a336e7 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 09:42:12 +0100 Subject: [PATCH 43/97] fix tracking constructor paramaters --- .../src/solidity-decoder/internalCallTree.ts | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 8271c4b1a5..4a815e25ab 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -42,6 +42,10 @@ export class InternalCallTree { } gasCostPerLine offsetToLineColumnConverter + pendingConstructorExecutionAt: number + pendingConstructorId: number + pendingConstructor + constructorsStartExecution /** * constructor @@ -109,6 +113,10 @@ export class InternalCallTree { this.astWalker = new AstWalker() this.reducedTrace = [] this.locationAndOpcodePerVMTraceIndex = {} + this.pendingConstructorExecutionAt = -1 + this.pendingConstructorId = -1 + this.constructorsStartExecution = {} + this.pendingConstructor = null } /** @@ -192,7 +200,7 @@ export class InternalCallTree { } } -async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, contractObj?, sourceLocation?) { +async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, contractObj?, sourceLocation?, validSourceLocation?) { let subScope = 1 tree.scopeStarts[step] = scopeId tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } @@ -217,9 +225,9 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, included.file === source.file) } - let currentSourceLocation = { start: -1, length: -1, file: -1, jump: '-' } + let currentSourceLocation = sourceLocation || { start: -1, length: -1, file: -1, jump: '-' } let previousSourceLocation = currentSourceLocation - let previousValidSourceLocation = currentSourceLocation + let previousValidSourceLocation = validSourceLocation || currentSourceLocation while (step < tree.traceManager.trace.length) { let sourceLocation let validSourceLocation @@ -275,15 +283,31 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, const contractObj = await tree.solidityProxy.contractObjectAtAddress(address) const generatedSources = getGeneratedSources(tree, scopeId, contractObj) - const functionDefinition = resolveFunctionDefinition(tree, sourceLocation, generatedSources) + let functionDefinition = resolveFunctionDefinition(tree, sourceLocation, generatedSources) const isInternalTxInstrn = isCallInstruction(stepDetail) const isCreateInstrn = isCreateInstruction(stepDetail) // we are checking if we are jumping in a new CALL or in an internal function - if (isInternalTxInstrn || (previousSourceLocation.jump === 'i' && functionDefinition)) { + + const constructorExecutionStarts = tree.pendingConstructorExecutionAt > -1 && tree.pendingConstructorExecutionAt < validSourceLocation.start + if (functionDefinition && functionDefinition.kind === 'constructor' && tree.pendingConstructorExecutionAt === -1 && !tree.constructorsStartExecution[functionDefinition.id]) { + tree.pendingConstructorExecutionAt = validSourceLocation.start + tree.pendingConstructorId = functionDefinition.id + tree.pendingConstructor = functionDefinition + // from now on we'll be waiting for a change in the source location which will mark the beginning of the constructor execution. + // constructorsStartExecution allows to keep track on which constructor has already been executed. + } + if (constructorExecutionStarts || isInternalTxInstrn || (functionDefinition && previousSourceLocation.jump === 'i')) { try { + if (constructorExecutionStarts) { + tree.constructorsStartExecution[tree.pendingConstructorId] = tree.pendingConstructorExecutionAt + functionDefinition = tree.pendingConstructor + tree.pendingConstructorExecutionAt = -1 + tree.pendingConstructorId = -1 + tree.pendingConstructor = null + } const newScopeId = scopeId === '' ? subScope.toString() : scopeId + '.' + subScope - const externalCallResult = await buildTree(tree, step, newScopeId, isCreateInstrn, functionDefinition, contractObj, sourceLocation) + const externalCallResult = await buildTree(tree, step, newScopeId, isCreateInstrn, functionDefinition, contractObj, sourceLocation, validSourceLocation) if (externalCallResult.error) { return { outStep: step, error: 'InternalCallTree - ' + externalCallResult.error } } else { @@ -328,7 +352,6 @@ async function registerFunctionParameters (tree, functionDefinition, step, scope const functionDefinitionAndInputs = { functionDefinition, inputs: [] } // means: the previous location was a function definition && JUMPDEST // => we are at the beginning of the function and input/output are setup - try { const stack = tree.traceManager.getStackAt(step) const states = tree.solidityProxy.extractStatesDefinitions() From 3f09a954a5aefcaee4811c0cdaf89c8787c869f5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 10:17:39 +0100 Subject: [PATCH 44/97] fix linting --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 4a815e25ab..f47db893ac 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -65,7 +65,7 @@ export class InternalCallTree { this.offsetToLineColumnConverter = offsetToLineColumnConverter this.sourceLocationTracker = new SourceLocationTracker(codeManager, { debugWithGeneratedSources: opts.debugWithGeneratedSources }) debuggerEvent.register('newTraceLoaded', (trace) => { - let time = Date.now() + const time = Date.now() this.reset() if (!this.solidityProxy.loaded()) { this.event.trigger('callTreeBuildFailed', ['compilation result not loaded. Cannot build internal call tree']) From cc2ff24bcc0d856dd0d61937c60469252e91ba5a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 10:18:26 +0100 Subject: [PATCH 45/97] fix decoding function parameters --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 5 +++-- libs/remix-debug/src/solidity-decoder/localDecoder.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index f47db893ac..cd378c665b 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -206,7 +206,7 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } if (functionDefinition) { - await registerFunctionParameters(tree, functionDefinition, step, scopeId, contractObj, sourceLocation) + await registerFunctionParameters(tree, functionDefinition, step, scopeId, contractObj, validSourceLocation) } function callDepthChange (step, trace) { @@ -470,7 +470,8 @@ function addParams (parameterList, tree, scopeId, states, contractObj, sourceLoc type: parseType(param.typeDescriptions.typeString, states, contractName, location), stackDepth: stackDepth, sourceLocation: sourceLocation, - abi: contractObj.contract.abi + abi: contractObj.contract.abi, + isParameter: true } params.push(attributesName) } diff --git a/libs/remix-debug/src/solidity-decoder/localDecoder.ts b/libs/remix-debug/src/solidity-decoder/localDecoder.ts index d333622408..d7619ce12b 100644 --- a/libs/remix-debug/src/solidity-decoder/localDecoder.ts +++ b/libs/remix-debug/src/solidity-decoder/localDecoder.ts @@ -11,7 +11,7 @@ export async function solidityLocals (vmtraceIndex, internalTreeCall, stack, mem let anonymousIncr = 1 for (const local in scope.locals) { const variable = scope.locals[local] - if (variable.stackDepth < stack.length && variable.sourceLocation.start <= currentSourceLocation.start) { + if (variable.stackDepth < stack.length && (variable.sourceLocation.start <= currentSourceLocation.start || variable.isParameter)) { let name = variable.name if (name.indexOf('$') !== -1) { name = '<' + anonymousIncr + '>' From d296de47a481dea7f72b6e5f268b206720719bf2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 10:18:46 +0100 Subject: [PATCH 46/97] fix display constructor in the function stack --- .../debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx index aa195f0038..8b2f706015 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx @@ -31,7 +31,7 @@ export const VmDebuggerHead = ({ vmDebugger: { registerEvent, triggerEvent }, de const functions = [] for (const func of stack) { - functions.push(func.functionDefinition.name + '(' + func.inputs.join(', ') + ')' + ' - ' + func.gasCost + ' gas') + functions.push(func.functionDefinition.name || func.functionDefinition.kind + '(' + func.inputs.join(', ') + ')' + ' - ' + func.gasCost + ' gas') } setFunctionPanel(() => functions) }) From d625d327ac717b90373f10ca3a6148d80957ecf8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 10:50:35 +0100 Subject: [PATCH 47/97] fix test (the constructor is now included) --- libs/remix-debug/test/decoder/localsTests/int.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remix-debug/test/decoder/localsTests/int.ts b/libs/remix-debug/test/decoder/localsTests/int.ts index f0579ecdb3..dfd15263cb 100644 --- a/libs/remix-debug/test/decoder/localsTests/int.ts +++ b/libs/remix-debug/test/decoder/localsTests/int.ts @@ -54,9 +54,9 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult, let functions2 = callTree.retrieveFunctionsStack(115) let functions3 = callTree.retrieveFunctionsStack(13) - st.equals(functions1.length, 1) - st.equals(functions2.length, 2) - st.equals(functions3.length, 0) + st.equals(functions1.length, 2) + st.equals(functions2.length, 3) + st.equals(functions3.length, 1) st.equal(functions1[0].gasCost, 55) From be8a7dd0ca03ef9d5fd6fc286adcc17db2e76251 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 11:40:17 +0100 Subject: [PATCH 48/97] set scope id before hand --- .../src/solidity-decoder/internalCallTree.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index cd378c665b..fe8e2c7101 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -73,7 +73,12 @@ export class InternalCallTree { // each recursive call to buildTree represent a new context (either call, delegatecall, internal function) const calledAddress = traceManager.getCurrentCalledAddressAt(0) const isCreation = isContractCreation(calledAddress) - buildTree(this, 0, '', isCreation).then((result) => { + + const scopeId = 1 + this.scopeStarts[0] = scopeId + this.scopes[scopeId] = { firstStep: 0, locals: {}, isCreation, gasCost: 0 } + + buildTree(this, 0, scopeId, isCreation).then((result) => { if (result.error) { this.event.trigger('callTreeBuildFailed', [result.error]) } else { @@ -202,9 +207,6 @@ export class InternalCallTree { async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, contractObj?, sourceLocation?, validSourceLocation?) { let subScope = 1 - tree.scopeStarts[step] = scopeId - tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } - if (functionDefinition) { await registerFunctionParameters(tree, functionDefinition, step, scopeId, contractObj, validSourceLocation) } @@ -299,15 +301,18 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, } if (constructorExecutionStarts || isInternalTxInstrn || (functionDefinition && previousSourceLocation.jump === 'i')) { try { + const newScopeId = scopeId === '' ? subScope.toString() : scopeId + '.' + subScope + tree.scopeStarts[step + 1] = newScopeId + tree.scopes[newScopeId] = { firstStep: step + 1, locals: {}, isCreation, gasCost: 0 } if (constructorExecutionStarts) { tree.constructorsStartExecution[tree.pendingConstructorId] = tree.pendingConstructorExecutionAt functionDefinition = tree.pendingConstructor tree.pendingConstructorExecutionAt = -1 tree.pendingConstructorId = -1 tree.pendingConstructor = null - } - const newScopeId = scopeId === '' ? subScope.toString() : scopeId + '.' + subScope - const externalCallResult = await buildTree(tree, step, newScopeId, isCreateInstrn, functionDefinition, contractObj, sourceLocation, validSourceLocation) + await registerFunctionParameters(tree, functionDefinition, step + 1, newScopeId, contractObj, validSourceLocation) + } + const externalCallResult = await buildTree(tree, step + 1, newScopeId, isCreateInstrn, functionDefinition, contractObj, sourceLocation, validSourceLocation) if (externalCallResult.error) { return { outStep: step, error: 'InternalCallTree - ' + externalCallResult.error } } else { From c6a146a15d9d505ca1a11f1328a5238494885ea8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 12:01:11 +0100 Subject: [PATCH 49/97] fix tests --- apps/remix-ide-e2e/src/tests/debugger.test.ts | 2 +- .../debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index 9fdd7fb6c2..7e2e43ec96 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -95,7 +95,7 @@ module.exports = { .waitForElementVisible('#stepdetail') .waitForElementVisible({ locateStrategy: 'xpath', - selector: '//*[@data-id="treeViewLivm trace step" and contains(.,"545")]', + selector: '//*[@data-id="treeViewLivm trace step" and contains(.,"546")]', }) .goToVMTraceStep(10) .waitForElementVisible({ diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx index 8b2f706015..669a5cf89c 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx @@ -31,7 +31,7 @@ export const VmDebuggerHead = ({ vmDebugger: { registerEvent, triggerEvent }, de const functions = [] for (const func of stack) { - functions.push(func.functionDefinition.name || func.functionDefinition.kind + '(' + func.inputs.join(', ') + ')' + ' - ' + func.gasCost + ' gas') + functions.push((func.functionDefinition.name || func.functionDefinition.kind) + '(' + func.inputs.join(', ') + ')' + ' - ' + func.gasCost + ' gas') } setFunctionPanel(() => functions) }) From c47023621374394e0cb7e0d51f8368ffb9547e40 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 13:05:28 +0100 Subject: [PATCH 50/97] fix decoding ctor parameters --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index fe8e2c7101..d52b6dc3b0 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -306,11 +306,10 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, tree.scopes[newScopeId] = { firstStep: step + 1, locals: {}, isCreation, gasCost: 0 } if (constructorExecutionStarts) { tree.constructorsStartExecution[tree.pendingConstructorId] = tree.pendingConstructorExecutionAt - functionDefinition = tree.pendingConstructor tree.pendingConstructorExecutionAt = -1 - tree.pendingConstructorId = -1 + tree.pendingConstructorId = -1 + await registerFunctionParameters(tree, tree.pendingConstructor, step, newScopeId, contractObj, previousValidSourceLocation) tree.pendingConstructor = null - await registerFunctionParameters(tree, functionDefinition, step + 1, newScopeId, contractObj, validSourceLocation) } const externalCallResult = await buildTree(tree, step + 1, newScopeId, isCreateInstrn, functionDefinition, contractObj, sourceLocation, validSourceLocation) if (externalCallResult.error) { From d4175eca081093bf334308826dc8eb58558a991e Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 13:14:46 +0100 Subject: [PATCH 51/97] fix linting --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index d52b6dc3b0..0227051833 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -285,7 +285,7 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, const contractObj = await tree.solidityProxy.contractObjectAtAddress(address) const generatedSources = getGeneratedSources(tree, scopeId, contractObj) - let functionDefinition = resolveFunctionDefinition(tree, sourceLocation, generatedSources) + const functionDefinition = resolveFunctionDefinition(tree, sourceLocation, generatedSources) const isInternalTxInstrn = isCallInstruction(stepDetail) const isCreateInstrn = isCreateInstruction(stepDetail) From 60eebb6b147e2d620ef578112d9b25b1674d28d2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 13:28:41 +0100 Subject: [PATCH 52/97] fix test --- apps/remix-ide-e2e/src/tests/debugger.test.ts | 2 +- libs/remix-debug/test/decoder/localsTests/int.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index 7e2e43ec96..9fdd7fb6c2 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -95,7 +95,7 @@ module.exports = { .waitForElementVisible('#stepdetail') .waitForElementVisible({ locateStrategy: 'xpath', - selector: '//*[@data-id="treeViewLivm trace step" and contains(.,"546")]', + selector: '//*[@data-id="treeViewLivm trace step" and contains(.,"545")]', }) .goToVMTraceStep(10) .waitForElementVisible({ diff --git a/libs/remix-debug/test/decoder/localsTests/int.ts b/libs/remix-debug/test/decoder/localsTests/int.ts index dfd15263cb..55aa009d0f 100644 --- a/libs/remix-debug/test/decoder/localsTests/int.ts +++ b/libs/remix-debug/test/decoder/localsTests/int.ts @@ -50,8 +50,8 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult, st.equals((await callTree.getGasCostPerLine(0, 16)).gasCost, 11) st.equals((await callTree.getGasCostPerLine(0, 32)).gasCost, 84) - let functions1 = callTree.retrieveFunctionsStack(102) - let functions2 = callTree.retrieveFunctionsStack(115) + let functions1 = callTree.retrieveFunctionsStack(103) + let functions2 = callTree.retrieveFunctionsStack(116) let functions3 = callTree.retrieveFunctionsStack(13) st.equals(functions1.length, 2) From 5381f679bd83eeacc84b66cc240652000ae539a8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 13:58:21 +0100 Subject: [PATCH 53/97] take in account generated sources during debugging --- apps/remix-ide-e2e/src/tests/debugger.test.ts | 10 +++++----- libs/remix-debug/src/debugger/debugger.ts | 9 +-------- .../src/solidity-decoder/internalCallTree.ts | 12 +++++++++++- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index 9fdd7fb6c2..60408cf1d3 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -97,11 +97,6 @@ module.exports = { locateStrategy: 'xpath', selector: '//*[@data-id="treeViewLivm trace step" and contains(.,"545")]', }) - .goToVMTraceStep(10) - .waitForElementVisible({ - locateStrategy: 'xpath', - selector: '//*[@data-id="treeViewLivm trace step" and contains(.,"10")]', - }) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`constructor (string memory name_, string memory symbol_) { _name = name_; @@ -109,6 +104,11 @@ module.exports = { }`) !== -1, 'current displayed content is not from the ERC20 source code') }) + .goToVMTraceStep(10) + .waitForElementVisible({ + locateStrategy: 'xpath', + selector: '//*[@data-id="treeViewLivm trace step" and contains(.,"10")]', + }) }, 'Should display correct source highlighting while debugging a contract which has ABIEncoderV2 #group2': function (browser: NightwatchBrowser) { diff --git a/libs/remix-debug/src/debugger/debugger.ts b/libs/remix-debug/src/debugger/debugger.ts index 09c8d29185..a96171e196 100644 --- a/libs/remix-debug/src/debugger/debugger.ts +++ b/libs/remix-debug/src/debugger/debugger.ts @@ -87,14 +87,7 @@ export class Debugger { const rawLocation = rawLocationAndOpcode.sourceLocation const stepDetail = rawLocationAndOpcode.stepDetail const generatedSources = this.debugger.callTree.sourceLocationTracker.getGeneratedSourcesFromAddress(address) - const astSources = Object.assign({}, compilationResultForAddress.data.sources) - const sources = Object.assign({}, compilationResultForAddress.source.sources) - if (generatedSources) { - for (const genSource of generatedSources) { - astSources[genSource.name] = { id: genSource.id, ast: genSource.ast } - sources[genSource.name] = { content: genSource.contents } - } - } + const lineColumnPos = rawLocationAndOpcode.lineColumnPos let lineGasCostObj = null diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 0227051833..0e9520ae5d 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -265,7 +265,17 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, let lineColumnPos if (tree.offsetToLineColumnConverter) { try { - lineColumnPos = await tree.offsetToLineColumnConverter.offsetToLineColumn(validSourceLocation, validSourceLocation.file, tree.solidityProxy.sourcesCode, tree.solidityProxy.sources) + const generatedSources = tree.sourceLocationTracker.getGeneratedSourcesFromAddress(address) + const astSources = Object.assign({}, tree.solidityProxy.sources) + const sources = Object.assign({}, tree.solidityProxy.sourcesCode) + if (generatedSources) { + for (const genSource of generatedSources) { + astSources[genSource.name] = { id: genSource.id, ast: genSource.ast } + sources[genSource.name] = { content: genSource.contents } + } + } + + lineColumnPos = await tree.offsetToLineColumnConverter.offsetToLineColumn(validSourceLocation, validSourceLocation.file, sources, astSources) if (!tree.gasCostPerLine[validSourceLocation.file]) tree.gasCostPerLine[validSourceLocation.file] = {} if (!tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line]) { tree.gasCostPerLine[validSourceLocation.file][lineColumnPos.start.line] = { From 254a1905fd62fdb20a369824bfb5744ffc4885bd Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 14:09:11 +0100 Subject: [PATCH 54/97] fix test --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 6a7840c6cd..01d48ef889 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -290,7 +290,7 @@ module.exports = { .waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000) .waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000) .waitForElementVisible('*[data-id="dropdownPanelSolidityLocals"]').pause(1000) - .waitForElementContainsText('*[data-id="solidityLocals"]', 'no locals', 60000) + .waitForElementContainsText('*[data-id="solidityLocals"]', 'No data available', 60000) .goToVMTraceStep(316) .waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000) .waitForElementContainsText('*[data-id="functionPanel"]', 'vote(proposal)', 60000) From 391b08564263c341b69cdf4a44f95a814e931b6f Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 15:33:01 +0100 Subject: [PATCH 55/97] fix scope type --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 0e9520ae5d..652576a188 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -74,7 +74,7 @@ export class InternalCallTree { const calledAddress = traceManager.getCurrentCalledAddressAt(0) const isCreation = isContractCreation(calledAddress) - const scopeId = 1 + const scopeId = '1' this.scopeStarts[0] = scopeId this.scopes[scopeId] = { firstStep: 0, locals: {}, isCreation, gasCost: 0 } From 120897b0fb2777fdbc105c6bc02f538a5bea6230 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 15:33:40 +0100 Subject: [PATCH 56/97] need to replay the step if we are parsing the ctor --- .../src/solidity-decoder/internalCallTree.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 652576a188..673de776a0 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -309,19 +309,22 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, // from now on we'll be waiting for a change in the source location which will mark the beginning of the constructor execution. // constructorsStartExecution allows to keep track on which constructor has already been executed. } - if (constructorExecutionStarts || isInternalTxInstrn || (functionDefinition && previousSourceLocation.jump === 'i')) { + const internalfunctionCall = functionDefinition && previousSourceLocation.jump === 'i' + if (constructorExecutionStarts || isInternalTxInstrn || internalfunctionCall) { try { const newScopeId = scopeId === '' ? subScope.toString() : scopeId + '.' + subScope - tree.scopeStarts[step + 1] = newScopeId - tree.scopes[newScopeId] = { firstStep: step + 1, locals: {}, isCreation, gasCost: 0 } + tree.scopeStarts[step] = newScopeId + tree.scopes[newScopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } + // for the ctor we we are at the start of its trace, we have to replay this step in order to catch all the locals: + let nextStep = constructorExecutionStarts ? step : step + 1 if (constructorExecutionStarts) { tree.constructorsStartExecution[tree.pendingConstructorId] = tree.pendingConstructorExecutionAt tree.pendingConstructorExecutionAt = -1 - tree.pendingConstructorId = -1 + tree.pendingConstructorId = -1 await registerFunctionParameters(tree, tree.pendingConstructor, step, newScopeId, contractObj, previousValidSourceLocation) tree.pendingConstructor = null - } - const externalCallResult = await buildTree(tree, step + 1, newScopeId, isCreateInstrn, functionDefinition, contractObj, sourceLocation, validSourceLocation) + } + const externalCallResult = await buildTree(tree, nextStep, newScopeId, isCreateInstrn, functionDefinition, contractObj, sourceLocation, validSourceLocation) if (externalCallResult.error) { return { outStep: step, error: 'InternalCallTree - ' + externalCallResult.error } } else { From ad152b8c9a8ffb198c338645ac12b00f6b1c461d Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 15:34:00 +0100 Subject: [PATCH 57/97] fix tests --- .../test/decoder/localsTests/int.ts | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/libs/remix-debug/test/decoder/localsTests/int.ts b/libs/remix-debug/test/decoder/localsTests/int.ts index 55aa009d0f..c36a217df3 100644 --- a/libs/remix-debug/test/decoder/localsTests/int.ts +++ b/libs/remix-debug/test/decoder/localsTests/int.ts @@ -58,7 +58,7 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult, st.equals(functions2.length, 3) st.equals(functions3.length, 1) - st.equal(functions1[0].gasCost, 55) + st.equal(functions1[0].gasCost, 54) st.equals(Object.keys(functions1[0])[0], 'functionDefinition') st.equals(Object.keys(functions1[0])[1], 'inputs') @@ -73,34 +73,34 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult, st.equals(functions1[0].functionDefinition.name, 'level11') st.equals(functions2[0].functionDefinition.name, 'level12') st.equals(functions2[1].functionDefinition.name, 'level11') - - st.equals(scopeStarts[0], '') - st.equals(scopeStarts[13], '1') - st.equals(scopeStarts[102], '2') - st.equals(scopeStarts[115], '2.1') - st.equals(scopeStarts[136], '3') - st.equals(scopeStarts[153], '4') - st.equals(scopeStarts[166], '4.1') - st.equals(scopes[''].locals['ui8'].type.typeName, 'uint8') - st.equals(scopes[''].locals['ui16'].type.typeName, 'uint16') - st.equals(scopes[''].locals['ui32'].type.typeName, 'uint32') - st.equals(scopes[''].locals['ui64'].type.typeName, 'uint64') - st.equals(scopes[''].locals['ui128'].type.typeName, 'uint128') - st.equals(scopes[''].locals['ui256'].type.typeName, 'uint256') - st.equals(scopes[''].locals['ui'].type.typeName, 'uint256') - st.equals(scopes[''].locals['i8'].type.typeName, 'int8') - st.equals(scopes[''].locals['i16'].type.typeName, 'int16') - st.equals(scopes[''].locals['i32'].type.typeName, 'int32') - st.equals(scopes[''].locals['i64'].type.typeName, 'int64') - st.equals(scopes[''].locals['i128'].type.typeName, 'int128') - st.equals(scopes[''].locals['i256'].type.typeName, 'int256') - st.equals(scopes[''].locals['i'].type.typeName, 'int256') - st.equals(scopes[''].locals['ishrink'].type.typeName, 'int32') - st.equals(scopes['2'].locals['ui8'].type.typeName, 'uint8') - st.equals(scopes['2.1'].locals['ui81'].type.typeName, 'uint8') - st.equals(scopes['3'].locals['ui81'].type.typeName, 'uint8') - st.equals(scopes['4'].locals['ui8'].type.typeName, 'uint8') - st.equals(scopes['4.1'].locals['ui81'].type.typeName, 'uint8') + + st.equals(scopeStarts[0], '1') + st.equals(scopeStarts[10], '1.1') + st.equals(scopeStarts[102], '1.1.1') + st.equals(scopeStarts[115], '1.1.1.1') + st.equals(scopeStarts[136], '1.1.2') + st.equals(scopeStarts[153], '1.1.3') + st.equals(scopeStarts[166], '1.1.3.1') + st.equals(scopes['1.1'].locals['ui8'].type.typeName, 'uint8') + st.equals(scopes['1.1'].locals['ui16'].type.typeName, 'uint16') + st.equals(scopes['1.1'].locals['ui32'].type.typeName, 'uint32') + st.equals(scopes['1.1'].locals['ui64'].type.typeName, 'uint64') + st.equals(scopes['1.1'].locals['ui128'].type.typeName, 'uint128') + st.equals(scopes['1.1'].locals['ui256'].type.typeName, 'uint256') + st.equals(scopes['1.1'].locals['ui'].type.typeName, 'uint256') + st.equals(scopes['1.1'].locals['i8'].type.typeName, 'int8') + st.equals(scopes['1.1'].locals['i16'].type.typeName, 'int16') + st.equals(scopes['1.1'].locals['i32'].type.typeName, 'int32') + st.equals(scopes['1.1'].locals['i64'].type.typeName, 'int64') + st.equals(scopes['1.1'].locals['i128'].type.typeName, 'int128') + st.equals(scopes['1.1'].locals['i256'].type.typeName, 'int256') + st.equals(scopes['1.1'].locals['i'].type.typeName, 'int256') + st.equals(scopes['1.1'].locals['ishrink'].type.typeName, 'int32') + st.equals(scopes['1.1.1'].locals['ui8'].type.typeName, 'uint8') + st.equals(scopes['1.1.1.1'].locals['ui81'].type.typeName, 'uint8') + st.equals(scopes['1.1.2'].locals['ui81'].type.typeName, 'uint8') + st.equals(scopes['1.1.3'].locals['ui8'].type.typeName, 'uint8') + st.equals(scopes['1.1.3.1'].locals['ui81'].type.typeName, 'uint8') } catch (e) { st.fail(e.message) } From 5589f1bf51367672268d0206e7452dd2a6f6db1d Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 15:42:54 +0100 Subject: [PATCH 58/97] linting --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 673de776a0..ad0e1638f4 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -316,7 +316,7 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, tree.scopeStarts[step] = newScopeId tree.scopes[newScopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } // for the ctor we we are at the start of its trace, we have to replay this step in order to catch all the locals: - let nextStep = constructorExecutionStarts ? step : step + 1 + const nextStep = constructorExecutionStarts ? step : step + 1 if (constructorExecutionStarts) { tree.constructorsStartExecution[tree.pendingConstructorId] = tree.pendingConstructorExecutionAt tree.pendingConstructorExecutionAt = -1 From 94768854be69dac1262488c4720297f27a8e6b16 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 28 Nov 2022 16:29:52 +0530 Subject: [PATCH 59/97] published libs --- libs/remix-analyzer/package.json | 8 ++++---- libs/remix-astwalker/package.json | 6 +++--- libs/remix-debug/package.json | 10 +++++----- libs/remix-lib/package.json | 4 ++-- libs/remix-simulator/package.json | 6 +++--- libs/remix-solidity/package.json | 6 +++--- libs/remix-tests/package.json | 12 ++++++------ libs/remix-url-resolver/package.json | 4 ++-- libs/remix-ws-templates/package.json | 4 ++-- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 8cd88adb79..8d705b625d 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-analyzer", - "version": "0.5.28", + "version": "0.5.29", "description": "Tool to perform static analysis on Solidity smart contracts", "main": "src/index.js", "types": "src/index.d.ts", @@ -22,8 +22,8 @@ "@ethereumjs/block": "^3.5.1", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-astwalker": "^0.0.49", - "@remix-project/remix-lib": "^0.5.19", + "@remix-project/remix-astwalker": "^0.0.50", + "@remix-project/remix-lib": "^0.5.20", "async": "^2.6.2", "ethereumjs-util": "^7.0.10", "ethers": "^5.4.2", @@ -52,5 +52,5 @@ "typescript": "^3.7.5" }, "typings": "src/index.d.ts", - "gitHead": "2cec195f5a3678b17745155536a1714d9b1a5694" + "gitHead": "569f7d53f6f218d99aa8281929b541ab7e00058f" } \ No newline at end of file diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index 8607412bda..04c2b64049 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-astwalker", - "version": "0.0.49", + "version": "0.0.50", "description": "Tool to walk through Solidity AST", "main": "src/index.js", "scripts": { @@ -37,7 +37,7 @@ "@ethereumjs/block": "^3.5.1", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-lib": "^0.5.19", + "@remix-project/remix-lib": "^0.5.20", "@types/tape": "^4.2.33", "async": "^2.6.2", "ethereumjs-util": "^7.0.10", @@ -54,5 +54,5 @@ "tap-spec": "^5.0.0" }, "typings": "src/index.d.ts", - "gitHead": "2cec195f5a3678b17745155536a1714d9b1a5694" + "gitHead": "569f7d53f6f218d99aa8281929b541ab7e00058f" } \ No newline at end of file diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index f36802e182..c2c3c18831 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-debug", - "version": "0.5.19", + "version": "0.5.20", "description": "Tool to debug Ethereum transactions", "contributors": [ { @@ -22,9 +22,9 @@ "@ethereumjs/common": "^2.5.0", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-astwalker": "^0.0.49", - "@remix-project/remix-lib": "^0.5.19", - "@remix-project/remix-simulator": "^0.2.19", + "@remix-project/remix-astwalker": "^0.0.50", + "@remix-project/remix-lib": "^0.5.20", + "@remix-project/remix-simulator": "^0.2.20", "ansi-gray": "^0.1.1", "async": "^2.6.2", "color-support": "^1.1.3", @@ -68,5 +68,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "typings": "src/index.d.ts", - "gitHead": "2cec195f5a3678b17745155536a1714d9b1a5694" + "gitHead": "569f7d53f6f218d99aa8281929b541ab7e00058f" } \ No newline at end of file diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index de16bf37b2..03fffb03d7 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-lib", - "version": "0.5.19", + "version": "0.5.20", "description": "Library to various Remix tools", "contributors": [ { @@ -54,5 +54,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "typings": "src/index.d.ts", - "gitHead": "2cec195f5a3678b17745155536a1714d9b1a5694" + "gitHead": "569f7d53f6f218d99aa8281929b541ab7e00058f" } \ No newline at end of file diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index 185a5ccafb..74ade97b55 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-simulator", - "version": "0.2.19", + "version": "0.2.20", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -18,7 +18,7 @@ "@ethereumjs/common": "^2.5.0", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-lib": "^0.5.19", + "@remix-project/remix-lib": "^0.5.20", "ansi-gray": "^0.1.1", "async": "^3.1.0", "body-parser": "^1.18.2", @@ -67,5 +67,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "typings": "src/index.d.ts", - "gitHead": "2cec195f5a3678b17745155536a1714d9b1a5694" + "gitHead": "569f7d53f6f218d99aa8281929b541ab7e00058f" } \ No newline at end of file diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index 0cba64b655..f58e6f94e0 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-solidity", - "version": "0.5.5", + "version": "0.5.6", "description": "Tool to load and run Solidity compiler", "main": "src/index.js", "types": "src/index.d.ts", @@ -18,7 +18,7 @@ "@ethereumjs/block": "^3.5.1", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-lib": "^0.5.19", + "@remix-project/remix-lib": "^0.5.20", "async": "^2.6.2", "eslint-scope": "^5.0.0", "ethereumjs-util": "^7.0.10", @@ -61,5 +61,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "typings": "src/index.d.ts", - "gitHead": "2cec195f5a3678b17745155536a1714d9b1a5694" + "gitHead": "569f7d53f6f218d99aa8281929b541ab7e00058f" } \ No newline at end of file diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 11996f4ef2..a8ecc9199f 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-tests", - "version": "0.2.19", + "version": "0.2.20", "description": "Tool to test Solidity smart contracts", "main": "src/index.js", "types": "./src/index.d.ts", @@ -40,10 +40,10 @@ "@ethereumjs/common": "^2.5.0", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-lib": "^0.5.19", - "@remix-project/remix-simulator": "^0.2.19", - "@remix-project/remix-solidity": "^0.5.5", - "@remix-project/remix-url-resolver": "^0.0.40", + "@remix-project/remix-lib": "^0.5.20", + "@remix-project/remix-simulator": "^0.2.20", + "@remix-project/remix-solidity": "^0.5.6", + "@remix-project/remix-url-resolver": "^0.0.41", "ansi-gray": "^0.1.1", "async": "^2.6.0", "axios": "1.1.2", @@ -81,5 +81,5 @@ "typescript": "^3.3.1" }, "typings": "src/index.d.ts", - "gitHead": "2cec195f5a3678b17745155536a1714d9b1a5694" + "gitHead": "569f7d53f6f218d99aa8281929b541ab7e00058f" } \ No newline at end of file diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index 7981f78c80..5acac15755 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-url-resolver", - "version": "0.0.40", + "version": "0.0.41", "description": "Solidity import url resolver engine", "main": "src/index.js", "types": "src/index.d.ts", @@ -41,5 +41,5 @@ "typescript": "^3.1.6" }, "typings": "src/index.d.ts", - "gitHead": "2cec195f5a3678b17745155536a1714d9b1a5694" + "gitHead": "569f7d53f6f218d99aa8281929b541ab7e00058f" } \ No newline at end of file diff --git a/libs/remix-ws-templates/package.json b/libs/remix-ws-templates/package.json index b6ee54b787..bb3e274521 100644 --- a/libs/remix-ws-templates/package.json +++ b/libs/remix-ws-templates/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-ws-templates", - "version": "1.0.6", + "version": "1.0.7", "description": "Create a Remix IDE workspace using different templates", "main": "src/index.js", "types": "src/index.d.ts", @@ -27,5 +27,5 @@ "ethers": "^5.4.2", "web3": "^1.5.1" }, - "gitHead": "2cec195f5a3678b17745155536a1714d9b1a5694" + "gitHead": "569f7d53f6f218d99aa8281929b541ab7e00058f" } \ No newline at end of file From f62b5eccab0e907446742d7a50d372e50097ff69 Mon Sep 17 00:00:00 2001 From: Praise Disu Date: Wed, 23 Nov 2022 13:15:15 +0100 Subject: [PATCH 60/97] Ensure platform has document object --- libs/remix-solidity/src/compiler/compiler-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-solidity/src/compiler/compiler-utils.ts b/libs/remix-solidity/src/compiler/compiler-utils.ts index 310cc50f1c..df959df896 100644 --- a/libs/remix-solidity/src/compiler/compiler-utils.ts +++ b/libs/remix-solidity/src/compiler/compiler-utils.ts @@ -52,7 +52,7 @@ export function canUseWorker (selectedVersion) { } function browserSupportWorker () { - return document.location.protocol !== 'file:' && Worker !== undefined + return document ? document.location.protocol !== 'file:' && Worker !== undefined : false } // returns a promise for minixhr From a2d29ed679a69e0c535ce0809825f3b0c977262f Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 28 Nov 2022 09:49:39 +0100 Subject: [PATCH 61/97] fix log to terminal --- .../solidity-unit-testing/src/lib/solidity-unit-testing.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index d92383a02b..c84beaf3ad 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -259,7 +259,7 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d finalLogs = finalLogs + ' ' + formattedLog + '\n' } _paq.push(['trackEvent', 'solidityUnitTesting', 'hardhat', 'console.log']) - testTab.call('terminal', 'log', { type: 'log', value: finalLogs }) + testTab.call('terminal', 'logHtml', { type: 'log', value: finalLogs }) } const discardHighlight = async () => { From 877deb68fe7493d14260e7ff79502b02d67ab075 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 28 Nov 2022 18:56:43 +0530 Subject: [PATCH 62/97] minor text fixes --- apps/remix-ide/src/app/tabs/locales/en-US.js | 2 +- .../workspace/src/lib/components/file-explorer-menu.tsx | 2 +- libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en-US.js b/apps/remix-ide/src/app/tabs/locales/en-US.js index 640ca2736d..8111d21cc2 100644 --- a/apps/remix-ide/src/app/tabs/locales/en-US.js +++ b/apps/remix-ide/src/app/tabs/locales/en-US.js @@ -60,7 +60,7 @@ export default { 'filePanel.compileForNahmii': 'Compile for Nahmii', 'filePanel.createNewFile': 'Create New File', 'filePanel.createNewFolder': 'Create New Folder', - 'filePanel.publishToGist': 'Publish all the current workspace files (only root) to a github gist', + 'filePanel.publishToGist': 'Publish all the current workspace files to a github gist', 'filePanel.uploadFile': 'Load a local file into current workspace', 'filePanel.updateGist': 'Update the current [gist] explorer', diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx index a1a2ec3cf7..cc9f3eae1d 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx @@ -22,7 +22,7 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => { }, { action: 'publishToGist', - title: 'Publish all the current workspace files (only root) to a github gist', + title: 'Publish all the current workspace files to a github gist', icon: 'fab fa-github', placement: 'top-start' }, diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 23c66f31a7..d76f21a1fa 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -264,7 +264,7 @@ export function Workspace () { - + From d5d3e76a17f827ff2e2bd0444085be5dfafcb074 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 28 Nov 2022 14:23:26 +0100 Subject: [PATCH 63/97] fix debugging proxy contract --- apps/remix-ide/src/blockchain/blockchain.js | 6 ++-- .../src/lib/compiler-artefacts.ts | 3 +- .../src/lib/compiler-fetch-and-compile.ts | 28 +++++++++++++++++++ .../src/lib/constants/uups.ts | 6 +++- .../src/lib/openzeppelin-proxy.ts | 2 +- libs/remix-lib/src/util.ts | 8 ++++++ 6 files changed, 46 insertions(+), 7 deletions(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 79d63c1684..3f8b22d751 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -11,7 +11,7 @@ import InjectedProvider from './providers/injected.js' import NodeProvider from './providers/node.js' import { execution, EventManager, helpers } from '@remix-project/remix-lib' import { etherScanLink } from './helper' -import { logBuilder, cancelUpgradeMsg, cancelProxyMsg } from "@remix-ui/helper" +import { logBuilder, cancelUpgradeMsg, cancelProxyMsg, addressToString } from "@remix-ui/helper" const { txFormat, txExecution, typeConversion, txListener: Txlistener, TxRunner, TxRunnerWeb3, txHelper } = execution const { txResultHelper: resultToRemixTx } = helpers const packageJson = require('../../../../package.json') @@ -180,7 +180,7 @@ export class Blockchain extends Plugin { if (networkInfo.name === 'VM') this.config.set('vm/proxy', address) else this.config.set(`${networkInfo.name}/${networkInfo.currentFork}/${networkInfo.id}/proxy`, address) _paq.push(['trackEvent', 'blockchain', 'Deploy With Proxy', 'Proxy deployment successful']) - return this.call('udapp', 'resolveContractAndAddInstance', implementationContractObject, address) + this.call('udapp', 'addInstance', addressToString(address), implementationContractObject.abi, implementationContractObject.name) } this.runTx(args, confirmationCb, continueCb, promptCb, finalCb) @@ -223,7 +223,7 @@ export class Blockchain extends Plugin { return this.call('terminal', 'logHtml', log) } _paq.push(['trackEvent', 'blockchain', 'Upgrade With Proxy', 'Upgrade Successful']) - return this.call('udapp', 'resolveContractAndAddInstance', newImplementationContractObject, proxyAddress) + this.call('udapp', 'addInstance', addressToString(address), newImplementationContractObject.abi, newImplementationContractObject.name) } this.runTx(args, confirmationCb, continueCb, promptCb, finalCb) } diff --git a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts index 0d3ed3202e..6c3752b33d 100644 --- a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts +++ b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts @@ -198,8 +198,7 @@ export class CompilerArtefacts extends Plugin { return this.compilersArtefactsPerFile[file] } - // compilerData is a CompilerAbstract object - addResolvedContract (address, compilerData) { + addResolvedContract (address: string, compilerData: CompilerAbstract) { this.compilersArtefacts[address] = compilerData } diff --git a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts index 3d5910d377..6aa8535a47 100644 --- a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts +++ b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts @@ -4,6 +4,7 @@ import { util } from '@remix-project/remix-lib' import { toChecksumAddress } from 'ethereumjs-util' import { fetchContractFromEtherscan } from './helpers/fetch-etherscan' import { fetchContractFromSourcify } from './helpers/fetch-sourcify' +import { UUPSDeployedByteCode, UUPSCompilerVersion } from './constants/uups' const profile = { name: 'fetchAndCompile', @@ -48,6 +49,33 @@ export class FetchAndCompile extends Plugin { if (resolved) return resolved if (this.unresolvedAddresses.includes(contractAddress)) return localCompilation() + if (codeAtAddress === '0x' + UUPSDeployedByteCode) { // proxy + const settings = { + version: UUPSCompilerVersion, + language: 'Solidity', + evmVersion: null, + optimize: false, + runs: 0 + } + const compilationTargets = { + 'proxy.sol': { content: 'import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/proxy/ERC1967/ERC1967Proxy.sol";' } + } + const compData = await compile( + compilationTargets, + settings, + async (url, cb) => { + // we first try to resolve the content from the compilation target using a more appropiate path + const path = `${targetPath}/${url}` + if (compilationTargets[path] && compilationTargets[path].content) { + return cb(null, compilationTargets[path].content) + } else { + await this.call('contentImport', 'resolveAndSave', url).then((result) => cb(null, result)).catch((error) => cb(error.message)) + } + }) + await this.call('compilerArtefacts', 'addResolvedContract', contractAddress, compData) + return compData + } + // sometimes when doing an internal call, the only available artifact is the Solidity interface. // resolving addresses of internal call would allow to step over the source code, even if the declaration was made using an Interface. diff --git a/libs/remix-core-plugin/src/lib/constants/uups.ts b/libs/remix-core-plugin/src/lib/constants/uups.ts index e161929f01..5b21e7ed00 100644 --- a/libs/remix-core-plugin/src/lib/constants/uups.ts +++ b/libs/remix-core-plugin/src/lib/constants/uups.ts @@ -1,5 +1,9 @@ export const UUPS = 'UUPSUpgradeable' -export const UUPSBytecode = '608060405260405162000d8638038062000d86833981810160405281019062000029919062000467565b60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd60001c6200005b9190620006a5565b60001b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b146200009357620000926200078a565b5b620000a782826000620000af60201b60201c565b5050620008f4565b620000c083620000f260201b60201c565b600082511180620000ce5750805b15620000ed57620000eb83836200014960201b620000371760201c565b505b505050565b62000103816200017f60201b60201c565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b606062000177838360405180606001604052806027815260200162000d5f602791396200025560201b60201c565b905092915050565b62000195816200033960201b620000641760201c565b620001d7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001ce90620005d0565b60405180910390fd5b80620002117f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b6200035c60201b620000871760201c565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606062000268846200033960201b60201c565b620002aa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a190620005f2565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051620002d4919062000593565b600060405180830381855af49150503d806000811462000311576040519150601f19603f3d011682016040523d82523d6000602084013e62000316565b606091505b50915091506200032e8282866200036660201b60201c565b925050509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000819050919050565b606083156200037857829050620003cb565b6000835111156200038c5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003c29190620005ac565b60405180910390fd5b9392505050565b6000620003e9620003e3846200063d565b62000614565b9050828152602081018484840111156200040857620004076200081c565b5b620004158482856200071e565b509392505050565b6000815190506200042e81620008da565b92915050565b600082601f8301126200044c576200044b62000817565b5b81516200045e848260208601620003d2565b91505092915050565b6000806040838503121562000481576200048062000826565b5b600062000491858286016200041d565b925050602083015167ffffffffffffffff811115620004b557620004b462000821565b5b620004c38582860162000434565b9150509250929050565b6000620004da8262000673565b620004e6818562000689565b9350620004f88185602086016200071e565b80840191505092915050565b600062000511826200067e565b6200051d818562000694565b93506200052f8185602086016200071e565b6200053a816200082b565b840191505092915050565b600062000554602d8362000694565b915062000561826200083c565b604082019050919050565b60006200057b60268362000694565b915062000588826200088b565b604082019050919050565b6000620005a18284620004cd565b915081905092915050565b60006020820190508181036000830152620005c8818462000504565b905092915050565b60006020820190508181036000830152620005eb8162000545565b9050919050565b600060208201905081810360008301526200060d816200056c565b9050919050565b60006200062062000633565b90506200062e828262000754565b919050565b6000604051905090565b600067ffffffffffffffff8211156200065b576200065a620007e8565b5b62000666826200082b565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000620006b28262000714565b9150620006bf8362000714565b925082821015620006d557620006d4620007b9565b5b828203905092915050565b6000620006ed82620006f4565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156200073e57808201518184015260208101905062000721565b838111156200074e576000848401525b50505050565b6200075f826200082b565b810181811067ffffffffffffffff82111715620007815762000780620007e8565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b620008e581620006e0565b8114620008f157600080fd5b50565b61045b80620009046000396000f3fe6080604052366100135761001161001d565b005b61001b61001d565b005b610025610091565b610035610030610093565b6100a2565b565b606061005c83836040518060600160405280602781526020016103ff602791396100c8565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000819050919050565b565b600061009d610195565b905090565b3660008037600080366000845af43d6000803e80600081146100c3573d6000f35b3d6000fd5b60606100d384610064565b610112576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161010990610319565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff168560405161013a91906102e0565b600060405180830381855af49150503d8060008114610175576040519150601f19603f3d011682016040523d82523d6000602084013e61017a565b606091505b509150915061018a8282866101ec565b925050509392505050565b60006101c37f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b610087565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606083156101fc5782905061024c565b60008351111561020f5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024391906102f7565b60405180910390fd5b9392505050565b600061025e82610339565b610268818561034f565b935061027881856020860161036b565b80840191505092915050565b600061028f82610344565b610299818561035a565b93506102a981856020860161036b565b6102b28161039e565b840191505092915050565b60006102ca60268361035a565b91506102d5826103af565b604082019050919050565b60006102ec8284610253565b915081905092915050565b600060208201905081810360008301526103118184610284565b905092915050565b60006020820190508181036000830152610332816102bd565b9050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60005b8381101561038957808201518184015260208101905061036e565b83811115610398576000848401525b50505050565b6000601f19601f8301169050919050565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e7472616374000000000000000000000000000000000000000000000000000060208201525056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201fbb70b81fbc37a0d465e50bdaf6c661d6411918ae96ccedacef32b393f9533964736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564' +// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/proxy/ERC1967/ERC1967Proxy.sol +// solidity 0.8.7 +export const UUPSBytecode = '608060405260405162000c6638038062000c6683398181016040528101906200002991906200041e565b6200003d828260006200004560201b60201c565b5050620007e2565b62000056836200008860201b60201c565b600082511180620000645750805b156200008357620000818383620000df60201b620000371760201c565b505b505050565b62000099816200011560201b60201c565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60606200010d838360405180606001604052806027815260200162000c3f60279139620001eb60201b60201c565b905092915050565b6200012b816200027d60201b620000641760201c565b6200016d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001649062000587565b60405180910390fd5b80620001a77f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b620002a060201b620000871760201c565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516200021791906200054a565b600060405180830381855af49150503d806000811462000254576040519150601f19603f3d011682016040523d82523d6000602084013e62000259565b606091505b50915091506200027286838387620002aa60201b60201c565b925050509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000819050919050565b606083156200031b576000835114156200031257620002cf856200027d60201b60201c565b62000311576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200030890620005a9565b60405180910390fd5b5b8290506200032e565b6200032d83836200033660201b60201c565b5b949350505050565b6000825111156200034a5781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000380919062000563565b60405180910390fd5b6000620003a06200039a84620005f4565b620005cb565b905082815260208101848484011115620003bf57620003be62000730565b5b620003cc84828562000690565b509392505050565b600081519050620003e581620007c8565b92915050565b600082601f8301126200040357620004026200072b565b5b81516200041584826020860162000389565b91505092915050565b600080604083850312156200043857620004376200073a565b5b60006200044885828601620003d4565b925050602083015167ffffffffffffffff8111156200046c576200046b62000735565b5b6200047a85828601620003eb565b9150509250929050565b600062000491826200062a565b6200049d818562000640565b9350620004af81856020860162000690565b80840191505092915050565b6000620004c88262000635565b620004d481856200064b565b9350620004e681856020860162000690565b620004f1816200073f565b840191505092915050565b60006200050b602d836200064b565b9150620005188262000750565b604082019050919050565b600062000532601d836200064b565b91506200053f826200079f565b602082019050919050565b600062000558828462000484565b915081905092915050565b600060208201905081810360008301526200057f8184620004bb565b905092915050565b60006020820190508181036000830152620005a281620004fc565b9050919050565b60006020820190508181036000830152620005c48162000523565b9050919050565b6000620005d7620005ea565b9050620005e58282620006c6565b919050565b6000604051905090565b600067ffffffffffffffff821115620006125762000611620006fc565b5b6200061d826200073f565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000620006698262000670565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60005b83811015620006b057808201518184015260208101905062000693565b83811115620006c0576000848401525b50505050565b620006d1826200073f565b810181811067ffffffffffffffff82111715620006f357620006f2620006fc565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b620007d3816200065c565b8114620007df57600080fd5b50565b61044d80620007f26000396000f3fe6080604052366100135761001161001d565b005b61001b61001d565b005b610025610091565b610035610030610093565b6100a2565b565b606061005c83836040518060600160405280602781526020016103f1602791396100c8565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000819050919050565b565b600061009d61014e565b905090565b3660008037600080366000845af43d6000803e80600081146100c3573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516100f291906102f8565b600060405180830381855af49150503d806000811461012d576040519150601f19603f3d011682016040523d82523d6000602084013e610132565b606091505b5091509150610143868383876101a5565b925050509392505050565b600061017c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b610087565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060831561020857600083511415610200576101c085610064565b6101ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f690610331565b60405180910390fd5b5b829050610213565b610212838361021b565b5b949350505050565b60008251111561022e5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610262919061030f565b60405180910390fd5b600061027682610351565b6102808185610367565b9350610290818560208601610383565b80840191505092915050565b60006102a78261035c565b6102b18185610372565b93506102c1818560208601610383565b6102ca816103b6565b840191505092915050565b60006102e2601d83610372565b91506102ed826103c7565b602082019050919050565b6000610304828461026b565b915081905092915050565b60006020820190508181036000830152610329818461029c565b905092915050565b6000602082019050818103600083015261034a816102d5565b9050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60005b838110156103a1578082015181840152602081019050610386565b838111156103b0576000848401525b50505050565b6000601f19601f8301169050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060008201525056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122055b27d4c39ab82b8890fc1565c3858a1b7f1e0f5780871061f908d7503dcf94e64736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564' +export const UUPSDeployedByteCode = '6080604052366100135761001161001d565b005b61001b61001d565b005b610025610091565b610035610030610093565b6100a2565b565b606061005c83836040518060600160405280602781526020016103f1602791396100c8565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000819050919050565b565b600061009d61014e565b905090565b3660008037600080366000845af43d6000803e80600081146100c3573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516100f291906102f8565b600060405180830381855af49150503d806000811461012d576040519150601f19603f3d011682016040523d82523d6000602084013e610132565b606091505b5091509150610143868383876101a5565b925050509392505050565b600061017c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b610087565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060831561020857600083511415610200576101c085610064565b6101ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f690610331565b60405180910390fd5b5b829050610213565b610212838361021b565b5b949350505050565b60008251111561022e5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610262919061030f565b60405180910390fd5b600061027682610351565b6102808185610367565b9350610290818560208601610383565b80840191505092915050565b60006102a78261035c565b6102b18185610372565b93506102c1818560208601610383565b6102ca816103b6565b840191505092915050565b60006102e2601d83610372565b91506102ed826103c7565b602082019050919050565b6000610304828461026b565b915081905092915050565b60006020820190508181036000830152610329818461029c565b905092915050565b6000602082019050818103600083015261034a816102d5565b9050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60005b838110156103a1578082015181840152602081019050610386565b838111156103b0576000848401525b50505050565b6000601f19601f8301169050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060008201525056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122055b27d4c39ab82b8890fc1565c3858a1b7f1e0f5780871061f908d7503dcf94e64736f6c63430008070033' +export const UUPSCompilerVersion = 'soljson-v0.8.7+commit.e28d00a7.js' export const UUPSABI = [ { "inputs": [ diff --git a/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts b/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts index 879351c58f..9caa46e441 100644 --- a/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts +++ b/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts @@ -119,4 +119,4 @@ export class OpenZeppelinProxy extends Plugin { newImplementationContractObject.name = proxyName this.blockchain.upgradeProxy(proxyAddress, newImplAddress, data, newImplementationContractObject) } -} +} \ No newline at end of file diff --git a/libs/remix-lib/src/util.ts b/libs/remix-lib/src/util.ts index 040f0736bf..6302ad1d98 100644 --- a/libs/remix-lib/src/util.ts +++ b/libs/remix-lib/src/util.ts @@ -239,6 +239,10 @@ export function compareByteCode (code1, code2) { code2 = replaceLibReference(code2, pos) code1 = replaceLibReference(code1, pos) } + + code1 = removeImmutableReference(code1) + code2 = removeImmutableReference(code2) + code1 = extractinputParameters(code1) code1 = extractSwarmHash(code1) code1 = extractcborMetadata(code1) @@ -276,6 +280,10 @@ function replaceLibReference (code, pos) { return code.substring(0, pos) + '0000000000000000000000000000000000000000' + code.substring(pos + 40) } +function removeImmutableReference (code) { + return code.replace(/7f([0-9a-f]{64})73/g, '') +} + function findCallInternal (index, rootCall, callsPath) { const calls = Object.keys(rootCall.calls) const ret = rootCall From a542fe661a9775b43fb4eadd173c0c6ddb1b0651 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 29 Nov 2022 11:07:23 +0100 Subject: [PATCH 64/97] add test --- libs/remix-lib/src/util.ts | 25 ++++++++++++++++++++----- libs/remix-lib/test/util.ts | 8 ++++++-- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/libs/remix-lib/src/util.ts b/libs/remix-lib/src/util.ts index 6302ad1d98..9f835eb8c8 100644 --- a/libs/remix-lib/src/util.ts +++ b/libs/remix-lib/src/util.ts @@ -240,9 +240,7 @@ export function compareByteCode (code1, code2) { code1 = replaceLibReference(code1, pos) } - code1 = removeImmutableReference(code1) - code2 = removeImmutableReference(code2) - + code1 = removeImmutableReference(code1, code2) code1 = extractinputParameters(code1) code1 = extractSwarmHash(code1) code1 = extractcborMetadata(code1) @@ -280,8 +278,25 @@ function replaceLibReference (code, pos) { return code.substring(0, pos) + '0000000000000000000000000000000000000000' + code.substring(pos + 40) } -function removeImmutableReference (code) { - return code.replace(/7f([0-9a-f]{64})73/g, '') +function removeByIndex (code, index, length, emptyRef) { + if (!code) return code + return code.slice(0, index) + emptyRef + code.slice(index + length) +} + +function removeImmutableReference (code1, code2) { + try { + const refOccurence = code2.match(/7f000000000000000000000000000000000000000000000000000000000000000073/g) + if (!refOccurence) return code1 + let offset = 0 + refOccurence.map((value) => { + offset = code2.indexOf(value, offset) + code1 = removeByIndex(code1, offset, value.length, '7f000000000000000000000000000000000000000000000000000000000000000073') + offset = offset + 1 + }) + } catch (e) { + console.log('error removeImmutableReference', e) + } + return code1 } function findCallInternal (index, rootCall, callsPath) { diff --git a/libs/remix-lib/test/util.ts b/libs/remix-lib/test/util.ts index 6035c4b134..e19674a645 100644 --- a/libs/remix-lib/test/util.ts +++ b/libs/remix-lib/test/util.ts @@ -72,7 +72,7 @@ tape('util.escapeRegExp', function (t) { }) tape('util.compareByteCode', function (t) { - t.plan(4) + t.plan(5) const address = 'c2a9cef5420203c2672f0e4325cca774893cca98' const nullAddress = '0000000000000000000000000000000000000000' @@ -90,7 +90,11 @@ tape('util.compareByteCode', function (t) { t.ok(!util.compareByteCode(sampleERC721, ERC721), 'should not match') - + + const immutableRef1 = '0x6080604052600436106101145760003560e01c806352d1902d116100a057806395d89b411161006457806395d89b4114610380578063a457c2d7146103ab578063a9059cbb146103e8578063dd62ed3e14610425578063f2fde38b1461046257610114565b806352d1902d146102bf57806370a08231146102ea578063715018a6146103275780638129fc1c1461033e5780638da5cb5b1461035557610114565b8063313ce567116100e7578063313ce567146101e95780633659cfe614610214578063395093511461023d57806340c10f191461027a5780634f1ef286146102a357610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac575b600080fd5b34801561012557600080fd5b5061012e61048b565b60405161013b919061228a565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190611e3d565b61051d565b6040516101789190612239565b60405180910390f35b34801561018d57600080fd5b50610196610540565b6040516101a3919061250c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190611d8e565b61054a565b6040516101e09190612239565b60405180910390f35b3480156101f557600080fd5b506101fe610579565b60405161020b9190612527565b60405180910390f35b34801561022057600080fd5b5061023b60048036038101906102369190611d21565b610582565b005b34801561024957600080fd5b50610264600480360381019061025f9190611e3d565b61070b565b6040516102719190612239565b60405180910390f35b34801561028657600080fd5b506102a1600480360381019061029c9190611e3d565b610742565b005b6102bd60048036038101906102b89190611de1565b610758565b005b3480156102cb57600080fd5b506102d4610895565b6040516102e19190612254565b60405180910390f35b3480156102f657600080fd5b50610311600480360381019061030c9190611d21565b61094e565b60405161031e919061250c565b60405180910390f35b34801561033357600080fd5b5061033c610997565b005b34801561034a57600080fd5b506103536109ab565b005b34801561036157600080fd5b5061036a610b65565b604051610377919061221e565b60405180910390f35b34801561038c57600080fd5b50610395610b8f565b6040516103a2919061228a565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd9190611e3d565b610c21565b6040516103df9190612239565b60405180910390f35b3480156103f457600080fd5b5061040f600480360381019061040a9190611e3d565b610c98565b60405161041c9190612239565b60405180910390f35b34801561043157600080fd5b5061044c60048036038101906104479190611d4e565b610cbb565b604051610459919061250c565b60405180910390f35b34801561046e57600080fd5b5061048960048036038101906104849190611d21565b610d42565b005b60606036805461049a906126d3565b80601f01602080910402602001604051908101604052809291908181526020018280546104c6906126d3565b80156105135780601f106104e857610100808354040283529160200191610513565b820191906000526020600020905b8154815290600101906020018083116104f657829003601f168201915b5050505050905090565b600080610528610dc6565b9050610535818585610dce565b600191505092915050565b6000603554905090565b600080610555610dc6565b9050610562858285610f99565b61056d858585611025565b60019150509392505050565b60006012905090565b7f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610611576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106089061230c565b60405180910390fd5b7f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff166106506112a0565b73ffffffffffffffffffffffffffffffffffffffff16146106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d9061236c565b60405180910390fd5b6106af816112f7565b61070881600067ffffffffffffffff8111156106ce576106cd612794565b5b6040519080825280601f01601f1916602001820160405280156107005781602001600182028036833780820191505090505b506000611302565b50565b600080610716610dc6565b90506107378185856107288589610cbb565b61073291906125ca565b610dce565b600191505092915050565b61074a61147f565b61075482826114fd565b5050565b7f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de9061230c565b60405180910390fd5b7f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff166108266112a0565b73ffffffffffffffffffffffffffffffffffffffff161461087c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108739061236c565b60405180910390fd5b610885826112f7565b61089182826001611302565b5050565b60007f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c9061238c565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b6000603360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099f61147f565b6109a96000611655565b565b60008060019054906101000a900460ff161590508080156109dc5750600160008054906101000a900460ff1660ff16105b80610a0957506109eb3061171b565b158015610a085750600160008054906101000a900460ff1660ff16145b5b610a48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3f906123cc565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610a85576001600060016101000a81548160ff0219169083151502179055505b610af96040518060400160405280600781526020017f4d79546f6b656e000000000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f4d544b000000000000000000000000000000000000000000000000000000000081525061173e565b610b0161179b565b610b096117f4565b8015610b625760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610b59919061226f565b60405180910390a15b50565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060378054610b9e906126d3565b80601f0160208091040260200160405190810160405280929190818152602001828054610bca906126d3565b8015610c175780601f10610bec57610100808354040283529160200191610c17565b820191906000526020600020905b815481529060010190602001808311610bfa57829003601f168201915b5050505050905090565b600080610c2c610dc6565b90506000610c3a8286610cbb565b905083811015610c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c76906124cc565b60405180910390fd5b610c8c8286868403610dce565b60019250505092915050565b600080610ca3610dc6565b9050610cb0818585611025565b600191505092915050565b6000603460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d4a61147f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610dba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db1906122cc565b60405180910390fd5b610dc381611655565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e359061248c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea5906122ec565b60405180910390fd5b80603460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f8c919061250c565b60405180910390a3505050565b6000610fa58484610cbb565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461101f5781811015611011576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110089061232c565b60405180910390fd5b61101e8484848403610dce565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611095576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108c9061246c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611105576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fc906122ac565b60405180910390fd5b611110838383611845565b6000603360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118e9061234c565b60405180910390fd5b818103603360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081603360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611287919061250c565b60405180910390a361129a84848461184a565b50505050565b60006112ce7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61184f565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6112ff61147f565b50565b61132e7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b611859565b60000160009054906101000a900460ff16156113525761134d83611863565b61147a565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561139857600080fd5b505afa9250505080156113c957506040513d601f19601f820116820180604052508101906113c69190611e7d565b60015b611408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ff906123ec565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b811461146d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611464906123ac565b60405180910390fd5b5061147983838361191c565b5b505050565b611487610dc6565b73ffffffffffffffffffffffffffffffffffffffff166114a5610b65565b73ffffffffffffffffffffffffffffffffffffffff16146114fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f29061242c565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561156d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611564906124ec565b60405180910390fd5b61157960008383611845565b806035600082825461158b91906125ca565b9250508190555080603360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161163d919061250c565b60405180910390a36116516000838361184a565b5050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1661178d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611784906124ac565b60405180910390fd5b6117978282611948565b5050565b600060019054906101000a900460ff166117ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e1906124ac565b60405180910390fd5b6117f26119c9565b565b600060019054906101000a900460ff16611843576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183a906124ac565b60405180910390fd5b565b505050565b505050565b6000819050919050565b6000819050919050565b61186c8161171b565b6118ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a29061240c565b60405180910390fd5b806118d87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61184f565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61192583611a2a565b6000825111806119325750805b15611943576119418383611a79565b505b505050565b600060019054906101000a900460ff16611997576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198e906124ac565b60405180910390fd5b81603690805190602001906119ad929190611bcf565b5080603790805190602001906119c4929190611bcf565b505050565b600060019054906101000a900460ff16611a18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0f906124ac565b60405180910390fd5b611a28611a23610dc6565b611655565b565b611a3381611863565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6060611a848361171b565b611ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aba9061244c565b60405180910390fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1684604051611aeb9190612207565b600060405180830381855af49150503d8060008114611b26576040519150601f19603f3d011682016040523d82523d6000602084013e611b2b565b606091505b5091509150611b538282604051806060016040528060278152602001612d9960279139611b5d565b9250505092915050565b60608315611b6d57829050611b78565b611b778383611b7f565b5b9392505050565b600082511115611b925781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc6919061228a565b60405180910390fd5b828054611bdb906126d3565b90600052602060002090601f016020900481019282611bfd5760008555611c44565b82601f10611c1657805160ff1916838001178555611c44565b82800160010185558215611c44579182015b82811115611c43578251825591602001919060010190611c28565b5b509050611c519190611c55565b5090565b5b80821115611c6e576000816000905550600101611c56565b5090565b6000611c85611c8084612567565b612542565b905082815260208101848484011115611ca157611ca06127c8565b5b611cac848285612691565b509392505050565b600081359050611cc381612d53565b92915050565b600081519050611cd881612d6a565b92915050565b600082601f830112611cf357611cf26127c3565b5b8135611d03848260208601611c72565b91505092915050565b600081359050611d1b81612d81565b92915050565b600060208284031215611d3757611d366127d2565b5b6000611d4584828501611cb4565b91505092915050565b60008060408385031215611d6557611d646127d2565b5b6000611d7385828601611cb4565b9250506020611d8485828601611cb4565b9150509250929050565b600080600060608486031215611da757611da66127d2565b5b6000611db586828701611cb4565b9350506020611dc686828701611cb4565b9250506040611dd786828701611d0c565b9150509250925092565b60008060408385031215611df857611df76127d2565b5b6000611e0685828601611cb4565b925050602083013567ffffffffffffffff811115611e2757611e266127cd565b5b611e3385828601611cde565b9150509250929050565b60008060408385031215611e5457611e536127d2565b5b6000611e6285828601611cb4565b9250506020611e7385828601611d0c565b9150509250929050565b600060208284031215611e9357611e926127d2565b5b6000611ea184828501611cc9565b91505092915050565b611eb381612620565b82525050565b611ec281612632565b82525050565b611ed18161263e565b82525050565b6000611ee282612598565b611eec81856125ae565b9350611efc8185602086016126a0565b80840191505092915050565b611f118161267f565b82525050565b6000611f22826125a3565b611f2c81856125b9565b9350611f3c8185602086016126a0565b611f45816127d7565b840191505092915050565b6000611f5d6023836125b9565b9150611f68826127e8565b604082019050919050565b6000611f806026836125b9565b9150611f8b82612837565b604082019050919050565b6000611fa36022836125b9565b9150611fae82612886565b604082019050919050565b6000611fc6602c836125b9565b9150611fd1826128d5565b604082019050919050565b6000611fe9601d836125b9565b9150611ff482612924565b602082019050919050565b600061200c6026836125b9565b91506120178261294d565b604082019050919050565b600061202f602c836125b9565b915061203a8261299c565b604082019050919050565b60006120526038836125b9565b915061205d826129eb565b604082019050919050565b60006120756029836125b9565b915061208082612a3a565b604082019050919050565b6000612098602e836125b9565b91506120a382612a89565b604082019050919050565b60006120bb602e836125b9565b91506120c682612ad8565b604082019050919050565b60006120de602d836125b9565b91506120e982612b27565b604082019050919050565b60006121016020836125b9565b915061210c82612b76565b602082019050919050565b60006121246026836125b9565b915061212f82612b9f565b604082019050919050565b60006121476025836125b9565b915061215282612bee565b604082019050919050565b600061216a6024836125b9565b915061217582612c3d565b604082019050919050565b600061218d602b836125b9565b915061219882612c8c565b604082019050919050565b60006121b06025836125b9565b91506121bb82612cdb565b604082019050919050565b60006121d3601f836125b9565b91506121de82612d2a565b602082019050919050565b6121f281612668565b82525050565b61220181612672565b82525050565b60006122138284611ed7565b915081905092915050565b60006020820190506122336000830184611eaa565b92915050565b600060208201905061224e6000830184611eb9565b92915050565b60006020820190506122696000830184611ec8565b92915050565b60006020820190506122846000830184611f08565b92915050565b600060208201905081810360008301526122a48184611f17565b905092915050565b600060208201905081810360008301526122c581611f50565b9050919050565b600060208201905081810360008301526122e581611f73565b9050919050565b6000602082019050818103600083015261230581611f96565b9050919050565b6000602082019050818103600083015261232581611fb9565b9050919050565b6000602082019050818103600083015261234581611fdc565b9050919050565b6000602082019050818103600083015261236581611fff565b9050919050565b6000602082019050818103600083015261238581612022565b9050919050565b600060208201905081810360008301526123a581612045565b9050919050565b600060208201905081810360008301526123c581612068565b9050919050565b600060208201905081810360008301526123e58161208b565b9050919050565b60006020820190508181036000830152612405816120ae565b9050919050565b60006020820190508181036000830152612425816120d1565b9050919050565b60006020820190508181036000830152612445816120f4565b9050919050565b6000602082019050818103600083015261246581612117565b9050919050565b600060208201905081810360008301526124858161213a565b9050919050565b600060208201905081810360008301526124a58161215d565b9050919050565b600060208201905081810360008301526124c581612180565b9050919050565b600060208201905081810360008301526124e5816121a3565b9050919050565b60006020820190508181036000830152612505816121c6565b9050919050565b600060208201905061252160008301846121e9565b92915050565b600060208201905061253c60008301846121f8565b92915050565b600061254c61255d565b90506125588282612705565b919050565b6000604051905090565b600067ffffffffffffffff82111561258257612581612794565b5b61258b826127d7565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006125d582612668565b91506125e083612668565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561261557612614612736565b5b828201905092915050565b600061262b82612648565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061268a82612672565b9050919050565b82818337600083830152505050565b60005b838110156126be5780820151818401526020810190506126a3565b838111156126cd576000848401525b50505050565b600060028204905060018216806126eb57607f821691505b602082108114156126ff576126fe612765565b5b50919050565b61270e826127d7565b810181811067ffffffffffffffff8211171561272d5761272c612794565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b7f555550535570677261646561626c653a206d757374206e6f742062652063616c60008201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000602082015250565b7f45524331393637557067726164653a20756e737570706f727465642070726f7860008201527f6961626c65555549440000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f45524331393637557067726164653a206e657720696d706c656d656e7461746960008201527f6f6e206973206e6f742055555053000000000000000000000000000000000000602082015250565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b612d5c81612620565b8114612d6757600080fd5b50565b612d738161263e565b8114612d7e57600080fd5b50565b612d8a81612668565b8114612d9557600080fd5b5056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122066b4ca7b81ce7dbc6af77b0a062c617f3c53c6ec81d80662160ff3cdcd358a8064736f6c63430008070033' + const immutableRef2 = '0x6080604052600436106101145760003560e01c806352d1902d116100a057806395d89b411161006457806395d89b4114610380578063a457c2d7146103ab578063a9059cbb146103e8578063dd62ed3e14610425578063f2fde38b1461046257610114565b806352d1902d146102bf57806370a08231146102ea578063715018a6146103275780638129fc1c1461033e5780638da5cb5b1461035557610114565b8063313ce567116100e7578063313ce567146101e95780633659cfe614610214578063395093511461023d57806340c10f191461027a5780634f1ef286146102a357610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac575b600080fd5b34801561012557600080fd5b5061012e61048b565b60405161013b919061228a565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190611e3d565b61051d565b6040516101789190612239565b60405180910390f35b34801561018d57600080fd5b50610196610540565b6040516101a3919061250c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190611d8e565b61054a565b6040516101e09190612239565b60405180910390f35b3480156101f557600080fd5b506101fe610579565b60405161020b9190612527565b60405180910390f35b34801561022057600080fd5b5061023b60048036038101906102369190611d21565b610582565b005b34801561024957600080fd5b50610264600480360381019061025f9190611e3d565b61070b565b6040516102719190612239565b60405180910390f35b34801561028657600080fd5b506102a1600480360381019061029c9190611e3d565b610742565b005b6102bd60048036038101906102b89190611de1565b610758565b005b3480156102cb57600080fd5b506102d4610895565b6040516102e19190612254565b60405180910390f35b3480156102f657600080fd5b50610311600480360381019061030c9190611d21565b61094e565b60405161031e919061250c565b60405180910390f35b34801561033357600080fd5b5061033c610997565b005b34801561034a57600080fd5b506103536109ab565b005b34801561036157600080fd5b5061036a610b65565b604051610377919061221e565b60405180910390f35b34801561038c57600080fd5b50610395610b8f565b6040516103a2919061228a565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd9190611e3d565b610c21565b6040516103df9190612239565b60405180910390f35b3480156103f457600080fd5b5061040f600480360381019061040a9190611e3d565b610c98565b60405161041c9190612239565b60405180910390f35b34801561043157600080fd5b5061044c60048036038101906104479190611d4e565b610cbb565b604051610459919061250c565b60405180910390f35b34801561046e57600080fd5b5061048960048036038101906104849190611d21565b610d42565b005b60606036805461049a906126d3565b80601f01602080910402602001604051908101604052809291908181526020018280546104c6906126d3565b80156105135780601f106104e857610100808354040283529160200191610513565b820191906000526020600020905b8154815290600101906020018083116104f657829003601f168201915b5050505050905090565b600080610528610dc6565b9050610535818585610dce565b600191505092915050565b6000603554905090565b600080610555610dc6565b9050610562858285610f99565b61056d858585611025565b60019150509392505050565b60006012905090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610611576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106089061230c565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166106506112a0565b73ffffffffffffffffffffffffffffffffffffffff16146106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d9061236c565b60405180910390fd5b6106af816112f7565b61070881600067ffffffffffffffff8111156106ce576106cd612794565b5b6040519080825280601f01601f1916602001820160405280156107005781602001600182028036833780820191505090505b506000611302565b50565b600080610716610dc6565b90506107378185856107288589610cbb565b61073291906125ca565b610dce565b600191505092915050565b61074a61147f565b61075482826114fd565b5050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de9061230c565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108266112a0565b73ffffffffffffffffffffffffffffffffffffffff161461087c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108739061236c565b60405180910390fd5b610885826112f7565b61089182826001611302565b5050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c9061238c565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b6000603360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099f61147f565b6109a96000611655565b565b60008060019054906101000a900460ff161590508080156109dc5750600160008054906101000a900460ff1660ff16105b80610a0957506109eb3061171b565b158015610a085750600160008054906101000a900460ff1660ff16145b5b610a48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3f906123cc565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610a85576001600060016101000a81548160ff0219169083151502179055505b610af96040518060400160405280600781526020017f4d79546f6b656e000000000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f4d544b000000000000000000000000000000000000000000000000000000000081525061173e565b610b0161179b565b610b096117f4565b8015610b625760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610b59919061226f565b60405180910390a15b50565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060378054610b9e906126d3565b80601f0160208091040260200160405190810160405280929190818152602001828054610bca906126d3565b8015610c175780601f10610bec57610100808354040283529160200191610c17565b820191906000526020600020905b815481529060010190602001808311610bfa57829003601f168201915b5050505050905090565b600080610c2c610dc6565b90506000610c3a8286610cbb565b905083811015610c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c76906124cc565b60405180910390fd5b610c8c8286868403610dce565b60019250505092915050565b600080610ca3610dc6565b9050610cb0818585611025565b600191505092915050565b6000603460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d4a61147f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610dba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db1906122cc565b60405180910390fd5b610dc381611655565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e359061248c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea5906122ec565b60405180910390fd5b80603460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f8c919061250c565b60405180910390a3505050565b6000610fa58484610cbb565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461101f5781811015611011576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110089061232c565b60405180910390fd5b61101e8484848403610dce565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611095576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108c9061246c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611105576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fc906122ac565b60405180910390fd5b611110838383611845565b6000603360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118e9061234c565b60405180910390fd5b818103603360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081603360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611287919061250c565b60405180910390a361129a84848461184a565b50505050565b60006112ce7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61184f565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6112ff61147f565b50565b61132e7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b611859565b60000160009054906101000a900460ff16156113525761134d83611863565b61147a565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561139857600080fd5b505afa9250505080156113c957506040513d601f19601f820116820180604052508101906113c69190611e7d565b60015b611408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ff906123ec565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b811461146d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611464906123ac565b60405180910390fd5b5061147983838361191c565b5b505050565b611487610dc6565b73ffffffffffffffffffffffffffffffffffffffff166114a5610b65565b73ffffffffffffffffffffffffffffffffffffffff16146114fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f29061242c565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561156d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611564906124ec565b60405180910390fd5b61157960008383611845565b806035600082825461158b91906125ca565b9250508190555080603360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161163d919061250c565b60405180910390a36116516000838361184a565b5050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1661178d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611784906124ac565b60405180910390fd5b6117978282611948565b5050565b600060019054906101000a900460ff166117ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e1906124ac565b60405180910390fd5b6117f26119c9565b565b600060019054906101000a900460ff16611843576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183a906124ac565b60405180910390fd5b565b505050565b505050565b6000819050919050565b6000819050919050565b61186c8161171b565b6118ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a29061240c565b60405180910390fd5b806118d87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61184f565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61192583611a2a565b6000825111806119325750805b15611943576119418383611a79565b505b505050565b600060019054906101000a900460ff16611997576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198e906124ac565b60405180910390fd5b81603690805190602001906119ad929190611bcf565b5080603790805190602001906119c4929190611bcf565b505050565b600060019054906101000a900460ff16611a18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0f906124ac565b60405180910390fd5b611a28611a23610dc6565b611655565b565b611a3381611863565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6060611a848361171b565b611ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aba9061244c565b60405180910390fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1684604051611aeb9190612207565b600060405180830381855af49150503d8060008114611b26576040519150601f19603f3d011682016040523d82523d6000602084013e611b2b565b606091505b5091509150611b538282604051806060016040528060278152602001612d9960279139611b5d565b9250505092915050565b60608315611b6d57829050611b78565b611b778383611b7f565b5b9392505050565b600082511115611b925781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc6919061228a565b60405180910390fd5b828054611bdb906126d3565b90600052602060002090601f016020900481019282611bfd5760008555611c44565b82601f10611c1657805160ff1916838001178555611c44565b82800160010185558215611c44579182015b82811115611c43578251825591602001919060010190611c28565b5b509050611c519190611c55565b5090565b5b80821115611c6e576000816000905550600101611c56565b5090565b6000611c85611c8084612567565b612542565b905082815260208101848484011115611ca157611ca06127c8565b5b611cac848285612691565b509392505050565b600081359050611cc381612d53565b92915050565b600081519050611cd881612d6a565b92915050565b600082601f830112611cf357611cf26127c3565b5b8135611d03848260208601611c72565b91505092915050565b600081359050611d1b81612d81565b92915050565b600060208284031215611d3757611d366127d2565b5b6000611d4584828501611cb4565b91505092915050565b60008060408385031215611d6557611d646127d2565b5b6000611d7385828601611cb4565b9250506020611d8485828601611cb4565b9150509250929050565b600080600060608486031215611da757611da66127d2565b5b6000611db586828701611cb4565b9350506020611dc686828701611cb4565b9250506040611dd786828701611d0c565b9150509250925092565b60008060408385031215611df857611df76127d2565b5b6000611e0685828601611cb4565b925050602083013567ffffffffffffffff811115611e2757611e266127cd565b5b611e3385828601611cde565b9150509250929050565b60008060408385031215611e5457611e536127d2565b5b6000611e6285828601611cb4565b9250506020611e7385828601611d0c565b9150509250929050565b600060208284031215611e9357611e926127d2565b5b6000611ea184828501611cc9565b91505092915050565b611eb381612620565b82525050565b611ec281612632565b82525050565b611ed18161263e565b82525050565b6000611ee282612598565b611eec81856125ae565b9350611efc8185602086016126a0565b80840191505092915050565b611f118161267f565b82525050565b6000611f22826125a3565b611f2c81856125b9565b9350611f3c8185602086016126a0565b611f45816127d7565b840191505092915050565b6000611f5d6023836125b9565b9150611f68826127e8565b604082019050919050565b6000611f806026836125b9565b9150611f8b82612837565b604082019050919050565b6000611fa36022836125b9565b9150611fae82612886565b604082019050919050565b6000611fc6602c836125b9565b9150611fd1826128d5565b604082019050919050565b6000611fe9601d836125b9565b9150611ff482612924565b602082019050919050565b600061200c6026836125b9565b91506120178261294d565b604082019050919050565b600061202f602c836125b9565b915061203a8261299c565b604082019050919050565b60006120526038836125b9565b915061205d826129eb565b604082019050919050565b60006120756029836125b9565b915061208082612a3a565b604082019050919050565b6000612098602e836125b9565b91506120a382612a89565b604082019050919050565b60006120bb602e836125b9565b91506120c682612ad8565b604082019050919050565b60006120de602d836125b9565b91506120e982612b27565b604082019050919050565b60006121016020836125b9565b915061210c82612b76565b602082019050919050565b60006121246026836125b9565b915061212f82612b9f565b604082019050919050565b60006121476025836125b9565b915061215282612bee565b604082019050919050565b600061216a6024836125b9565b915061217582612c3d565b604082019050919050565b600061218d602b836125b9565b915061219882612c8c565b604082019050919050565b60006121b06025836125b9565b91506121bb82612cdb565b604082019050919050565b60006121d3601f836125b9565b91506121de82612d2a565b602082019050919050565b6121f281612668565b82525050565b61220181612672565b82525050565b60006122138284611ed7565b915081905092915050565b60006020820190506122336000830184611eaa565b92915050565b600060208201905061224e6000830184611eb9565b92915050565b60006020820190506122696000830184611ec8565b92915050565b60006020820190506122846000830184611f08565b92915050565b600060208201905081810360008301526122a48184611f17565b905092915050565b600060208201905081810360008301526122c581611f50565b9050919050565b600060208201905081810360008301526122e581611f73565b9050919050565b6000602082019050818103600083015261230581611f96565b9050919050565b6000602082019050818103600083015261232581611fb9565b9050919050565b6000602082019050818103600083015261234581611fdc565b9050919050565b6000602082019050818103600083015261236581611fff565b9050919050565b6000602082019050818103600083015261238581612022565b9050919050565b600060208201905081810360008301526123a581612045565b9050919050565b600060208201905081810360008301526123c581612068565b9050919050565b600060208201905081810360008301526123e58161208b565b9050919050565b60006020820190508181036000830152612405816120ae565b9050919050565b60006020820190508181036000830152612425816120d1565b9050919050565b60006020820190508181036000830152612445816120f4565b9050919050565b6000602082019050818103600083015261246581612117565b9050919050565b600060208201905081810360008301526124858161213a565b9050919050565b600060208201905081810360008301526124a58161215d565b9050919050565b600060208201905081810360008301526124c581612180565b9050919050565b600060208201905081810360008301526124e5816121a3565b9050919050565b60006020820190508181036000830152612505816121c6565b9050919050565b600060208201905061252160008301846121e9565b92915050565b600060208201905061253c60008301846121f8565b92915050565b600061254c61255d565b90506125588282612705565b919050565b6000604051905090565b600067ffffffffffffffff82111561258257612581612794565b5b61258b826127d7565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006125d582612668565b91506125e083612668565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561261557612614612736565b5b828201905092915050565b600061262b82612648565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061268a82612672565b9050919050565b82818337600083830152505050565b60005b838110156126be5780820151818401526020810190506126a3565b838111156126cd576000848401525b50505050565b600060028204905060018216806126eb57607f821691505b602082108114156126ff576126fe612765565b5b50919050565b61270e826127d7565b810181811067ffffffffffffffff8211171561272d5761272c612794565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b7f555550535570677261646561626c653a206d757374206e6f742062652063616c60008201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000602082015250565b7f45524331393637557067726164653a20756e737570706f727465642070726f7860008201527f6961626c65555549440000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f45524331393637557067726164653a206e657720696d706c656d656e7461746960008201527f6f6e206973206e6f742055555053000000000000000000000000000000000000602082015250565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b612d5c81612620565b8114612d6757600080fd5b50565b612d738161263e565b8114612d7e57600080fd5b50565b612d8a81612668565b8114612d9557600080fd5b5056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122066b4ca7b81ce7dbc6af77b0a062c617f3c53c6ec81d80662160ff3cdcd358a8064736f6c63430008070033' + t.ok(util.compareByteCode(immutableRef1, immutableRef2), 'code contains immutable refs and should match') + }) tape('util.getInputParameters', function (t) { From c8481321854f03c40271dc201436c98ff1247d8c Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 29 Nov 2022 11:38:23 +0100 Subject: [PATCH 65/97] fix tests --- apps/remix-ide/src/blockchain/blockchain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 3f8b22d751..1a1c591833 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -223,7 +223,7 @@ export class Blockchain extends Plugin { return this.call('terminal', 'logHtml', log) } _paq.push(['trackEvent', 'blockchain', 'Upgrade With Proxy', 'Upgrade Successful']) - this.call('udapp', 'addInstance', addressToString(address), newImplementationContractObject.abi, newImplementationContractObject.name) + this.call('udapp', 'addInstance', addressToString(proxyAddress), newImplementationContractObject.abi, newImplementationContractObject.name) } this.runTx(args, confirmationCb, continueCb, promptCb, finalCb) } From 0728a5ac5bfbe4ac67d71bd2cd099272292177d2 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 16 Nov 2022 19:57:43 +0100 Subject: [PATCH 66/97] add tooltip for HomeIcon --- .../src/lib/components/Home.tsx | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx index 94a56bed15..c0ba0a4add 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx @@ -1,3 +1,4 @@ +import { CustomTooltip } from '@remix-ui/helper' import React from 'react' import BasicLogo from './BasicLogo' interface HomeProps { @@ -6,16 +7,20 @@ interface HomeProps { function Home ({ verticalIconPlugin }: HomeProps) { return ( -
await verticalIconPlugin.activateHome()} - {...{ plugin: 'home'}} - title="Home" - data-id="verticalIconsHomeIcon" - id="verticalIconsHomeIcon" + - -
+
await verticalIconPlugin.activateHome()} + {...{ plugin: 'home'}} + data-id="verticalIconsHomeIcon" + id="verticalIconsHomeIcon" + > + +
+ ) } From 50117ab06e4fe0beed2f56711603fb74cf4d4b88 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 17 Nov 2022 11:15:43 +0100 Subject: [PATCH 67/97] add fixes to tooltips --- .../src/lib/components/contractDropdownUI.tsx | 16 +++---- .../src/lib/components/recorderCardUI.tsx | 2 +- .../src/lib/components/Icon.tsx | 45 ++++++++++--------- .../src/lib/components/file-explorer-menu.tsx | 4 +- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index ac14cde8b9..477768d353 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -17,12 +17,12 @@ export function ContractDropdownUI (props: ContractDropdownProps) { display: '', content: '' }) - const [atAddressOptions, setAtAddressOptions] = useState<{ title: string, disabled: boolean }>({ + const [atAddressOptions, setAtAddressOptions] = useState<{ title: string | JSX.Element, disabled: boolean }>({ title: 'address of contract', disabled: true }) const [loadedAddress, setLoadedAddress] = useState('') - const [contractOptions, setContractOptions] = useState<{ title: string, disabled: boolean }>({ + const [contractOptions, setContractOptions] = useState<{ title: string | JSX.Element, disabled: boolean }>({ title: 'Please compile *.sol file to deploy or access a contract', disabled: true }) @@ -136,12 +136,12 @@ export function ContractDropdownUI (props: ContractDropdownProps) { if (enable) { setAtAddressOptions({ disabled: false, - title: 'Interact with the deployed contract - requires the .abi file or compiled .sol file to be selected in the editor (with the same compiler configuration)' + title: Interact with the deployed contract - requires the .abi file or
compiled .sol file to be selected in the editor
(with the same compiler configuration)
}) } else { setAtAddressOptions({ disabled: true, - title: loadedAddress ? 'Compile a *.sol file or select a *.abi file.' : 'To interact with a deployed contract, enter its address and compile its source *.sol file (with the same compiler settings) or select its .abi file in the editor. ' + title: loadedAddress ? 'Compile a *.sol file or select a *.abi file.' : To interact with a deployed contract,
enter its address and compile its source *.sol file
(with the same compiler settings) or select its .abi file in the editor.
}) } } @@ -155,7 +155,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { } else { setContractOptions({ disabled: true, - title: loadType === 'sol' ? 'Select and compile *.sol file to deploy or access a contract.' : 'When there is a compiled .sol file, the choice of contracts to deploy or to use with AtAddress is made here.' + title: loadType === 'sol' ? 'Select and compile *.sol file to deploy or access a contract.' : When there is a compiled .sol file,
choose the contract to deploy or to use with AtAddress.'
}) } } @@ -266,8 +266,8 @@ export function ContractDropdownUI (props: ContractDropdownProps) { placement={'right'} tooltipClasses="text-wrap" tooltipId="info-sync-compiled-contract" - tooltipText="Click here to import contracts compiled from an external framework. - This action is enabled when Remix is connected to an external framework (hardhat, truffle, foundry) through remixd." + tooltipText={Click here to import contracts compiled from an external framework.
+ This action is enabled when Remix is connected to an external framework (hardhat, truffle, foundry) through remixd.
} >
Choose the script to execute right after compilation by adding the `dev-run-script` natspec tag, as in:
diff --git a/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx b/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx index b6567c020b..4f8eed6086 100644 --- a/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx +++ b/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx @@ -19,12 +19,12 @@ const StaticAnalyserButton = ({ return (
) @@ -458,7 +459,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { expand={false} >
- handleCheckOrUncheckCategory(category)} id={categoryId} inputType="checkbox" label={`Select ${category[0].categoryDisplayName}`} name='checkCategoryEntry' checked={category.map(x => x._index.toString()).every(el => categoryIndex.includes(el))} onChange={() => {}}/> + handleCheckOrUncheckCategory(category)} id={categoryId} inputType="checkbox" label={`Select ${category[0].categoryDisplayName}`} name='checkCategoryEntry' checked={category.map(x => x._index.toString()).every(el => categoryIndex.includes(el))} onChange={() => {}} title={category[0].categoryDisplayName} tooltipPlacement="right"/>
{category.map((item, i) => { From 4542faa2455993a627af6c24f9e3eea5446c76bc Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 18 Nov 2022 01:31:42 +0100 Subject: [PATCH 72/97] fix e2e --- libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx index 14afb02878..d9a7022110 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx @@ -86,7 +86,7 @@ const Icon = ({ return ( <>
Date: Fri, 18 Nov 2022 02:02:22 +0100 Subject: [PATCH 73/97] fix more e2e test failures --- apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts b/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts index 4b3c4528c4..6108b794a2 100644 --- a/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts +++ b/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts @@ -21,6 +21,7 @@ module.exports = { let addressRef: string browser.verifyContracts(['test']) .clickLaunchIcon('udapp') + .click('#selectExEnv') .selectContract('test') .createContract('') .getAddressAtPosition(0, (address) => { From 11f99a284e66f60e8c5f49a9eb066ce251a9b32c Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 18 Nov 2022 10:35:18 +0100 Subject: [PATCH 74/97] search test fix e2e --- apps/remix-ide-e2e/src/tests/search.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index c91531d587..9059f71080 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -170,6 +170,9 @@ module.exports = { .click('*[plugin="search"]') .waitForElementVisible('*[id="search_input"]') .waitForElementVisible('*[data-id="toggle_replace"]') + // .moveTo('*[id="search_input"]', 0,0) + // .click('*[id="search_input"]') + .assert.visible('*[data-id="toggle_replace"]') .click('*[data-id="toggle_replace"]') .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', '123') From 49a8e265b5a089eb3422bc6b08666eb50ab404d2 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 18 Nov 2022 11:56:37 +0100 Subject: [PATCH 75/97] rm search fix --- apps/remix-ide-e2e/src/tests/search.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 9059f71080..c91531d587 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -170,9 +170,6 @@ module.exports = { .click('*[plugin="search"]') .waitForElementVisible('*[id="search_input"]') .waitForElementVisible('*[data-id="toggle_replace"]') - // .moveTo('*[id="search_input"]', 0,0) - // .click('*[id="search_input"]') - .assert.visible('*[data-id="toggle_replace"]') .click('*[data-id="toggle_replace"]') .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', '123') From 59c799c25a155537371ca721b24cb89a7c9ea45d Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 18 Nov 2022 13:06:05 +0100 Subject: [PATCH 76/97] fix vertical icons panel test --- libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx index d9a7022110..3c8a2e6059 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx @@ -86,7 +86,7 @@ const Icon = ({ return ( <>
Date: Fri, 18 Nov 2022 13:58:06 +0100 Subject: [PATCH 77/97] fix lib deploy test --- libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx index 3c8a2e6059..50948f49ed 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx @@ -86,7 +86,8 @@ const Icon = ({ return ( <>
Date: Mon, 21 Nov 2022 17:57:37 +0100 Subject: [PATCH 78/97] fix plugin api test --- apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx | 1 + apps/remix-ide-e2e/src/tests/plugin_api.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx b/apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx index 298316e6cd..634421545e 100644 --- a/apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx +++ b/apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx @@ -110,6 +110,7 @@ function App () { placeholder="Enter payload here..." value={payload} onChange={handleChange} + data-id="payload-input" /> {profiles.map((profile: Profile) => { const methods = profile.methods.map((method: string) => { diff --git a/apps/remix-ide-e2e/src/tests/plugin_api.ts b/apps/remix-ide-e2e/src/tests/plugin_api.ts index 9a4d7b74b2..32cee645c4 100644 --- a/apps/remix-ide-e2e/src/tests/plugin_api.ts +++ b/apps/remix-ide-e2e/src/tests/plugin_api.ts @@ -50,7 +50,7 @@ const debugValues = async function (browser: NightwatchBrowser, field: string, e const setPayload = async (browser: NightwatchBrowser, payload: any) => { return new Promise((resolve) => { if (typeof payload !== 'string') payload = JSON.stringify(payload) - browser.clearValue('//*[@id="payload"]').setValue('//*[@id="payload"]', payload, (result) => { + browser.clearValue('//*[@id="payload"]').pause(500).setValue('//*[@id="payload"]', payload, (result) => { resolve(result) }) }) @@ -419,7 +419,7 @@ module.exports = { .addFile('test_modal.js', { content: testModalToasterApi }) .executeScriptInTerminal('remix.execute(\'test_modal.js\')') .useCss() - .waitForElementVisible('*[data-id="test_id_1_ModalDialogModalBody-react"]', 60000) + .waitForElementVisible('*[data-id="test_id_1_ModalDialogModalBody-react"]', 65000) .assert.containsText('*[data-id="test_id_1_ModalDialogModalBody-react"]', 'message 1') .modalFooterOKClick('test_id_1_') // check the script runner notifications From ea2500d59e757e8bf488a444124e9d440b53e91f Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 18 Nov 2022 10:35:18 +0100 Subject: [PATCH 79/97] search test fix e2e --- apps/remix-ide-e2e/src/tests/search.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index c91531d587..9059f71080 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -170,6 +170,9 @@ module.exports = { .click('*[plugin="search"]') .waitForElementVisible('*[id="search_input"]') .waitForElementVisible('*[data-id="toggle_replace"]') + // .moveTo('*[id="search_input"]', 0,0) + // .click('*[id="search_input"]') + .assert.visible('*[data-id="toggle_replace"]') .click('*[data-id="toggle_replace"]') .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', '123') From 54ed4b321bfe5cdedec6c31c6c29685e9c0d5a5e Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 18 Nov 2022 11:56:37 +0100 Subject: [PATCH 80/97] rm search fix --- apps/remix-ide-e2e/src/tests/search.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 9059f71080..c91531d587 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -170,9 +170,6 @@ module.exports = { .click('*[plugin="search"]') .waitForElementVisible('*[id="search_input"]') .waitForElementVisible('*[data-id="toggle_replace"]') - // .moveTo('*[id="search_input"]', 0,0) - // .click('*[id="search_input"]') - .assert.visible('*[data-id="toggle_replace"]') .click('*[data-id="toggle_replace"]') .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', '123') From 7f14a066681e34a951ef262d3eee6bac5394b945 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 18 Nov 2022 13:06:05 +0100 Subject: [PATCH 81/97] fix vertical icons panel test --- libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx index 50948f49ed..3c8a2e6059 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx @@ -86,8 +86,7 @@ const Icon = ({ return ( <>
Date: Fri, 18 Nov 2022 13:58:06 +0100 Subject: [PATCH 82/97] fix lib deploy test --- libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx index 3c8a2e6059..50948f49ed 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx @@ -86,7 +86,8 @@ const Icon = ({ return ( <>
Date: Tue, 22 Nov 2022 10:31:07 +0100 Subject: [PATCH 83/97] review comment fixes --- .../src/lib/components/contractDropdownUI.tsx | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 477768d353..78da4cd98e 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -155,7 +155,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { } else { setContractOptions({ disabled: true, - title: loadType === 'sol' ? 'Select and compile *.sol file to deploy or access a contract.' : When there is a compiled .sol file,
choose the contract to deploy or to use with AtAddress.'
+ title: loadType === 'sol' ? 'Select and compile *.sol file to deploy or access a contract.' : When there is a compiled .sol file, choose the
contract to deploy or to use with AtAddress.'
}) } } @@ -266,7 +266,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { placement={'right'} tooltipClasses="text-wrap" tooltipId="info-sync-compiled-contract" - tooltipText={Click here to import contracts compiled from an external framework.
+ tooltipText={Click here to import contracts compiled from an external framework.
This action is enabled when Remix is connected to an external framework (hardhat, truffle, foundry) through remixd.
} > ) : null} -
-
- +
+ + {abiLabel.content} +
- {abiLabel.content} -
-
{((contractList[currentFile] && contractList[currentFile].filter(contract => contract)) || []).length <= 0 ? intl.formatMessage({id: 'udapp.noCompiledContracts', defaultMessage: 'No compiled contracts'}) : loadedContractData ?
@@ -343,7 +341,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
-
+
Date: Tue, 22 Nov 2022 12:23:10 +0100 Subject: [PATCH 84/97] address changes in review comments --- .../checkbox/src/lib/remix-ui-checkbox.tsx | 2 +- .../src/lib/components/contractDropdownUI.tsx | 64 +++++++++++-------- .../src/lib/compiler-container.tsx | 2 +- .../src/lib/Button/StaticAnalyserButton.tsx | 2 +- 4 files changed, 41 insertions(+), 29 deletions(-) diff --git a/libs/remix-ui/checkbox/src/lib/remix-ui-checkbox.tsx b/libs/remix-ui/checkbox/src/lib/remix-ui-checkbox.tsx index 8c36fa5fa8..268927908e 100644 --- a/libs/remix-ui/checkbox/src/lib/remix-ui-checkbox.tsx +++ b/libs/remix-ui/checkbox/src/lib/remix-ui-checkbox.tsx @@ -34,7 +34,7 @@ export const RemixUiCheckbox = ({ title, visibility, display = 'flex', - tooltipPlacement = 'right-start' + tooltipPlacement = 'right' }: RemixUiCheckboxProps) => { const childJSX = ( diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 78da4cd98e..cd05f0823c 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -136,12 +136,12 @@ export function ContractDropdownUI (props: ContractDropdownProps) { if (enable) { setAtAddressOptions({ disabled: false, - title: Interact with the deployed contract - requires the .abi file or
compiled .sol file to be selected in the editor
(with the same compiler configuration)
+ title: Interact with the deployed contract - requires the .abi file or
compiled .sol file to be selected in the editor
(with the same compiler configuration)
}) } else { setAtAddressOptions({ disabled: true, - title: loadedAddress ? 'Compile a *.sol file or select a *.abi file.' : To interact with a deployed contract,
enter its address and compile its source *.sol file
(with the same compiler settings) or select its .abi file in the editor.
+ title: loadedAddress ? 'Compile a *.sol file or select a *.abi file.' : To interact with a deployed contract either,
enter its address and compile its source *.sol file
(with the same compiler settings) or select its .abi file in the editor.
}) } } @@ -155,7 +155,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { } else { setContractOptions({ disabled: true, - title: loadType === 'sol' ? 'Select and compile *.sol file to deploy or access a contract.' : When there is a compiled .sol file, choose the
contract to deploy or to use with AtAddress.'
+ title: loadType === 'sol' ? 'Select and compile *.sol file to deploy or access a contract.' : When there is a compiled .sol file, choose the
contract to deploy or to use with AtAddress.'
}) } } @@ -236,7 +236,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { const checkSumWarning = () => { return ( - + It seems you are not using a checksumed address.
A checksummed address is an address that contains uppercase letters, as specified in EIP-55.
Checksummed addresses are meant to help prevent users from sending transactions to the wrong address. @@ -264,10 +264,12 @@ export function ContractDropdownUI (props: ContractDropdownProps) { {props.remixdActivated ? (Click here to import contracts compiled from an external framework.
- This action is enabled when Remix is connected to an external framework (hardhat, truffle, foundry) through remixd.
} + tooltipText={ + Click here to import contracts compiled from an external framework.
+ This action is enabled when Remix is connected to an external
framework (hardhat, truffle, foundry) through remixd. +
} >
) : null} - +
+ {contractOptions.disabled ? ( + + ) : ( -
- - {abiLabel.content} -
-
+ + )} + {abiLabel.content} +
+
{((contractList[currentFile] && contractList[currentFile].filter(contract => contract)) || []).length <= 0 ? intl.formatMessage({id: 'udapp.noCompiledContracts', defaultMessage: 'No compiled contracts'}) : loadedContractData ?
@@ -322,9 +334,9 @@ export function ContractDropdownUI (props: ContractDropdownProps) { /> Publishing the source code and metadata to IPFS
facilitates source code verification using Sourcify and
will greatly foster contract adoption
(auditing, debugging, calling it, etc...)} + tooltipText={Publishing the source code and metadata to IPFS facilitates
source code verification using Sourcify and will greatly foster
contract adoption (auditing, debugging, calling it, etc...)
} >
-
+
@@ -356,9 +368,9 @@ export function ContractDropdownUI (props: ContractDropdownProps) { { contract ContractName {'{}'}
- Click to know more + Click the i icon to learn more
} >
diff --git a/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx b/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx index 4f8eed6086..db660c1d49 100644 --- a/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx +++ b/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx @@ -19,7 +19,7 @@ const StaticAnalyserButton = ({ return (
- {contractOptions.disabled ? ( - - ) : ( - - )} +
+ +
+ {abiLabel.content}
diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 2d39863b6c..9dd58a07bb 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -862,7 +862,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { tooltipText={{'Language specification available from Compiler >= v0.5.7'}} >
- handleLanguageChange(e.target.value)} disabled={state.useFileConfiguration} value={state.language} className="custom-select" id="compilierLanguageSelector" style={{ pointerEvents: 'none' }}> diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index 7073b2366a..b8eafbbc4f 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -431,7 +431,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { onClick={event => handleCheckSingle(event, item._index)} checked={categoryIndex.includes(item._index.toString())} onChange={() => {}} - title={item.description} />
) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx index 50948f49ed..7f6080fb44 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx @@ -86,9 +86,9 @@ const Icon = ({ return ( <>
Date: Wed, 23 Nov 2022 13:11:49 +0100 Subject: [PATCH 86/97] make tooltip position auto --- libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx index 7f6080fb44..da65a2da41 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx @@ -86,7 +86,8 @@ const Icon = ({ return ( <> From 532153192b0560bab82d9ba5256c37dc69d94507 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 29 Nov 2022 09:30:06 +0100 Subject: [PATCH 87/97] fix e2e --- libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index aa11635733..a055758440 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -288,7 +288,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { tooltipText={contractOptions.title} >
- {(contractList[currentFile] || []).map((contract, index) => { return
) From 68d3755b68c2c9790f2fa3784aec7ceb4efdb7bc Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 10 Nov 2022 16:03:43 +0100 Subject: [PATCH 90/97] scrolling fixed for buttons --- .../lib/components/customButtonGroupAsArrows.tsx | 14 -------------- .../src/lib/components/customNavButtons.tsx | 10 ++++++---- .../src/lib/components/homeTabFeatured.tsx | 15 +++++++++++++-- .../src/lib/components/homeTabFeaturedPlugins.tsx | 7 ++++--- .../src/lib/components/homeTabGetStarted.tsx | 6 +++--- .../home-tab/src/lib/components/homeTabTitle.tsx | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 libs/remix-ui/home-tab/src/lib/components/customButtonGroupAsArrows.tsx diff --git a/libs/remix-ui/home-tab/src/lib/components/customButtonGroupAsArrows.tsx b/libs/remix-ui/home-tab/src/lib/components/customButtonGroupAsArrows.tsx deleted file mode 100644 index d265e5781d..0000000000 --- a/libs/remix-ui/home-tab/src/lib/components/customButtonGroupAsArrows.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import React from 'react' - -function CustomButtonGroupAsArrows ({ next, previous }) { - return ( -
-

These buttons can be positioned anywhere you want on the screen

- - -
- ) -} - -export default CustomButtonGroupAsArrows \ No newline at end of file diff --git a/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx b/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx index 9418051754..5596f314de 100644 --- a/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx @@ -1,8 +1,10 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import React from 'react' -const CustomNavButtons = ({ next, previous, goToSlide, ...rest }) => { - const { carouselState: { currentSlide, totalItems, itemWidth, containerWidth } } = rest +const CustomNavButtons = ({ parent, next, previous, goToSlide, ...rest }) => { + const { carouselState: { currentSlide, totalItems, containerWidth, transform } } = rest + console.log("REST ", rest) + console.log("parent ", parent) return (
diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx index ca5232484d..5af5c58d73 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState, useRef, useContext } from 'react' import { ThemeContext, themes } from '../themeContext' import Carousel from 'react-multi-carousel' import 'react-multi-carousel/lib/styles.css' -import CustomNavButtons from './customNavButtons' +import CustomButtonGroupDots from './customButtonGroupDots' const _paq = window._paq = window._paq || [] // eslint-disable-line function HomeTabFeatured() { @@ -14,6 +14,16 @@ function HomeTabFeatured() { } }, []) + const ButtonGroup = () => { + return ( + <> + + + + + ); + }; + return (
@@ -21,7 +31,7 @@ function HomeTabFeatured() {
} + customButtonGroup={} arrows={false} swipeable={false} draggable={true} @@ -31,6 +41,7 @@ function HomeTabFeatured() { ssr={true} // means to render carousel on server-side. infinite={true} centerMode={false} + partialVisible={false} autoPlay={true} keyBoardControl={true} containerClass="border carousel-container" diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx index 9fa324e9b2..97513bb050 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx @@ -20,7 +20,7 @@ interface HomeTabFeaturedPluginsProps { function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { const themeFilter = useContext(ThemeContext) - const carouselRef = useRef(null) + const carouselRef = useRef({}) const carouselRefDiv = useRef(null) useEffect(() => { @@ -46,8 +46,9 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { e.stopPropagation() let nextSlide = 0 if (e.wheelDelta < 0) { + console.log("scroll") nextSlide = carouselRef.current.state.currentSlide + 1; - if ((carouselRef.current.state.totalItems - carouselRef.current.state.currentSlide) * carouselRef.current.state.itemWidth + 5 < carouselRef.current.state.containerWidth) return // 5 is approx margins + if (Math.abs(carouselRef.current.state.transform) >= carouselRef.current.containerRef.current.scrollWidth - carouselRef.current.state.containerWidth) return carouselRef.current.goToSlide(nextSlide) } else { nextSlide = carouselRef.current.state.currentSlide - 1; @@ -92,7 +93,7 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { ref={carouselRef} focusOnSelect={true} customButtonGroup={ - + } arrows={false} swipeable={false} diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx index ae6be5ad5c..aa65cf9dd7 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx @@ -17,7 +17,7 @@ interface HomeTabGetStartedProps { function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { const themeFilter = useContext(ThemeContext) - const carouselRef = useRef(null) + const carouselRef = useRef({}) const carouselRefDiv = useRef(null) useEffect(() => { @@ -44,7 +44,7 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { let nextSlide = 0 if (e.wheelDelta < 0) { nextSlide = carouselRef.current.state.currentSlide + 1; - if ((carouselRef.current.state.totalItems - carouselRef.current.state.currentSlide) * carouselRef.current.state.itemWidth + 5 < carouselRef.current.state.containerWidth) return // 5 is approx margins + if (Math.abs(carouselRef.current.state.transform) >= carouselRef.current.containerRef.current.scrollWidth - carouselRef.current.state.containerWidth) return carouselRef.current.goToSlide(nextSlide) } else { nextSlide = carouselRef.current.state.currentSlide - 1; @@ -77,7 +77,7 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { ref={carouselRef} focusOnSelect={true} customButtonGroup={ - + } arrows={false} swipeable={false} diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx index 60c2420067..0ca38dc338 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx @@ -157,7 +157,7 @@ function HomeTabTitle() { ref={searchInputRef} type="text" className="border form-control border-right-0" - id="searchInput" + id="homeTabSearchInput" placeholder="Search Documentation" data-id="terminalInputSearch" /> From 47d82ada6bd74a0d9d0c2471dcd39722d4941468 Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 10 Nov 2022 16:07:12 +0100 Subject: [PATCH 91/97] adding a file --- .../src/lib/components/customButtonGroupDots.tsx | 15 +++++++++++++++ .../src/lib/components/homeTabFeatured.tsx | 11 ----------- 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 libs/remix-ui/home-tab/src/lib/components/customButtonGroupDots.tsx diff --git a/libs/remix-ui/home-tab/src/lib/components/customButtonGroupDots.tsx b/libs/remix-ui/home-tab/src/lib/components/customButtonGroupDots.tsx new file mode 100644 index 0000000000..365d86971e --- /dev/null +++ b/libs/remix-ui/home-tab/src/lib/components/customButtonGroupDots.tsx @@ -0,0 +1,15 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import React from 'react' + +const CustomButtonGroupDots = ({ next, previous, goToSlide, ...rest }) => { + const { carouselState: { currentSlide, totalItems } } = rest + + return ( +
+ + +
+ ) +} + +export default CustomButtonGroupDots diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx index 5af5c58d73..3e145a5473 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx @@ -14,16 +14,6 @@ function HomeTabFeatured() { } }, []) - const ButtonGroup = () => { - return ( - <> - - - - - ); - }; - return (
@@ -41,7 +31,6 @@ function HomeTabFeatured() { ssr={true} // means to render carousel on server-side. infinite={true} centerMode={false} - partialVisible={false} autoPlay={true} keyBoardControl={true} containerClass="border carousel-container" From eb683d43afd2ca577b1cc5353ba1bd0f50792103 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 14 Nov 2022 12:22:18 +0100 Subject: [PATCH 92/97] cleanup --- .../lib/components/customButtonGroupDots.tsx | 15 -------------- .../src/lib/components/customNavButtons.tsx | 2 -- .../src/lib/components/homeTabFeatured.tsx | 20 +++++++------------ 3 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 libs/remix-ui/home-tab/src/lib/components/customButtonGroupDots.tsx diff --git a/libs/remix-ui/home-tab/src/lib/components/customButtonGroupDots.tsx b/libs/remix-ui/home-tab/src/lib/components/customButtonGroupDots.tsx deleted file mode 100644 index 365d86971e..0000000000 --- a/libs/remix-ui/home-tab/src/lib/components/customButtonGroupDots.tsx +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import React from 'react' - -const CustomButtonGroupDots = ({ next, previous, goToSlide, ...rest }) => { - const { carouselState: { currentSlide, totalItems } } = rest - - return ( -
- - -
- ) -} - -export default CustomButtonGroupDots diff --git a/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx b/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx index 5596f314de..c161a82591 100644 --- a/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx @@ -3,8 +3,6 @@ import React from 'react' const CustomNavButtons = ({ parent, next, previous, goToSlide, ...rest }) => { const { carouselState: { currentSlide, totalItems, containerWidth, transform } } = rest - console.log("REST ", rest) - console.log("parent ", parent) return (
- + - +
diff --git a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx index 7d646043f3..05f3fbf678 100644 --- a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx +++ b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx @@ -75,6 +75,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => { try { const result = await publishToIPFS(contract, api) modal(`Published ${contract.name}'s Metadata and Sources`, publishMessage(result.uploaded)) + console.log("ptot") } catch (err) { modal('IPFS Publish Failed', publishMessageFailed(storage, err.message)) } diff --git a/libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx b/libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx index dbea8a4766..d54332e96f 100644 --- a/libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx +++ b/libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx @@ -1,7 +1,5 @@ import IpfsHttpClient from 'ipfs-http-client' - - let ipfsNodes = [] export const publishToIPFS = async (contract, api) => { @@ -93,7 +91,6 @@ export const publishToIPFS = async (contract, api) => { try { const result = await ipfsVerifiedPublish(metadataContent, '', api) - try { contract.metadataHash = result.url.match('dweb:/ipfs/(.+)')[1] } catch (e) { diff --git a/libs/remix-ui/run-tab/src/lib/css/run-tab.css b/libs/remix-ui/run-tab/src/lib/css/run-tab.css index 1c9cd7fe5b..203e315de1 100644 --- a/libs/remix-ui/run-tab/src/lib/css/run-tab.css +++ b/libs/remix-ui/run-tab/src/lib/css/run-tab.css @@ -45,8 +45,6 @@ width: 164px; min-width: 164px; } -.udapp_col2_2 { -} .udapp_select { font-weight: normal; width: 100%; @@ -314,7 +312,7 @@ .udapp_cActionsWrapper { border-top-left-radius: 0; border-bottom-left-radius: 0.25rem; - border-top-rightt-radius: 0; + border-top-right-radius: 0; border-bottom-right-radius: 0.25rem; padding: 8px 10px 7px; } From 814ca35d95aca222dd47c977250d576c57e6576a Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 16 Nov 2022 13:48:13 +0100 Subject: [PATCH 94/97] udapp min size fixed --- .../remix-app/components/dragbar/dragbar.tsx | 2 +- .../app/src/lib/remix-app/remix-app.tsx | 2 +- .../src/lib/components/custom-dropdown.tsx | 2 +- .../src/lib/publish-to-storage.tsx | 1 - .../src/lib/components/environment.tsx | 38 +++++++++++++------ .../src/lib/components/recorderCardUI.tsx | 2 +- 6 files changed, 30 insertions(+), 17 deletions(-) diff --git a/libs/remix-ui/app/src/lib/remix-app/components/dragbar/dragbar.tsx b/libs/remix-ui/app/src/lib/remix-app/components/dragbar/dragbar.tsx index 34bf717785..d0dc3f0c6d 100644 --- a/libs/remix-ui/app/src/lib/remix-app/components/dragbar/dragbar.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/components/dragbar/dragbar.tsx @@ -61,7 +61,7 @@ const DragBar = (props: IRemixDragBarUi) => { function stopDrag(data: any) { setDragState(false) console.log("drag") - if (data.x < props.minWidth) { + if (data.x < props.minWidth + offset) { setDragBarPosX(offset) props.setHideStatus(true) } else { diff --git a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx index 06d990e5a2..3aff79e0df 100644 --- a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx @@ -85,7 +85,7 @@ const RemixApp = (props: IRemixAppUi) => {
{props.app.menuicons.render()}
{props.app.sidePanel.render()}
- +
diff --git a/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx b/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx index 4ca65cf2d3..9bb3ef0c84 100644 --- a/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx +++ b/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx @@ -13,7 +13,7 @@ export const CustomToggle = React.forwardRef(({ children, onClick, icon, classNa className={className.replace('dropdown-toggle', '')} >
-
{ children }
+
{ children }
{ icon &&
}
diff --git a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx index 05f3fbf678..7d646043f3 100644 --- a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx +++ b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx @@ -75,7 +75,6 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => { try { const result = await publishToIPFS(contract, api) modal(`Published ${contract.name}'s Metadata and Sources`, publishMessage(result.uploaded)) - console.log("ptot") } catch (err) { modal('IPFS Publish Failed', publishMessageFailed(storage, err.message)) } diff --git a/libs/remix-ui/run-tab/src/lib/components/environment.tsx b/libs/remix-ui/run-tab/src/lib/components/environment.tsx index 8636a3b8e0..4614810ba9 100644 --- a/libs/remix-ui/run-tab/src/lib/components/environment.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/environment.tsx @@ -28,20 +28,28 @@ export function EnvironmentUI (props: EnvironmentProps) {
- - + { isL2(currentProvider) && 'L2 - '} { currentProvider && currentProvider.content } - { currentProvider && bridges[currentProvider.value] && - - } + { currentProvider && bridges[currentProvider.value] && + + } { @@ -53,14 +61,20 @@ export function EnvironmentUI (props: EnvironmentProps) { }} data-id={`dropdown-item-${value}`} > - { isL2({ value }) && 'L2 - ' }{ content } + { isL2({ value }) && 'L2 - ' }{ content } )) } - }> + } + >
diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index 1fa7741253..4102f20df6 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -28,7 +28,7 @@ export function RecorderUI (props: RecorderProps) { return ( -
+