I'm working on a puzzle where msg.sender != tx.origin, so the implication is that the caller needs to be a contract or at least something in between the calling account.

But extcodesize(caller) == 0 also needs to be true. So the caller needs to be an address or externally owned account.

How can both of these be true? Can the caller's codesize ever be 0 if not an address/EOA?

  • Is caller msg.sender? – Lauri Peltonen Apr 8 '18 at 17:38
  • Should be. caller is assembly so is not loggable. But caller is the calling contract, or at least typically it is. – Joe Blow Apr 8 '18 at 17:46
  • Yeah I was just wondering, no idea what the caller really means. – Lauri Peltonen Apr 8 '18 at 17:50
  • Actually, by the documentation, it's not the "call sender" in case of delegatecall. That might be a part of the solution. But don't ask me how. – Lauri Peltonen Apr 8 '18 at 17:52

All things must have a beginning

I think you're getting called from a contract constructor before it's committed to the chain.

At this point, it will have a (theoretical) address but no code yet in the chain. It will only get code size after the transaction completes and the block is accepted.

  • 1
    If this answered your question, please mark it as the correct answer. If not let me know so I can further assist. – norganna Apr 10 '18 at 9:41

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.