I have happened a problem when I migrate a singale contract,the log is below:
> truffle migrate --network rinkeby --reset
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'rinkeby'
> Network id: 4
> Block gas limit: 10000000 (0x989680)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" -- transaction could not be decoded: could not recover secp256k1 key: calculated Rx is larger than curve P.
at D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\deployer\src\deployment.js:365:1
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Migration._deploy (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:74:1)
at Migration._load (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:61:1)
at Migration.run (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:212:1)
at Object.runMigrations (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)
at Object.runAll (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\migrate\index.js:114:1)
at Object.run (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\migrate\index.js:79:1)
at runMigrations (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:263:1)
at Object.run (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:228:1)
at Command.run (D:\projects\hero-contract\node_modules\truffle\build\webpack:\packages\core\lib\command.js:136:1)
Truffle v5.2.5 (core: 5.2.5)
Node v12.16.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hero-contract@1.0.0 migrate: `truffle migrate --network rinkeby --reset`
npm ERR! Exit status 1
npm ERR!
And the trufffle-config.js is below:
const { projectId, mnemonic,ropsten_projectId} = require('./secrets.json');
const HDWalletProvider = require('@truffle/hdwallet-provider');
module.exports = {
networks: {
development: {
host: '127.0.0.1', // Localhost (default: none)
port: 7545, // Standard Ethereum port (default: none)
network_id: '*', // Any network (default: none)
},
// Useful for deploying to a public network.
// NB: It's important to wrap the provider as a function.
rinkeby: {
provider: () => new HDWalletProvider(mnemonic, `https://rinkeby.infura.io/v3/${projectId}`),
network_id: 4, // Rinkeby's id
gas: 5500000, // Rinkeby 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 )
},
ropsten: {
provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${ropsten_projectId}`),
network_id: 3, // Rinkeby's id
gas: 5500000, // Rinkeby 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 )
},
},
compilers: {
solc: {
version: '0.7.0', // 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: 200,
// }
// evmVersion: "byzantium"
}
},
};
$ npx truffle migrate --network rinkeby
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Migrations dry-run (simulation)
===============================
> Network name: 'rinkeby-fork'
> Network id: 4
> Block gas limit: 10000000 (0x989680)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
> block number: 8275701
> block timestamp: 1616368781
> account: 0x6B5732937e1c3B041B95D523C1817E45746d39C0
> balance: 2.995372098
> gas used: 171951 (0x29faf)
> gas price: 2 gwei
> value sent: 0 ETH
> total cost: 0.000343902 ETH
-------------------------------------
> Total cost: 0.000343902 ETH
2_deploy.js
===========
Deploying 'Box'
---------------
> block number: 8275703
> block timestamp: 1616368797
> account: 0x6B5732937e1c3B041B95D523C1817E45746d39C0
> balance: 2.994522228
> gas used: 397600 (0x61120)
> gas price: 2 gwei
> value sent: 0 ETH
> total cost: 0.0007952 ETH
-------------------------------------
> Total cost: 0.0007952 ETH
Summary
=======
> Total deployments: 2
> Final cost: 0.001139102 ETH
Starting migrations...
======================
> Network name: 'rinkeby'
> Network id: 4
> Block gas limit: 10000000 (0x989680)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" -- transaction could not be decoded: could not recover secp256k1 key: calculated Rx is larger than curve P.
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at Migration._deploy (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:74:1)
at Migration._load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:61:1)
at Migration.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:212:1)
at Object.runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
at Object.runFrom (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:87:1)
at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:263:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:226:1)
at Command.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)
Truffle v5.2.4 (core: 5.2.4)
Node v15.12.0
I’ve been having the same problem the last two days and have been following this thread. I was able to get it working by downgrading to version 1.2.1 as opposed to 1.2.3