1

Knowing that
account0 = 0x2ac971cfceb478a3db5a43598e098839007cec34
account1 = 0x55990a8c443a0eb296cff4bece4c54350185b019

I started testrpc. After that, I called a function buyItem(moneyPaid,{from:account1}) in a javascript test file. Then I verified the msg.sender inside the function. I realized that the msg.sender is not account1. Plus, it changes every time I called the function. Can anyone explain why the msg.sender is not account1 nor any account on the web3.eth.accounts list?

-2

It happens. I faced it when my web3 object was not getting injected properly. I was using metamask then. Everytime I was trying to use the msg.sender, it was giving me some other address than the account selected in metamask.

You please check in the browser console, by putting some flags, whether your web3 is getting injected properly or not.

It's going to be the case, most probably.

Hope this helps.

Thanks.

  • 1
    This is really a comment, not an answer. You are suggesting what to do but not how. – Waqar Lim Mar 14 '17 at 12:48

Your Answer

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

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