If I look in the past transactions of a smart contract that called a function, I can see the MethodID being used.
If the function was never used in the past, I would never know what was the method ID. Is there any way I could generate this?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityThe function selector or method id is the first 4 bytes of the hash of the method name and the parameters. This is documentend here https://solidity-by-example.org/function-selector/
More details are also available here What is a function selector? There are also database where you can look these up. For example https://www.4byte.directory/