Hi. Can anyone assist me in figuring out a good method in finding out if a function exists in a smart contract without initially having the abi (only the contractAddress). I found a solution online using web3.js however it does not seem to work (see below).
const contractCode = await web3.eth.getCode(tokenAddress)
console.log(contractCode)
const contractAbi = await web3.eth.abi.decodeParameters([], contractCode)
console.log(contractAbi)
const myContract = new web3.eth.Contract(contractAbi, tokenAddress)
await myContract.methods.myFunction().call()