tax/

directory
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MPL-2.0

README

Tax Module

Overview

The Tax Module is a crucial component of the Mantrachain ecosystem, responsible for managing and allocating taxes within the blockchain network. It provides functionality to set tax parameters, allocate taxes to designated addresses, and manage the overall tax system of the chain.

Key Components

Keeper

The Keeper is the main component that handles the business logic of the tax module. It provides methods for:

  • Allocating MCA (Mantra Chain Authority) tax
  • Managing tax parameters
  • Interacting with other modules (e.g., bank, auth)
Types

The module defines several important types:

  1. Params: Stores the tax module parameters
  2. GenesisState: Defines the initial state of the module
  3. MsgUpdateParams: Message for updating tax parameters
Events

The module emits events when taxes occur, such as allocating MCA tax. The event types are defined in the types package.

Usage

To use the tax module in your application:

  1. Include the module in your app's module configuration.
  2. Set up the initial parameters in the genesis state.
  3. Use the Keeper methods to interact with the tax functionality in your application logic.

Governance

The tax module parameters can be updated through governance proposals. This allows for dynamic adjustment of the tax system without requiring a chain upgrade.

Key Functions

BeginBlocker

The BeginBlocker function is called at the beginning of each block. It handles the allocation of MCA tax based on the current parameters.

UpdateParams

The UpdateParams function allows for updating the module parameters through a governance proposal or by the designated admin.

Testing

The module includes various tests to ensure its functionality. You can find examples of these tests in the genesis_test.go file.

Future Improvements

  • Implement more sophisticated tax allocation strategies
  • Add support for multiple tax recipients
  • Integrate with other modules for more complex tax scenarios

For more detailed information on the module's implementation and usage, please refer to the source code and comments within the x/tax directory.

Directories

Path Synopsis
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

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