Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
cr fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stana-miric committed Aug 30, 2023
1 parent c354ba9 commit 60fb909
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 5 additions & 0 deletions command/genesis/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/0xPolygon/polygon-edge/consensus/ibft/fork"
"github.com/0xPolygon/polygon-edge/consensus/ibft/signer"
"github.com/0xPolygon/polygon-edge/consensus/polybft/common"
"github.com/0xPolygon/polygon-edge/contracts"
"github.com/0xPolygon/polygon-edge/contracts/staking"
stakingHelper "github.com/0xPolygon/polygon-edge/helper/staking"
"github.com/0xPolygon/polygon-edge/server"
Expand Down Expand Up @@ -572,6 +573,10 @@ func (p *genesisParams) validateProxyContractsAdmin() error {
return errors.New("proxy contracts admin address must not be zero address")
}

if proxyContractsAdminAddr == contracts.SystemCaller {
return errors.New("proxy contracts admin address must not be system caller address")
}

return nil
}

Expand Down
7 changes: 2 additions & 5 deletions consensus/polybft/polybft.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,8 @@ func GenesisPostHookFactory(config *chain.Chain, engineName string) func(txn *st

proxyAddr := contracts.GetProxyImplementationMapping()

var burnContractAddress types.Address

var isBurnContractSet bool

if burnContractAddress, isBurnContractSet = getBurnContractAddress(config, polyBFTConfig); isBurnContractSet {
burnContractAddress, isBurnContractSet := getBurnContractAddress(config, polyBFTConfig)
if isBurnContractSet {
proxyAddr[contracts.DefaultBurnContract] = burnContractAddress
}

Expand Down
7 changes: 4 additions & 3 deletions e2e-polybft/framework/test-cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ const (
)

var (
startTime int64
testRewardWalletAddr = types.StringToAddress("0xFFFFFFFF")
startTime int64
testRewardWalletAddr = types.StringToAddress("0xFFFFFFFF")
ProxyContractAdminAddr = "0x5aaeb6053f3e94c9b9a09f33669435e7ef1beaed"
)

func init() {
Expand Down Expand Up @@ -612,7 +613,7 @@ func NewTestCluster(t *testing.T, validatorsCount int, opts ...ClusterOption) *T

proxyAdminAddr := cluster.Config.ProxyContractsAdmin
if proxyAdminAddr == "" {
proxyAdminAddr = "0x5aaeb6053f3e94c9b9a09f33669435e7ef1beaed"
proxyAdminAddr = ProxyContractAdminAddr
}
args = append(args, "--proxy-contracts-admin", proxyAdminAddr)

Expand Down

0 comments on commit 60fb909

Please sign in to comment.