mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
tx.origin pointing where exactly is the bug
Clarification for preventing more bugs of this kind that have been shown recently.
This commit is contained in:
parent
6d6c9e6e4f
commit
71d6e8da2d
@ -211,6 +211,7 @@ Never use tx.origin for authorization. Let's say you have a wallet contract like
|
||||
}
|
||||
|
||||
function transferTo(address payable dest, uint amount) public {
|
||||
// THE BUG IS RIGHT HERE, you must use msg.sender instead of tx.origin
|
||||
require(tx.origin == owner);
|
||||
dest.transfer(amount);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user