I’d like to write CFG for solidity. And then use it for code analysis. It is new for me and i have some troubles with opcodes understanding. Sorry if i choose the wrong forum section, but i think that it is the most appropriate.
I have read article https://blog.openzeppelin.com/deconstructing-a-solidity-contract-part-ii-creation-vs-runtime-6b9d60ecb44c/ . I didn’t understand this commands (add screenshot):
As i understood our goal is: keccak256(k.Р) , where k - is key and p is position; And at this step we are trying to get concatination k.Р. At first we must to save in memory key But i didn’t understand this commands: PUSH a0 PUSH 02 EXP SUB CALLER DUP2 AND AND DUP2 MSTORE
Why we can’t write this in such way: CALLER PUSH 0 MSTORE ?
Why we are using EXP SUB AND commands ?
Code to reproduce