Skip to content

Instantly share code, notes, and snippets.

@z0r0z
Last active January 25, 2022 14:27
Show Gist options
  • Select an option

  • Save z0r0z/3ec8609313628470af9750d02a2c0cdf to your computer and use it in GitHub Desktop.

Select an option

Save z0r0z/3ec8609313628470af9750d02a2c0cdf to your computer and use it in GitHub Desktop.
simple NFT with license mapping for each token Id
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
import "https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
contract FERC721 is ERC721("FERC721", "FERC"), Ownable {
string public baseURI;
mapping(uint256 => bytes32) public licenses;
constructor(string memory baseURI_) {
baseURI = baseURI_;
}
function mint(
address to,
uint256 id,
bytes32 license
) public onlyOwner virtual {
_safeMint(to, id);
licenses[id] = license;
}
function tokenURI(uint256) public view override virtual returns (string memory) {
return baseURI;
}
}
@lex-node
Copy link

dope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment