Implement " import an existing NFT Collection " feature

Viewed 30

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. 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

1 Answers

I need to check if the remote smart Contract is ERC721 | ERC1155 Compliant.

If it IS, i Can retrieve some Collection Data ( name, symbol, ...)

I don't have to mint in the existing remote smart contract

Related