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

Commit

Permalink
Root chain proxy contracts deployment (0xPolygon#1888)
Browse files Browse the repository at this point in the history
* root chain proxy contracts deployment

* fixed docker script

* readme.md updates; cr minor fix

* cr fix: deploy impl and proxy contracts in the same goroutine

* cr fixes
  • Loading branch information
dusan-maksimovic authored Sep 11, 2023
1 parent 6d848ed commit c49733b
Show file tree
Hide file tree
Showing 19 changed files with 257 additions and 70 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.nightly.devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ jobs:
polygon-edge polybft stake-manager-deploy \
--jsonrpc {{ rootchain_json_rpc }} \
--proxy-contracts-admin $PROXY_CONTRACTS_ADMIN \
--test
polygon-edge rootchain deploy \
--stake-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeManagerAddr') \
--stake-token $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeTokenAddr') \
--json-rpc {{ rootchain_json_rpc }} \
--proxy-contracts-admin $PROXY_CONTRACTS_ADMIN \
--test
polygon-edge rootchain fund \
Expand Down
14 changes: 14 additions & 0 deletions command/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/0xPolygon/polygon-edge/server"
"github.com/0xPolygon/polygon-edge/server/proto"
txpoolOp "github.com/0xPolygon/polygon-edge/txpool/proto"
"github.com/0xPolygon/polygon-edge/types"
"github.com/ryanuber/columnize"
"github.com/spf13/cobra"
"google.golang.org/grpc"
Expand Down Expand Up @@ -260,3 +261,16 @@ func ParseAmount(amount string) (*big.Int, error) {

return result, nil
}

func ValidateProxyContractsAdmin(proxyContractsAdmin string) error {
if err := types.IsValidAddress(proxyContractsAdmin); err != nil {
return fmt.Errorf("proxy contracts admin address is not valid: %w", err)
}

proxyContractsAdminAddr := types.StringToAddress(proxyContractsAdmin)
if proxyContractsAdminAddr == types.ZeroAddress {
return errors.New("proxy contracts admin address must not be zero address")
}

return nil
}
3 changes: 2 additions & 1 deletion command/rootchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ $ polygon-edge rootchain deploy \
--deployer-key <hex_encoded_rootchain_deployer_private_key> \
--stake-manager <stake_manager_address> \
--stake-token <stake_token_address> \
--json-rpc <json_rpc_endpoint>
--json-rpc <json_rpc_endpoint> \
--proxy-contracts-admin <address of proxy contracts admin>
```

**Note:** In case `test` flag is provided, it engages test mode, which uses predefined test account private key to send transactions to the rootchain.
Loading

0 comments on commit c49733b

Please sign in to comment.