diff --git a/examples/7nodes/script1.js b/examples/7nodes/script1.js index 02219a5..c260796 100644 --- a/examples/7nodes/script1.js +++ b/examples/7nodes/script1.js @@ -2,9 +2,10 @@ a = eth.accounts[0] web3.eth.defaultAccount = a; var simpleSource = 'contract simplestorage { uint public storedData; function simplestorage(uint initVal) { storedData = initVal; } function set(uint x) { storedData = x; } function get() constant returns (uint retVal) { return storedData; } }' -var simpleCompiled = web3.eth.compile.solidity(simpleSource) -var simpleContract = web3.eth.contract(simpleCompiled.simplestorage.info.abiDefinition); -var simple = simpleContract.new(42, {from:web3.eth.accounts[0], data: simpleCompiled.simplestorage.code, gas: 300000, privateFor: ["ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc="]}, function(e, contract) { +var simpleCompiled = web3.eth.compile.solidity(simpleSource); +var simpleRoot = Object.keys(simpleCompiled)[0]; +var simpleContract = web3.eth.contract(simpleCompiled[simpleRoot].info.abiDefinition); +var simple = simpleContract.new(42, {from:web3.eth.accounts[0], data: simpleCompiled[simpleRoot].code, gas: 300000, privateFor: ["ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc="]}, function(e, contract) { if (e) { console.log("err creating contract", e); } else {