Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make base URI final after revealing. #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions contracts/NFT/NFT_REVEAL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import "@openzeppelin/contracts/access/Ownable.sol";
contract NFT is ERC721Enumerable, Ownable {
using Strings for uint256;

string public baseURI;
string public baseURI = "";
string public baseExtension = ".json";
uint256 public cost = 0.05 ether;
uint256 public maxSupply = 10000;
Expand All @@ -34,10 +34,8 @@ contract NFT is ERC721Enumerable, Ownable {
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri
) ERC721(_name, _symbol) {
setBaseURI(_initBaseURI);
setNotRevealedURI(_initNotRevealedUri);
mint(msg.sender, 20);
}
Expand Down Expand Up @@ -102,10 +100,12 @@ contract NFT is ERC721Enumerable, Ownable {
}

//only owner
function reveal() public onlyOwner {
revealed = true;
function reveal(string memory _finalBaseURI) public onlyOwner {
require(revealed == false);
baseURI = _finalBaseURI;
revealed = true;
}

function setCost(uint256 _newCost) public onlyOwner {
cost = _newCost;
}
Expand All @@ -118,10 +118,6 @@ contract NFT is ERC721Enumerable, Ownable {
notRevealedUri = _notRevealedURI;
}

function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}

function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
baseExtension = _newBaseExtension;
}
Expand Down