├── App.css ├── App.js ├── ERC721-NFT-Collection-SmartContract-Web3-v1.sol ├── README.md ├── ape.png ├── art.png ├── matic.png ├── n2dr-logo.png └── usdt.png /App.css: -------------------------------------------------------------------------------- 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 | } 112 | -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | import './App.css'; 2 | import { Button, ButtonToolbar,ButtonGroup, Modal } from 'react-bootstrap'; 3 | import 'bootstrap/dist/css/bootstrap.min.css'; 4 | import Web3 from 'web3'; 5 | import axios from 'axios'; 6 | import React, { Component } from 'react'; 7 | import Web3Modal from "web3modal"; 8 | import WalletConnectProvider from "@walletconnect/web3-provider"; 9 | import WalletLink from "walletlink"; 10 | import "sf-font"; 11 | 12 | const ABI = [ 13 | { 14 | "anonymous": false, 15 | "inputs": [ 16 | { 17 | "indexed": true, 18 | "internalType": "address", 19 | "name": "owner", 20 | "type": "address" 21 | }, 22 | { 23 | "indexed": true, 24 | "internalType": "address", 25 | "name": "approved", 26 | "type": "address" 27 | }, 28 | { 29 | "indexed": true, 30 | "internalType": "uint256", 31 | "name": "tokenId", 32 | "type": "uint256" 33 | } 34 | ], 35 | "name": "Approval", 36 | "type": "event" 37 | }, 38 | { 39 | "anonymous": false, 40 | "inputs": [ 41 | { 42 | "indexed": true, 43 | "internalType": "address", 44 | "name": "owner", 45 | "type": "address" 46 | }, 47 | { 48 | "indexed": true, 49 | "internalType": "address", 50 | "name": "operator", 51 | "type": "address" 52 | }, 53 | { 54 | "indexed": false, 55 | "internalType": "bool", 56 | "name": "approved", 57 | "type": "bool" 58 | } 59 | ], 60 | "name": "ApprovalForAll", 61 | "type": "event" 62 | }, 63 | { 64 | "anonymous": false, 65 | "inputs": [ 66 | { 67 | "indexed": true, 68 | "internalType": "address", 69 | "name": "previousOwner", 70 | "type": "address" 71 | }, 72 | { 73 | "indexed": true, 74 | "internalType": "address", 75 | "name": "newOwner", 76 | "type": "address" 77 | } 78 | ], 79 | "name": "OwnershipTransferred", 80 | "type": "event" 81 | }, 82 | { 83 | "anonymous": false, 84 | "inputs": [ 85 | { 86 | "indexed": true, 87 | "internalType": "address", 88 | "name": "from", 89 | "type": "address" 90 | }, 91 | { 92 | "indexed": true, 93 | "internalType": "address", 94 | "name": "to", 95 | "type": "address" 96 | }, 97 | { 98 | "indexed": true, 99 | "internalType": "uint256", 100 | "name": "tokenId", 101 | "type": "uint256" 102 | } 103 | ], 104 | "name": "Transfer", 105 | "type": "event" 106 | }, 107 | { 108 | "inputs": [ 109 | { 110 | "internalType": "contract IERC20", 111 | "name": "_paytoken", 112 | "type": "address" 113 | }, 114 | { 115 | "internalType": "uint256", 116 | "name": "_costvalue", 117 | "type": "uint256" 118 | } 119 | ], 120 | "name": "addCurrency", 121 | "outputs": [], 122 | "stateMutability": "nonpayable", 123 | "type": "function" 124 | }, 125 | { 126 | "inputs": [ 127 | { 128 | "internalType": "address", 129 | "name": "to", 130 | "type": "address" 131 | }, 132 | { 133 | "internalType": "uint256", 134 | "name": "tokenId", 135 | "type": "uint256" 136 | } 137 | ], 138 | "name": "approve", 139 | "outputs": [], 140 | "stateMutability": "nonpayable", 141 | "type": "function" 142 | }, 143 | { 144 | "inputs": [ 145 | { 146 | "internalType": "address", 147 | "name": "_to", 148 | "type": "address" 149 | }, 150 | { 151 | "internalType": "uint256", 152 | "name": "_mintAmount", 153 | "type": "uint256" 154 | } 155 | ], 156 | "name": "mint", 157 | "outputs": [], 158 | "stateMutability": "payable", 159 | "type": "function" 160 | }, 161 | { 162 | "inputs": [ 163 | { 164 | "internalType": "address", 165 | "name": "_to", 166 | "type": "address" 167 | }, 168 | { 169 | "internalType": "uint256", 170 | "name": "_mintAmount", 171 | "type": "uint256" 172 | }, 173 | { 174 | "internalType": "uint256", 175 | "name": "_pid", 176 | "type": "uint256" 177 | } 178 | ], 179 | "name": "mintpid", 180 | "outputs": [], 181 | "stateMutability": "payable", 182 | "type": "function" 183 | }, 184 | { 185 | "inputs": [ 186 | { 187 | "internalType": "bool", 188 | "name": "_state", 189 | "type": "bool" 190 | } 191 | ], 192 | "name": "pause", 193 | "outputs": [], 194 | "stateMutability": "nonpayable", 195 | "type": "function" 196 | }, 197 | { 198 | "inputs": [], 199 | "name": "renounceOwnership", 200 | "outputs": [], 201 | "stateMutability": "nonpayable", 202 | "type": "function" 203 | }, 204 | { 205 | "inputs": [ 206 | { 207 | "internalType": "address", 208 | "name": "from", 209 | "type": "address" 210 | }, 211 | { 212 | "internalType": "address", 213 | "name": "to", 214 | "type": "address" 215 | }, 216 | { 217 | "internalType": "uint256", 218 | "name": "tokenId", 219 | "type": "uint256" 220 | } 221 | ], 222 | "name": "safeTransferFrom", 223 | "outputs": [], 224 | "stateMutability": "nonpayable", 225 | "type": "function" 226 | }, 227 | { 228 | "inputs": [ 229 | { 230 | "internalType": "address", 231 | "name": "from", 232 | "type": "address" 233 | }, 234 | { 235 | "internalType": "address", 236 | "name": "to", 237 | "type": "address" 238 | }, 239 | { 240 | "internalType": "uint256", 241 | "name": "tokenId", 242 | "type": "uint256" 243 | }, 244 | { 245 | "internalType": "bytes", 246 | "name": "_data", 247 | "type": "bytes" 248 | } 249 | ], 250 | "name": "safeTransferFrom", 251 | "outputs": [], 252 | "stateMutability": "nonpayable", 253 | "type": "function" 254 | }, 255 | { 256 | "inputs": [ 257 | { 258 | "internalType": "address", 259 | "name": "operator", 260 | "type": "address" 261 | }, 262 | { 263 | "internalType": "bool", 264 | "name": "approved", 265 | "type": "bool" 266 | } 267 | ], 268 | "name": "setApprovalForAll", 269 | "outputs": [], 270 | "stateMutability": "nonpayable", 271 | "type": "function" 272 | }, 273 | { 274 | "inputs": [ 275 | { 276 | "internalType": "string", 277 | "name": "_newBaseExtension", 278 | "type": "string" 279 | } 280 | ], 281 | "name": "setBaseExtension", 282 | "outputs": [], 283 | "stateMutability": "nonpayable", 284 | "type": "function" 285 | }, 286 | { 287 | "inputs": [ 288 | { 289 | "internalType": "string", 290 | "name": "_newBaseURI", 291 | "type": "string" 292 | } 293 | ], 294 | "name": "setBaseURI", 295 | "outputs": [], 296 | "stateMutability": "nonpayable", 297 | "type": "function" 298 | }, 299 | { 300 | "inputs": [ 301 | { 302 | "internalType": "uint256", 303 | "name": "_newmaxMintAmount", 304 | "type": "uint256" 305 | } 306 | ], 307 | "name": "setmaxMintAmount", 308 | "outputs": [], 309 | "stateMutability": "nonpayable", 310 | "type": "function" 311 | }, 312 | { 313 | "inputs": [ 314 | { 315 | "internalType": "address", 316 | "name": "from", 317 | "type": "address" 318 | }, 319 | { 320 | "internalType": "address", 321 | "name": "to", 322 | "type": "address" 323 | }, 324 | { 325 | "internalType": "uint256", 326 | "name": "tokenId", 327 | "type": "uint256" 328 | } 329 | ], 330 | "name": "transferFrom", 331 | "outputs": [], 332 | "stateMutability": "nonpayable", 333 | "type": "function" 334 | }, 335 | { 336 | "inputs": [ 337 | { 338 | "internalType": "address", 339 | "name": "newOwner", 340 | "type": "address" 341 | } 342 | ], 343 | "name": "transferOwnership", 344 | "outputs": [], 345 | "stateMutability": "nonpayable", 346 | "type": "function" 347 | }, 348 | { 349 | "inputs": [ 350 | { 351 | "internalType": "uint256", 352 | "name": "_pid", 353 | "type": "uint256" 354 | } 355 | ], 356 | "name": "withdraw", 357 | "outputs": [], 358 | "stateMutability": "payable", 359 | "type": "function" 360 | }, 361 | { 362 | "inputs": [], 363 | "stateMutability": "nonpayable", 364 | "type": "constructor" 365 | }, 366 | { 367 | "inputs": [ 368 | { 369 | "internalType": "uint256", 370 | "name": "", 371 | "type": "uint256" 372 | } 373 | ], 374 | "name": "AllowedCrypto", 375 | "outputs": [ 376 | { 377 | "internalType": "contract IERC20", 378 | "name": "paytoken", 379 | "type": "address" 380 | }, 381 | { 382 | "internalType": "uint256", 383 | "name": "costvalue", 384 | "type": "uint256" 385 | } 386 | ], 387 | "stateMutability": "view", 388 | "type": "function" 389 | }, 390 | { 391 | "inputs": [ 392 | { 393 | "internalType": "address", 394 | "name": "owner", 395 | "type": "address" 396 | } 397 | ], 398 | "name": "balanceOf", 399 | "outputs": [ 400 | { 401 | "internalType": "uint256", 402 | "name": "", 403 | "type": "uint256" 404 | } 405 | ], 406 | "stateMutability": "view", 407 | "type": "function" 408 | }, 409 | { 410 | "inputs": [], 411 | "name": "baseExtension", 412 | "outputs": [ 413 | { 414 | "internalType": "string", 415 | "name": "", 416 | "type": "string" 417 | } 418 | ], 419 | "stateMutability": "view", 420 | "type": "function" 421 | }, 422 | { 423 | "inputs": [], 424 | "name": "baseURI", 425 | "outputs": [ 426 | { 427 | "internalType": "string", 428 | "name": "", 429 | "type": "string" 430 | } 431 | ], 432 | "stateMutability": "view", 433 | "type": "function" 434 | }, 435 | { 436 | "inputs": [], 437 | "name": "cost", 438 | "outputs": [ 439 | { 440 | "internalType": "uint256", 441 | "name": "", 442 | "type": "uint256" 443 | } 444 | ], 445 | "stateMutability": "view", 446 | "type": "function" 447 | }, 448 | { 449 | "inputs": [ 450 | { 451 | "internalType": "uint256", 452 | "name": "tokenId", 453 | "type": "uint256" 454 | } 455 | ], 456 | "name": "getApproved", 457 | "outputs": [ 458 | { 459 | "internalType": "address", 460 | "name": "", 461 | "type": "address" 462 | } 463 | ], 464 | "stateMutability": "view", 465 | "type": "function" 466 | }, 467 | { 468 | "inputs": [ 469 | { 470 | "internalType": "uint256", 471 | "name": "_pid", 472 | "type": "uint256" 473 | } 474 | ], 475 | "name": "getCryptotoken", 476 | "outputs": [ 477 | { 478 | "internalType": "contract IERC20", 479 | "name": "", 480 | "type": "address" 481 | } 482 | ], 483 | "stateMutability": "view", 484 | "type": "function" 485 | }, 486 | { 487 | "inputs": [ 488 | { 489 | "internalType": "uint256", 490 | "name": "_pid", 491 | "type": "uint256" 492 | } 493 | ], 494 | "name": "getNFTCost", 495 | "outputs": [ 496 | { 497 | "internalType": "uint256", 498 | "name": "", 499 | "type": "uint256" 500 | } 501 | ], 502 | "stateMutability": "view", 503 | "type": "function" 504 | }, 505 | { 506 | "inputs": [ 507 | { 508 | "internalType": "address", 509 | "name": "owner", 510 | "type": "address" 511 | }, 512 | { 513 | "internalType": "address", 514 | "name": "operator", 515 | "type": "address" 516 | } 517 | ], 518 | "name": "isApprovedForAll", 519 | "outputs": [ 520 | { 521 | "internalType": "bool", 522 | "name": "", 523 | "type": "bool" 524 | } 525 | ], 526 | "stateMutability": "view", 527 | "type": "function" 528 | }, 529 | { 530 | "inputs": [], 531 | "name": "maxMintAmount", 532 | "outputs": [ 533 | { 534 | "internalType": "uint256", 535 | "name": "", 536 | "type": "uint256" 537 | } 538 | ], 539 | "stateMutability": "view", 540 | "type": "function" 541 | }, 542 | { 543 | "inputs": [], 544 | "name": "maxSupply", 545 | "outputs": [ 546 | { 547 | "internalType": "uint256", 548 | "name": "", 549 | "type": "uint256" 550 | } 551 | ], 552 | "stateMutability": "view", 553 | "type": "function" 554 | }, 555 | { 556 | "inputs": [], 557 | "name": "name", 558 | "outputs": [ 559 | { 560 | "internalType": "string", 561 | "name": "", 562 | "type": "string" 563 | } 564 | ], 565 | "stateMutability": "view", 566 | "type": "function" 567 | }, 568 | { 569 | "inputs": [], 570 | "name": "owner", 571 | "outputs": [ 572 | { 573 | "internalType": "address", 574 | "name": "", 575 | "type": "address" 576 | } 577 | ], 578 | "stateMutability": "view", 579 | "type": "function" 580 | }, 581 | { 582 | "inputs": [ 583 | { 584 | "internalType": "uint256", 585 | "name": "tokenId", 586 | "type": "uint256" 587 | } 588 | ], 589 | "name": "ownerOf", 590 | "outputs": [ 591 | { 592 | "internalType": "address", 593 | "name": "", 594 | "type": "address" 595 | } 596 | ], 597 | "stateMutability": "view", 598 | "type": "function" 599 | }, 600 | { 601 | "inputs": [], 602 | "name": "paused", 603 | "outputs": [ 604 | { 605 | "internalType": "bool", 606 | "name": "", 607 | "type": "bool" 608 | } 609 | ], 610 | "stateMutability": "view", 611 | "type": "function" 612 | }, 613 | { 614 | "inputs": [ 615 | { 616 | "internalType": "bytes4", 617 | "name": "interfaceId", 618 | "type": "bytes4" 619 | } 620 | ], 621 | "name": "supportsInterface", 622 | "outputs": [ 623 | { 624 | "internalType": "bool", 625 | "name": "", 626 | "type": "bool" 627 | } 628 | ], 629 | "stateMutability": "view", 630 | "type": "function" 631 | }, 632 | { 633 | "inputs": [], 634 | "name": "symbol", 635 | "outputs": [ 636 | { 637 | "internalType": "string", 638 | "name": "", 639 | "type": "string" 640 | } 641 | ], 642 | "stateMutability": "view", 643 | "type": "function" 644 | }, 645 | { 646 | "inputs": [ 647 | { 648 | "internalType": "uint256", 649 | "name": "index", 650 | "type": "uint256" 651 | } 652 | ], 653 | "name": "tokenByIndex", 654 | "outputs": [ 655 | { 656 | "internalType": "uint256", 657 | "name": "", 658 | "type": "uint256" 659 | } 660 | ], 661 | "stateMutability": "view", 662 | "type": "function" 663 | }, 664 | { 665 | "inputs": [ 666 | { 667 | "internalType": "address", 668 | "name": "owner", 669 | "type": "address" 670 | }, 671 | { 672 | "internalType": "uint256", 673 | "name": "index", 674 | "type": "uint256" 675 | } 676 | ], 677 | "name": "tokenOfOwnerByIndex", 678 | "outputs": [ 679 | { 680 | "internalType": "uint256", 681 | "name": "", 682 | "type": "uint256" 683 | } 684 | ], 685 | "stateMutability": "view", 686 | "type": "function" 687 | }, 688 | { 689 | "inputs": [ 690 | { 691 | "internalType": "uint256", 692 | "name": "tokenId", 693 | "type": "uint256" 694 | } 695 | ], 696 | "name": "tokenURI", 697 | "outputs": [ 698 | { 699 | "internalType": "string", 700 | "name": "", 701 | "type": "string" 702 | } 703 | ], 704 | "stateMutability": "view", 705 | "type": "function" 706 | }, 707 | { 708 | "inputs": [], 709 | "name": "totalSupply", 710 | "outputs": [ 711 | { 712 | "internalType": "uint256", 713 | "name": "", 714 | "type": "uint256" 715 | } 716 | ], 717 | "stateMutability": "view", 718 | "type": "function" 719 | }, 720 | { 721 | "inputs": [ 722 | { 723 | "internalType": "address", 724 | "name": "_owner", 725 | "type": "address" 726 | } 727 | ], 728 | "name": "walletOfOwner", 729 | "outputs": [ 730 | { 731 | "internalType": "uint256[]", 732 | "name": "", 733 | "type": "uint256[]" 734 | } 735 | ], 736 | "stateMutability": "view", 737 | "type": "function" 738 | } 739 | ] 740 | 741 | const VAULTABI = [ 742 | { 743 | "anonymous": false, 744 | "inputs": [ 745 | { 746 | "indexed": false, 747 | "internalType": "address", 748 | "name": "owner", 749 | "type": "address" 750 | }, 751 | { 752 | "indexed": false, 753 | "internalType": "uint256", 754 | "name": "amount", 755 | "type": "uint256" 756 | } 757 | ], 758 | "name": "Claimed", 759 | "type": "event" 760 | }, 761 | { 762 | "anonymous": false, 763 | "inputs": [ 764 | { 765 | "indexed": false, 766 | "internalType": "address", 767 | "name": "owner", 768 | "type": "address" 769 | }, 770 | { 771 | "indexed": false, 772 | "internalType": "uint256", 773 | "name": "tokenId", 774 | "type": "uint256" 775 | }, 776 | { 777 | "indexed": false, 778 | "internalType": "uint256", 779 | "name": "value", 780 | "type": "uint256" 781 | } 782 | ], 783 | "name": "NFTStaked", 784 | "type": "event" 785 | }, 786 | { 787 | "anonymous": false, 788 | "inputs": [ 789 | { 790 | "indexed": false, 791 | "internalType": "address", 792 | "name": "owner", 793 | "type": "address" 794 | }, 795 | { 796 | "indexed": false, 797 | "internalType": "uint256", 798 | "name": "tokenId", 799 | "type": "uint256" 800 | }, 801 | { 802 | "indexed": false, 803 | "internalType": "uint256", 804 | "name": "value", 805 | "type": "uint256" 806 | } 807 | ], 808 | "name": "NFTUnstaked", 809 | "type": "event" 810 | }, 811 | { 812 | "anonymous": false, 813 | "inputs": [ 814 | { 815 | "indexed": true, 816 | "internalType": "address", 817 | "name": "previousOwner", 818 | "type": "address" 819 | }, 820 | { 821 | "indexed": true, 822 | "internalType": "address", 823 | "name": "newOwner", 824 | "type": "address" 825 | } 826 | ], 827 | "name": "OwnershipTransferred", 828 | "type": "event" 829 | }, 830 | { 831 | "inputs": [ 832 | { 833 | "internalType": "uint256[]", 834 | "name": "tokenIds", 835 | "type": "uint256[]" 836 | } 837 | ], 838 | "name": "claim", 839 | "outputs": [], 840 | "stateMutability": "nonpayable", 841 | "type": "function" 842 | }, 843 | { 844 | "inputs": [ 845 | { 846 | "internalType": "address", 847 | "name": "account", 848 | "type": "address" 849 | }, 850 | { 851 | "internalType": "uint256[]", 852 | "name": "tokenIds", 853 | "type": "uint256[]" 854 | } 855 | ], 856 | "name": "claimForAddress", 857 | "outputs": [], 858 | "stateMutability": "nonpayable", 859 | "type": "function" 860 | }, 861 | { 862 | "inputs": [], 863 | "name": "renounceOwnership", 864 | "outputs": [], 865 | "stateMutability": "nonpayable", 866 | "type": "function" 867 | }, 868 | { 869 | "inputs": [ 870 | { 871 | "internalType": "uint256[]", 872 | "name": "tokenIds", 873 | "type": "uint256[]" 874 | } 875 | ], 876 | "name": "stake", 877 | "outputs": [], 878 | "stateMutability": "nonpayable", 879 | "type": "function" 880 | }, 881 | { 882 | "inputs": [ 883 | { 884 | "internalType": "address", 885 | "name": "newOwner", 886 | "type": "address" 887 | } 888 | ], 889 | "name": "transferOwnership", 890 | "outputs": [], 891 | "stateMutability": "nonpayable", 892 | "type": "function" 893 | }, 894 | { 895 | "inputs": [ 896 | { 897 | "internalType": "uint256[]", 898 | "name": "tokenIds", 899 | "type": "uint256[]" 900 | } 901 | ], 902 | "name": "unstake", 903 | "outputs": [], 904 | "stateMutability": "nonpayable", 905 | "type": "function" 906 | }, 907 | { 908 | "inputs": [ 909 | { 910 | "internalType": "contract Collection", 911 | "name": "_nft", 912 | "type": "address" 913 | }, 914 | { 915 | "internalType": "contract N2DRewards", 916 | "name": "_token", 917 | "type": "address" 918 | } 919 | ], 920 | "stateMutability": "nonpayable", 921 | "type": "constructor" 922 | }, 923 | { 924 | "inputs": [ 925 | { 926 | "internalType": "address", 927 | "name": "account", 928 | "type": "address" 929 | } 930 | ], 931 | "name": "balanceOf", 932 | "outputs": [ 933 | { 934 | "internalType": "uint256", 935 | "name": "", 936 | "type": "uint256" 937 | } 938 | ], 939 | "stateMutability": "view", 940 | "type": "function" 941 | }, 942 | { 943 | "inputs": [ 944 | { 945 | "internalType": "address", 946 | "name": "account", 947 | "type": "address" 948 | }, 949 | { 950 | "internalType": "uint256[]", 951 | "name": "tokenIds", 952 | "type": "uint256[]" 953 | } 954 | ], 955 | "name": "earningInfo", 956 | "outputs": [ 957 | { 958 | "internalType": "uint256[1]", 959 | "name": "info", 960 | "type": "uint256[1]" 961 | } 962 | ], 963 | "stateMutability": "view", 964 | "type": "function" 965 | }, 966 | { 967 | "inputs": [ 968 | { 969 | "internalType": "address", 970 | "name": "", 971 | "type": "address" 972 | }, 973 | { 974 | "internalType": "address", 975 | "name": "from", 976 | "type": "address" 977 | }, 978 | { 979 | "internalType": "uint256", 980 | "name": "", 981 | "type": "uint256" 982 | }, 983 | { 984 | "internalType": "bytes", 985 | "name": "", 986 | "type": "bytes" 987 | } 988 | ], 989 | "name": "onERC721Received", 990 | "outputs": [ 991 | { 992 | "internalType": "bytes4", 993 | "name": "", 994 | "type": "bytes4" 995 | } 996 | ], 997 | "stateMutability": "pure", 998 | "type": "function" 999 | }, 1000 | { 1001 | "inputs": [], 1002 | "name": "owner", 1003 | "outputs": [ 1004 | { 1005 | "internalType": "address", 1006 | "name": "", 1007 | "type": "address" 1008 | } 1009 | ], 1010 | "stateMutability": "view", 1011 | "type": "function" 1012 | }, 1013 | { 1014 | "inputs": [ 1015 | { 1016 | "internalType": "address", 1017 | "name": "account", 1018 | "type": "address" 1019 | } 1020 | ], 1021 | "name": "tokensOfOwner", 1022 | "outputs": [ 1023 | { 1024 | "internalType": "uint256[]", 1025 | "name": "ownerTokens", 1026 | "type": "uint256[]" 1027 | } 1028 | ], 1029 | "stateMutability": "view", 1030 | "type": "function" 1031 | }, 1032 | { 1033 | "inputs": [], 1034 | "name": "totalStaked", 1035 | "outputs": [ 1036 | { 1037 | "internalType": "uint256", 1038 | "name": "", 1039 | "type": "uint256" 1040 | } 1041 | ], 1042 | "stateMutability": "view", 1043 | "type": "function" 1044 | }, 1045 | { 1046 | "inputs": [ 1047 | { 1048 | "internalType": "uint256", 1049 | "name": "", 1050 | "type": "uint256" 1051 | } 1052 | ], 1053 | "name": "vault", 1054 | "outputs": [ 1055 | { 1056 | "internalType": "uint24", 1057 | "name": "tokenId", 1058 | "type": "uint24" 1059 | }, 1060 | { 1061 | "internalType": "uint48", 1062 | "name": "timestamp", 1063 | "type": "uint48" 1064 | }, 1065 | { 1066 | "internalType": "address", 1067 | "name": "owner", 1068 | "type": "address" 1069 | } 1070 | ], 1071 | "stateMutability": "view", 1072 | "type": "function" 1073 | } 1074 | ] 1075 | 1076 | var TOKENABI = [ 1077 | { 1078 | "anonymous": false, 1079 | "inputs": [ 1080 | { 1081 | "indexed": true, 1082 | "internalType": "address", 1083 | "name": "owner", 1084 | "type": "address" 1085 | }, 1086 | { 1087 | "indexed": true, 1088 | "internalType": "address", 1089 | "name": "spender", 1090 | "type": "address" 1091 | }, 1092 | { 1093 | "indexed": false, 1094 | "internalType": "uint256", 1095 | "name": "value", 1096 | "type": "uint256" 1097 | } 1098 | ], 1099 | "name": "Approval", 1100 | "type": "event" 1101 | }, 1102 | { 1103 | "anonymous": false, 1104 | "inputs": [ 1105 | { 1106 | "indexed": true, 1107 | "internalType": "address", 1108 | "name": "previousOwner", 1109 | "type": "address" 1110 | }, 1111 | { 1112 | "indexed": true, 1113 | "internalType": "address", 1114 | "name": "newOwner", 1115 | "type": "address" 1116 | } 1117 | ], 1118 | "name": "OwnershipTransferred", 1119 | "type": "event" 1120 | }, 1121 | { 1122 | "anonymous": false, 1123 | "inputs": [ 1124 | { 1125 | "indexed": true, 1126 | "internalType": "address", 1127 | "name": "from", 1128 | "type": "address" 1129 | }, 1130 | { 1131 | "indexed": true, 1132 | "internalType": "address", 1133 | "name": "to", 1134 | "type": "address" 1135 | }, 1136 | { 1137 | "indexed": false, 1138 | "internalType": "uint256", 1139 | "name": "value", 1140 | "type": "uint256" 1141 | } 1142 | ], 1143 | "name": "Transfer", 1144 | "type": "event" 1145 | }, 1146 | { 1147 | "inputs": [ 1148 | { 1149 | "internalType": "address", 1150 | "name": "controller", 1151 | "type": "address" 1152 | } 1153 | ], 1154 | "name": "addController", 1155 | "outputs": [], 1156 | "stateMutability": "nonpayable", 1157 | "type": "function" 1158 | }, 1159 | { 1160 | "inputs": [ 1161 | { 1162 | "internalType": "address", 1163 | "name": "spender", 1164 | "type": "address" 1165 | }, 1166 | { 1167 | "internalType": "uint256", 1168 | "name": "amount", 1169 | "type": "uint256" 1170 | } 1171 | ], 1172 | "name": "approve", 1173 | "outputs": [ 1174 | { 1175 | "internalType": "bool", 1176 | "name": "", 1177 | "type": "bool" 1178 | } 1179 | ], 1180 | "stateMutability": "nonpayable", 1181 | "type": "function" 1182 | }, 1183 | { 1184 | "inputs": [ 1185 | { 1186 | "internalType": "uint256", 1187 | "name": "amount", 1188 | "type": "uint256" 1189 | } 1190 | ], 1191 | "name": "burn", 1192 | "outputs": [], 1193 | "stateMutability": "nonpayable", 1194 | "type": "function" 1195 | }, 1196 | { 1197 | "inputs": [ 1198 | { 1199 | "internalType": "address", 1200 | "name": "account", 1201 | "type": "address" 1202 | }, 1203 | { 1204 | "internalType": "uint256", 1205 | "name": "amount", 1206 | "type": "uint256" 1207 | } 1208 | ], 1209 | "name": "burnFrom", 1210 | "outputs": [], 1211 | "stateMutability": "nonpayable", 1212 | "type": "function" 1213 | }, 1214 | { 1215 | "inputs": [ 1216 | { 1217 | "internalType": "address", 1218 | "name": "spender", 1219 | "type": "address" 1220 | }, 1221 | { 1222 | "internalType": "uint256", 1223 | "name": "subtractedValue", 1224 | "type": "uint256" 1225 | } 1226 | ], 1227 | "name": "decreaseAllowance", 1228 | "outputs": [ 1229 | { 1230 | "internalType": "bool", 1231 | "name": "", 1232 | "type": "bool" 1233 | } 1234 | ], 1235 | "stateMutability": "nonpayable", 1236 | "type": "function" 1237 | }, 1238 | { 1239 | "inputs": [ 1240 | { 1241 | "internalType": "address", 1242 | "name": "spender", 1243 | "type": "address" 1244 | }, 1245 | { 1246 | "internalType": "uint256", 1247 | "name": "addedValue", 1248 | "type": "uint256" 1249 | } 1250 | ], 1251 | "name": "increaseAllowance", 1252 | "outputs": [ 1253 | { 1254 | "internalType": "bool", 1255 | "name": "", 1256 | "type": "bool" 1257 | } 1258 | ], 1259 | "stateMutability": "nonpayable", 1260 | "type": "function" 1261 | }, 1262 | { 1263 | "inputs": [ 1264 | { 1265 | "internalType": "address", 1266 | "name": "to", 1267 | "type": "address" 1268 | }, 1269 | { 1270 | "internalType": "uint256", 1271 | "name": "amount", 1272 | "type": "uint256" 1273 | } 1274 | ], 1275 | "name": "mint", 1276 | "outputs": [], 1277 | "stateMutability": "nonpayable", 1278 | "type": "function" 1279 | }, 1280 | { 1281 | "inputs": [ 1282 | { 1283 | "internalType": "address", 1284 | "name": "controller", 1285 | "type": "address" 1286 | } 1287 | ], 1288 | "name": "removeController", 1289 | "outputs": [], 1290 | "stateMutability": "nonpayable", 1291 | "type": "function" 1292 | }, 1293 | { 1294 | "inputs": [], 1295 | "name": "renounceOwnership", 1296 | "outputs": [], 1297 | "stateMutability": "nonpayable", 1298 | "type": "function" 1299 | }, 1300 | { 1301 | "inputs": [ 1302 | { 1303 | "internalType": "address", 1304 | "name": "to", 1305 | "type": "address" 1306 | }, 1307 | { 1308 | "internalType": "uint256", 1309 | "name": "amount", 1310 | "type": "uint256" 1311 | } 1312 | ], 1313 | "name": "transfer", 1314 | "outputs": [ 1315 | { 1316 | "internalType": "bool", 1317 | "name": "", 1318 | "type": "bool" 1319 | } 1320 | ], 1321 | "stateMutability": "nonpayable", 1322 | "type": "function" 1323 | }, 1324 | { 1325 | "inputs": [ 1326 | { 1327 | "internalType": "address", 1328 | "name": "from", 1329 | "type": "address" 1330 | }, 1331 | { 1332 | "internalType": "address", 1333 | "name": "to", 1334 | "type": "address" 1335 | }, 1336 | { 1337 | "internalType": "uint256", 1338 | "name": "amount", 1339 | "type": "uint256" 1340 | } 1341 | ], 1342 | "name": "transferFrom", 1343 | "outputs": [ 1344 | { 1345 | "internalType": "bool", 1346 | "name": "", 1347 | "type": "bool" 1348 | } 1349 | ], 1350 | "stateMutability": "nonpayable", 1351 | "type": "function" 1352 | }, 1353 | { 1354 | "inputs": [ 1355 | { 1356 | "internalType": "address", 1357 | "name": "newOwner", 1358 | "type": "address" 1359 | } 1360 | ], 1361 | "name": "transferOwnership", 1362 | "outputs": [], 1363 | "stateMutability": "nonpayable", 1364 | "type": "function" 1365 | }, 1366 | { 1367 | "inputs": [], 1368 | "stateMutability": "nonpayable", 1369 | "type": "constructor" 1370 | }, 1371 | { 1372 | "inputs": [ 1373 | { 1374 | "internalType": "address", 1375 | "name": "owner", 1376 | "type": "address" 1377 | }, 1378 | { 1379 | "internalType": "address", 1380 | "name": "spender", 1381 | "type": "address" 1382 | } 1383 | ], 1384 | "name": "allowance", 1385 | "outputs": [ 1386 | { 1387 | "internalType": "uint256", 1388 | "name": "", 1389 | "type": "uint256" 1390 | } 1391 | ], 1392 | "stateMutability": "view", 1393 | "type": "function" 1394 | }, 1395 | { 1396 | "inputs": [ 1397 | { 1398 | "internalType": "address", 1399 | "name": "account", 1400 | "type": "address" 1401 | } 1402 | ], 1403 | "name": "balanceOf", 1404 | "outputs": [ 1405 | { 1406 | "internalType": "uint256", 1407 | "name": "", 1408 | "type": "uint256" 1409 | } 1410 | ], 1411 | "stateMutability": "view", 1412 | "type": "function" 1413 | }, 1414 | { 1415 | "inputs": [], 1416 | "name": "decimals", 1417 | "outputs": [ 1418 | { 1419 | "internalType": "uint8", 1420 | "name": "", 1421 | "type": "uint8" 1422 | } 1423 | ], 1424 | "stateMutability": "view", 1425 | "type": "function" 1426 | }, 1427 | { 1428 | "inputs": [], 1429 | "name": "maxSupply", 1430 | "outputs": [ 1431 | { 1432 | "internalType": "uint256", 1433 | "name": "", 1434 | "type": "uint256" 1435 | } 1436 | ], 1437 | "stateMutability": "pure", 1438 | "type": "function" 1439 | }, 1440 | { 1441 | "inputs": [], 1442 | "name": "name", 1443 | "outputs": [ 1444 | { 1445 | "internalType": "string", 1446 | "name": "", 1447 | "type": "string" 1448 | } 1449 | ], 1450 | "stateMutability": "view", 1451 | "type": "function" 1452 | }, 1453 | { 1454 | "inputs": [], 1455 | "name": "owner", 1456 | "outputs": [ 1457 | { 1458 | "internalType": "address", 1459 | "name": "", 1460 | "type": "address" 1461 | } 1462 | ], 1463 | "stateMutability": "view", 1464 | "type": "function" 1465 | }, 1466 | { 1467 | "inputs": [], 1468 | "name": "symbol", 1469 | "outputs": [ 1470 | { 1471 | "internalType": "string", 1472 | "name": "", 1473 | "type": "string" 1474 | } 1475 | ], 1476 | "stateMutability": "view", 1477 | "type": "function" 1478 | }, 1479 | { 1480 | "inputs": [], 1481 | "name": "totalSupply", 1482 | "outputs": [ 1483 | { 1484 | "internalType": "uint256", 1485 | "name": "", 1486 | "type": "uint256" 1487 | } 1488 | ], 1489 | "stateMutability": "view", 1490 | "type": "function" 1491 | } 1492 | ] 1493 | 1494 | var account = null; 1495 | var contract = null; 1496 | var vaultcontract = null; 1497 | var web3 = null; 1498 | 1499 | const NFTCONTRACT = "0xC6Ad2824B03275D4cC5E8f4f61c5a143b999717b"; 1500 | const STAKINGCONTRACT = "0x60fEA9c2cFe8b44a9C7bf16dA54856CbfC290f13" 1501 | const polygonscanapikey = "DBQX5JUSAVUZRK8CC4IN2UZF9N2HA63P4U"; 1502 | const polygonscanapi = "https://api-testnet.polygonscan.com/api" 1503 | const moralisapi = "https://deep-index.moralis.io/api/v2/"; 1504 | const moralisapikey = "QlJv1SQwf47sxwKLY6Ut8M9sq9KI9q6MmrcEIMuNHiGF5lNKdSLfDmnACTO2rK2g"; 1505 | const nftpng = "https://ipfs.io/ipfs/QmetESUb7wTPr8mBHWFsiSKMw6HTLWUGoL8DrkcaY9TTyh/"; 1506 | 1507 | const providerOptions = { 1508 | binancechainwallet: { 1509 | package: true 1510 | }, 1511 | walletconnect: { 1512 | package: WalletConnectProvider, 1513 | options: { 1514 | infuraId: "3cf2d8833a2143b795b7796087fff369" 1515 | } 1516 | }, 1517 | walletlink: { 1518 | package: WalletLink, 1519 | options: { 1520 | appName: "Net2Dev NFT Minter", 1521 | infuraId: "3cf2d8833a2143b795b7796087fff369", 1522 | rpc: "", 1523 | chainId: 4, 1524 | appLogoUrl: null, 1525 | darkMode: true 1526 | } 1527 | }, 1528 | }; 1529 | 1530 | const web3Modal = new Web3Modal({ 1531 | network: "rinkeby", 1532 | theme: "dark", 1533 | cacheProvider: true, 1534 | providerOptions 1535 | }); 1536 | 1537 | 1538 | class App extends Component { 1539 | constructor() { 1540 | super(); 1541 | this.state = { 1542 | balance: [], 1543 | nftdata: [], 1544 | }; 1545 | } 1546 | 1547 | handleModal(){ 1548 | this.setState({show:!this.state.show}) 1549 | } 1550 | 1551 | handleNFT(nftamount) { 1552 | this.setState({outvalue:nftamount.target.value}); 1553 | } 1554 | 1555 | async componentDidMount() { 1556 | 1557 | await axios.get((polygonscanapi + `?module=stats&action=tokensupply&contractaddress=${NFTCONTRACT}&apikey=${polygonscanapikey}`)) 1558 | .then(outputa => { 1559 | this.setState({ 1560 | balance:outputa.data 1561 | }) 1562 | console.log(outputa.data) 1563 | }) 1564 | let config = {'X-API-Key': moralisapikey, 'accept': 'application/json'}; 1565 | await axios.get((moralisapi + `/nft/${NFTCONTRACT}/owners?chain=mumbai&format=decimal`), {headers: config}) 1566 | .then(outputb => { 1567 | const { result } = outputb.data 1568 | this.setState({ 1569 | nftdata:result 1570 | }) 1571 | console.log(outputb.data) 1572 | }) 1573 | } 1574 | 1575 | render() { 1576 | const {balance} = this.state; 1577 | const {nftdata} = this.state; 1578 | const {outvalue} = this.state; 1579 | 1580 | async function connectwallet() { 1581 | var provider = await web3Modal.connect(); 1582 | web3 = new Web3(provider); 1583 | await provider.send('eth_requestAccounts'); 1584 | var accounts = await web3.eth.getAccounts(); 1585 | account = accounts[0]; 1586 | document.getElementById('wallet-address').textContent = account; 1587 | contract = new web3.eth.Contract(ABI, NFTCONTRACT); 1588 | vaultcontract = new web3.eth.Contract(VAULTABI, STAKINGCONTRACT); 1589 | } 1590 | 1591 | async function mint0() { 1592 | var _pid = "0"; 1593 | var erc20address = await contract.methods.getCryptotoken(_pid).call(); 1594 | var currency = new web3.eth.Contract(TOKENABI, erc20address); 1595 | var mintRate = await contract.methods.getNFTCost(_pid).call(); 1596 | var _mintAmount = Number(outvalue); 1597 | var totalAmount = mintRate * _mintAmount; 1598 | currency.methods.approve(NFTCONTRACT, String(totalAmount)).send({from: account}) 1599 | .then( 1600 | await currency.methods.transfer(NFTCONTRACT, String(totalAmount)).send({from:account})) 1601 | .then( 1602 | contract.methods.mintpid(account, _mintAmount, _pid).send({from: account}) 1603 | ); 1604 | } 1605 | async function mint1() { 1606 | var _pid = "1"; 1607 | var erc20address = await contract.methods.getCryptotoken(_pid).call(); 1608 | var currency = new web3.eth.Contract(TOKENABI, erc20address); 1609 | var mintRate = await contract.methods.getNFTCost(_pid).call(); 1610 | var _mintAmount = Number(outvalue); 1611 | var totalAmount = mintRate * _mintAmount; 1612 | currency.methods.approve(NFTCONTRACT, String(totalAmount)).send({from: account}) 1613 | .then( 1614 | await currency.methods.transfer(NFTCONTRACT, String(totalAmount)).send({from:account})) 1615 | .then( 1616 | contract.methods.mintpid(account, _mintAmount, _pid).send({from: account}) 1617 | ); 1618 | } 1619 | 1620 | async function mint2() { 1621 | var _pid = "2"; 1622 | var erc20address = await contract.methods.getCryptotoken(_pid).call(); 1623 | var currency = new web3.eth.Contract(TOKENABI, erc20address); 1624 | var mintRate = await contract.methods.getNFTCost(_pid).call(); 1625 | var _mintAmount = Number(outvalue); 1626 | var totalAmount = mintRate * _mintAmount; 1627 | currency.methods.approve(NFTCONTRACT, String(totalAmount)).send({from: account}) 1628 | .then( 1629 | await currency.methods.transfer(NFTCONTRACT, String(totalAmount)).send({from:account})) 1630 | .then( 1631 | contract.methods.mintpid(account, _mintAmount, _pid).send({from: account}) 1632 | ); 1633 | } 1634 | 1635 | async function mint() { 1636 | var _mintAmount = Number(outvalue); 1637 | var mintRate = Number(await contract.methods.cost().call()); 1638 | var totalAmount = mintRate * _mintAmount; 1639 | contract.methods.mint(account, _mintAmount).send({ from: account, value: String(totalAmount) }); 1640 | } 1641 | async function claimit() { 1642 | var tokenids = Number(document.querySelector("[name=stkid]").value); 1643 | vaultcontract.methods.claim([tokenids]).send({from: account}); 1644 | } 1645 | 1646 | async function verify() { 1647 | var getbalance = Number(await vaultcontract.methods.balanceOf(account).call()); 1648 | document.getElementById('stakedbalance').textContent = getbalance; 1649 | } 1650 | 1651 | async function enable() { 1652 | contract.methods.setApprovalForAll(STAKINGCONTRACT, true).send({from: account}); 1653 | } 1654 | 1655 | async function rewardinfo() { 1656 | var tokenid = Number(document.querySelector("[name=stkid]").value); 1657 | var rawearn = await vaultcontract.methods.earningInfo(account, ([tokenid])).call(); 1658 | var earned = String(rawearn).split(",")[0]; 1659 | var earnedrwd = Web3.utils.fromWei(earned); 1660 | var rewards = Number(earnedrwd).toFixed(2); 1661 | document.getElementById('earned').textContent = rewards; 1662 | } 1663 | 1664 | return ( 1665 |
Collection | 1744 |Rewards Per Day | 1745 |Exchangeable Items | 1746 |
---|---|---|
N2D Bronze Collection | 1751 |1752 | 0.50 N2DR 1753 | | 1754 |1755 | 2 NFTs/M 1756 | | 1757 |
N2D Silver Collection | 1760 |1761 | 2.50 N2DR 1762 | | 1763 |10 NFTs/M 1764 | | 1765 |
N2D Gold Collection | 1768 |1 N2DR+ 1769 | | 1770 |1771 | 25 NFTs/M or 1772 | 100 N2DR/M 1773 | | 1774 |
Farm Pools | 1784 |Harvest Daily Earnings | 1785 |
---|---|
Stake N2DR to Earn N2DR | 1790 |1791 | 0.01 Per N2DR 1792 | | 1793 |
Stake N2DR to Earn N2DR+ | 1796 |1797 | 0.005 Per N2DR 1798 | | 1799 |
{result.owner_of}
1852 |