Hello,
Our minting platform will be implementing buy/sell functionality like this:
function buy(uint256 tokenId)external payable{
require(ArtPieces[tokenId].isValue, "No token found with specified id");
require(ArtPieces[tokenId].Listed, "NFT is not for sale");
require(msg.value == ArtPieces[tokenId].SalePrice, "Invalid amount sent up");
//Give royalties to original contract owner
uint256 ownerCut = (msg.value * 2) / 100;
payable(owner).transfer(ownerCut);
//Give royalties to NPort (1%)
uint256 nportCut = (msg.value * 1) / 100;
payable(0x16c22e9A1727967553F2358aA873B4e0f8A049d0).transfer(nportCut);
//Give current owner the rest
payable(ArtPieces[tokenId].Owner).transfer(msg.value - ownerCut - nportCut);
//transfer the token
IERC721Upgradeable tokenContract = IERC721Upgradeable(address(this));
tokenContract.safeTransferFrom(ArtPieces[tokenId].Owner, msg.sender, tokenId);
//transfer ownership
ArtPieces[tokenId].Owner = msg.sender;
ArtPieces[tokenId].Listed = false;
}
Our contract currently interfaces with OpenSea, although they probably have their own buy function, so no cuts are handed out. Does anyone know of a way we could retain our royalties while allowing users to still use our contract on third party websites like OpenSea or Rarible?
Thanks!