Closed veridelisi closed 1 year ago
Hello thank you for your feedback :-) Can you explain what is the problem and how your proposal is a solution to it? I must admit, I fail to understand what you are proposing.
Hi peroket
Opcodes, 37, CALLDATACOPY page, you use Calldata as 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF And you use input 2 as (0,31,8)
Problem is that:
User cant understand what is going on with this Calldata and input 2's variables because your calldata is filling with F.
My advice is
you use call data as "0xCCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAABBCCDDEE" and you use input 2 as (1,0,0) and input 1 as (2,30,0)
So this is for clarity, understood, thank you :-) Feel free to do the change yourself, otherwise I will do it later.
I have changed the code, and the page has been changed as below:
But I still need to post the pr. If you like it, I will post it.
The code is here: https://github.com/jonahcui/evm.codes/tree/204-change-example-of-calldatacopy
Can we keep the inputs closer to the original ones, maybe? The important things to show, I think, is that it writes for the given length (not overwriting the rest), and that reading out of bounds makes it write 0s. So making the first write bigger than the second, and making the second read out of bounds but not overwriting the whole memory we just wrote, I think it shows well the behaviour :-) Plus the change in the input to make it more clear which bytes are copied, and this is perfect :-)
Hi I think you need to change "CALLDATACOPY sample".
CALLDATA adress must be as follows 0xCCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAABBCCDDEE
input 1 must be PUSH1 2 PUSH1 30 PUSH1 0 CALLDATACOPY
input 2 must be PUSH1 1 PUSH1 0 PUSH1 0 CALLDATACOPY
Sincerely VeriDelisi