0

I was trying to compile my contract using solc compiler but it returning me some errors. I will place my solidity code along with the error that I am getting here. Please help me out to sort this error out asap if possible.

This is the solidity code that I am using:

pragma solidity ^0.4.17;
contract Maxsupply {
    string public message;
    function Maxsupply(string newMessage) public{
        message = newMessage;
    }
    function setmessage(string _message) public{
        message = _message;
    }
}

This is the code that I have written in javascript for compiling the contract:

const path = require('path');
const fs = require('fs');
const solc = require('solc');
const inboxPath = path.resolve(__dirname,'contracts','message.sol');
const source = fs.readFileSync(inboxPath,'utf8');
console.log(solc.compile(source,1));

Error:

(node:1091) V8:
/Users/saitejakuruva/Documents/Inbox/node_modules/solc/soljson.js:3
Invalid asm.js: Invalid member of stdlib
  • Hi there. What is the solc command you're using? (Or what is the Javascript code you've written?) What version of solc are you running? – Richard Horrocks Apr 1 at 14:26
  • Sorry I have updated my question please go through that once again . I have provided the solidity code and about I'm using 0.4.25 version of solc – Saiteja Kuruva Apr 1 at 14:32
0

Your node_modules directory is probably corrupted. Try removing it and do npm i again. Also try updating solc version.

  • I have all the stuff you have suggested me but I am unable to sort out this error . – Saiteja Kuruva Apr 1 at 17:27

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.