I'm trying to deploy a contract using solcjs.
here is my code
const web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));
async function compileAndDeploy() {
let ambrosiaContract;
try {
let contract = await fs.readFileSync( path.join(__dirname, './Ambrosia.sol') );
let Ambrosia = contract.toString();
let input = {};
input[ path.join(__dirname, './Ambrosia.sol')] = Ambrosia;
console.log('> Compiling Storage');
let output = solc.compile({sources: input}, 1);
console.log(output.contracts, output.formal);
ambrosiaContract = output.contracts['Ambrosia'];
}
catch (e) {
console.log(e);
}
console.log('deploying...')
let ambrosiaInstance = await deployStorage(ambrosiaContract)
console.log('...deployed at ' + ambrosiaInstance.address)
}
compileAndDeploy();
now when I actually run the script, the compiler send me back that error.
Error: Type "bytes32" not supported for state variable.\n mapping (address => bytes32) restaurants;\n
here is my contract code.
pragma solidity ^0.4.4;
contract Ambrosia {
mapping (address => bytes32) restaurants;
address _owner;
event Transfer(address indexed _from, address indexed _to, uint256 _value); // listen to that event whenever a transfer has been made..
event Order(address indexed _from, address indexed _to, uint256 _value); // listen to that event whenever an order is triggered
function Ambrosia() {
_owner = msg.sender;
}
}
I am using solcjs version 0.4.4 the error doesnt depend on the node client, it happen both with geth and js-eth on the development network