Given the inclusion ever-growing for smart contracts to be inter-connected, I wanted to come up with an idea to aid developers in building “smarter” multi-contract systems by being able to apply introspection to the entrypoint of a blockchain transaction.
I have already filled out the necessary EIP data under my fork, however, before submitting a formal PR I would like to get validation on whether this is something that the community feels would be useful. I have briefly voiced the idea in Ethereum security channels with positive feedback, hence the conception of the EIP.
Put briefly, I have introduced four EVM instructions that permit introspection to be applied to the original transaction data by being able to access the original
data payload as well as the original recipient of the transaction, the
to address. This would primarily allow more complex types of “basic” contracts to be created, such as ERC-20 tokens that are aware of exactly what type of action (i.e. “buy” or “sell”) is performed on a DEX like Uniswap.
As a side-effect, it would counter-act the breaking change of EIP-3074 with regards to the
ORIGIN opcode by allowing a more granular level of introspection to be performed on the original transaction context, i.e. in pseudo-code the
ORIGIN() == CALLER() can be replaced by
ADDRESS() == ENTRYPOINT().
Let me know your thoughts.
EDIT: This EIP has been split into two separate ones given that the optimizational benefit of the
ORIGINDATA* opcodes was properly argued. The main point of the EIP is to provide an optimized way of transmission for large data payloads rather than introspection; that purpose is suited for the new EIP 3520.