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

"Unexpected number" when compiling contracts with solc-js v0.5.14+commit.1f1aaa4 #975

Closed
kuzdogan opened this issue Apr 4, 2023 · 1 comment
Assignees
Labels
🪲 bug Something isn't working

Comments

@kuzdogan
Copy link
Member

kuzdogan commented Apr 4, 2023

When debugging, I've encountered a compiler version that when compiled with solc-js throw the Error Unexpected number when importing at this line:

const solcjsImports = await import(soljsonPath);

Since I was suspecting this to be related to #964 I've also tested another "symlinked" compiler version in solc-bin: v0.3.5+commit.5f97274, and yes that also throws the same error.

I have tested contracts will the following versions:

  • v0.6.0+commit.26b70077
  • v0.5.17+commit.d19bba13
  • v0.5.16+commit.9c3226ce
  • v0.5.15+commit.6a57276f
  • Affected version: v0.5.14+commit.1f1aaa4
  • v0.5.13+commit.5b0b510c
  • Affected version v0.3.5+commit.5f97274

Example contracts

Withv0.5.14:

With v0.3.5:

Remarks

I can observe two issues here:

  1. I suspect this is can be because of symlinking of the compiler, due to an incorrect commit naming as laid out here Default SolcJs compiler #964 v0.5.14+commit.1f1aaa4
  2. The same error is also thrown in staging, which should actually have used the platform-specific binary and not the solc-js. I can see that the binary is not being downloaded under linux-amd64/. Is the PR Default SolcJs compiler #964 not working as intended? We must further investigate before a prod. release

View in Huly HI-388

@kuzdogan kuzdogan added 🪲 bug Something isn't working high-priority labels Apr 4, 2023
@marcocastignoli marcocastignoli self-assigned this Apr 11, 2023
@marcocastignoli
Copy link
Member

Calling the generated link that fetchAndSaveSolc creates (https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/soljson-v0.5.14+commit.1f1aaa4.js), you get:

soljson-v0.5.14+commit.01f1aaa4.js

If you call it again you finally get the right soljson-v0.5.14 implementation.

https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/soljson-v0.5.14+commit.01f1aaa4.js

So the fix would be to handle this cases in which the url doesn't return the soljson-v0.5.14 implementation but the name to the right file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants