I have attempted to deploy the contracts through Polygon Amoy and Sepolia, and both of them produce the same error. I have launched Ganache with the same MNEMONIC
as the MetaMask wallet and the one used in .secret
file.
The network used in MetaMask is also the same as the one used in the truffle-config.js
Compiling your contracts...
===========================
⠇ Fetching solc version list from solc-bin. Attempt #1
/home/ahmed/PycharmProjects/payment-dapp/node_modules/eth-block-tracker/src/polling.js:51
const newErr = new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:n${err.stack}`)
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
undefined
at PollingBlockTracker._performSync (/home/ahmed/PycharmProjects/payment-dapp/node_modules/eth-block-tracker/src/polling.js:51:24)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
truffle-config.js
const HDWalletProvider = require("@truffle/hdwallet-provider");
const fs = require("fs");
const mnemonic = fs.readFileSync(".secret").toString().trim();
require('dotenv').config()
module.exports = {
networks: {
development: {
host: "localhost",
port: 7545,
network_id: "*",
},
sepolia: {
provider: () =>
new HDWalletProvider(
mnemonic,
`https://sepolia.infura.io/v3/`
),
network_id: 11155111,
confirmations: 2,
gas: 5500000,
gasPrice: 45000000,
networkCheckTimeout: 10000000,
timeoutBlocks: 200,
skipDryRun: true,
chainId: 11155111,
},
},
contracts_directory: "./contracts",
contracts_build_directory: "./abis",
compilers: {
solc: {
version: "^0.8.19",
optimizer: {
enabled: true,
runs: 200,
},
},
},
db: {
enabled: false,
},
};