From 4dfbf08a6fb80daffae700eefa01f8ac1fb4641a Mon Sep 17 00:00:00 2001 From: parmarrushabh Date: Mon, 29 Oct 2018 14:53:44 +0530 Subject: [PATCH] prepare testnet genesis --- cmd/puppeth/wizard_genesis.go | 2 +- contracts/validator/validator.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/puppeth/wizard_genesis.go b/cmd/puppeth/wizard_genesis.go index 99f886955b..cbd5bd7084 100644 --- a/cmd/puppeth/wizard_genesis.go +++ b/cmd/puppeth/wizard_genesis.go @@ -217,7 +217,7 @@ func (w *wizard) makeGenesis() { } // Randomize Smart Contract Code - randomizeAddress, _, err := randomizeContract.DeployRandomize(transactOpts, contractBackend, big.NewInt(99)) + randomizeAddress, _, err := randomizeContract.DeployRandomize(transactOpts, contractBackend, big.NewInt(90)) if err != nil { fmt.Println("Can't deploy root registry") } diff --git a/contracts/validator/validator.go b/contracts/validator/validator.go index 3288e138bf..64debc9f1a 100644 --- a/contracts/validator/validator.go +++ b/contracts/validator/validator.go @@ -30,8 +30,11 @@ func NewValidator(transactOpts *bind.TransactOpts, contractAddr common.Address, func DeployValidator(transactOpts *bind.TransactOpts, contractBackend bind.ContractBackend, validatorAddress []common.Address, caps []*big.Int, ownerAddress common.Address) (common.Address, *Validator, error) { minDeposit := new(big.Int) minDeposit.SetString("50000000000000000000000", 10) - validatorAddr, _, _, err := contract.DeployXDCValidator(transactOpts, contractBackend, validatorAddress, caps, ownerAddress, minDeposit, big.NewInt(99), big.NewInt(100), big.NewInt(100)) - if err != nil { + // Deposit 50K XDC + // 150 masternodes + // Candidate Delay Withdraw 30 days = 1296000 blocks + // Voter Delay Withdraw 2 days = 8640 blocks + validatorAddr, _, _, err := contract.DeployXDCValidator(transactOpts, contractBackend, validatorAddress, caps, ownerAddress, minDeposit, big.NewInt(150), big.NewInt(8640), big.NewInt(1296000)) if err != nil { return validatorAddr, nil, err }