/
initialize_config.go
43 lines (36 loc) · 1.1 KB
/
initialize_config.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 systemcontract
import (
"encoding/json"
"github.com/DxChainNetwork/dxc/common"
"github.com/DxChainNetwork/dxc/common/math"
"math/big"
"strings"
)
// using for Validators contract's initialize
var (
InitRate = uint8(100)
InitDeposit = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(40000000))
InitName = "dxc-validator-1" // max bytes length: 100
InitDetails = "initialize validator" // max bytes length: 10000
)
var MigrateOwner = common.HexToAddress("0x3fe93764c06bb5d712b73ad2a385b168d69d3984")
type MigrateAddrBalance struct {
Address common.Address `json:"address"`
Balance *math.HexOrDecimal256 `json:"balance"`
}
var migrateAddrBalanceStr = `[
]`
func InitMigrateAddrBalance() ([]common.Address, []*big.Int) {
var migrates []MigrateAddrBalance
err := json.NewDecoder(strings.NewReader(migrateAddrBalanceStr)).Decode(&migrates)
if err != nil {
panic(err)
}
var addrs []common.Address
var bals []*big.Int
for i := 0; i < len(migrates); i++ {
addrs = append(addrs, migrates[i].Address)
bals = append(bals, (*big.Int)(migrates[i].Balance))
}
return addrs, bals
}