Skip to content

Format http://solc-bin.ethereum.org/bin/soljson-v*.js has changed #34

@gpersoon

Description

@gpersoon

The format of http://solc-bin.ethereum.org/bin/soljson-v*.js has changed from version 0.5.14.
This results in the fact that source with a compiler version of 0.5.14 or higher shows the error:
Error: Contract could not be compiled. Try another pragma solidity version.

Until version 0.5.13:
https://solc-bin.ethereum.org/bin/soljson-v0.5.13+commit.5b0b510c.js

var Module=typeof Module!=="undefined"?Module:{};

https://solc-bin.ethereum.org/bin/soljson-v0.5.14+commit.1f1aaa4.js

"use strict";var Module=typeof Module!=="undefined"?Module:{}

This breaks the following piece of code (e.g. the checking for var Module).

async function getCompilersource(compilerURL) {
  try {
    const opts = {
      url: compilerURL,
      caching: true,
      transform: function (data) {
        if (data.substring(0, 10) != 'var Module') {
          throw Error('get compiler source fail');
        }
        return data;
      }
    };
    return await promiseAjax(opts);
  } catch (error) {
    throw error;
  }
}

Source is probably:
https://github.com/alincode/solcjs-core/blob/master/src/getCompilersource.js#L12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions