-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuyMeACoffee.sol
43 lines (35 loc) · 1004 Bytes
/
BuyMeACoffee.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/ERC721A.sol";
// Thanks Apetimism (-/|\-)
contract BuyMeACoffee is ERC721A, Ownable {
string private _baseURIExtended;
//
// SYMBOL
//
constructor() ERC721A("BuyMeACoffee", "COFFEE") {}
//
// BASE_URI
//
function _baseURI() internal view virtual override returns (string memory) {
return _baseURIExtended;
}
function setBaseURI(string memory baseURI) external onlyOwner {
_baseURIExtended = baseURI;
}
//
// MINT <3
//
function mint(uint256 quantity) external payable onlyOwner {
// `_mint`'s second argument now takes in a `quantity`, not a `tokenId`.
_mint(msg.sender, quantity);
}
//
// WITHDRAW
//
function withdraw() public onlyOwner {
uint256 balance = address(this).balance;
payable(msg.sender).transfer(balance);
}
}