Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gpersoon opened this issue Jan 3, 2020 · 1 comment
Open

Comments

@gpersoon
Copy link
Contributor

gpersoon commented Jan 3, 2020

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

@serapath
Copy link
Member

@gpersoon pull requests are welcome - do you maybe have students who are interested in this? :-) sadly we are currently very busy and smartcontract.codes and the related play-ed are at the moment not supported by anyone.

But thanks for the nice write-up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants