Created
May 6, 2022 08:13
-
-
Save dexXxed/2d5ef2ac7d742aa159d9a07eb61cf11d to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=true&runs=200&gist=
This file contains 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: MIT | |
pragma solidity ^0.8.4; | |
import "erc721a/contracts/ERC721A.sol"; | |
import "@openzeppelin/contracts/utils/Strings.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract UnitedForUkraine is ERC721A, Ownable { | |
string private baseURI = "ipfs://QmPKAqXrWmT1DAp4K3SAKFYPMdkH6QW8LPp21woJ1oCsbY/"; | |
constructor() ERC721A("UnitedForUkraine", "UnitedForUkraine") { | |
_safeMint(msg.sender, 1); | |
} | |
function tokenURI(uint256 tokenId) public view override returns (string memory) { | |
return string(abi.encodePacked(baseURI, Strings.toString(tokenId), ".json")); | |
} | |
function setNewBaseURI(string memory _newbaseURI) public onlyOwner { | |
baseURI = _newbaseURI; | |
} | |
function mintQuantity(uint256 _quantity) public onlyOwner { | |
_safeMint(msg.sender, _quantity); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment