Skip to content

Commit

Permalink
feat(abigen): support event id in filter (#12697)
Browse files Browse the repository at this point in the history
support abigen with xxxEventID() in Filter. After this pr the abigen
will generate one more method with each event of Filter:


```go
func (_ERC20 *ERC20Filterer) TransferEventID() libcommon.Hash {
 return libcommon.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")
}
```
  • Loading branch information
fenghaojiang authored Dec 3, 2024
1 parent 96f7aa2 commit 909099f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions accounts/abi/bind/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,10 @@ var (
Raw types.Log // Blockchain specific contextual infos
}
func (_{{$contract.Type}} *{{$contract.Type}}Filterer) {{.Normalized.Name}}EventID() libcommon.Hash {
return libcommon.HexToHash("0x{{printf "%x" .Original.ID}}")
}
// Filter{{.Normalized.Name}} is a free log retrieval operation binding the contract event 0x{{printf "%x" .Original.ID}}.
//
// Solidity: {{.Original.String}}
Expand Down

0 comments on commit 909099f

Please sign in to comment.