-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathwhitelist.go
64 lines (55 loc) · 1.63 KB
/
whitelist.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package whitelist
import (
_ "embed"
"encoding/json"
)
//go:embed protocols.json
var protocols []byte
const (
Gaming string = "Gaming"
Bridge string = "Bridge"
DEX string = "DEX"
Lending string = "Lending"
DeFi string = "DeFi"
ENS string = "ENS"
NFT string = "NFT"
CrossChain string = "Cross-chain"
Derivatives string = "Derivatives"
BridgeAggregator string = "Bridge Aggregator"
SocialFi string = "SocialFi"
Analytics string = "Analytics"
AI string = "AI"
PredictionMarket string = "Prediction Market"
LiquidityManagement string = "Liquidity Management"
Staking string = "Staking"
)
type Protocol struct {
// Mandatory fields
// Name of the protocol
Name string `json:"name"`
// Slug of the protocol
Slug string `json:"slug"`
// Mandatory fields for Trailblazer competitions
// Contracts holds the protocols' contract addresses
Contracts []string `json:"contracts"`
// Optional fields
// Short description of the protocol
Description *string `json:"description,omitempty"`
// Category of the protocol
Category *string `json:"category,omitempty"`
// Twitter reference of the protocol
Twitter *string `json:"twitter,omitempty"`
// Website of the protocol
Website *string `json:"website,omitempty"`
// Logo of the protocol
Logo *string `json:"logo,omitempty"`
}
// Protocols that are whitelisted
func Protocols() ([]Protocol, error) {
var ps []Protocol
err := json.Unmarshal(protocols, &ps)
if err != nil {
return nil, err
}
return ps, nil
}