Created
July 29, 2019 06:42
-
-
Save qianbin/3394e6df3a6d601b1c6f6504163b9c8c to your computer and use it in GitHub Desktop.
encode contract call data
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
// 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