I have an array (i.e. functionNames[]
) of getter functions's names of my contract and another array (i.e. finalGettersParams
) of encoded parameters (which has been populated from web3.eth.abi.decodeParameters
) of that getter functions.
finalGettersParams = [ Result { __length__: 0 },
Result {
'0': '0x0000000000000000000000000000000000000000',
__length__: 1 },
Result {
'0': '0x0000000000000000000000000000000000000000',
'1': '0x0000000000000000000000000000000000000000',
__length__: 2 }
]
now i want to call all getter functions with above available information. Is it possible? One possible solution which i am trying (but its not working, being incomplete) ....
for(j=0; j<functionNames.length; j++) {
myFunc = functionNames[j].funcName;
try {
res = await myContractInstance.methods[myFunc](...finalGettersParams[?????????]).call({from: account1}) // here i need help
console.log("Getter output", res);
} catch (error) {
console.log("Getter ERROR", error);
}
Anyone can suggest me how to proceed, further?