-
Suppose I don't care about ethers.utils.Interface. Then parse splitTX.data[0] as uint256 and into a JavaScript number. (I know JavaScript number limitations with BigNumber) What's the easiest way to do this without fiddling with ABI? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
In that specific example, you could use: selector = utils.hexDataSlice(txData, 0, 4);
p1 = utils.hexDataSlice(txData, 4, 68);
p2 = utils.hexDataSlice(txData, 68); But generally you should try using the ABI, which is more scalable, as you start trying to parse arbitrary data. The ABI greatly simplifies your life in the long run. :) |
Beta Was this translation helpful? Give feedback.
In that specific example, you could use:
But generally you should try using the ABI, which is more scalable, as you start trying to parse arbitrary data. The ABI greatly simplifies your life in the long run. :)