I don’t know if this is the right place to ask my question.
I’m retrieving all newly deployed contracts on Uniswap V2 & V3, and I’ve encountered a problem related to differences between contract versions. I’m providing a standard ABI like below :
function name() public view returns (string memory)
However, some contracts have this signature:
function name() public pure returns (string memory)
Due to the presence of “pure”, I can’t call it using the standard ABI. I’m currently using the ethers library with Infura. What’s my best approach to retrieve the ABI and make calls that are compatible with all contracts?
I want to be able to call any name function if exist no matter the signature.
Ad-hoc Solidity support questions. For urgent Solidity support questions, please check out the Ethereum StackExchange or use the Solidity Gitter or Matrix chat.
To call the name() function, regardless of the modifier, maybe you can use the ethers library along with a try-catch mechanism. Please let me know if I’ve misunderstood. I’m still learning.