0
votes

I am currently developing a dapp on ethereum. From what I know msg.sender should has the value of the account who interact with it. However, it keeps the value of the deployer's account.

I am using metamask and solidity ^0.4.24. I am deploying the contact using truffle framework and also Ganache GUI as my virtual node

function getMe() public view returns(address){
        return msg.sender;
    }

So, I expect this code to return the hash of the account which is interacting with the contract but instead I am taking back the address of the acount which deployed it

1

1 Answers

0
votes

msg.sender contains the value of the address of the caller. You must be deploying and interacting from the same account, probably using accounts[0].