-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
executable file
·43 lines (36 loc) · 993 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package mai
import (
"github.com/trylotus/connectors/mai/smart-contracts/mai"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/core/types"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/types/known/timestamppb"
)
var protos = []proto.Message{
&mai.Approval{},
&mai.OwnershipTransferred{},
&mai.TransferVault{},
&mai.DepositCollateral{},
&mai.WithdrawCollateral{},
&mai.BuyRiskyVault{},
&mai.Transfer{},
&mai.CreateVault{},
&mai.DestroyVault{},
&mai.BorrowToken{},
&mai.PayBackToken{},
}
type ISmartContract interface {
Message(eventName string, contractAbi *abi.ABI, vLog types.Log, timestamp *timestamppb.Timestamp) protoreflect.ProtoMessage
}
type Contract struct {
ABI *abi.ABI
Name string
MessageParser ISmartContract
}
var ABIs = map[string]string{
"mai": mai.MaiABI,
}
var Parsers = map[string]ISmartContract{
"mai": &mai.SmartContract{},
}