Skip to content

Commit 407410d

Browse files
authored
Update EIP-6110: add filtering by deposit event sig hash (#3122)
* Update EIP-6110: add filtering by deposit event sig hash * lint
1 parent 32419e3 commit 407410d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

execution_chain/core/eip6110.nim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Nimbus
2-
# Copyright (c) 2024 Status Research & Development GmbH
2+
# Copyright (c) 2024-2025 Status Research & Development GmbH
33
# Licensed under either of
44
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
55
# http://www.apache.org/licenses/LICENSE-2.0)
@@ -22,6 +22,7 @@ import
2222

2323
const
2424
depositRequestSize = 192
25+
DEPOSIT_EVENT_SIGNATURE_HASH = bytes32"0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"
2526

2627
type
2728
DepositRequest = array[depositRequestSize, byte]
@@ -73,7 +74,9 @@ func depositLogToRequest(data: openArray[byte]): DepositRequest =
7374
func parseDepositLogs*(logs: openArray[Log], depositContractAddress: Address): Result[seq[byte], string] =
7475
var res = newSeqOfCap[byte](logs.len*depositRequestSize)
7576
for i, log in logs:
76-
if log.address != depositContractAddress:
77+
let isDepositEvent = log.topics.len > 0 and
78+
log.topics[0] == DEPOSIT_EVENT_SIGNATURE_HASH
79+
if not(log.address == depositContractAddress and isDepositEvent):
7780
continue
7881
if log.data.len != 576:
7982
return err("deposit wrong length: want 576, have " & $log.data.len)

0 commit comments

Comments
 (0)