You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `compile()` method always returns an object, which can contain `errors`, `sources` and `contracts` fields. `errors` is a list of error mesages.
@@ -99,21 +100,21 @@ new BrowserWindow({
99
100
webPreferences: {
100
101
nodeIntegration:false
101
102
}
102
-
});
103
+
})
103
104
```
104
105
105
106
### Using a Legacy Version
106
107
107
108
In order to compile contracts using a specific version of Solidity, the `solc.useVersion` method is available. This returns a new `solc` object that uses a version of the compiler specified. **Note**: version strings must match the version substring of the files available in `/bin/soljson-*.js`. See below for an example.
108
109
109
110
```javascript
110
-
var solc =require('solc');
111
+
var solc =require('solc')
111
112
// by default the latest version is used
112
113
// ie: solc.useVersion('latest')
113
114
114
115
// getting a legacy version
115
-
var solcV011 =solc.useVersion('v0.1.1-2015-08-04-6ff4cd6');
116
-
var output =solcV011.compile('contract t { function g() {} }', 1);
116
+
var solcV011 =solc.useVersion('v0.1.1-2015-08-04-6ff4cd6')
117
+
var output =solcV011.compile('contract t { function g() {} }', 1)
117
118
```
118
119
119
120
If the version is not available locally, you can use `solc.loadRemoteVersion(version, callback)` to load it directly from GitHub.
@@ -126,15 +127,15 @@ You can also load the "binary" manually and use `setupMethods` to create the fam
126
127
By default, the npm version is only created for releases. This prevents people from deploying contracts with non-release versions because they are less stable and harder to verify. If you would like to use the latest development snapshot (at your own risk!), you may use the following example code.
Note: in future versions of Solidity a more sophisticated linker architecture will be introduced. Once that changes, this method will still be usable for output created by old versions of Solidity.
@@ -155,9 +156,9 @@ The ABI generated by Solidity versions can differ slightly, due to new features
155
156
156
157
It can be used as:
157
158
```javascript
158
-
var abi =require('solc/abi');
159
+
var abi =require('solc/abi')
159
160
160
-
var inputABI = [{"constant":false,"inputs":[],"name":"hello","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"}];
161
+
var inputABI = [{"constant":false,"inputs":[],"name":"hello","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"}]
0 commit comments