I am working on a small project designed to show and teach people how the blockchain and smart contracts operate. In order to do so I had in mind to showcase the transactions on https://testnet.etherscan.io corresponding to my function calls. What I want to do here is to read the payloadData field from the transaction and to translate it into human readable code (using the ABI I guess) such as: createReferendum("Name")
. I am using Node.js. In a nutshell, I want to do the opposite of what the following code does :
const _ = require('lodash')
const SolidityFunction = require('web3/lib/web3/function')
var closeReferendumsFormat = new SolidityFunction('', _.find(ABI, { name: 'closeReferendums' }), '')
var payloadData = closeReferendumsFormat.toPayload([]).data
I have been looking thoroughly but haven't been able to find any way to achieve that. Thank you for your insights!