1

The Solidity docs on Global Variables say this about tx.origin:

sender of the transaction (full call chain)

But that is a bit vague. Can we always be sure that ts.origin is an externally owned account (EOA)? Are there any edge cases?

1

It is, tx.origin is the original sender of the call. In a transaction that results in a chain of calls, tx.origin is the EOA that initiated the transaction in the first place (contracts cant initiate transactions on their own) and msg.sender is the last member of the chain (and it can be a contract)

2
  • Do you know if there are any plans to let contracts execute txs on their own? I'm thinking of something like cron jobs. Sep 10 at 15:09
  • Not that IK of. If you really need your contract to execute txs on its own you can set up something in web3.js that calls it periodically or in response to an event
    – Foxxxey
    Sep 10 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.