How to use the solc.version function in solc

To help you get started, we’ve selected a few solc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github EthWorks / Waffle / test / compiler / wrappers / compileSolcjs.ts View on Github external
it('loadCompier without solcVersion', async () => {
    const solcLoaded = await loadCompiler(requiredInputs);
    expect(solcLoaded.version()).to.equal(solc.version());
  });
});
github ajsantander / pocketh / src / commands / compile.js View on Github external
function requiresDifferentCompiler(solcVersion) {
  const currentVersion = solc.version();
  const current = currentVersion.split('+')[0].split('.');
  const wanted = solcVersion.split('.');
  if(current[0] !== wanted[0]) return true;
  if(current[1] !== wanted[1]) return true;
  if(parseInt(wanted[2], 10) > parseInt(current[2], 10)) return true;
  return false;
}
github KyberNetwork / smart-contracts / web3deployment / verifyLiquidityDeploy.js View on Github external
async function main() {

    myLog(0, 1, "solc version: " + solc.version());

    switch (network){
        case 'm':
            rpcUrl = mainnetUrl;
            break;
        case 'k':
            rpcUrl = kovanPublicNode;
            break;
        case 'r':
            rpcUrl = ropstenPublicNode;
            break;
        default: {
            myLog(1, 0, "error: invalid network parameter, choose: m / r / k");
        }
    }
github 0mkara / etheratom / lib / web3 / worker.js View on Github external
process.on('message', async(m) => {
    if (m.command === 'compile') {
        try {
            const input = m.payload;
            const installedSlocVersion = 'v' + Solc.version();
            const requiredSolcVersion = m.version;

            if(installedSlocVersion.includes(requiredSolcVersion)) {
                const output = await Solc.compileStandardWrapper(JSON.stringify(input));
                process.send({ compiled: output });
            } else {
                Solc.loadRemoteVersion(requiredSolcVersion, async(err, solcSnapshot) => {
                    if (err) {
                        process.send({ error: err });
                    } else {
                        const output = await solcSnapshot.compile(JSON.stringify(input));
                        process.send({ compiled: output });
                    }
                });
            }
        } catch (e) {