Closed razsa closed 1 year ago
hi @razsa can you please show your Inbox.sol
smart contract and your accompanying compile.js
Node script?
Inbox.sol
pragma solidity >=0.5.0 <0.7.0;
contract Inbox {
string public message;
constructor(string memory initialMessage) public {
message = initialMessage;
}
function setMessage(string memory newMessage) public {
message = newMessage;
}
}
compile.js
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, 'utf8');
const input = {
langauge: 'Solidity',
sources: {
'Inbox.sol' :{
content: source
}
},
settings: {
outputSelection: {
'*':{
'*': ['*']
}
}
}
};
const output = JSON.parse(solc.compile(JSON.stringify(input)));
module.exports = output.contracts['Inbox.sol'].Inbox;
ok so I see no difference between what you have above for your smart contract and node script compared to what's here and here respectively. Assuming that you specified a 0.5.x
version of solc in your package.json (I specified ^0.5.15
in mine as shown here) then your smart contract should compile without error. Can you confirm the solc version requirement you have specified in your package.json?
Hi @razsa since you opened this issue, the Inbox smart contract has been updated to Solidity 0.8 and the compile and deploy scripts brought up-to-date with the latest versions of the Node.js libraries they are using. If possible, can you please test things with the code from the current state of this repo and let me know if you get any errors when running compile.js
for the Inbox
smart contract?
Since this issue has had no comments from it's author in well over 2 years now, I'll go ahead and close it due to inactivity.
{ "name": "inbox", "version": "1.0.0", "description": "", "main": "compile.js", "scripts": { "test": "" }, "author": "", "license": "ISC", "dependencies": { "solc": "^0.5.15" } }
Any ideas?