func (app *CetChainApp) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string) (
	appState json.RawMessage, validators []tmtypes.GenesisValidator, err error) {
	ctx := app.NewContext(true, abci.Header{Height: app.LastBlockHeight()})
	if forZeroHeight {
		app.prepForZeroHeightGenesis(ctx, jailWhiteList)
	}
	genState := app.mm.ExportGenesis(ctx)
	if forZeroHeight {
		var ig incentive.GenesisState
		incentive.ModuleCdc.MustUnmarshalJSON(genState[incentive.ModuleName], &ig)
		ig.State.HeightAdjustment = ig.State.HeightAdjustment + ctx.BlockHeader().Height
		genState[incentive.ModuleName] = incentive.ModuleCdc.MustMarshalJSON(ig)
	}
	appState, err = codec.MarshalJSONIndent(app.cdc, genState)
	if err != nil {
		return nil, nil, err
	}
	validators = staking.WriteValidators(ctx, app.stakingKeeper)
	return appState, validators, nil
}
export the state of CoinEx chain for a genesis file
package app
import (
	"encoding/json"
	"log"
	abci "github.com/tendermint/tendermint/abci/types"
	tmtypes "github.com/tendermint/tendermint/types"
	"github.com/cosmos/cosmos-sdk/codec"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/cosmos/cosmos-sdk/x/slashing"
	"github.com/cosmos/cosmos-sdk/x/staking"
	"github.com/coinexchain/cet-sdk/modules/incentive"
)
func (app *CetChainApp) ExportGenesisState(ctx sdk.Context) GenesisState {
	g := app.mm.ExportGenesis(ctx)
	return FromMap(app.cdc, g)
}