Skip to content

Instantly share code, notes, and snippets.

@kennethhutw
Created December 8, 2022 12:38
Show Gist options
  • Save kennethhutw/ceb34d4d122e4a814ede61455d2c59d6 to your computer and use it in GitHub Desktop.
Save kennethhutw/ceb34d4d122e4a814ede61455d2c59d6 to your computer and use it in GitHub Desktop.
function mintWithRoyalty(address recipient, string memory uri, address royaltFeeReceiver, uint96 fee) public returns(uint256){
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(recipient, tokenId);
_setTokenURI(tokenId, uri);
_setTokenRoyalty(tokenId, royaltFeeReceiver, fee);
return tokenId;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment