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. 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" 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 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 fc67d2a79b..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,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.6", + "web3": "0.20.6" }, "devDependencies": { "babel-eslint": "^7.1.1", 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() diff --git a/remix-lib/package.json b/remix-lib/package.json index a859cd88c5..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": [ { @@ -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..5d1ff46c56 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 } @@ -64,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 = [] @@ -71,9 +85,14 @@ 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) { + decoded[v] = this._stringifyEvent(decodedlog.values[v]) + } + 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/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' 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 }, 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) => { diff --git a/remix-simulator/package.json b/remix-simulator/package.json index 36f60c686b..84d7c21a4d 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", "ethereumjs-vm": "3.0.0", "ethereumjs-util": "^5.1.2", "standard": "^10.0.3", 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-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) 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"