Currently, copy instructions, i.e., CALLDATACOPY, CODECOPY, EXTCODECOPY and RETURNDATACOPY, do not emit State.stmts. These instructions, and in particular CODECOPY, need to be emitted to support Yul decompilation:
For the EVM, the datacopy function is equivalent to codecopy.[1]
See for instance the ERC-20 Yul example[2]
code {
// Store the creator in slot zero.
sstore(0, caller())
// Deploy the contract
datacopy(0, dataoffset("runtime"), datasize("runtime"))
return(0, datasize("runtime"))
}
[1] https://docs.soliditylang.org/en/latest/yul.html#datasize-dataoffset-datacopy
[2] https://docs.soliditylang.org/en/latest/yul.html#complete-erc20-example
Currently, copy instructions, i.e.,
CALLDATACOPY,CODECOPY,EXTCODECOPYandRETURNDATACOPY, do not emitState.stmts. These instructions, and in particularCODECOPY, need to be emitted to support Yul decompilation:See for instance the ERC-20 Yul example[2]
[1] https://docs.soliditylang.org/en/latest/yul.html#datasize-dataoffset-datacopy
[2] https://docs.soliditylang.org/en/latest/yul.html#complete-erc20-example