Here is the info related with above issue
- Debug logs
error: ASTDereferencerError: No node with id 6677 of type ContractDefinition
at deref (/home/Documents/Projects/nft-marketplace/node_modules/solidity-ast/src/ast-dereferencer.ts:59:11)
at derefNode (/home/Documents/Projects/nft-marketplace/node_modules/solidity-ast/src/ast-dereferencer.ts:63:12)
at curried (/home/Documents/Projects/nft-marketplace/node_modules/solidity-ast/src/ast-dereferencer.ts:84:14)
at getInheritedContractOpcodeErrors (/home/Documents/Projects/nft-marketplace/node_modules/@openzeppelin/upgrades-core/src/validate/run.ts:361:34)
at getInheritedContractOpcodeErrors.next (<anonymous>)
at getContractOpcodeErrors (/home/Documents/Projects/nft-marketplace/node_modules/@openzeppelin/upgrades-core/src/validate/run.ts:254:10)
at getContractOpcodeErrors.next (<anonymous>)
at getOpcodeErrors (/home/Documents/Projects/nft-marketplace/node_modules/@openzeppelin/upgrades-core/src/validate/run.ts:229:10)
at getOpcodeErrors.next (<anonymous>)
at validate (/home/Documents/Projects/nft-marketplace/node_modules/@openzeppelin/upgrades-core/src/validate/run.ts:167:14)
at validateArtifacts (/home/Documents/Projects/nft-marketplace/node_modules/@openzeppelin/truffle-upgrades/src/utils/validations.ts:21:18)
at getDeployData (/home/Documents/Projects/nft-marketplace/node_modules/@openzeppelin/truffle-upgrades/src/utils/deploy-impl.ts:41:23)
at deployProxyImpl (/home/Documents/Projects/nft-marketplace/node_modules/@openzeppelin/truffle-upgrades/src/utils/deploy-impl.ts:64:22)
at deployProxy (/home/Documents/Projects/nft-marketplace/node_modules/@openzeppelin/truffle-upgrades/src/deploy-proxy.ts:36:26)
at module.exports (/home/Documents/Projects/nft-marketplace/migrations/4_deploy_nft_marketplace_royalty.js:18:24) {
id: 6677,
nodeType: [ 'ContractDefinition' ]
}
- Truffle Configs
/* eslint-disable camelcase */
/**
* Use this file to configure your truffle project. It's seeded with some
* common settings for different networks and features like migrations,
* compilation and testing. Uncomment the ones you need or modify
* them to suit your project as necessary.
*
* More information about configuration can be found at:
*
* trufflesuite.com/docs/advanced/configuration
*
* To deploy via Infura you'll need a wallet provider (like @truffle/hdwallet-provider)
* to sign your transactions before they're sent to a remote public node. Infura accounts
* are available for free at: infura.io/register.
*
* You'll also need a mnemonic - the twelve word phrase the wallet uses to generate
* public/private key pairs. If you're publishing your code to GitHub make sure you load this
* phrase from a file you've .gitignored so it doesn't accidentally become public.
*
*/
const {
mnemonic,
BSCSCAN_API_KEY,
ETHERSCAN_API_KEY,
POLYSCAN_API_KEY,
infuraApiKey
} = require('./secrets.json');
const test_data = require('./secrets.test.json');
const HDWalletProvider = require('@truffle/hdwallet-provider');
module.exports = {
plugins: ['solidity-coverage', 'truffle-plugin-verify', 'truffle-contract-size'],
api_keys: {
bscscan: BSCSCAN_API_KEY,
etherscan: ETHERSCAN_API_KEY,
polygonscan: POLYSCAN_API_KEY
},
contracts_directory: './contracts/',
/**
* Networks define how you connect to your ethereum client and let you set the
* defaults web3 uses to send transactions. If you don't specify one truffle
* will spin up a development blockchain for you on port 9545 when you
* run `develop` or `test`. You can ask a truffle command to use a specific
* network from the command line, e.g
*
* $ truffle test --network <network-name>
*/
networks: {
// Useful for testing. The `development` name is special - truffle uses it by default
// if it's defined here and no other network is specified at the command line.
// You should run a client (like ganache-cli, geth or parity) in a separate terminal
// tab if you use this network and you must also set the `host`, `port` and `network_id`
// options below to some value.
development: {
host: '127.0.0.1', // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: '*' // Any network (default: none)
},
coverage: {
host: 'localhost',
network_id: 1111,
port: 8555,
gas: 8000000,
gasPrice: 1000000000
},
local_fork: {
port: 8545,
network_id: 9999, // Custom network
gas: 20000000000, // Gas sent with each transaction (default: ~6700000)
gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei)
websocket: true // Enable EventEmitter interface for web3 (default: false)
},
bsc_test: {
provider: () =>
new HDWalletProvider(test_data.mnemonic, 'https://data-seed-prebsc-1-s1.binance.org:8545/'),
gasPrice: 10000000000, // 10 gwei (in wei)
network_id: 97,
timeout: 20000000,
skipDryRun: true,
networkCheckTimeout: 20000000
},
bsc_main: {
provider: () => new HDWalletProvider(mnemonic, 'https://bsc-dataseed1.ninicoin.io'),
network_id: 56,
gasPrice: 10000000000, // 10 gwei (in wei)
skipDryRun: true
},
mumbai: {
provider: () => new HDWalletProvider(mnemonic, 'https://rpc-mumbai.maticvigil.com/'),
network_id: 80001,
gasPrice: 10e9,
skipDryRun: true,
networkCheckTimeout: 20000000
},
matic: {
provider: () => new HDWalletProvider(mnemonic, 'https://matic-mainnet.chainstacklabs.com/'),
// https://rpc-mumbai.maticvigil.com/
// https://matic-mumbai.chainstacklabs.com
// https://rpc-mumbai.matic.today
network_id: 137,
gasPrice: 10e9,
skipDryRun: true,
timeout: 20000000,
networkCheckTimeout: 20000000,
timeoutBlocks: 200
}
// Useful for deploying to a public network.
// NB: It's important to wrap the provider as a function.
// ropsten: {
// provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/YOUR-PROJECT-ID`),
// network_id: 3, // Ropsten's id
// gas: 5500000, // Ropsten has a lower block limit than mainnet
// confirmations: 2, // # of confs to wait between deployments. (default: 0)
// timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
// skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
// },
// Useful for private networks
// private: {
// provider: () => new HDWalletProvider(mnemonic, `https://network.io`),
// network_id: 2111, // This network is yours, in the cloud.
// production: true // Treats this network as if it was a public net. (default: false)
// }
},
// Set default mocha options here, use special reporters etc.
mocha: {
timeout: 10000000,
useColors: true,
slow: 30000,
bail: true,
reporter: 'eth-gas-reporter',
reporterOptions: {
excludeContracts: ['Migrations', 'mocks'],
currency: 'USD',
noColors: true
}
},
// Configure your compilers
compilers: {
solc: {
version: '0.8.18', // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
settings: {
// See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 1
}
// evmVersion: "byzantium"
}
}
}
};
- Truffle version
Truffle v5.4.5 (core: 5.4.5)
Solidity - 0.8.18 (solc-js)
Node v18.1.0
Web3.js v1.5.1
- Migration command
npx truffle migrate --network=mumbai