diff --git a/module/x/gravity/keeper/genesis.go b/module/x/gravity/keeper/genesis.go index b4e97d5db..f59ff7e7d 100644 --- a/module/x/gravity/keeper/genesis.go +++ b/module/x/gravity/keeper/genesis.go @@ -173,6 +173,12 @@ func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState) { k.SetStaticValCosmosAddr(ctx, cosmosAddr) } + var bridgeContractAddress string + k.paramSpace.Get(ctx, types.ParamsStoreKeyBridgeContractAddress, &bridgeContractAddress) + if bridgeContractAddress == "" { + k.paramSpace.Set(ctx, types.ParamsStoreKeyBridgeContractAddress, types.ZeroAddressString) + } + } // ExportGenesis exports all the state needed to restart the chain diff --git a/module/x/gravity/types/genesis.go b/module/x/gravity/types/genesis.go index 5e8fd028f..d5dc9b58e 100644 --- a/module/x/gravity/types/genesis.go +++ b/module/x/gravity/types/genesis.go @@ -123,7 +123,7 @@ func DefaultParams() *Params { return &Params{ GravityId: "defaultgravityid", ContractSourceHash: "", - BridgeEthereumAddress: "0x0000000000000000000000000000000000000000", + BridgeEthereumAddress: ZeroAddressString, BridgeChainId: 0, SignedValsetsWindow: 10000, SignedBatchesWindow: 10000, diff --git a/module/x/gravity/types/msgs.go b/module/x/gravity/types/msgs.go index 39a02a24e..0c8818620 100644 --- a/module/x/gravity/types/msgs.go +++ b/module/x/gravity/types/msgs.go @@ -151,7 +151,7 @@ func (msg MsgSendToEth) ValidateBasic() error { if !msg.BridgeFee.IsValid() { return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "fee") } - if msg.EthDest == "0x0000000000000000000000000000000000000000" { + if msg.EthDest == ZeroAddressString { return sdkerrors.Wrap(fmt.Errorf("sending to 0th address"), "ethereum address") } if err := ValidateEthAddress(msg.EthDest); err != nil {