I have used require function as:

require(owner == msg.sender, "Sender must be owner");

But in the remix console I got,

transact to Contract.setAdmin errored: [object Object]

What should I do to get proper error message? Also the same contract, using metamask is successfully deployed on Rinkeby. Is it the matter of traffic on that testnet?

  • This error doesn't look like it has anything to do with the require statement in your code. – goodvibration Oct 29 '20 at 11:47
  • So why I am getting [object Object] ? – Rudrika Fichadiya Oct 29 '20 at 11:48
  • Because you are doing something wrong of course. – goodvibration Oct 29 '20 at 11:49
  • @RudrikaFichadiya Which ethereum node are you using to deploy your contracts? ie geth, parity, ganache, etc. Remix gets the message from the node, it is not standarized how to get the error message so it may not work for every client. – Ismael Oct 29 '20 at 14:42
  • @Ismael, I am using Injected Web3 & Metamask to deploy my contract on testnet. – Rudrika Fichadiya Oct 30 '20 at 3:56

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.