Skip to content

Instantly share code, notes, and snippets.

@PaulLaux
Last active August 30, 2018 08:04
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 PaulLaux/341abd39d4628ddca3fd13e906ffa673 to your computer and use it in GitHub Desktop.
Save PaulLaux/341abd39d4628ddca3fd13e906ffa673 to your computer and use it in GitHub Desktop.
Calling Ethereum contract methods via Web3.js
// Automatically determines the use of call or sendTransaction based on the method type
myContractInstance.myMethod(param1 [, ...][, callback]);
// Explicitly calling this method - simulate execution and return result
// No cost, no actual transaction is sent to the blockchain
myContractInstance.myMethod.call(param1 [, ...] [, callback]);
// Explicitly sending a transaction to this method
myContractInstance.myMethod.sendTransaction(param1 [, ...] [, callback]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment