From b691e62ee89ba685007dd4d004cbb088813a536e Mon Sep 17 00:00:00 2001 From: nujabes403 Date: Tue, 16 Apr 2019 14:51:31 +0900 Subject: [PATCH 01/11] Remove duplicated function declaration 'Ethdebugger.prototype.debug' --- remix-debug/src/Ethdebugger.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/remix-debug/src/Ethdebugger.js b/remix-debug/src/Ethdebugger.js index 7545bebebb..157cc10e1b 100644 --- a/remix-debug/src/Ethdebugger.js +++ b/remix-debug/src/Ethdebugger.js @@ -160,15 +160,6 @@ Ethdebugger.prototype.updateWeb3 = function (web3) { this.setManagers() } -Ethdebugger.prototype.debug = function (tx) { - this.setCompilationResult(this.opts.compilationResult()) - if (tx instanceof Object) { - this.txBrowser.load(tx.hash) - } else if (tx instanceof String) { - this.txBrowser.load(tx) - } -} - Ethdebugger.prototype.unLoad = function () { this.traceManager.init() this.codeManager.clear() From 667e138cb65e67e106494b1cc4b82d7b099dedf1 Mon Sep 17 00:00:00 2001 From: subtly Date: Tue, 30 Apr 2019 02:34:37 +0800 Subject: [PATCH 02/11] fix for electron w/dynamic loading of solcjson This is a fix so that remix will work inside of electron, and presumably, it makes sense for dynamic downloading of solidity compiler. When I enable node integration with electron and install solc node module, it looks like it works for a second, but then it too does not work (page goes blank). I'm not sure if require() works here with node, as I believe solcjson would need to be downloaded into a path that can be resolved by require (typically node_modules). Notably, electron docs recommend against enabling node integration when remote scripts are loaded dynamically. --- remix-solidity/src/compiler/compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-solidity/src/compiler/compiler.js b/remix-solidity/src/compiler/compiler.js index 0109223932..3766d8beea 100644 --- a/remix-solidity/src/compiler/compiler.js +++ b/remix-solidity/src/compiler/compiler.js @@ -74,7 +74,7 @@ function Compiler (handleImportCall) { if (worker === null) { var compiler var userAgent = (typeof (navigator) !== 'undefined') && navigator.userAgent ? navigator.userAgent.toLowerCase() : '-' - if (typeof (window) === 'undefined' || userAgent.indexOf(' electron/') > -1) { + if (typeof (window) === 'undefined') { compiler = require('solc') } else { compiler = solc(window.Module) From 85e15771598a7a8a3e5bbe4a9a7028d5035d9d66 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 2 May 2019 10:37:36 +0200 Subject: [PATCH 03/11] Update release-process.md --- release-process.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/release-process.md b/release-process.md index 5c92fcf133..ab7f57edd1 100644 --- a/release-process.md +++ b/release-process.md @@ -2,9 +2,6 @@ This document details steps for publishing packages and tag the code base accordingly: -# Case where we deploy a remix module that is a dependency for another remix module: -**remix-lib** , **remix-simulator** , **remix-solidity** - 1) publish (using lerna) all the modules that depends on one of the newly published module: - checkout a new branch from master @@ -26,21 +23,3 @@ This document details steps for publishing packages and tag the code base accord - in changelog put list of published packages with version -# Case where we deploy a top level library -**remix-debug** , **remix-tests** , **remix-url-resolver** , **remix-analyzer** - -1) publish the module: - -- checkout a new branch from master -- cd in the module folder -- increment package.json version -- npm run publish - -2) create a tag (using the package.json version) - -- checkout latest origin/master -- git tag @ -- git push --tags -- github-changes -o ethereum -r remix -a --only-pulls --use-commit-body --only-merges --between-tags previous_version...next_version -- keep only PRs related to changes in the published module -- create a new release out of the changelog.md From 0bf4b2935088dafa06e2d264356a093a415f00b5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 3 May 2019 10:20:10 +0200 Subject: [PATCH 04/11] Update execution-context.js --- remix-lib/src/execution/execution-context.js | 1 + 1 file changed, 1 insertion(+) diff --git a/remix-lib/src/execution/execution-context.js b/remix-lib/src/execution/execution-context.js index fe81dcb5e1..dc66ca77c7 100644 --- a/remix-lib/src/execution/execution-context.js +++ b/remix-lib/src/execution/execution-context.js @@ -130,6 +130,7 @@ function ExecutionContext () { else if (id === '2') name = 'Morden (deprecated)' else if (id === '3') name = 'Ropsten' else if (id === '4') name = 'Rinkeby' + else if (id === '5') name = 'Görli' else if (id === '42') name = 'Kovan' else name = 'Custom' From 0b45189087bfaac9e0dfcdba7096d2cb03683ef0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 3 May 2019 10:26:04 +0200 Subject: [PATCH 05/11] Update universalDapp.js --- remix-lib/src/universalDapp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remix-lib/src/universalDapp.js b/remix-lib/src/universalDapp.js index 48271ac449..5250ca2983 100644 --- a/remix-lib/src/universalDapp.js +++ b/remix-lib/src/universalDapp.js @@ -47,7 +47,7 @@ UniversalDApp.prototype.resetEnvironment = function () { executionContext.detectNetwork(cb) }, personalMode: () => { - return this.config.get('settings/personal-mode') + return this._deps.config.get('settings/personal-mode') } }) this.txRunner.event.register('transactionBroadcasted', (txhash) => { @@ -70,7 +70,7 @@ UniversalDApp.prototype.createVMAccount = function (privateKey, balance, cb) { UniversalDApp.prototype.newAccount = function (password, passwordPromptCb, cb) { if (!executionContext.isVM()) { - if (!this.config.get('settings/personal-mode')) { + if (!this._deps.config.get('settings/personal-mode')) { return cb('Not running in personal mode') } passwordPromptCb((passphrase) => { From 7487c7bbce9440dacbf818394f67936abeaec681 Mon Sep 17 00:00:00 2001 From: Scott Tsai Date: Wed, 8 May 2019 00:49:36 +0800 Subject: [PATCH 06/11] remix-debug depends on web3 remix-debug has the following line in `src/cmdline/index.js`: ``` var Web3 = require('web3') <... snip ...> connect (providerType, url) { if (providerType !== 'http') throw new Error('unsupported provider type') this.web3 = new Web3(new Web3.providers.HttpProvider(url)) } ``` So it should either mark `web3` as a dependency in `package.json` or refactor `remix-lib` to provide a web3 provider that can take an `url` paramter. This patch does the former and makes `remix-debug` depend on the same version of `web3` as `remix-lib` in `package.json`. --- remix-debug/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remix-debug/package.json b/remix-debug/package.json index fc67d2a79b..d2bcb679b4 100644 --- a/remix-debug/package.json +++ b/remix-debug/package.json @@ -22,7 +22,8 @@ "ethereumjs-util": "^4.5.0", "ethereumjs-vm": "3.0.0", "fast-async": "^6.1.2", - "remix-lib": "0.4.5" + "remix-lib": "0.4.5", + "web3": "0.20.6" }, "devDependencies": { "babel-eslint": "^7.1.1", From a8bf6ded24238cb0e6e9c4287c2d8f8dde05739d Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 9 May 2019 14:10:19 +0200 Subject: [PATCH 07/11] move to ethers v4 --- remix-lib/package.json | 2 +- remix-lib/src/execution/eventsDecoder.js | 19 +++++++++++++------ remix-lib/src/execution/txHelper.js | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/remix-lib/package.json b/remix-lib/package.json index a859cd88c5..0980428122 100644 --- a/remix-lib/package.json +++ b/remix-lib/package.json @@ -19,7 +19,7 @@ "ethereumjs-tx": "^1.3.3", "ethereumjs-util": "^5.1.2", "ethereumjs-vm": "3.0.0", - "ethers": "^3.0.15", + "ethers": "^4.0.27", "fast-async": "^6.1.2", "solc": "^0.5.0", "web3": "0.20.6" diff --git a/remix-lib/src/execution/eventsDecoder.js b/remix-lib/src/execution/eventsDecoder.js index a0a3b5123c..88a17e9353 100644 --- a/remix-lib/src/execution/eventsDecoder.js +++ b/remix-lib/src/execution/eventsDecoder.js @@ -1,5 +1,4 @@ 'use strict' -var ethJSUtil = require('ethereumjs-util') var ethers = require('ethers') var txHelper = require('./txHelper') @@ -39,10 +38,10 @@ class EventsDecoder { _eventABI (contract) { var eventABI = {} - var abi = new ethers.Interface(contract.abi) + var abi = new ethers.utils.Interface(contract.abi) for (var e in abi.events) { var event = abi.events[e] - eventABI[ethJSUtil.sha3(Buffer.from(event.signature)).toString('hex')] = { event: event.name, inputs: event.inputs, object: event } + eventABI[event.topic.replace('0x', '')] = { event: event.name, inputs: event.inputs, object: event, abi: abi } } return eventABI } @@ -71,9 +70,17 @@ class EventsDecoder { // [address, topics, mem] var log = logs[i] var topicId = log.topics[0] - var abi = this._event(topicId.replace('0x', ''), eventsABI) - if (abi) { - events.push({ from: log.address, topic: topicId, event: abi.event, args: abi.object.parse(log.topics, log.data) }) + var eventAbi = this._event(topicId.replace('0x', ''), eventsABI) + if (eventAbi) { + var decodedlog = eventAbi.abi.parseLog(log) + let decoded = {} + for (const v in decodedlog.values) { + const value = decodedlog.values[v] + if (value._ethersType) value.type = value._ethersType + let decodedValue = value._ethersType === 'BigNumber' ? value.toString() : value + decoded[v] = decodedValue + } + events.push({ from: log.address, topic: topicId, event: eventAbi.event, args: decoded }) } else { events.push({ from: log.address, data: log.data, topics: log.topics }) } diff --git a/remix-lib/src/execution/txHelper.js b/remix-lib/src/execution/txHelper.js index 954a311c66..1f1b886414 100644 --- a/remix-lib/src/execution/txHelper.js +++ b/remix-lib/src/execution/txHelper.js @@ -30,7 +30,7 @@ module.exports = { encodeFunctionId: function (funABI) { if (funABI.type === 'fallback') return '0x' - var abi = new ethers.Interface([funABI]) + var abi = new ethers.utils.Interface([funABI]) abi = abi.functions[funABI.name] return abi.sighash }, From 978f36592fb034399a8bc5cc4c92e521c25b64a1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 10 May 2019 12:13:42 +0200 Subject: [PATCH 08/11] stringify event with param array and struct --- remix-lib/src/execution/eventsDecoder.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/remix-lib/src/execution/eventsDecoder.js b/remix-lib/src/execution/eventsDecoder.js index 88a17e9353..5d1ff46c56 100644 --- a/remix-lib/src/execution/eventsDecoder.js +++ b/remix-lib/src/execution/eventsDecoder.js @@ -63,6 +63,21 @@ class EventsDecoder { return null } + _stringifyBigNumber (value) { + return value._ethersType === 'BigNumber' ? value.toString() : value + } + + _stringifyEvent (value) { + if (value === null || value === undefined) return ' - ' + if (value._ethersType) value.type = value._ethersType + if (Array.isArray(value)) { + // for struct && array + return value.map((item) => { return this._stringifyEvent(item) }) + } else { + return this._stringifyBigNumber(value) + } + } + _decodeEvents (tx, logs, contractName, compiledContracts, cb) { var eventsABI = this._eventsABI(compiledContracts) var events = [] @@ -75,10 +90,7 @@ class EventsDecoder { var decodedlog = eventAbi.abi.parseLog(log) let decoded = {} for (const v in decodedlog.values) { - const value = decodedlog.values[v] - if (value._ethersType) value.type = value._ethersType - let decodedValue = value._ethersType === 'BigNumber' ? value.toString() : value - decoded[v] = decodedValue + decoded[v] = this._stringifyEvent(decodedlog.values[v]) } events.push({ from: log.address, topic: topicId, event: eventAbi.event, args: decoded }) } else { From 2309e6d8ebf42d86591559e52cfbe5ce041bd12a Mon Sep 17 00:00:00 2001 From: yann300 Date: Sat, 11 May 2019 09:42:20 +0200 Subject: [PATCH 09/11] bump version --- remix-analyzer/package.json | 4 ++-- remix-debug/package.json | 4 ++-- remix-lib/package.json | 2 +- remix-simulator/package.json | 4 ++-- remix-solidity/package.json | 4 ++-- remix-tests/package.json | 8 ++++---- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/remix-analyzer/package.json b/remix-analyzer/package.json index 2e3a3f1f96..70bbef99b4 100644 --- a/remix-analyzer/package.json +++ b/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "remix-analyzer", - "version": "0.3.5", + "version": "0.3.6", "description": "Remix Analyzer", "main": "./index.js", "contributors": [ @@ -18,7 +18,7 @@ } ], "dependencies": { - "remix-lib": "0.4.5" + "remix-lib": "0.4.6" }, "scripts": { "lint": "standard", diff --git a/remix-debug/package.json b/remix-debug/package.json index d2bcb679b4..f0a984bd03 100644 --- a/remix-debug/package.json +++ b/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "remix-debug", - "version": "0.3.5", + "version": "0.3.6", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -22,7 +22,7 @@ "ethereumjs-util": "^4.5.0", "ethereumjs-vm": "3.0.0", "fast-async": "^6.1.2", - "remix-lib": "0.4.5", + "remix-lib": "0.4.6", "web3": "0.20.6" }, "devDependencies": { diff --git a/remix-lib/package.json b/remix-lib/package.json index 0980428122..63c5b18c8c 100644 --- a/remix-lib/package.json +++ b/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "remix-lib", - "version": "0.4.5", + "version": "0.4.6", "description": "Ethereum IDE and tools for the web", "contributors": [ { diff --git a/remix-simulator/package.json b/remix-simulator/package.json index e65688c34a..6b7292ed83 100644 --- a/remix-simulator/package.json +++ b/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "remix-simulator", - "version": "0.1.5", + "version": "0.1.6", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -22,7 +22,7 @@ "express-ws": "^4.0.0", "fast-async": "^6.3.7", "merge": "^1.2.0", - "remix-lib": "0.4.5", + "remix-lib": "0.4.6", "standard": "^10.0.3", "time-stamp": "^2.0.0", "web3": "1.0.0-beta.27" diff --git a/remix-solidity/package.json b/remix-solidity/package.json index 25749b56f5..fde8bf8f95 100644 --- a/remix-solidity/package.json +++ b/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "remix-solidity", - "version": "0.3.5", + "version": "0.3.6", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -17,7 +17,7 @@ "ethereumjs-util": "^4.5.0", "ethereumjs-vm": "3.0.0", "fast-async": "^6.1.2", - "remix-lib": "0.4.5", + "remix-lib": "0.4.6", "solc": "^0.5.0", "webworkify": "^1.2.1" }, diff --git a/remix-tests/package.json b/remix-tests/package.json index c67ce62e62..56a17f0e36 100644 --- a/remix-tests/package.json +++ b/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "remix-tests", - "version": "0.1.6", + "version": "0.1.7", "description": "Tests for the Ethereum tool suite Remix", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -42,9 +42,9 @@ "change-case": "^3.0.1", "colors": "^1.1.2", "commander": "^2.13.0", - "remix-lib": "0.4.5", - "remix-simulator": "0.1.5", - "remix-solidity": "0.3.5", + "remix-lib": "0.4.6", + "remix-simulator": "0.1.6", + "remix-solidity": "0.3.6", "signale": "^1.2.1", "web3": "1.0.0-beta.36", "winston": "^3.0.0" From 7eff819a77790c6f93527d9cc187e998f34550aa Mon Sep 17 00:00:00 2001 From: yann300 Date: Sat, 11 May 2019 09:43:01 +0200 Subject: [PATCH 10/11] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0802e169b..5f19b70dce 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.1.9", + "version": "0.1.10", "devDependencies": { "gulp": "^3.9.1", "lerna": "^2.10.2" From 92bb0f19b31a19f61568497eb36c7286acbe8807 Mon Sep 17 00:00:00 2001 From: yann300 Date: Sat, 11 May 2019 10:38:10 +0200 Subject: [PATCH 11/11] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index edcd49c036..937a56b412 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,8 @@ Remix is built out of several different modules: + [`remix-lib`](remix-lib/README.md) + [`remix-debug`](remix-debug/README.md) allo debuggin transaction. + [`remix-tests`](remix-tests/README.md) provides unit testing for solidity. ++ [`remix-astwalker`](remix-tests/README.md) provides a tool for parsing solidity AST. ++ [`remix-url-resolver`](remix-url-resolver/README.md) provides helpers for resolving external content (github, swarm, ipfs, ...). + [`remixd`](https://github.com/ethereum/remixd/tree/master) CLI which allow accessing local element from Remix IDE (see https://remix.readthedocs.io/en/latest/tutorial_remixd_filesystem.html) Each generally has their own npm package and test suite, as well as basic documentation.