0

As I understand, if I compile a contract via truffle compile to have the Contract.json, and then deploy the contract from Remix IDE to, say, Ropsten, the dapp should work via MetaMask pointed to Ropsten, no? But, for some reason, this is not working.

At the end of the day, I want to be able to deploy a contract to MainNet from Remix IDE, and then use Truffle as the UI to work with the dapp. Is there a way to do this?

  • Can you describe your issue exactly? ie error message, anything that can be useful to triage your problem. I've used both Truffle and Remix to compile and deploy dapps, and can use them through MetaMask without issues. – Ismael Nov 5 '18 at 17:00
  • I am getting artifact/network mismatch error when deploying from Remix IDE to Ganache, and then using Truffle console to execute the contract functions. – Ruham Nov 7 '18 at 17:10
  • When you deploy contracts with Truffle it will update the artifacts with some details like deployed address, network id, etc. If you deploy with Remix this fields will not be updated and Truffle will not be able to reference deployed contracts. One option is to manually update artifacts with the address obtained from Remix. – Ismael Nov 7 '18 at 17:44
  • Thanks for clarification. I wonder if those fields are known, or there's more I could read. The issue is the migration mechanism of Truffle, every time deploying the Migrations contract, and storing the info on the blockchain. I would rather deploy from Remix, having the ability to interact with the contract via the Truffle console. – Ruham Nov 7 '18 at 19:29
  • 1
    IMHO messing with artifacts is not something I'll recommend against. You can refer to contracts by its address replace MyContract.deployed() with MyContract.at("0x12341234...."). Another option is to use a different framework like Embark, EtherLime, or program directly on top of web3. – Ismael Nov 7 '18 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.