These are chat archives for Nethereum/Nethereum

14th
Jul 2016
Matt.Tan
@mtbitcoin
Jul 14 2016 18:29

does the library support decoding the Tx ABI hex if the ABI definition is known ?

for example in EthereumJS we can do the following:

var abi = require('ethereumjs-abi')

// need to have the ABI definition in JSON as per specification
var tokenAbi = [{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"inputs":[],"type":"constructor"}]

var encoded = abi.encode(tokenAbi, "balanceOf(uint256 address)", [ "0x0000000000000000000000000000000000000000" ])
var decoded = abi.decode(tokenAbi, "balanceOf(uint256 address)", data)