I’m trying to create an NFT using Alchemy on the Sepolia network but getting a 404 server error. The script runs without issues in other scenarios, but when I execute node scripts/deploy.js, this error appears:
Error occurred: Error: server response 404 Not Found (request={}, response={}, error=null, code=SERVER_ERROR, version=6.3.0)
at makeError (.../blockchain/node_modules/ethers/lib.commonjs/utils/errors.js:121:21)
at assert (.../blockchain/node_modules/ethers/lib.commonjs/utils/errors.js:138:15)
at FetchResponse.assertOk (.../blockchain/node_modules/ethers/lib.commonjs/utils/fetch.js:775:32)
at AlchemyProvider._send (.../blockchain/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:772:18)
Here’s my deployment script:
const { ethers } = require("ethers");
const tokenContract = require("../artifacts/contracts/nftToken.sol/nftToken.json");
const contractABI = tokenContract.abi;
const alchemyProvider = new ethers.AlchemyProvider("sepolia", process.env.ALCHEMY_KEY);
const signerWallet = new ethers.Wallet(process.env.WALLET_PRIVATE_KEY, alchemyProvider);
const NFTToken = new ethers.Contract(process.env.DEPLOYED_CONTRACT_ADDRESS, contractABI, signerWallet);
const deployToken = async () => {
try {
const txn = await NFTToken.createToken(process.env.WALLET_PUBLIC_KEY);
console.log(txn);
} catch (error) {
console.log("Error occurred", error);
}
};
deployToken();
I’ve verified my environment variables multiple times and tried different approaches but the 404 error persists. Has anyone encountered this issue before? Looking for a way to successfully execute the minting script.