I’m a bit confusing the concept of owner for NFT.
I’m creating NFT platform which allows user to create their NFTs.
The smart contract is based on ERC1155 like this.
contract MyNFT is ERC1155, Ownable {
mapping(uint256 => address) private minters;
constructor() ERC1155(""){}
function mint(address account, uint256 id, uint256 amount) public {
require(minters[id] == address(0) || minters[id] == msg.sender);
if(minters[id] == address(0)) {
minters[id] = msg.sender;
}
_mint(account,id,amount,"");
}
I will deploy the contract. So the owner is me. Let’s say I am contract creator.
Users will call mint
when they create their NFTs. Let’s say the user is minter.
In this timing, the minter is owner?
I can see the user owns the NFT on OpenSea and Rarible.
Buyer can buy the NFT on OpenSea. Once buyer buy the NFT, who will be the owner?
Contract creator, minter or buyer?
The smart contract has a few functions with onlyOwner
Is the function callable only by contract creator always? Or it can be called by minter and buyer sometimes?
Shinya