ipld-eth-server/pkg/transformers/shared/event_signature_generator.go

15 lines
463 B
Go
Raw Normal View History

package shared
import "github.com/ethereum/go-ethereum/crypto"
func GetEventSignature(solidityMethodSignature string) string {
eventSignature := []byte(solidityMethodSignature)
hash := crypto.Keccak256Hash(eventSignature)
return hash.Hex()
}
func GetLogNoteSignature(solidityMethodSignature string) string {
rawSignature := GetEventSignature(solidityMethodSignature)
return rawSignature[:10] + "00000000000000000000000000000000000000000000000000000000"
}