Open clowestab opened 7 months ago
This is a straightforward way to implement multi-target fetches, but I wonder if there's a tidier option that works by extending the VM; something like this:
0x00000000000000001234567890123456789012345678901234567890
), then slice20(16, 20)
returns 0x1234567890123456789012345678901234567890
. This can be used to extract an address from abi-encoded data.setaddr
opcode that pops the top stack element and uses it as the address for subsequent fetches.setaddr
is encountered, append an account proof to the list of proofs to be returned. Modify the proof format so that we verify these inline rather than specifying them separately.WDYT?
I'm not averse to that option and its a good opportunity for my to keep playing with low-level code. I have some bandwidth so I'll have a play and report back
This is my initial implementation of multi-target CCIP read. I've had a play with a few APIs/architectures and settled on this one.
The crux new API additions being:
setTarget
which allows you to target a new contract for the value lookups that followsetTargetRef
which allows you to reference a value returned from a previous target value lookup. It is a naive API in that it assumes that the value returned and referenced is a valid 20 (padded to 32) byte address.Added tests to demonstrate functionality in the context of two contracts deployed on L1.
Open to feedback, suggestions, and discussion.