0

I am completely noob to solidity . I am following a tutorial for solidity . Here I have a file name compile.js . When I run this ,I am supposed to get bytecode and abi of my contract . But I got some error saying "RangeError: Maximum call stack size exceeded" How to solve this .

here is my compile.js file :

const path= require('path');
const fs= require('fs');

const solc=require('solc');

const inboxPath=path.resolve(__dirname,'Contracts','inbox.sol');

const source = fs.readFileSync(inboxPath,'utf-8');

module.exports = solc.compile(source,1).Contracts[':inbox'];
//console.log(solc.compile(source,1));

after ruuning this file on terminal I got tons of values but at the end I got this error saying

RangeError: Maximum call stack size exceeded

I am completely a newbie ,I dont want to give up . I tried some solutions ,it seems not to work .

here is my contract :

pragma solidity >=0.4.22 <0.9.0;

contract inboxx {
    string public message;

    constructor(string memory intialmsg) {
        message = intialmsg;
    }

    function setmessage(string memory newMessage) public {
        message = newMessage;
    }
}
2
  • what command did you run in terminal?
    – Viggos
    Commented Jan 3, 2023 at 19:59
  • node compile.js
    – Shorna
    Commented Jan 6, 2023 at 14:19

1 Answer 1

0

if you are new to solidity please use Remix , there you can easily get the bytecode and abi , https://medium.com/@ultrasoundchad/an-introduction-to-solidity-and-remix-91b710865934

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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