Skip to content

Instantly share code, notes, and snippets.

@vikasjakhar
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vikasjakhar/99c79b93d677e04e33a8 to your computer and use it in GitHub Desktop.
Save vikasjakhar/99c79b93d677e04e33a8 to your computer and use it in GitHub Desktop.
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);
myMultiply7 = MyContract.new({from: web3.eth.coinbase, data: contract.code})
console.log("calling myMultiply7.multiply.call(6, {from:web3.eth.coinbase}");
fortytwo = myMultiply7.multiply.call(6, {from:web3.eth.coinbase});
console.log("result="+fortytwo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment