Hi I'm building a game and wanted to implement a marketplace. The user puts the token on the marketplace and then someone buys it. I've already managed to implement something to create the market place, the problem is how to transfer the token to whoever buys it. Because when I click on buy, it gives an error saying that you don't own the token and that you can't transfer it.
First, the seller has to Approve() the marketplace contract manually or automatically, it depends on your design characteristics, for that token. Then marketplace could take care of transferring the ERC721 token from seller to buyer whenever the asked amount from the seller is completely paid.
This is the solution if your error is like this: "Caller is not approved nor the owner "
Go check out Approve() section of the ERC721 contract. I think it may help you. If your problem is something else, please provide more information.