Open GildedHonour opened 2 years ago
What's testData? Is it transaction.input? Or what is it?
Yep, I believe testData
is the transaction's input and includes the function signature in the first eight bytes.
abiDecoder.addABI(testABI); - does this mean that once I've added some abi (abi1), the method decodeMethod will ONLY be able to decode methods using once specified abi1? What if I have multiple abi-s and multiple methods to decode? In other words, how can I decode a specifi method with a specific abi?
I think you can call addABI
multiple times. As long as the function signatures are unique, it'll add a new entry to the state and not overwrite an existing one (see L35 and L37 below).
https://github.com/ConsenSys/abi-decoder/blob/a9ed4923433ad32069e2ea963d683ed2ff49fa07/index.js#L20-L46
In README:
Need to pass the ABI's manually to the library in order to be able to decode params later
1) What's
testData
? Is ittransaction.input
? Or what is it?2)
abiDecoder.addABI(testABI);
- does this mean that once I've added some abi (abi1
), the methoddecodeMethod
will ONLY be able to decode methods using once specifiedabi1
? What if I have multiple abi-s and multiple methods to decode? In other words, how can I decode a specifi method with a specificabi
?