- Publish all open files to an anonymous github gist.
- Copy all files to another instance of browser-solidity.
+ Publish all open files to an anonymous github gist.
+ Copy all files to another instance of Browser-solidity.
You can also load a gist by adding the following #gist=GIST_ID to your url, where GIST_ID is the id of the gist to load.
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+ Select execution environment:
+
+
-
+
-
-
-
This tab provides support for formal verification of Solidity contracts.
- This feature is still in development and thus also not yet well documented,
- but you can find some information
- here.
- The compiler generates input to be verified
- (or report errors). Please paste the text below into
- http://why3.lri.fr/try/
- to actually perform the verification.
- We plan to support direct integration in the future.
+
+ This tab provides support for formal verification of Solidity contracts.
+ This feature is still in development and thus also not yet well documented,
+ but you can find some information
+ here.
+ The compiler generates input to be verified
+ (or report errors). Please paste the text below into
+ http://why3.lri.fr/try/
+ to actually perform the verification.
+ We plan to support direct integration in the future.
+
-
diff --git a/package.json b/package.json
index 7cf1339a8f..c190509d5c 100644
--- a/package.json
+++ b/package.json
@@ -30,10 +30,8 @@
"babel-plugin-transform-es2015-unicode-regex": "^6.11.0",
"babel-plugin-transform-regenerator": "^6.16.1",
"babel-polyfill": "^6.22.0",
-
"babel-plugin-yo-yoify": "^0.3.3",
"babel-preset-es2015": "^6.24.0",
-
"babelify": "^7.3.0",
"brace": "^0.8.0",
"browserify": "^13.0.0",
@@ -116,24 +114,36 @@
},
"browserify": {
"transform": [
- ["babelify", {
- "sourceMapsAbsolute": false,
- "sourceMaps": true,
- "plugins": [
- ["fast-async", {
- "runtimePattern": null,
- "compiler": {
- "es7": true,
- "noRuntime": true,
- "promises": true,
- "wrapAwait": true
- }
- }],
- ["yo-yoify"]
- ],
- "presets": ["es2015"]
- }],
- ["uglifyify"]
+ [
+ "babelify",
+ {
+ "sourceMapsAbsolute": false,
+ "sourceMaps": true,
+ "plugins": [
+ [
+ "fast-async",
+ {
+ "runtimePattern": null,
+ "compiler": {
+ "es7": true,
+ "noRuntime": true,
+ "promises": true,
+ "wrapAwait": true
+ }
+ }
+ ],
+ [
+ "yo-yoify"
+ ]
+ ],
+ "presets": [
+ "es2015"
+ ]
+ }
+ ],
+ [
+ "uglifyify"
+ ]
]
},
"scripts": {
@@ -160,5 +170,8 @@
"test": "standard; npm run csslint; node test/index.js",
"test-browser": "npm-run-all -lpr selenium downloadsolc make-mock-compiler serve browsertest",
"watch": "watchify src/index.js -dv --delay 0 -p browserify-reload -o '| npm run sourcemap'"
+ },
+ "dependencies": {
+ "csjs-inject": "^1.0.1"
}
}
diff --git a/src/app.js b/src/app.js
index 3789685d3c..4da7b9c1fa 100644
--- a/src/app.js
+++ b/src/app.js
@@ -858,7 +858,7 @@ var run = function () {
})
compiler.event.register('loadingCompiler', this, function (url, usingWorker) {
- setVersionText(usingWorker ? '(loading using worker)' : '(loading)')
+ setVersionText(usingWorker ? '(loading using worker)' : '( Loading... Please, wait a moment. )')
})
compiler.event.register('compilerLoaded', this, function (version) {
@@ -940,7 +940,7 @@ var run = function () {
loadVersion($('#versionSelector').val())
})
- var header = new Option('Select new compiler version to load')
+ var header = new Option('Click to select new compiler version')
header.disabled = true
header.selected = true
$('#versionSelector').append(header)
diff --git a/src/app/execution-context.js b/src/app/execution-context.js
index 84a7e81fcf..ce6f5b18cd 100644
--- a/src/app/execution-context.js
+++ b/src/app/execution-context.js
@@ -1,4 +1,4 @@
-/* global confirm */
+/* global confirm, prompt */
'use strict'
var $ = require('jquery')
@@ -94,43 +94,25 @@ function ExecutionContext () {
this.setContext = function (context) {
executionContext = context
executionContextChange(context)
- setExecutionContextRadio()
}
- var $injectedToggle = $('#injected-mode')
- var $vmToggle = $('#vm-mode')
- var $web3Toggle = $('#web3-mode')
var $web3endpoint = $('#web3Endpoint')
if (web3.providers && web3.currentProvider instanceof web3.providers.IpcProvider) {
$web3endpoint.val('ipc')
}
- setExecutionContextRadio()
-
- $injectedToggle.on('change', executionContextUIChange)
- $vmToggle.on('change', executionContextUIChange)
- $web3Toggle.on('change', executionContextUIChange)
- $web3endpoint.on('change', function () {
- setProviderFromEndpoint()
- if (executionContext === 'web3') {
- self.event.trigger('web3EndpointChanged')
- }
- })
-
- function executionContextUIChange (ev) {
- executionContextChange(ev.target.value)
- }
-
function executionContextChange (context) {
if (context === 'web3' && !confirm('Are you sure you want to connect to a local ethereum node?')) {
- setExecutionContextRadio()
+ return false
} else if (context === 'injected' && injectedProvider === undefined) {
- setExecutionContextRadio()
+ return false
} else {
if (context === 'web3') {
executionContext = context
- setProviderFromEndpoint()
+ var endpoint = prompt('Please type Web3 Provider Endpoint', 'http://localhost:8545')
+ setProviderFromEndpoint(endpoint)
+ self.event.trigger('web3EndpointChanged')
self.event.trigger('contextChanged', ['web3'])
} else if (context === 'injected') {
executionContext = context
@@ -143,11 +125,11 @@ function ExecutionContext () {
})
self.event.trigger('contextChanged', ['vm'])
}
+ return true
}
}
- function setProviderFromEndpoint () {
- var endpoint = $web3endpoint.val()
+ function setProviderFromEndpoint (endpoint) {
if (endpoint === 'ipc') {
web3.setProvider(new web3.providers.IpcProvider())
} else {
@@ -155,15 +137,16 @@ function ExecutionContext () {
}
}
- function setExecutionContextRadio () {
- if (executionContext === 'injected') {
- $injectedToggle.get(0).checked = true
- } else if (executionContext === 'vm') {
- $vmToggle.get(0).checked = true
- } else if (executionContext === 'web3') {
- $web3Toggle.get(0).checked = true
+ /* ---------------------------------------------------------------------------
+ DROPDOWN
+ --------------------------------------------------------------------------- */
+
+ var selectExEnv = document.querySelector('#selectExEnv')
+ selectExEnv.addEventListener('change', function (event) {
+ if (!executionContextChange(selectExEnv.options[selectExEnv.selectedIndex].value)) {
+ selectExEnv.value = executionContext
}
- }
+ })
}
module.exports = ExecutionContext
diff --git a/src/app/renderer.js b/src/app/renderer.js
index 24d948731b..777c5906db 100644
--- a/src/app/renderer.js
+++ b/src/app/renderer.js
@@ -16,6 +16,10 @@ function Renderer (appAPI, formalVerificationEvent, compilerEvent) {
$('#output').empty()
if (success) {
self.contracts(data, source)
+ $('#header #menu .envView').css('color', '')
+ } else {
+ // envView is the `Contract` tab, as a refactor the entire envView should have his own module
+ $('#header #menu .envView').css('color', '#FF8B8B')
}
// NOTE: still need to display as there might be warnings
diff --git a/src/app/staticanalysis/staticAnalysisView.js b/src/app/staticanalysis/staticAnalysisView.js
index e016ac2ca8..ff163d40e7 100644
--- a/src/app/staticanalysis/staticAnalysisView.js
+++ b/src/app/staticanalysis/staticAnalysisView.js
@@ -3,6 +3,14 @@ var StaticAnalysisRunner = require('./staticAnalysisRunner.js')
var yo = require('yo-yo')
var $ = require('jquery')
var utils = require('../utils')
+var csjs = require('csjs-inject')
+
+var css = csjs`
+ .analysis {
+ margin-top: 2em;
+ font-height: 1.5em;
+ }
+`
function staticAnalysisView (appAPI, compilerEvent) {
this.view = null
@@ -25,7 +33,7 @@ function staticAnalysisView (appAPI, compilerEvent) {
staticAnalysisView.prototype.render = function () {
var self = this
- var view = yo`