Skip to content

Commit 3b3fca8

Browse files
committed
fix: tx.to for contract creations
1 parent fb67bd7 commit 3b3fca8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ func ProtoToTx(proto *eth.Transaction) *Transaction {
136136

137137
if len(proto.To) > 0 {
138138
to = (*common.Address)(proto.To)
139+
} else {
140+
// for contract creations, the to address must be nil
141+
// otherwise the RLP encoding will be invalid
142+
to = nil
139143
}
140144

141145
var acl []types.AccessTuple

0 commit comments

Comments
 (0)