@@ -97,7 +97,7 @@ var networkInfos = map[string]NetworkConfig{
97
97
StagingAddr : "fetch1479lwv5vy8skute5cycuz727e55spkhxut0valrcm38x9caa2x8q99ef0q" ,
98
98
},
99
99
MobixStaking : & MobixStaking {
100
- Addr : "fetch1xr3rq8yvd7qplsw5yx90ftsr2zdhg4e9z60h5duusgxpv72hud3szdul6e" ,
100
+ Addresses : [] string { "fetch174kgn5rtw4kf6f938wm7kwh70h2v4vcfcnfkl0" , "fetch1sh36qn08g4cqg685cfzmyxqv2952q6r8actxru" } ,
101
101
},
102
102
TokenBridge : & TokenBridge {
103
103
Addr : "fetch1qxxlalvsdjd07p07y3rc5fu6ll8k4tmetpha8n" ,
@@ -139,7 +139,7 @@ var networkInfos = map[string]NetworkConfig{
139
139
StagingAddr : "fetch1mxz8kn3l5ksaftx8a9pj9a6prpzk2uhxnqdkwuqvuh37tw80xu6qges77l" , // testnet STAGING contract,
140
140
},
141
141
MobixStaking : & MobixStaking {
142
- Addr : "fetch1xr3rq8yvd7qplsw5yx90ftsr2zdhg4e9z60h5duusgxpv72hud3szdul6e" ,
142
+ Addresses : [] string { "fetch1xr3rq8yvd7qplsw5yx90ftsr2zdhg4e9z60h5duusgxpv72hud3szdul6e" } ,
143
143
},
144
144
FccCw20 : & FccCw20 {
145
145
Addr : "fetch1s0p7pwtm8qhvh2sfpg0ajgl20hwtehr0vcztyeku0vkzzvg044xqx4t7pt" ,
@@ -425,45 +425,47 @@ func ASIGenesisUpgradeUpdateFccIssuanceContract(jsonData map[string]interface{},
425
425
}
426
426
427
427
func ASIGenesisUpgradeUpdateMobixStakingContract (jsonData map [string ]interface {}, networkInfo NetworkConfig ) {
428
- if networkInfo .Contracts == nil || networkInfo .Contracts .MobixStaking == nil {
428
+ if networkInfo .Contracts == nil || networkInfo .Contracts .MobixStaking == nil || len ( networkInfo . Contracts . MobixStaking . Addresses ) < 1 {
429
429
return
430
430
}
431
- mobixStakingContractAddress := networkInfo .Contracts .MobixStaking .Addr
432
- mobixStakingContract := getContractFromAddr (mobixStakingContractAddress , jsonData )
433
431
434
- re := regexp .MustCompile (fmt .Sprintf (`%s%s1([%s]{%d,%d})$` , OldAddrPrefix , "" , Bech32Chars , AddrDataLength + AddrChecksumLength , MaxAddrDataLength ))
435
- states := mobixStakingContract ["contract_state" ].([]interface {})
436
- for i , val := range states {
437
- state := val .(map [string ]interface {})
438
- hexKey := state ["key" ].(string )
439
- b64Value := state ["value" ].(string )
432
+ for _ , mobixStakingContractAddress := range networkInfo .Contracts .MobixStaking .Addresses {
433
+ mobixStakingContract := getContractFromAddr (mobixStakingContractAddress , jsonData )
440
434
441
- valueBytes , err := base64 .StdEncoding .DecodeString (b64Value )
442
- if err != nil {
443
- panic (err )
444
- }
435
+ re := regexp .MustCompile (fmt .Sprintf (`%s%s1([%s]{%d,%d})$` , OldAddrPrefix , "" , Bech32Chars , AddrDataLength + AddrChecksumLength , MaxAddrDataLength ))
436
+ states := mobixStakingContract ["contract_state" ].([]interface {})
437
+ for i , val := range states {
438
+ state := val .(map [string ]interface {})
439
+ hexKey := state ["key" ].(string )
440
+ b64Value := state ["value" ].(string )
445
441
446
- updatedKey := hexKey
447
- updatedValue := b64Value
442
+ valueBytes , err := base64 .StdEncoding .DecodeString (b64Value )
443
+ if err != nil {
444
+ panic (err )
445
+ }
448
446
449
- keyBytes , err := hex .DecodeString (hexKey )
450
- if err != nil {
451
- panic (err )
452
- }
447
+ updatedKey := hexKey
448
+ updatedValue := b64Value
453
449
454
- _keyBytes := Bytes (keyBytes )
455
- switch {
456
- case _keyBytes .StartsWith (stakesKey ):
457
- updatedKey = replaceAddressInContractStateKey (keyBytes , stakesKey )
458
- case _keyBytes .StartsWith (unbondEntriesKey ):
459
- updatedKey = replaceAddressInContractStateKey (keyBytes , unbondEntriesKey )
460
- case _keyBytes .StartsWith (configKey ):
461
- updatedValue = replaceAddressInContractStateValue (re , string (valueBytes ))
462
- }
450
+ keyBytes , err := hex .DecodeString (hexKey )
451
+ if err != nil {
452
+ panic (err )
453
+ }
463
454
464
- states [i ] = map [string ]interface {}{
465
- "key" : updatedKey ,
466
- "value" : updatedValue ,
455
+ _keyBytes := Bytes (keyBytes )
456
+ switch {
457
+ case _keyBytes .StartsWith (stakesKey ):
458
+ updatedKey = replaceAddressInContractStateKey (keyBytes , stakesKey )
459
+ case _keyBytes .StartsWith (unbondEntriesKey ):
460
+ updatedKey = replaceAddressInContractStateKey (keyBytes , unbondEntriesKey )
461
+ case _keyBytes .StartsWith (configKey ):
462
+ updatedValue = replaceAddressInContractStateValue (re , string (valueBytes ))
463
+ }
464
+
465
+ states [i ] = map [string ]interface {}{
466
+ "key" : updatedKey ,
467
+ "value" : updatedValue ,
468
+ }
467
469
}
468
470
}
469
471
}
@@ -1041,7 +1043,7 @@ type AName struct {
1041
1043
}
1042
1044
1043
1045
type MobixStaking struct {
1044
- Addr string
1046
+ Addresses [] string
1045
1047
}
1046
1048
1047
1049
type FccCw20 struct {
0 commit comments