Solidity compiler in the browser
Solc is the solidity compiler. It usually runs on the Ethereum node. Browser-solidity is an example for Solc in the browser, but it's hard to pick apart just the solc library from the entire application. This repo is a wrapper that helps you do that. browser-solc is a browserified version of solc-js.
You should use browser-solc if you:
solc.compile()
in your Dapp<script src="http://code.dappbench.com/browser-solc.min.js" type="text/javascript"></script>
//Get a list of all possibile solc versions
BrowserSolc.getVersions(function(soljsonSources, soljsonReleases) {
console.log(soljsonSources);
console.log(soljsonReleases);
}
//Load a specific compiler version
BrowserSolc.loadVersion("soljson-v0.4.6+commit.2dabbdf0.js", function(compiler) {
source = 'contract x { function g() {} }';
optimize = 1;
result = compiler.compile(source, optimize);
console.log(result);
}