I am creating an NFT app. I know how to implement a "create a NFT Collection" & "Create NFT" from scratch.
I am trying now to implement a " Import an existing Collection" feature like some NFT MarketPlaces such as Opensea, Rarible, Montable
To do so,my process is:
1- I let users enter the remote smart Contract address
2- I check if smart Contract exists by checking the bytecode through provider.getcode()
3- I would like to check if that Contract implement basic ERC 721 functions, like mint, ... to ensure it IS a Erc721. And because i will call the mint function of that contract later when users will purchase NFT. But i notice that the mint function is not the same in all Contract. It is a customized function over an internal _mint function. For exemple the mint function can be mint(amount), mint(to,tokenId), etc.
How Can i check the mint function in the bytecode when I dont't know how it's implemented in that contract?.
Any suggestion to implement this feature " Import Existing Collection" will be appreciated. Or What is another pattern to do that ? Please help