app

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 177 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisplayDenom  = "tac"
	BaseDenom     = "utac"
	BaseDenomUnit = 18

	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
	Bech32PrefixAccAddr = "tac"

	NodeDir        = ".tacchaind"
	AppName        = "TacChainApp"
	DefaultChainID = "tacchain_2391-1"

	// Custom timeout commit to ensure faster block times
	TimeoutCommit = 1 * time.Second
)

Variables

View Source
var (
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key.
	Bech32PrefixAccPub = Bech32PrefixAccAddr + "pub"
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address.
	Bech32PrefixValAddr = Bech32PrefixAccAddr + "valoper"
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key.
	Bech32PrefixValPub = Bech32PrefixAccAddr + "valoperpub"
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address.
	Bech32PrefixConsAddr = Bech32PrefixAccAddr + "valcons"
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key.
	Bech32PrefixConsPub = Bech32PrefixAccAddr + "valconspub"

	DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir

	// PowerReduction defines the default power reduction value for staking
	PowerReduction = sdkmath.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(BaseDenomUnit), nil))
)

Upgrades list of chain upgrades

Functions

func BlockedAddresses

func BlockedAddresses() map[string]bool

BlockedAddresses returns all the app's blocked account addresses.

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

NOTE: This is solely to be used for testing purposes. GetMaccPerms returns a copy of the module account permissions

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)

NewAnteHandler returns an ante handler responsible for attempting to route an Ethereum or SDK transaction to an internal ante handler for performing transaction-level processing (e.g. fee payment, signature verification) before being passed onto it's respective handler.

func SetupEvmConfig

func SetupEvmConfig(chainID string) error

func TacLinearInflationFormula

func TacLinearInflationFormula(_ context.Context, _ minttypes.Minter, params minttypes.Params, bondedRatio math.LegacyDec) math.LegacyDec

Example: 1. goal_bonded -> max inflation = 7% 2. left or right from the goal_bonded inflation is linearly decreasing to minimum = 2% (in both cases) 3. E.g. Staking rate = 35% infl = 4.5% Staking rate = 100% infl = 2%

func TacParabolicInflationFormula

func TacParabolicInflationFormula(_ context.Context, _ minttypes.Minter, params minttypes.Params, bondedRatio math.LegacyDec) math.LegacyDec

Parabolic formula inflation (X) = Max inflation * (1 - ((X - Xtarget)/Xtarget)^2), where X - actual staking rate Xtarget - Ideal staking rate (e.g. 70%) Max inflation = 7%

this one gives a U-shape curve (an inversed parabola) with the maximum at Xtarget (70%)

Example: given goalBonded 70% and maxInflation 7%: - if currently 70% of tokens are staked the inflation should be 7% - the further staked tokens go away from goalBonded in both directions, the less inflation is - if 0% tokens staked then 0% inflation and so on - if 100% of tokens are staked inflation comes around 5% - if staked tokens are 40% inflation is again around 5% cuz both are 30% away from the goalBonded

Types

type GenesisState

type GenesisState map[string]json.RawMessage

GenesisState of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.

type HandlerOptions

type HandlerOptions struct {
	authante.HandlerOptions

	AccountKeeper evmanteinterfaces.AccountKeeper

	IBCKeeper *keeper.Keeper

	TXCounterStoreService corestoretypes.KVStoreService
	CircuitKeeper         *circuitkeeper.Keeper

	// Cosmos EVM
	FeeMarketKeeper evmanteinterfaces.FeeMarketKeeper
	EvmKeeper       evmanteinterfaces.EVMKeeper
	MaxTxGasWanted  uint64
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper and Ethermint keeper.

type SetupOptions

type SetupOptions struct {
	Logger  log.Logger
	DB      *dbm.MemDB
	AppOpts servertypes.AppOptions
}

SetupOptions defines arguments that are passed into `TacChainApp` constructor.

type TacChainApp

type TacChainApp struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper         authkeeper.AccountKeeper
	BankKeeper            bankkeeper.BaseKeeper
	CapabilityKeeper      *capabilitykeeper.Keeper
	StakingKeeper         *stakingkeeper.Keeper
	SlashingKeeper        slashingkeeper.Keeper
	MintKeeper            mintkeeper.Keeper
	DistrKeeper           distrkeeper.Keeper
	GovKeeper             govkeeper.Keeper
	CrisisKeeper          *crisiskeeper.Keeper
	UpgradeKeeper         *upgradekeeper.Keeper
	ParamsKeeper          paramskeeper.Keeper
	AuthzKeeper           authzkeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	FeeGrantKeeper        feegrantkeeper.Keeper
	GroupKeeper           groupkeeper.Keeper
	NFTKeeper             nftkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper
	CircuitKeeper         circuitkeeper.Keeper

	IBCKeeper           *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	IBCFeeKeeper        ibcfeekeeper.Keeper
	ICAControllerKeeper icacontrollerkeeper.Keeper
	ICAHostKeeper       icahostkeeper.Keeper
	TransferKeeper      evmibctransferkeeper.Keeper

	ScopedIBCKeeper           capabilitykeeper.ScopedKeeper
	ScopedICAHostKeeper       capabilitykeeper.ScopedKeeper
	ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper      capabilitykeeper.ScopedKeeper
	ScopedIBCFeeKeeper        capabilitykeeper.ScopedKeeper

	// the module manager
	ModuleManager      *module.Manager
	BasicModuleManager module.BasicManager

	EpochsKeeper *epochskeeper.Keeper
	// liquidstake keeper
	LiquidStakeKeeper liquidstakekeeper.Keeper

	// Cosmos EVM keepers
	FeeMarketKeeper evmfeemarketkeeper.Keeper
	EVMKeeper       *evmvmkeeper.Keeper
	Erc20Keeper     evmerc20keeper.Keeper
	// contains filtered or unexported fields
}

TacChainApp extended ABCI application

func NewTacChainApp

func NewTacChainApp(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	invCheckPeriod uint,
	appOpts servertypes.AppOptions,
	evmAppOptions evmd.EVMOptionsFn,
	baseAppOptions ...func(*baseapp.BaseApp),
) *TacChainApp

NewTacChainApp returns a reference to an initialized TacChainApp.

func NewTacChainAppWithCustomOptions

func NewTacChainAppWithCustomOptions(t *testing.T, isCheckTx bool, invCheckPeriod uint, options SetupOptions) *TacChainApp

NewTacChainAppWithCustomOptions initializes a new TacChainApp with custom options.

func (*TacChainApp) AppCodec

func (app *TacChainApp) AppCodec() codec.Codec

AppCodec returns app codec.

NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.

func (*TacChainApp) AutoCliOpts

func (app *TacChainApp) AutoCliOpts() autocli.AppOptions

AutoCliOpts returns the autocli options for the app.

func (*TacChainApp) BeginBlocker

func (app *TacChainApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)

BeginBlocker application updates every begin block

func (*TacChainApp) Configurator

func (a *TacChainApp) Configurator() module.Configurator

func (*TacChainApp) DefaultGenesis

func (app *TacChainApp) DefaultGenesis() map[string]json.RawMessage

DefaultGenesis returns a default genesis from the registered AppModuleBasic's.

func (*TacChainApp) EndBlocker

func (app *TacChainApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)

EndBlocker application updates every end block

func (*TacChainApp) ExportAppStateAndValidators

func (app *TacChainApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (servertypes.ExportedApp, error)

ExportAppStateAndValidators exports the state of the application for a genesis file.

func (*TacChainApp) FinalizeBlock

func (app *TacChainApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (res *abci.ResponseFinalizeBlock, err error)

func (*TacChainApp) GetKey

func (app *TacChainApp) GetKey(storeKey string) *storetypes.KVStoreKey

GetKey returns the KVStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*TacChainApp) GetMemKey

func (app *TacChainApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*TacChainApp) GetStoreKeys

func (app *TacChainApp) GetStoreKeys() []storetypes.StoreKey

GetStoreKeys returns all the stored store keys.

func (*TacChainApp) GetSubspace

func (app *TacChainApp) GetSubspace(moduleName string) paramstypes.Subspace

GetSubspace returns a param subspace for a given module name.

NOTE: This is solely to be used for testing purposes.

func (*TacChainApp) GetTKey

func (app *TacChainApp) GetTKey(storeKey string) *storetypes.TransientStoreKey

GetTKey returns the TransientStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*TacChainApp) InitChainer

func (app *TacChainApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)

InitChainer application update at chain initialization

func (*TacChainApp) InterfaceRegistry

func (app *TacChainApp) InterfaceRegistry() types.InterfaceRegistry

InterfaceRegistry returns TacChainApp's InterfaceRegistry

func (*TacChainApp) LegacyAmino

func (app *TacChainApp) LegacyAmino() *codec.LegacyAmino

LegacyAmino returns legacy amino codec.

NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.

func (*TacChainApp) LoadHeight

func (app *TacChainApp) LoadHeight(height int64) error

LoadHeight loads a particular height

func (*TacChainApp) Name

func (app *TacChainApp) Name() string

Name returns the name of the App

func (*TacChainApp) PreBlocker

PreBlocker application updates every pre block

func (*TacChainApp) RegisterAPIRoutes

func (app *TacChainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)

RegisterAPIRoutes registers all application module routes with the provided API server.

func (*TacChainApp) RegisterNodeService

func (app *TacChainApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)

func (*TacChainApp) RegisterTendermintService

func (app *TacChainApp) RegisterTendermintService(clientCtx client.Context)

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*TacChainApp) RegisterTxService

func (app *TacChainApp) RegisterTxService(clientCtx client.Context)

RegisterTxService implements the Application.RegisterTxService method.

func (*TacChainApp) RegisterUpgradeHandlers

func (app *TacChainApp) RegisterUpgradeHandlers()

RegisterUpgradeHandlers registers the chain upgrade handlers

func (*TacChainApp) SimulationManager

func (app *TacChainApp) SimulationManager() *module.SimulationManager

SimulationManager implements the SimulationApp interface

func (*TacChainApp) TxConfig

func (app *TacChainApp) TxConfig() client.TxConfig

TxConfig returns TacChainApp's TxConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL