Skip to content

Commit

Permalink
nft contract
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoAcosta committed Aug 24, 2024
1 parent f502344 commit 397ce6b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/NFTIndexer.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";

contract Indexer is ERC721URIStorage, Ownable {
address public holder;

uint256 private _tokenId;

constructor() ERC721("OpenFlow", "OF") Ownable(msg.sender) {}

function mint(string memory _uri) public onlyOwner {
__mint(_uri);
}

function mintBatch(string[] memory _uris) public onlyOwner {
for (uint256 i = 0; i < _uris.length; i++) {
__mint(_uris[i]);
}
}

function __mint(string memory _uri) private {
uint256 newtokenId = _tokenId++;

_setTokenURI(newtokenId, _uri);
_mint(holder, newtokenId);
}
}

0 comments on commit 397ce6b

Please sign in to comment.