0

I am trying to deploy contract to polygon mumbai testnet. It works with the first wallet address, but when i use a different wallet address it doesn't work. I am using the same alchemy rpc url

truffle migrate --reset --network first_owner //works
truffle migrate --reset --network different_owner //doesn't work

Second one is compiling fine, but no transaction

//UPDATE

Truffle Config file

networks: {
matic_test: {
  provider: () => new HDWalletProvider({
    mnemonic: {
      phrase: process.env.MEMONIC
    },
    providerOrUrl: process.env.ALCHEMY_API_POLYGON_TEST
  }),
  network_id: 80001,
  confirmations: 2,
  timeoutBlocks: 200,
  skipDryRun: true,
  gas: 6000000,
  gasPrice: 10000000000,
  from : "WORKING_ADDRESS"
},
matic_test_staging: {
  provider: () => new HDWalletProvider({
    mnemonic: {
      phrase: process.env.MEMONIC_STAGING
    },
    providerOrUrl: process.env.ALCHEMY_API_POLYGON_TEST
  }),
  network_id: 80001,
  confirmations: 2,
  timeoutBlocks: 200,
  skipDryRun: true,
  gas: 6000000,
  gasPrice: 10000000000,
  from : "DIFFERENT_ADDRESS"
},
}

Second one is only compiling but not deploying Any idea?

5
  • --network should be the network specified on your truffle-config.js not the address of the owner
    – Adam Boudj
    Mar 18, 2022 at 16:21
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Mar 18, 2022 at 16:22
  • i deployed my contract with one wallet address. I am trying to deploy the same contract under different wallet address. @AdamBoudjemaa. first_owner and different_owner is the configuration in truffle config file. I have updated the main question with the config file. Mar 24, 2022 at 21:47
  • truffle migrate --reset --network matic_test_staging try this do you have enough ETH / MATIC to deploy / run a transaction?
    – Adam Boudj
    Mar 24, 2022 at 21:59
  • yes, tried it. didn't work. it shows compile complete but no new contract address. same call works with matic_test Mar 24, 2022 at 22:00

1 Answer 1

0

Resolved Remove everything from the build folder and then build it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.