I have been running into the specified in the title.
I have developed a smart contract and have successfully compiled and deployed it to the network as follows: 1. Run testrpc 2. truffle compile 3. truffle migrate
However, the error above is still being shown. I then tried deleting the build file and followed the steps below: 1. Run testrpc 2. truffle compile 3. truffle migrate --network rinkeby
The error was still being shown.
Below is the truffle.js file
module.exports = {
migrations_directory: "./migrations",
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
},
rinkeby: {
host: "localhost", // Connect to geth on the specified
port: 8545,
network_id: "*",
}
} };
If anybody has faced any similar issues and have resolved it, I would greatly appreciate it if you could share how you have resolved it.
Thanks in advance
For me, the following steps worked: create the file 2_deploy_contract.js in the migration folder with the code
var myContract = artifacts.require("myContract");
module.exports = function(deployer){
deployer.deploy(myContract);
}
And run on terminal
$ truffle migrate --reset
I didn't need to change any settings in the truffle-config.js
I had the same issue and created the file 2_deploy_contract.js in the migration folder with the code:
var myContract = artifacts.require("myContract");
module.exports = function(deployer){
deployer.deploy(myContract);
}
I also checked the truffle-config.js at the root of the folder with the default settings:
rinkeby: {
host: "localhost",
port: 8545,
from: "0x0085f8e72391Ce4BB5ce47541C846d059399fA6c", // default address to use for any transaction Truffle makes during migrations
network_id: 4,
gas: 4612388 // Gas limit used for deploys
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With