0

I want to know the real msg.sender of the transaction. Which this means is, if I use truffle console I can change the msg.sender by using {from: another address}. So let's say my address is A, and another user's address is B. And B created an sale auction for he's item1. But by using truffle console, I can cancel this auction by, cancelAuction(item1_id, {from: B}) despite the REAL msg.sender is me(the address A). How can I check the real msg.sender(A) from the function's require()?

1 Answer 1

4

On a real blockchain, you can't send from whatever account you want. You can only send as an address for which you know the private key.

So "the real msg.sender" is just msg.sender. It cannot be spoofed.

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.