Is it possible to check which data types are present in a function?
Basically, let's say that I know the function selector and I know the data types present in the function.
How can I validate whether these data types are actually correct? I mean what if the data types aren't correct? How can I check that?
I mean I don't think this would work:
Encoding values based on the data type I think is present in the function and then simulating the transaction so that I don't spend money.
This could work to some extent if the data types don't share similar encoding rules. For example if the function is buyWETHwithUSDC(address, uint256, uint256, address)
and I think that these data types are present buyWETHwithUSDC(uint256, uint256, address, address)
then I would parse an value of a token where the contract expects an address. But if I prarse an address where it expects an uint256, there isn't an issue as the parsed address can represent an number in uint256.
Any ideas?
submitted by /u/Weary-Bell-4541
[link] [comments]