spaghetti at the wall idea here, but what if we introduce a new opcode which returns the top level contract interacted with, maybe something like ENTRYPOINT
. If it’s an EOA transfer it just returns the zero address. Then you could check that the value of the opcode was the known entrypoint contract for 4337 and perform more specific checks based on that. This might allow devs to implement an additional check where maybe something like
if (msg.sender != tx.origin) require(tx.entrypoint == ENTRYPOINT_CONTRACT);
This idea has been discussed slightly here but needs more work first