The scenario is that the contract has been deployed to the blockchain and the NFT is minted. Two questions:
how do you implement in solidity the ability to give ownership of the NFT to the buyer in exchange for a specific amount of ether going from seller to buyer?
do I need to write a separate contract for this to happen or can I include all functionality in the original smart contract?
Thank you for taking the time to reply! Links to guides that answer my questions are also appreciated.
I would look at existing marketplaces which likely have a wide audience to see if this was suitable for your use case e.g. OpenSea, rather than creating your own sale contract.
Your sale contract would need to hold the token (or be granted an allowance), assuming that the tokens have already been minted.
I recommend only including functionality required for the life of the contract. When selling tokens, if the sale has a limited life, then I would make this separate from the token. This separates the concerns.