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
// utils.ts | |
export const generatePagination = (currentPage: number, totalPages: number) => { | |
// If the total number of pages is 7 or less, | |
// display all pages without any ellipsis. | |
if (totalPages <= 7) { | |
return Array.from({ length: totalPages }, (_, i) => i + 1); | |
} | |
// If the current page is among the first 3 pages, |
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
"use client"; | |
import { Network, Alchemy } from "alchemy-sdk"; | |
import { ethers } from "ethers"; // ethers V6 | |
const settings = { | |
apiKey: "", // Replace with your Alchemy API Key. | |
network: Network.MATIC_MAINNET, // Replace with your network. | |
}; |
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
server { | |
root /var/www/YOUR_DOMAIN_PATH_NAME/html; | |
index index.html index.htm index.nginx-debian.html; | |
server_name YOUR_DOMAIN; | |
location / { | |
proxy_pass YOUR_SERVER_IP:8080; | |
proxy_http_version 1.1; |
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
/* | |
- yarn init -y | |
- update package.json :) | |
{ | |
"name": "rarity", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", |
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 "@openzeppelin/contracts/access/Ownable.sol"; | |
import "erc721a/contracts/ERC721A.sol"; | |
import "erc721a/contracts/extensions/ERC721AQueryable.sol"; | |
import "solady/src/Milady.sol"; | |
import "solady/src/utils/ECDSA.sol"; | |
import "solady/src/utils/LibString.sol"; | |
import "solady/src/utils/SafeTransferLib.sol"; |