# Security of Smart Contracts 3: Tx.origin

By [Hicss](https://paragraph.com/@freesuton) · 2022-02-22

---

![](https://storage.googleapis.com/papyrus_images/f13864c0ea73cd983f994d356d3aec31f529c372be420cddbfaffc375bdc0d25.png)

![](https://storage.googleapis.com/papyrus_images/fa9ce56b2befe9e45da704efa654033687566ade8302efbc8330da7b080fef43.png)

Solution:

use “msg.sender” rather than “tx.origin”

![](https://storage.googleapis.com/papyrus_images/2d3a10e1b71189870964be504763e1cdb612bf4e477198c2d3b58e50e032f88d.png)

---

*Originally published on [Hicss](https://paragraph.com/@freesuton/security-of-smart-contracts-3-tx-origin)*
