Recently I'm build some
ERC721 nft contract.
I know that smart contract can receive
ETH, so my question is that is it possible to write a payable function, and upon receive some ETH from someone, the contract will mint an NFT right away and send to the msg sender?
If not, what will be the recommended way to buy an
NFT with ETH instead of going through some third party platform like OpenSea?