Skip to content

Commit

Permalink
Replace Rinkeby with Goerli everywhere, because Rinkeby is getting de…
Browse files Browse the repository at this point in the history
…precated.
  • Loading branch information
kristjanpeterson1 committed Oct 4, 2022
1 parent a1eac60 commit 418f4de
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions backend/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const extraMetadata = {
// ** REQUIRED **
const AUTH = process.env.NFTPORT_API_KEY; // Set this in the .env file to prevent exposing your API key when pushing to Github
const LIMIT = 2; // Your API key rate limit
const CHAIN = 'rinkeby'; // only rinkeby, polygon, or ethereum
const CHAIN = 'goerli'; // only goerli, polygon, or ethereum

// REQUIRED CONTRACT DETAILS THAT CANNOT BE UPDATED LATER!
const CONTRACT_NAME = 'CRYPTOPUNKS';
Expand All @@ -54,7 +54,7 @@ const METADATA_UPDATABLE = true; // set to false if you don't want to allow meta
const OWNER_ADDRESS = 'YOUR WALLET ADDRESS HERE';
const TREASURY_ADDRESS = 'YOUR WALLET ADDRESS HERE';
const MAX_SUPPLY = 5000; // The maximum number of NFTs that can be minted. CANNOT BE UPDATED!
const MINT_PRICE = 0.01; // Minting price per NFT. Rinkeby = ETH, Ethereum = ETH, Polygon = MATIC. CANNOT BE UPDATED!
const MINT_PRICE = 0.01; // Minting price per NFT. Goerli = ETH, Ethereum = ETH, Polygon = MATIC. CANNOT BE UPDATED!
const TOKENS_PER_MINT = 10; // maximum number of NFTs a user can mint in a single transaction. CANNOT BE UPDATED!

// REQUIRED CONTRACT DETAILS THAT CAN BE UPDATED LATER.
Expand Down
4 changes: 2 additions & 2 deletions backend/utils/functions/refreshOpensea.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ if (!START || !END) {
}

const COLLECTION_BASE_URL =
CHAIN.toLowerCase() === "rinkeby"
? `https://testnets.opensea.io/assets`
CHAIN.toLowerCase() === "goerli"
? `https://testnets.opensea.io/assets/goerli`
: "https://opensea.io/assets/matic";

async function main() {
Expand Down
22 changes: 11 additions & 11 deletions frontend/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ const updateConnectStatus = async () => {

async function checkChain() {
let chainId = 0;
if(chain === 'rinkeby') {
chainId = 4;
if(chain === 'goerli') {
chainId = 5;
} else if(chain === 'polygon') {
chainId = 137;
} else if(chain === 'ethereum') {
Expand All @@ -120,15 +120,15 @@ async function checkChain() {
// This error code indicates that the chain has not been added to MetaMask.
if (err.code === 4902) {
try {
if(chain === 'rinkeby') {
if(chain === 'goerli') {
await window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [
{
chainName: 'Rinkeby Test Network',
chainName: 'Goerli Test Network',
chainId: web3.utils.toHex(chainId),
nativeCurrency: { name: 'ETH', decimals: 18, symbol: 'ETH' },
rpcUrls: ['https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161'],
rpcUrls: ['https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161'],
},
],
});
Expand Down Expand Up @@ -223,7 +223,7 @@ async function loadInfo() {
}, 1000);

let priceType = '';
if(chain === 'rinkeby' || chain === 'ethereum') {
if(chain === 'goerli' || chain === 'ethereum') {
priceType = 'ETH';
} else if (chain === 'polygon') {
priceType = 'MATIC';
Expand Down Expand Up @@ -288,7 +288,7 @@ function setTotalPrice() {
const totalPriceWei = BigInt(info.deploymentConfig.mintPrice) * BigInt(mintInputValue);

let priceType = '';
if(chain === 'rinkeby' || chain === 'ethereum') {
if(chain === 'goerli' || chain === 'ethereum') {
priceType = 'ETH';
} else if (chain === 'polygon') {
priceType = 'MATIC';
Expand Down Expand Up @@ -317,8 +317,8 @@ async function mint() {
.mint(amount)
.send({ from: window.address, value: value.toString() });
if(mintTransaction) {
if(chain === 'rinkeby') {
const url = `https://rinkeby.etherscan.io/tx/${mintTransaction.transactionHash}`;
if(chain === 'goerli') {
const url = `https://goerli.etherscan.io/tx/${mintTransaction.transactionHash}`;
const mintedContainer = document.querySelector('.minted-container');
const countdownContainer = document.querySelector('.countdown');
const mintedTxnBtn = document.getElementById("mintedTxnBtn");
Expand Down Expand Up @@ -354,8 +354,8 @@ async function mint() {
.presaleMint(amount, merkleJson)
.send({ from: window.address, value: value.toString() });
if(presaleMintTransaction) {
if(chain === 'rinkeby') {
const url = `https://rinkeby.etherscan.io/tx/${presaleMintTransaction.transactionHash}`;
if(chain === 'goerli') {
const url = `https://goerli.etherscan.io/tx/${presaleMintTransaction.transactionHash}`;
const mintedContainer = document.querySelector('.minted-container');
const countdownContainer = document.querySelector('.countdown');
const mintedTxnBtn = document.getElementById("mintedTxnBtn");
Expand Down
2 changes: 1 addition & 1 deletion frontend/js/constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const contractAddress = "YOUR CONTRACT ADDRESS"; // Replace with your own contract address
const chain = 'rinkeby'; // rinkeby, polygon, or ethereum
const chain = 'goerli'; // goerli, polygon, or ethereum

const welcome_h1 = "Welcome to the CodeCats NFT Project!!";
const welcome_h2 = "Connect to MetaMask to Get Started";
Expand Down

0 comments on commit 418f4de

Please sign in to comment.