Skip to content

Commit 0915afc

Browse files
Add files via upload
1 parent bcf4633 commit 0915afc

7 files changed

+264
-0
lines changed

App.css

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
.App {
2+
text-align: center;
3+
}
4+
5+
.App-logo {
6+
height: 40vmin;
7+
pointer-events: none;
8+
}
9+
10+
@media (prefers-reduced-motion: no-preference) {
11+
.App-logo {
12+
animation: App-logo-spin infinite 20s linear;
13+
}
14+
}
15+
16+
.App-header {
17+
background-color: #282c34;
18+
min-height: 100vh;
19+
display: flex;
20+
flex-direction: column;
21+
align-items: center;
22+
justify-content: center;
23+
font-size: calc(10px + 2vmin);
24+
color: white;
25+
}
26+
27+
.App-link {
28+
color: #61dafb;
29+
}
30+
31+
@keyframes App-logo-spin {
32+
from {
33+
transform: rotate(0deg);
34+
}
35+
to {
36+
transform: rotate(360deg);
37+
}
38+
}
39+
.gradient {
40+
background-color: #00DBDE;
41+
background-image: linear-gradient(90deg, #00DBDE 0%, #FC00FF 100%);
42+
}
43+
.gradient2 {
44+
background-color: #000000;
45+
background-image: linear-gradient(90deg, #000000 0%, #E84393 100%);
46+
}
47+
.gradient3 {
48+
background-color: #28313B;
49+
background-image: linear-gradient(90deg, #28313B 0%, #485461 100%);
50+
}
51+
.container1{
52+
margin-top:100px;
53+
}
54+
55+
.counter-box {
56+
display: block;
57+
background: #f6f6f6;
58+
padding: 40px 20px 37px;
59+
text-align: center
60+
}
61+
62+
.counter-box p {
63+
margin: 5px 0 0;
64+
padding: 0;
65+
color: #909090;
66+
font-size: 18px;
67+
font-weight: 500
68+
}
69+
70+
.counter-box i {
71+
font-size: 60px;
72+
margin: 0 0 15px;
73+
color: #d2d2d2
74+
}
75+
76+
.counter {
77+
display: block;
78+
font-size: 32px;
79+
font-weight: 700;
80+
color: #666;
81+
line-height: 28px
82+
}
83+
84+
.counter-box.colored {
85+
background: #3acf87;
86+
}
87+
88+
.counter-box.colored p,
89+
.counter-box.colored i,
90+
.counter-box.colored .counter {
91+
color: #fff
92+
}
93+
94+
.modalback {
95+
96+
background: #000000;
97+
98+
}
99+
100+
.modal-style {
101+
background-image: linear-gradient(125.83deg, rgb(30, 42, 34) 0%, rgb(122, 37, 33) 80.09%);
102+
font-family: "SF Pro Display";
103+
color: white;
104+
box-shadow: 1px 1px 50px #f09000;
105+
-webkit-border-radius: 20px !important;
106+
-moz-border-radius: 20px !important;
107+
border-radius: 20px !important;
108+
-webkit-border: 20px !important;
109+
-moz-border: 20px !important;
110+
border: 20px !important;
111+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
// SPDX-License-Identifier: MIT LICENSE
2+
3+
import "@openzeppelin/contracts/access/Ownable.sol";
4+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
5+
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
6+
7+
pragma solidity ^0.8.0;
8+
9+
contract Collection is ERC721Enumerable, Ownable {
10+
11+
struct TokenInfo {
12+
IERC20 paytoken;
13+
uint256 costvalue;
14+
}
15+
16+
TokenInfo[] public AllowedCrypto;
17+
18+
using Strings for uint256;
19+
string public baseURI;
20+
string public baseExtension = ".json";
21+
uint256 cost = 15 ether;
22+
uint256 public maxSupply = 1000;
23+
uint256 public maxMintAmount = 5;
24+
bool public paused = false;
25+
26+
constructor() ERC721("Net2Dev NFT Collection", "N2D") {}
27+
28+
function addCurrency(
29+
IERC20 _paytoken,
30+
uint256 _costvalue
31+
) public onlyOwner {
32+
AllowedCrypto.push(
33+
TokenInfo({
34+
paytoken: _paytoken,
35+
costvalue: _costvalue
36+
})
37+
);
38+
}
39+
40+
function _baseURI() internal view virtual override returns (string memory) {
41+
return "ipfs://EE5MmqVp5MmqVp7ZRMBBizicVh9ficVh9fjUofWicVh9f/";
42+
43+
}
44+
45+
function mint(address _to, uint256 _mintAmount) public payable {
46+
uint256 supply = totalSupply();
47+
require(!paused);
48+
require(_mintAmount > 0);
49+
require(_mintAmount <= maxMintAmount);
50+
require(supply + _mintAmount <= maxSupply);
51+
52+
if (msg.sender != owner()) {
53+
require(msg.value == cost * _mintAmount, "Not enough balance to complete transaction.");
54+
}
55+
56+
for (uint256 i = 1; i <= _mintAmount; i++) {
57+
_safeMint(_to, supply + i);
58+
}
59+
}
60+
61+
62+
function mintpid(address _to, uint256 _mintAmount, uint256 _pid) public payable {
63+
TokenInfo storage tokens = AllowedCrypto[_pid];
64+
IERC20 paytoken;
65+
paytoken = tokens.paytoken;
66+
uint256 cost;
67+
cost = tokens.costvalue;
68+
uint256 supply = totalSupply();
69+
require(!paused);
70+
require(_mintAmount > 0);
71+
require(_mintAmount <= maxMintAmount);
72+
require(supply + _mintAmount <= maxSupply);
73+
74+
if (msg.sender != owner()) {
75+
require(msg.value == cost * _mintAmount, "Not enough balance to complete transaction.");
76+
}
77+
78+
for (uint256 i = 1; i <= _mintAmount; i++) {
79+
paytoken.transferFrom(msg.sender, address(this), cost);
80+
_safeMint(_to, supply + i);
81+
}
82+
}
83+
84+
function walletOfOwner(address _owner)
85+
public
86+
view
87+
returns (uint256[] memory)
88+
{
89+
uint256 ownerTokenCount = balanceOf(_owner);
90+
uint256[] memory tokenIds = new uint256[](ownerTokenCount);
91+
for (uint256 i; i < ownerTokenCount; i++) {
92+
tokenIds[i] = tokenOfOwnerByIndex(_owner, i);
93+
}
94+
return tokenIds;
95+
}
96+
97+
98+
function tokenURI(uint256 tokenId)
99+
public
100+
view
101+
virtual
102+
override
103+
returns (string memory) {
104+
require(
105+
_exists(tokenId),
106+
"ERC721Metadata: URI query for nonexistent token"
107+
);
108+
109+
string memory currentBaseURI = _baseURI();
110+
return
111+
bytes(currentBaseURI).length > 0
112+
? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension))
113+
: "";
114+
}
115+
// only owner
116+
117+
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner() {
118+
maxMintAmount = _newmaxMintAmount;
119+
}
120+
121+
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
122+
baseURI = _newBaseURI;
123+
}
124+
125+
function setBaseExtension(string memory _newBaseExtension) public onlyOwner() {
126+
baseExtension = _newBaseExtension;
127+
}
128+
129+
function pause(bool _state) public onlyOwner() {
130+
paused = _state;
131+
}
132+
133+
function getNFTCost(uint256 _pid) public view virtual returns(uint256) {
134+
TokenInfo storage tokens = AllowedCrypto[_pid];
135+
uint256 cost;
136+
cost = tokens.costvalue;
137+
return cost;
138+
}
139+
140+
function getCryptotoken(uint256 _pid) public view virtual returns(IERC20) {
141+
TokenInfo storage tokens = AllowedCrypto[_pid];
142+
IERC20 paytoken;
143+
paytoken = tokens.paytoken;
144+
return paytoken;
145+
}
146+
147+
function withdraw(uint256 _pid) public payable onlyOwner() {
148+
TokenInfo storage tokens = AllowedCrypto[_pid];
149+
IERC20 paytoken;
150+
paytoken = tokens.paytoken;
151+
paytoken.transfer(msg.sender, paytoken.balanceOf(address(this)));
152+
}
153+
}

ape.png

654 KB
Loading

art.png

606 KB
Loading

matic.png

76 KB
Loading

n2dr-logo.png

1020 KB
Loading

usdt.png

68 KB
Loading

0 commit comments

Comments
 (0)