question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

solcjs doesn't appear to do anything on Windows

See original GitHub issue

Either I’m doing something wrong (the usage instructions are unclear), or there’s a bug:

I just installed latest solcjs npm install -g solcjs on my Windows 10 machine, trying to compile a simple script.

Running

solcjs --bin Coin.sol thinks for a bit, and doesn’t actually do anything, where Coin.sol is the following file:

pragma solidity ^0.4.0;

contract Coin {
    // The keyword "public" makes those variables
    // readable from outside.
    address public minter;
    mapping (address => uint) public balances;

    // Events allow light clients to react on
    // changes efficiently.
    event Sent(address from, address to, uint amount);

    // This is the constructor whose code is
    // run only when the contract is created.
    function Coin() {
        minter = msg.sender;
    }

    function mint(address receiver, uint amount) {
        if (msg.sender != minter) return;
        balances[receiver] += amount;
    }

    function send(address receiver, uint amount) {
        if (balances[msg.sender] < amount) return;
        balances[msg.sender] -= amount;
        balances[receiver] += amount;
        Sent(msg.sender, receiver, amount);
    }
}

solcjs version is 0.4.11+commit.68ef5810.Emscripten.clang

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
axiccommented, Jul 11, 2017

Sorry, solcjs actually writes a file and doesn’t show anything on screen. You should have a file Coin.sol:Coin.bin.

0reactions
ripper234commented, Jul 11, 2017

I believe it is indeed an invalid filename. It is odd that an error isn’t detected though.

On Tue, Jul 11, 2017 at 1:00 PM, chriseth notifications@github.com wrote:

… which might be impossible on windows - : might be invalid in filenames for windows.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ethereum/solc-js/issues/109#issuecomment-314396351, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKg-nkOlZTGx6CJa1ZOwwX8QfqlXGtuks5sM0fVgaJpZM4NiqvT .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solidity compiler command-line utility (solcjs) various problems
First I noticed that I cannot use a backslash, i.e., can only use a slash (I should emphasize that I am running on...
Read more >
Installing the Solidity Compiler — Solidity 0.8.16 documentation
The commandline options of solcjs are not compatible with solc and tools (such as geth ) expecting the behaviour of solc will not...
Read more >
Cant compile solidity files using correct Solc version
It seems that you have two copies of solcjs - one v0.5.16 (dependency of truffle) and one v0.8.4 (separately installed package). Can you ......
Read more >
Solidity Documentation - Read the Docs
This contract does not do much yet apart from (due to the infrastructure ... you will not see anything when you look at...
Read more >
How to Install Solidity in Windows? - GeeksforGeeks
With the help of this feature, we can run the Ubuntu terminal on the Windows machine. Below are the steps to setup Solidity...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found