0

I've just started my journy with etherium, so now I am trying to get my first script complied. I tried starting with this project https://github.com/san-lee-ai/simple_auction But I could not get the solidity script compiled. Clicking on the compile button, on the http://remix.ethereum.org, just make the arrows near the "compile SimpleAuction.sol" just turn enlessly, over more than 24 hours. I got it down to This code:

pragma solidity ^0.4.0;

contract SimpleAuction {
  uint public auctionStart;
  uint public biddingTime;
}

That compiles without any fuss, to this code:

pragma solidity ^0.4.0;

contract SimpleAuction {
   uint public auctionStart;
   uint public biddingTime;
   function SimpleAuction(
   ) {
       auctionStart = now;
   }
}

That never gets compiled. It just spins endlessly without throwing any error. This is a trend: any code that doesn't contain a function, compiles in seconds, but when I add a function, compiling never ends.

What can I do, to get my code to compile with functions? I am using compiler version 4.1 (I tried others, with similar results), and EVM Version default (again, tried others with similar results).

I am using a local node (not sure it has anything to do with this, but I just started, so I'm trying to stick to what I read).

Thanks in advance

  • 1
    Check your browser console. I get a "Cannot read property 'length' of undefined" error when trying to compile that code with 0.4.1. If I use 0.4.26, things work fine. In case you're not aware, 0.4.1 is over 3 years old. Many compiler bugs have been fixed since then. Please use a recent version of the compiler. 0.5.11 is current, and 0.4.26 is the last 0.4.x version (in case you're trying to get old sample code to work that uses 0.4.x syntax). – user19510 Sep 30 '19 at 5:49
  • Thanks! I tried it, and you're right. As this is a comment and not an answer, but you're upvoted in my heart :) – GuruYaya Oct 1 '19 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.