gpt4 book ai didi

javascript - 范围错误: Maximum call stack size exceeded when try Compilation in Solidity

转载 作者:行者123 更新时间:2023-12-02 22:48:00 26 4
gpt4 key购买 nike

当我尝试在控制台中执行时

node compile.js

我收到此错误。

RangeError: Maximum call stack size exceeded when try Compilation in Solidity

Invox.sol:

pragma solidity  ^0.4.25;

contract Invox {
string public message;

function Invox (string initialmessage) public {
message = initialmessage;
}
function setMessage(string _message) public {
message = _message;
}
}

编译.js:

const path = require('path');
const fs = require('fs');
const solc = require('solc');
const invoxPath = path.resolve(__dirname, 'contracts', 'invox.sol');
const source = fs.readFileSync(invoxPath, 'utf8');
//We have replaced the following line, but the issue persists
module.compile = solc.compile(source, 1).contracts[':Invox'];
//console.log(solc.compile(source, 1));

package.json:

{
"name": "invox",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"solc": "^0.4.25"
}
}

最佳答案

npm install --save solc@0.4.17

运行上述命令并更改 invox.sol 中的 Solidity 版本

编译指示可靠性^0.4.25; -> pragma Solidity ^0.4.17;

关于javascript - 范围错误: Maximum call stack size exceeded when try Compilation in Solidity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58306038/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com