I'm trying to deploy a smart contract to the main Ethereum network, and I'm having trouble actually getting my front-end to work. I'm using Truffle, Geth, Infura, and web3js.
var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = "hidden_for_obvious_reasons";
module.exports = {
networks: {
live: {
network_id: 1,
provider: new HDWalletProvider(mnemonic, "https://mainnet.infura.io/my_api_key")
}
}
};
Inside Adoption.js, which is the artifact for my contract, I see the following:
"networks": {
"3": {
"events": {},
"links": {},
"address": "0xf45599d4f5a0e9b3f8f4b45012f96e038e7208e6"
}
I think that has something to do with it.
My contract deploys without any issues and I can see it on etherscan here.
My 1_initial_migration.js file:
var Migrations = artifacts.require("./Migrations.sol");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
My 2_deploy_contracts.js file:
var Adoption = artifacts.require("Adoption");
module.exports = function(deployer) {
deployer.deploy(Adoption, {gas:2000000});
};
I'm just trying to figure out why my front-end can't interact with my contract. Here's the console output in the browser:
truffle-contract.js:425 Uncaught (in promise) Error: Contract has not been deployed to detected network (network/artifact mismatch)
at truffle-contract.js:425
at <anonymous>
insufficient funds for gas * price + value
. I'm using the same MetaMask mnemonic as I was before, and that wallet has about .07 eth in it. Do you know why that may be happening? – rustyshackleford Feb 24 '18 at 7:19