Skip to content

Instantly share code, notes, and snippets.

@qianbin
Created July 29, 2019 06:42
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 qianbin/3394e6df3a6d601b1c6f6504163b9c8c to your computer and use it in GitHub Desktop.
Save qianbin/3394e6df3a6d601b1c6f6504163b9c8c to your computer and use it in GitHub Desktop.
encode contract call data
// VIP-180 balanceOf method
const balanceOf = new abi.Function({
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "balance",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
})
// encode into clause data
const data = balanceOf.encode('some address')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment