testnet
GitHub

Genesis State Constructors

New<Module>GenesisState() *<Module>types.GenesisState

A collection of constructor functions that create the default genesis state for various modules within the Maroo application. These functions are used when initializing a new chain to provide a sane, Maroo-specific default configuration for modules like the EVM, Fee Market, and OKRW. They encapsulate important initial parameters, such as enabling precompiles or setting the gas token denomination.

Parameters

This method has no parameters.

Returns

Type: *<Module>types.GenesisState

A pointer to a GenesisState struct for the respective module, populated with Maroo's default values.

Examples

Generating Default EVM Genesis State

This example shows how to call `NewEVMGenesisState` to get Maroo's default configuration for the EVM module. The resulting struct is pre-configured with important settings like the EVM denomination and enabled precompiles.

package main

import (
	"fmt"
	"github.com/delight-labs/maroo/app"
)

func main() {
	// Get the default EVM genesis state for Maroo
	evmGenState := app.NewEVMGenesisState()

	// The returned state has all static precompiles enabled by default
	fmt.Printf("Default EVM Denom: %s\n", evmGenState.Params.EvmDenom)
	fmt.Printf("Number of active precompiles: %d\n", len(evmGenState.Params.ActiveStaticPrecompiles))
}

Generating Default Fee Market Genesis State

Demonstrates calling `NewFeeMarketGenesisState`. Maroo configures the fee market as **EIP-1559–compatible with BaseFee enabled** — senders pay both a base fee and a priority tip in `aokrw`, identical to Ethereum mainnet semantics with OKRW as the gas token. See `feemarket-module` for the full mechanism.

package main

import (
	"fmt"
	"github.com/delight-labs/maroo/app"
)

func main() {
	// Get the default Fee Market genesis state for Maroo (EIP-1559 BaseFee enabled)
	feeMarketGenState := app.NewFeeMarketGenesisState()

	fmt.Printf("Initial base fee: %s\n", feeMarketGenState.Params.BaseFee)
	fmt.Printf("Min gas price (floor): %s\n", feeMarketGenState.Params.MinGasPrice)
}
ESC
Type to search