func ExportAirdropSnapshotCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "export-airdrop-snapshot [airdrop-to-denom] [first-input-snapshot-file] [second-input-snapshot-file] [input-games-file]",
		Short: "Export a quadratic fairdrop snapshot from a provided cosmos-sdk v0.42 genesis export",
		Long: `Export a quadratic fairdrop snapshot from a provided cosmos-sdk v0.42 genesis export
Example:
	nibirud export-airdrop-snapshot uatom ~/.nibiru/config/genesis.json ../snapshot.json --nibiru-supply=100000000000000
	- Check input genesis:
		file is at ~/.nibirud/config/genesis.json
	- Snapshot
		file is at "../snapshot.json"
`,
		Args: cobra.ExactArgs(4),
		RunE: func(cmd *cobra.Command, args []string) error {
			clientCtx := client.GetClientContextFromCmd(cmd)

			serverCtx := server.GetServerContextFromCmd(cmd)
			config := serverCtx.Config

			config.SetRoot(clientCtx.HomeDir)

			denom := args[0]
			firstGenesisFile := args[1]
			secondGenesisFile := args[2]
			snapshotOutput := args[3]

			var snapshot Snapshot
			snapshot.Accounts = make(map[string]SnapshotAccount)
			snapshot.TotalGameAirdropAmount = sdk.ZeroInt()

			snapshot = exportSnapShotFromGenesisFile(clientCtx, firstGenesisFile, denom, snapshotOutput, snapshot)
			snapshot = exportSnapShotFromGenesisFile(clientCtx, secondGenesisFile, denom, snapshotOutput, snapshot)

			// export snapshot json
			snapshotJSON, err := json.MarshalIndent(snapshot, "", "    ")
			if err != nil {
				return fmt.Errorf("failed to marshal snapshot: %w", err)
			}

			err = ioutil.WriteFile(snapshotOutput, snapshotJSON, 0644)
			return err
		},
	}

	flags.AddQueryFlagsToCmd(cmd)

	return cmd
}
// ExportAirdropSnapshotCmd generates a snapshot.json from a provided cosmos-sdk v0.36 genesis export.
ExportAirdropSnapshotCmd generates a snapshot.json from a provided cosmos-sdk v0.36 genesis export.
// ExportAirdropSnapshotCmd generates a snapshot . json from a provided cosmos - sdk v0 . 36 genesis export .
func ExportAirdropSnapshotCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "export-airdrop-snapshot [airdrop-to-denom] [first-input-snapshot-file] [second-input-snapshot-file] [input-games-file]",
		Short: "Export a quadratic fairdrop snapshot from a provided cosmos-sdk v0.42 genesis export",
		Long: `Export a quadratic fairdrop snapshot from a provided cosmos-sdk v0.42 genesis export
Example:
	nibirud export-airdrop-snapshot uatom ~/.nibiru/config/genesis.json ../snapshot.json --nibiru-supply=100000000000000
	- Check input genesis:
		file is at ~/.nibirud/config/genesis.json
	- Snapshot
		file is at "../snapshot.json"
`,
		Args: cobra.ExactArgs(4),
		RunE: func(cmd *cobra.Command, args []string) error {
			clientCtx := client.GetClientContextFromCmd(cmd)
			serverCtx := server.GetServerContextFromCmd(cmd)
			config := serverCtx.Config
			config.SetRoot(clientCtx.HomeDir)
			denom := args[0]
			firstGenesisFile := args[1]
			secondGenesisFile := args[2]
			snapshotOutput := args[3]
			var snapshot Snapshot
			snapshot.Accounts = make(map[string]SnapshotAccount)
			snapshot.TotalGameAirdropAmount = sdk.ZeroInt()
			snapshot = exportSnapShotFromGenesisFile(clientCtx, firstGenesisFile, denom, snapshotOutput, snapshot)
			snapshot = exportSnapShotFromGenesisFile(clientCtx, secondGenesisFile, denom, snapshotOutput, snapshot)
			snapshotJSON, err := json.MarshalIndent(snapshot, "", "    ")
			if err != nil {
				return fmt.Errorf("failed to marshal snapshot: %w", err)
			}
			err = ioutil.WriteFile(snapshotOutput, snapshotJSON, 0644)
			return err
		},
	}
	flags.AddQueryFlagsToCmd(cmd)
	return cmd
}
func ExportAirdropSnapshotCmd ( ) * cobra . Command { cmd := & cobra . Command { Use : " " , Short : " " , Long : `Export a quadratic fairdrop snapshot from a provided cosmos-sdk v0.42 genesis export
Example:
	nibirud export-airdrop-snapshot uatom ~/.nibiru/config/genesis.json ../snapshot.json --nibiru-supply=100000000000000
	- Check input genesis:
		file is at ~/.nibirud/config/genesis.json
	- Snapshot
		file is at "../snapshot.json"
` , Args : cobra . ExactArgs ( 4 ) , RunE : func ( cmd * cobra . Command , args [ ] string ) error { clientCtx := client . GetClientContextFromCmd ( cmd ) serverCtx := server . GetServerContextFromCmd ( cmd ) config := serverCtx . Config config . SetRoot ( clientCtx . HomeDir ) denom := args [ 0 ] firstGenesisFile := args [ 1 ] secondGenesisFile := args [ 2 ] snapshotOutput := args [ 3 ] var snapshot Snapshot snapshot . Accounts = make ( map [ string ] SnapshotAccount ) snapshot . TotalGameAirdropAmount = sdk . ZeroInt ( ) snapshot = exportSnapShotFromGenesisFile ( clientCtx , firstGenesisFile , denom , snapshotOutput , snapshot ) snapshot = exportSnapShotFromGenesisFile ( clientCtx , secondGenesisFile , denom , snapshotOutput , snapshot ) snapshotJSON , err := json . MarshalIndent ( snapshot , " " , " " ) if err != nil { return fmt . Errorf ( " " , err ) } err = ioutil . WriteFile ( snapshotOutput , snapshotJSON , 0644 ) return err } , } flags . AddQueryFlagsToCmd ( cmd ) return cmd }
ExportAirdropSnapshotCmd generates a snapshot.json from a provided cosmos-sdk v0.36 genesis export.
ExportAirdropSnapshotCmd generates a snapshot . json from a provided cosmos - sdk v0 . 36 genesis export .
// export snapshot json