Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 4
    If you use a wallet like the Mist wallet you will not want to use tx.origin, if I understand this explanation correctly. I would not ever hold substantial ether unless it was in a multi-sig wallet such as the Mist wallet. Commented Mar 7, 2016 at 5:45
  • 2
    Agree! Code that uses tx.origin will not be "ownable" by a contract multi-sig wallet like Mist. Commented May 29, 2016 at 3:40
  • 2
    OpenZeppelin's sample code has "address public owner", which means anyone can get the contract's owner's address. Can a wallet (hacker) ever spoof msg.sender to impersonate the owner? Commented Aug 3, 2017 at 14:11
  • 2
    @Curt The feasible way to impersonate msg.sender is to have their private key; without the private key it is computationally infeasible. Commented Aug 10, 2017 at 6:19
  • 4
    Passing on the origin address as a parameter should never be used for security (e.g. "only allow this action if the passed-in address is the contract owner / has certain privileges") because it is easy to spoof: an attacker can just figure out the right address to pass in (e.g. calling owner()) and pass that in as the parameter value. You don't want that giving the caller permissions which should require demonstration that the actor holds the private key associated with the address (as when reading msg.sender directly, not via a passed parameter). Commented Feb 1, 2018 at 18:41