Skip to content

Commit

Permalink
fix(event-attestator): topics concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmp01 committed Aug 16, 2024
1 parent 27f9c21 commit 72ca209
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions typescript/event-attestator/src/ProofcastEventAttestator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,11 @@ export class ProofcastEventAttestator {
getEventPayload(event: Event): string {
// EVM event support only: for other chains may be
// required to change logic based on version and protocolID
return hexConcat([
hexZeroPad(event.address, 32),
event.topics[0],
event.topics[1],
hexZeroPad('0x00', 32),
hexZeroPad('0x00', 32),
event.data,
])
const topics = [0, 1, 2, 3].map(
i => event.topics[i] || hexZeroPad('0x00', 32),
)

return hexConcat([hexZeroPad(event.address, 32), ...topics, event.data])
}

getEventContext(): string {
Expand Down

0 comments on commit 72ca209

Please sign in to comment.