Last active
January 25, 2022 14:27
-
-
Save z0r0z/3ec8609313628470af9750d02a2c0cdf to your computer and use it in GitHub Desktop.
simple NFT with license mapping for each token Id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dope