Skip to content

Commit 0d6ed68

Browse files
committed
core/vm: don't call SetCode on target of contract creation if initcode didn't return anything.
1 parent 3cfc334 commit 0d6ed68

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/vm/evm.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,9 @@ func (evm *EVM) initNewContract(contract *Contract, address common.Address) ([]b
601601
}
602602
}
603603

604-
evm.StateDB.SetCode(address, ret, tracing.CodeChangeContractCreation)
604+
if len(ret) > 0 {
605+
evm.StateDB.SetCode(address, ret, tracing.CodeChangeContractCreation)
606+
}
605607
return ret, nil
606608
}
607609

0 commit comments

Comments
 (0)