From 66dac3c0c29f875c76eb162d9edf83f6db610750 Mon Sep 17 00:00:00 2001 From: DarianShawn Date: Tue, 26 Apr 2022 17:44:55 +0800 Subject: [PATCH] Remove any premine wDoge and DC assets from init validators --- helper/validatorset/validatorset.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/helper/validatorset/validatorset.go b/helper/validatorset/validatorset.go index 85d2c0c94b..6aaabe524d 100644 --- a/helper/validatorset/validatorset.go +++ b/helper/validatorset/validatorset.go @@ -2,7 +2,6 @@ package validatorset import ( "errors" - "fmt" "math/big" "github.com/dogechain-lab/jury/chain" @@ -123,14 +122,6 @@ func PredeploySC(params PredeployParams) (*chain.GenesisAccount, error) { Code: scHex, } - // Parse the default staked balance value into *big.Int - val := DefaultStakedBalance - bigDefaultStakedBalance, err := types.ParseUint256orHex(&val) - - if err != nil { - return nil, fmt.Errorf("unable to generate DefaultStatkedBalance, %w", err) - } - if params.Owner == types.ZeroAddress { return nil, errors.New("contract owner should not be empty") } @@ -142,9 +133,6 @@ func PredeploySC(params PredeployParams) (*chain.GenesisAccount, error) { stakedAmount := big.NewInt(0) for indx, validator := range params.Validators { - // Update the total staked amount - stakedAmount.Add(stakedAmount, bigDefaultStakedBalance) - // Get the storage indexes storageIndexes := getStorageIndexes(validator, int64(indx)) @@ -152,10 +140,6 @@ func PredeploySC(params PredeployParams) (*chain.GenesisAccount, error) { storageMap[types.BytesToHash(storageIndexes.OwnerIndex)] = types.BytesToHash(params.Owner.Bytes()) - // Set the value for the threshold - storageMap[types.BytesToHash(storageIndexes.ThresholdIndex)] = - types.BytesToHash(bigDefaultStakedBalance.Bytes()) - // Set the value for the owner storageMap[types.BytesToHash(storageIndexes.MinimumIndex)] = types.BytesToHash(bigOne.Bytes()) @@ -170,10 +154,6 @@ func PredeploySC(params PredeployParams) (*chain.GenesisAccount, error) { storageMap[types.BytesToHash(storageIndexes.AddressToIsValidatorIndex)] = types.BytesToHash(bigTrueValue.Bytes()) - // Set the value for the address -> staked amount mapping - storageMap[types.BytesToHash(storageIndexes.AddressToStakedAmountIndex)] = - types.StringToHash(hex.EncodeBig(bigDefaultStakedBalance)) - // Set the value for the address -> validator index mapping storageMap[types.BytesToHash(storageIndexes.AddressToValidatorIndexIndex)] = types.StringToHash(hex.EncodeUint64(uint64(indx)))