@@ -407,18 +407,15 @@ Annotated examples of EOF formatted containers demonstrating several key feature
407407 let size := calldatasize()
408408 if lt(size, 64) { revert(0, 0) }
409409
410- let tx_initcode_hash := calldataload(0)
411- let salt := calldataload(32)
412-
413- mstore8(0, 0xff) // a magic value to ensure a specific preimage space
414- calldatacopy(1, 0, size) // copy tx_initcode_hash, salt and init_data to memory to hash
415- let commitment_size := add(size, 1)
416- let final_salt := keccak256(0, commitment_size)
410+ calldatacopy(0, 0, size) // copy tx_initcode_hash, salt and init_data to memory to hash
411+ let final_salt := keccak256(0, size)
417412
413+ let tx_initcode_hash := calldataload(0)
418414 let init_data_size := sub(size, 64)
419- calldatacopy(0, 64, init_data_size)
420415
421- let ret := txcreate(tx_initcode_hash, callvalue(), final_salt, 0, init_data_size)
416+ // reuse init_data which has been already copied to memory above
417+ let ret := txcreate(tx_initcode_hash, callvalue(), final_salt, 64, init_data_size)
418+
422419 if iszero(ret) {
423420 let ret_data_size := returndatasize()
424421 returndatacopy(0, ret_data_size)
0 commit comments