Commit 53e225e7 authored by d11e9's avatar d11e9

update readme for legacy versions

parent 8e3677c8
...@@ -32,9 +32,12 @@ Note that all input files that are imported have to be supplied, the compiler wi ...@@ -32,9 +32,12 @@ Note that all input files that are imported have to be supplied, the compiler wi
###Using a legacy version ###Using a legacy version
In order to allow compiling contracts using a specific version of solidity, the `solc.setVersion` method is available. In order to allow compiling contracts using a specific version of solidity, the `solc.useVersion` method is available. this returns a new solc object using the version provided. **Note**: version strings must match the version substring of the files availble in `/bin/soljson-*.js`. See below for an example.
var solc = require('solc'); var solc = require('solc');
solc.setVersion( 'latest' ); // this is used by default // by default the latest version is used
solc.setVersion( 'v0.1.1-2015-08-04-6ff4cd6' ); // ie: solc.useVersion('latest')
var output = solc.compile( "contract t { function g() {} }", 1 );
// getting a legacy version
var solcV011 = solc.useVersion( 'v0.1.1-2015-08-04-6ff4cd6' );
var output = solcV011.compile( "contract t { function g() {} }", 1 );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment