Cudder
August 6, 2021, 7:11pm
1
Today I tried to deploy a contract on the mainnet but something went wrong. I've got this message:
⠧ Saving migration to chain. insufficient funds for gas * price + value
The strange thing is that even though I've got the error the contract can still be found on Etherscan and ETH is deducted from my wallet.
Whenever I try to interact with the contract (via truffle console) I get the message:
contractname has not been deployed to detected network (network/artifact mismatch)
Is there still a way to fix this, or did I loose all my ETH and have to try again?
STYJ
August 7, 2021, 3:02pm
2
When you deploy with truffle, you'll deploy the migrations contract first. Maybe it's the migration contract that has been deployed and not your actual contract?
Cudder
August 7, 2021, 3:36pm
3
Both seem to be deployed if I check etherscan. I just noticed that Truffle failed to create an artifact for the main contract. Is it possible to recreate the artifact?
STYJ
August 8, 2021, 1:47am
4
I don't remember truffle too well as it has been a long time since I used it but just want to point out a few things:
If you already have it deployed, you don't need the artifact. Artifacts are unique to truffle https://ethereum.stackexchange.com/questions/30457/what-are-artifacts-in-truffle .
To interact with the contract, all you need is the ABI of the token contract and the contract address.
Try running truffle compile
to build these artifacts again. https://www.trufflesuite.com/docs/truffle/getting-started/compiling-contracts