@@ -12,14 +12,18 @@ import (
12
12
)
13
13
14
14
type PDPContracts struct {
15
- PDPVerifier common.Address
15
+ PDPVerifier common.Address
16
+ AllowedPublicRecordKeepers []common.Address
16
17
}
17
18
18
19
func ContractAddresses () PDPContracts {
19
20
switch build .BuildType {
20
21
case build .BuildCalibnet :
21
22
return PDPContracts {
22
23
PDPVerifier : common .HexToAddress ("0x445238Eca6c6aB8Dff1Aa6087d9c05734D22f137" ),
24
+ AllowedPublicRecordKeepers : []common.Address {
25
+ common .HexToAddress ("0x80617b65FD2EEa1D7fDe2B4F85977670690ed348" ), // FilecoinWarmStorageService
26
+ },
23
27
}
24
28
case build .BuildMainnet :
25
29
// Compatible contract not yet deployed
@@ -34,3 +38,20 @@ const NumChallenges = 5
34
38
func SybilFee () * big.Int {
35
39
return must .One (types .ParseFIL ("0.1" )).Int
36
40
}
41
+
42
+ // IsPublicService checks if a service label indicates a public service
43
+ func IsPublicService (serviceLabel string ) bool {
44
+ return serviceLabel == "public"
45
+ }
46
+
47
+ // IsRecordKeeperAllowed checks if a recordkeeper address is in the whitelist
48
+ // Returns true if the address is allowed, or if there's no whitelist for the network
49
+ func IsRecordKeeperAllowed (recordKeeper common.Address ) bool {
50
+ // Check if the recordkeeper is in the whitelist
51
+ for _ , allowed := range ContractAddresses ().AllowedPublicRecordKeepers {
52
+ if recordKeeper == allowed {
53
+ return true
54
+ }
55
+ }
56
+ return false
57
+ }
0 commit comments