Skip to content

Commit

Permalink
David/merge upstream (#2)
Browse files Browse the repository at this point in the history
* use proper javascript object for scripting

* clear circle cache

* warn deprecated

* help message in terminal

* typo

* intro

* clear circle cache

* Filter tests

* Add event trigger/register for new File created

* Push new file to allTest and run only selectedTests

* Add checked to new tests

* Add styling to test outputs

* Add filename to tests summary

* fix lost refs while rebasing

* new css style for test result

* Fix copy input field

* Update test-tab.js

* draggable content for extension

* update font awesome

* don't load plugin if loaded

* add actions (minimize, maximise, close)

* load plugin

* standard

* add compiler metadata

* retrieve contract metadata

* linklibrairies in metadata file is present

* fix path

* autodeploy libs when creating instances

* add autdeploylib property to metadata

* fix compilation slow warning

* clear circle ci cache

* Update package.json

* json file include network id

* clear ci cache

* resolve only networkname if id no present

* also return by networkid

* Update test-tab.js

* Update txlogger.js

Decoded output log now have copytoclipboard feature

* commit added vm acount (for fixing account balance)

* add NPM pkg for .sol syntax hilighting

Start using https://www.npmjs.com/package/ace-mode-solidity ,
which is an improved version of src/app/editor/mode-solidity.js

* add ethers.js to the console

* implemented `execute` terminal command

* return error if localhost not connected

* use Web3 1.0.0 in remix-ide

* Update terminal.js

* Update package.json

* Update terminal.js

* Update compiler-imports.js

* Update publishOnSwarm.js

* Check lowered case metadata key

* add http && https explorer and import raw url

* remove User Agent Remix

* clear circle ci cache

* Alignment fixes

* Some more fixes in UI of run tab

* Fix_ErrorWhileCallingUnknownContract

* typo

* fix display status not available if receipt not available

* add console.warn to terminal

* add missing css to dark style

* add generate test file

* fix tab name

* fix description

* fix test tab

* add "no test file available"

* tab ordering

* Warn user at deploy time if contract size above ethereum/EIPs#170

* reorg debug panel

* Improve log styling

* fix test

* Update vmdebugger.js

* Update vmdebugger.js

* Update vmdebugger.js

* clear accounts list before renewing

* fix autoDeploy lib, default behavior

* auto update accounts list

* standard

* add warning color to stylesheet

* update requires to new remix libs

* point to local libs to test

* use lastest package versions

* fix reference to storage

* fix typo

* cleanup

* fix web3 obj

* update txbrowser web3 reference

* reinit vmdebugger; tolerate view not existing

* fix fixes for remix-debug integration

* fix debugging

* make linter happy

* fix debug button

* fix loading trace

* don't display provider url

* remove reference when unloading

* use getSourceLocationFromVMTraceIndex

* fix used ref

* fix hit breakpoint

* use latest published remix lib

* remove downloadsolc + clean cache

* fix ref

* adapt UI

* ui small fixes

* small ui fixes

* clear cache

* fix standalone debugger

* delete comment

* remove console.log

* fix updating web reference

* show all panels in any case

* fix fake provider

* fix tests

* fix test

* add remix-debug to the console

* typo

* fix tests

* move solidity version selector to compile tab

* move plugin panel up

* move remix, remixd info to setttings tab

* refactor plugin loading/removing

* UX update for buttons for plugin tab

* add title in pluging

* fix dark styling

* add some help log

* option for generating metadata

* Add ability to sign messages for web3 providers and Javascript VM

* fix standard && display hashed messages in the result

* remove ECRecover test

* word wrap for modal dialog

* display error message in the console

* Update README.md

* Update package.json

* Add Custom networks when using Web3 Provider.

* Fixed linkages
  • Loading branch information
ansermino committed Oct 9, 2018
1 parent 29dcb2a commit 71aa52c
Show file tree
Hide file tree
Showing 68 changed files with 4,513 additions and 2,324 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
- checkout
- restore_cache:
keys:
- dep-bundle-13-{{ checksum "package.json" }}
- dep-bundle-20-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: dep-bundle-13-{{ checksum "package.json" }}
key: dep-bundle-20-{{ checksum "package.json" }}
paths:
- ~/repo/node_modules
- run: npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build
- run: npm run lint && npm run test && npm run make-mock-compiler && npm run build
- run: ./ci/browser_tests.sh

remix-debugger:
Expand All @@ -46,10 +46,10 @@ jobs:
- checkout
- restore_cache:
keys:
- dep-bundle-8-{{ checksum "package.json" }}
- dep-bundle-15-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: dep-bundle-8-{{ checksum "package.json" }}
key: dep-bundle-15-{{ checksum "package.json" }}
paths:
- ~/repo/node_modules
- run: npm run build_debugger
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branches:
- master
- remix_live
script:
- npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build
- npm run lint && npm run test && npm run make-mock-compiler && npm run build
- ./ci/browser_tests.sh
deploy:
- provider: script
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Remix is a browser-based compiler and IDE that enables users to build **Ethereum

To try it out, visit [https://remix.ethereum.org](https://remix.ethereum.org).

https://github.com/ethereum/remix-ide/releases also gives others ways to use Remix locally. Please check it out.

Remix consists of many modules and in this repository you will find the Remix IDE (aka. Browser-Solidity).

![Remix screenshot](https://i.imgur.com/clfc7US.png)
Expand Down Expand Up @@ -36,7 +38,7 @@ Or if you want to clone the github repository (`wget` need to be installed first
git clone https://github.com/ethereum/remix-ide.git
cd remix-ide
npm install
npm run setupremix # this will clone https://github.com/ethereum/remix for you and link it to remix-ide
npm run setupremix # this will clone https://github.com/ethereum/remix for you and link it to remix-ide. Only execute this step if you want to contribute on Remix development
npm start
```

Expand Down
4 changes: 2 additions & 2 deletions assets/css/font-awesome.min.css

Large diffs are not rendered by default.

Binary file modified assets/fonts/FontAwesome.otf
Binary file not shown.
Binary file modified assets/fonts/fontawesome-webfont.eot
Binary file not shown.
3,305 changes: 2,668 additions & 637 deletions assets/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file modified assets/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file modified assets/fonts/fontawesome-webfont.woff2
Binary file not shown.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.2",
"description": "Minimalistic browser-based Solidity IDE",
"devDependencies": {
"@shyftnetwork/shyft_ethereumjs-block": "^1.7.1",
"ace-mode-solidity": "^0.1.0",
"async": "^2.1.2",
"babel-preset-env": "^1.6.1",
"babel-eslint": "^7.1.1",
Expand Down Expand Up @@ -38,21 +38,22 @@
"npm-link-local": "^1.1.0",
"npm-run-all": "^4.0.2",
"onchange": "^3.2.1",
"@shyftnetwork/shyft_remix-core": "latest",
"@shyftnetwork/shyft_remix-debugger": "latest",
"@shyftnetwork/shyft_remix-debug": "latest",
"@shyftnetwork/shyft_remix-analyzer": "latest",
"@shyftnetwork/shyft_remix-lib": "latest",
"@shyftnetwork/shyft_remix-solidity": "latest",
"@shyftnetwork/shyft_remix-tests": "latest",
"remixd": "git+https://github.com/ethereum/remixd.git",
"request": "^2.83.0",
"rimraf": "^2.6.1",
"selenium-standalone": "^6.0.1",
"standard": "^8.5.0",
"swarmgw": "^0.2.0",
"swarmgw": "^0.3.1",
"tape": "^4.5.1",
"uglify-js": "^2.8.16",
"vm-browserify": "0.0.4",
"watchify": "^3.9.0",
"web3": "^0.18.0",
"web3": "1.0.0-beta.27",
"webworkify": "^1.2.1",
"yo-yo": "^1.2.2",
"yo-yoify": "^3.7.3"
Expand All @@ -64,7 +65,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/ethereum/remix-ide.git"
"url": "git+https://github.com/shyftnetwork/shyft_remix-ide.git"
},
"keywords": [
"ethereum",
Expand Down Expand Up @@ -148,21 +149,20 @@
"remix-ide": "./bin/remix-ide"
},
"scripts": {
"setupremix": "npm run pullremix && npm run linkremixcore && npm run linkremixlib && npm run linkremixsolidity;",
"setupremix": "npm run pullremix && npm run linkremixlib && npm run linkremixsolidity;",
"pullremix": "git clone https://github.com/ethereum/remix",
"linkremixcore": "cd node_modules && rm -rf remix-core && ln -s ../remix/remix-core remix-core && cd ..",
"linkremixlib": "cd node_modules && rm -rf remix-lib && ln -s ../remix/remix-lib remix-lib && cd ..",
"linkremixsolidity": "cd node_modules && rm -rf remix-solidity && ln -s ../remix/remix-solidity remix-solidity && cd ..",
"build": "browserify src/index.js -o build/app.js",
"build": "browserify src/index.js -o build/app.js --exclude solc",
"build_debugger": "browserify src/app/debugger/remix-debugger/index.js -o src/app/debugger/remix-debugger/build/app.js",
"browsertest": "sleep 5 && npm run nightwatch_local",
"csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='assets/css/font-awesome.min.css' assets/css/",
"downloadsolc": "rimraf soljson.js && cd node_modules/solc && wget --no-check-certificate https://shyftnetwork.github.io/shyft_solc-bin/soljson.js && cd ../../",
"downloadsolc_root": "wget --no-check-certificate https://shyftnetwork.github.io/shyft_solc-bin/soljson.js",
"lint": "standard | notify-error",
"make-mock-compiler": "node ci/makeMockCompiler.js",
"minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false",
"nightwatch_local": "nightwatch --config nightwatch.js --env local",
"nightwatch_local_debugger": "nightwatch --config nightwatch_debugger.js --env local",
"nightwatch_remote_chrome": "nightwatch --config nightwatch.js --env chrome",
"nightwatch_remote_firefox": "nightwatch --config nightwatch.js --env default",
"nightwatch_remote_ie": "nightwatch --config nightwatch.js --env ie",
Expand All @@ -180,6 +180,6 @@
"start": "npm-run-all -lpr serve watch onchange remixd",
"test": "npm run csslint; standard && node test/index.js",
"test-browser": "npm-run-all -lpr selenium downloadsolc_root make-mock-compiler serve browsertest",
"watch": "watchify src/index.js -dv -p browserify-reload -o build/app.js"
"watch": "watchify src/index.js -dv -p browserify-reload -o build/app.js --exclude solc"
}
}
6 changes: 6 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ class App {
self._components.filesProviders['github'] = new BasicReadOnlyExplorer('github')
self._components.filesProviders['gist'] = new NotPersistedExplorer('gist')
self._components.filesProviders['ipfs'] = new BasicReadOnlyExplorer('ipfs')
self._components.filesProviders['https'] = new BasicReadOnlyExplorer('https')
self._components.filesProviders['http'] = new BasicReadOnlyExplorer('http')
registry.put({api: self._components.filesProviders['localhost'], name: 'fileproviders/localhost'})
registry.put({api: self._components.filesProviders['swarm'], name: 'fileproviders/swarm'})
registry.put({api: self._components.filesProviders['github'], name: 'fileproviders/github'})
Expand Down Expand Up @@ -321,6 +323,9 @@ class App {
}
var provider = self._components.fileManager.fileProviderOf(url)
if (provider) {
if (provider.type === 'localhost' && !provider.isConnected()) {
return filecb(`file provider ${provider.type} not available while trying to resolve ${url}`)
}
provider.exists(url, (error, exist) => {
if (error) return filecb(error)
if (exist) {
Expand Down Expand Up @@ -474,6 +479,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
self._components.filePanel = new FilePanel()
self._view.leftpanel.appendChild(self._components.filePanel.render())
self._components.filePanel.event.register('resize', delta => self._adjustLayout('left', delta))
registry.put({api: self._components.filePanel, name: 'filepanel'})

// ----------------- Renderer -----------------
var renderer = new Renderer()
Expand Down
22 changes: 17 additions & 5 deletions src/app/compiler/compiler-imports.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'
var base64 = require('js-base64').Base64
var swarmgw = require('swarmgw')
var swarmgw = require('swarmgw')()
var request = require('request')

module.exports = class CompilerImports {
Expand Down Expand Up @@ -40,10 +40,7 @@ module.exports = class CompilerImports {

return request.get(
{
url: 'https://gateway.ipfs.io/' + url,
headers: {
'User-Agent': 'Remix'
}
url: 'https://gateway.ipfs.io/' + url
},
(err, r, data) => {
if (err) {
Expand All @@ -53,9 +50,24 @@ module.exports = class CompilerImports {
})
}

handleHttpCall (url, cleanUrl, cb) {
return request.get(
{
url
},
(err, r, data) => {
if (err) {
return cb(err || 'Unknown transport error')
}
cb(null, data, cleanUrl)
})
}

handlers () {
return [
{ type: 'github', match: /^(https?:\/\/)?(www.)?github.com\/([^/]*\/[^/]*)\/(.*)/, handler: (match, cb) => { this.handleGithubCall(match[3], match[4], cb) } },
{ type: 'http', match: /^(http?:\/\/?(.*))$/, handler: (match, cb) => { this.handleHttpCall(match[1], match[2], cb) } },
{ type: 'https', match: /^(https?:\/\/?(.*))$/, handler: (match, cb) => { this.handleHttpCall(match[1], match[2], cb) } },
{ type: 'swarm', match: /^(bzz[ri]?:\/\/?(.*))$/, handler: (match, cb) => { this.handleSwarmImport(match[1], match[2], cb) } },
{ type: 'ipfs', match: /^(ipfs:\/\/?.+)/, handler: (match, cb) => { this.handleIPFS(match[1], cb) } }
]
Expand Down
2 changes: 1 addition & 1 deletion src/app/contract/publishOnSwarm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

var async = require('async')
var swarmgw = require('swarmgw')
var swarmgw = require('swarmgw')()

module.exports = (contract, fileManager, cb, swarmVerifiedPublishCallBack) => {
// gather list of files to publish
Expand Down
44 changes: 26 additions & 18 deletions src/app/debugger/debugger.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict'

var EthdebuggerUI = require('./remix-debugger/src/ui/EthdebuggerUI')
var Ethdebugger = require('@shyftnetwork/shyft_remix-debug').EthDebugger
var remixLib = require('@shyftnetwork/shyft_remix-lib')
var remixCore = require('@shyftnetwork/shyft_remix-core')
var Ethdebugger = require('./remix-debugger/src/ui/Ethdebugger')
var executionContext = require('../../execution-context')
var globlalRegistry = require('../../global/registry')

Expand All @@ -22,6 +21,7 @@ function Debugger (container, sourceHighlighter, localRegistry) {
}
this.debugger = new Ethdebugger(
{
executionContext: executionContext,
compilationResult: () => {
var compilationResult = this._deps.compiler.lastCompilationResult
if (compilationResult) {
Expand All @@ -30,17 +30,21 @@ function Debugger (container, sourceHighlighter, localRegistry) {
return null
}
})
this.debugger_ui = new EthdebuggerUI({debugger: this.debugger})
this.sourceMappingDecoder = new remixLib.SourceMappingDecoder()
container.appendChild(this.debugger.render())
//
// TODO: render doesn't exist anymore
container.appendChild(this.debugger_ui.render())
//
this.isActive = false

this.breakPointManager = new remixCore.code.BreakpointManager(this.debugger, (sourceLocation) => {
this.breakPointManager = new remixLib.code.BreakpointManager(this.debugger, (sourceLocation) => {
return self._deps.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, this._deps.compiler.lastCompilationResult.source.sources)
}, (step) => {
this.debugger_ui.stepManager.jumpTo(step)
})

this.debugger.setBreakpointManager(this.breakPointManager)
this.breakPointManager.event.register('breakpointHit', (sourceLocation) => {
})

var self = this
self._deps.editor.event.register('breakpointCleared', (fileName, row) => {
Expand Down Expand Up @@ -70,15 +74,18 @@ function Debugger (container, sourceHighlighter, localRegistry) {
})

// register selected code item, highlight the corresponding source location
this.debugger.codeManager.event.register('changed', this, function (code, address, index) {
this.debugger_ui.event.register('indexChanged', function (index) {
if (self._deps.compiler.lastCompilationResult) {
self.debugger.callTree.sourceLocationTracker.getSourceLocationFromInstructionIndex(address, index, self._deps.compiler.lastCompilationResult.data.contracts, function (error, rawLocation) {
if (!error && self._deps.compiler.lastCompilationResult && self._deps.compiler.lastCompilationResult.data) {
var lineColumnPos = self._deps.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, self._deps.compiler.lastCompilationResult.source.sources)
self._components.sourceHighlighter.currentSourceLocation(lineColumnPos, rawLocation)
} else {
self._components.sourceHighlighter.currentSourceLocation(null)
}
self.debugger.traceManager.getCurrentCalledAddressAt(index, (error, address) => {
if (error) return console.log(error)
self.debugger.callTree.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, index, self._deps.compiler.lastCompilationResult.data.contracts, function (error, rawLocation) {
if (!error && self._deps.compiler.lastCompilationResult && self._deps.compiler.lastCompilationResult.data) {
var lineColumnPos = self._deps.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, self._deps.compiler.lastCompilationResult.source.sources)
self._components.sourceHighlighter.currentSourceLocation(lineColumnPos, rawLocation)
} else {
self._components.sourceHighlighter.currentSourceLocation(null)
}
})
})
}
})
Expand All @@ -91,9 +98,10 @@ function Debugger (container, sourceHighlighter, localRegistry) {
*/
Debugger.prototype.debug = function (txHash) {
var self = this
this.debugger.web3().eth.getTransaction(txHash, function (error, tx) {

this.debugger.web3.eth.getTransaction(txHash, function (error, tx) {
if (!error) {
self.debugger.debug(tx)
self.debugger_ui.debug(tx)
}
})
}
Expand Down Expand Up @@ -121,7 +129,7 @@ Debugger.prototype.switchProvider = function (type) {
* get the current provider
*/
Debugger.prototype.web3 = function (type) {
return this.debugger.web3()
return this.debugger.web3
}

module.exports = Debugger
5 changes: 2 additions & 3 deletions src/app/debugger/remix-debugger/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
<script type="text/javascript">
function loadDebugger() {
var container = document.getElementById('app')
container.debugger = new window.remix.ui.Debugger()
container.debugger.addProvider('INTERNAL')
container.debugger.switchProvider('INTERNAL')
var debuggerBackend = new window.remix.ui.DebuggerBackend({})
container.debugger = new window.remix.ui.Debugger({debugger: debuggerBackend})
container.appendChild(container.debugger.render())
}
</script>
Expand Down
6 changes: 4 additions & 2 deletions src/app/debugger/remix-debugger/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'
var VMDebugger = require('./src/ui/VmDebugger')
var Debugger = require('./src/ui/Ethdebugger')
var Debugger = require('./src/ui/EthdebuggerUI')
var DebuggerBackend = require('@shyftnetwork/shyft_remix-debug').EthDebugger

if (typeof (module) !== 'undefined' && typeof (module.exports) !== 'undefined') {
module.exports = modules()
Expand All @@ -14,7 +15,8 @@ function modules () {
return {
ui: {
Debugger: Debugger,
VMdebugger: VMDebugger
VMdebugger: VMDebugger,
DebuggerBackend
}
}
}
1 change: 1 addition & 0 deletions src/app/debugger/remix-debugger/src/ui/ButtonNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function ButtonNavigator (_parent, _traceManager) {
this.revertionPoint = null

_parent.event.register('indexChanged', this, (index) => {
if (!this.view) return
if (index < 0) return
if (_parent.currentStepIndex !== index) return

Expand Down
10 changes: 5 additions & 5 deletions src/app/debugger/remix-debugger/src/ui/CalldataPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
var DropdownPanel = require('./DropdownPanel')
var yo = require('yo-yo')

function CalldataPanel (_parent, _traceManager) {
this.parent = _parent
function CalldataPanel (_parentUI, _traceManager) {
this._parentUI = _parentUI
this.traceManager = _traceManager
this.basicPanel = new DropdownPanel('Call Data', {json: true})
this.init()
Expand All @@ -15,15 +15,15 @@ CalldataPanel.prototype.render = function () {

CalldataPanel.prototype.init = function () {
var self = this
this.parent.event.register('indexChanged', this, function (index) {
this._parentUI.event.register('indexChanged', this, function (index) {
if (index < 0) return
if (self.parent.currentStepIndex !== index) return
if (self._parentUI.currentStepIndex !== index) return

self.traceManager.getCallDataAt(index, function (error, calldata) {
if (error) {
self.basicPanel.update({})
console.log(error)
} else if (self.parent.currentStepIndex === index) {
} else if (self._parentUI.currentStepIndex === index) {
self.basicPanel.update(calldata)
}
})
Expand Down
5 changes: 2 additions & 3 deletions src/app/debugger/remix-debugger/src/ui/CodeListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ var styles = styleGuide.chooser()
var css = csjs`
.instructions {
${styles.rightPanel.debuggerTab.box_Debugger}
width: 75%;
overflow-y: scroll;
max-height: 250px;
max-height: 150px;
}
`
function CodeListView (_parent, _codeManager) {
Expand All @@ -24,7 +23,7 @@ function CodeListView (_parent, _codeManager) {
this.address
this.codeView
this.itemSelected
this.basicPanel = new DropdownPanel('Instructions', {json: false})
this.basicPanel = new DropdownPanel('Instructions', {json: false, displayContentOnly: true})
this.basicPanel.event.register('hide', () => {
this.event.trigger('hide', [])
})
Expand Down
Loading

0 comments on commit 71aa52c

Please sign in to comment.