Created
June 22, 2015 18:26
-
-
Save vikasjakhar/750a6289a9492f33f352 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source = "contract test { function multiply(uint a) returns(uint d) { return a * 7; } }" | |
contract = eth.compile.solidity(source).test; | |
MyContract = eth.contract(contract.info.abiDefinition); | |
address = MyContract.new({from: web3.eth.coinbase, data: contract.code}) | |
console.log("contract created address="+address); | |
var Multiply7 = eth.contract(contract.info.abiDefinition); | |
console.log("Multiply7="+Multiply7); | |
var myMultiply7 = Multiply7.at(address); | |
console.log("myMultiply7="+myMultiply7); | |
console.log("calling myMultiply7.multiply.call(6, {from:web3.eth.coinbase}"); | |
var fortytwo=myMultiply7.multiply.sendTransaction(6, { from: web3.eth.coinbase }); | |
console.log("multiply7.multiply.call(6, {from:web3.eth.coinbase}) => "+fortytwo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment