The x/fee module is a core component of the Sunrise blockchain responsible for managing transaction fees. It collects fees in a designated stablecoin (fee_denom) and then swaps a portion of these fees into RISE (burned_denom) to be burned. This module supports deflationary tokenomics for RISE while maintaining a stable fee system for users.
-
Burn Mechanism:
- A portion of collected fees (in
fee_denom) is swapped to RISE (burned_denom) and then burned, reducing the circulating supply. - The burn ratio is determined by the
burn_ratioparameter (default: 50%). - The swap and burn operations are atomic and verified on-chain.
- A portion of collected fees (in
-
Fee Denomination (
fee_denom):- Specifies the denomination required for transaction fees (default:
"uusdrise"). - Transactions must pay fees in this denomination unless bypassed.
- Strict validation of fee denominations is enforced.
- Specifies the denomination required for transaction fees (default:
-
Dynamic Parameter Configuration:
- Developers can configure parameters dynamically with validation enforced by the module.
- Parameters can be updated through governance proposals.
Fee Collection Process:
- Fees are collected in
fee_denomthrough theFeeCollectormodule account. - The system validates:
- Only one fee denomination per transaction.
- The fee denomination matches the configured
fee_denom. - The fee amount is valid and non-zero.
Fee Processing Flow:
- A portion of the collected fees, determined by
burn_ratio, is designated for burning. - This portion is swapped from
fee_denomtoburned_denomvia thex/swapmodule. - The resulting
burned_denomtokens are burned from the supply. - The remaining
fee_denom(the portion not designated for burning) stays in theFeeCollectoraccount for other protocol uses.
Note: The following section covers advanced topics intended for experienced users or developers.
| Parameter | Description | Default Value | Constraints |
|---|---|---|---|
fee_denom |
Required denomination for transaction fees | "uusdrise" |
Must be a valid denomination |
burned_denom |
Denomination to be burnt at the time of fee settlement. | "urise" |
Must be a valid denomination |
burn_ratio |
Percentage of fees to burn | 0.5 |
Must be between 0 and 1 |
Note: The following section covers advanced topics intended for experienced users or developers.
sequenceDiagram
participant User
participant FeeModule as x/fee Module
participant BankKeeper as Bank Keeper
participant SwapModule as x/swap Module
participant FeeCollector as Fee Collector
participant BribeModule as x/bribe Module
User->>FeeModule: Submit Transaction
FeeModule->>BankKeeper: Validate Fee Denomination
BankKeeper->>FeeCollector: Transfer Fees (in fee_denom)
note over FeeModule, SwapModule: Fee Processing
FeeModule->>FeeModule: Calculate amount to swap & burn
FeeModule->>SwapModule: Swap fee_denom to burned_denom
SwapModule-->>FeeModule: Returns burned_denom
FeeModule->>BankKeeper: Execute Burn (burned_denom)
note over BribeModule, FeeCollector: Unclaimed Bribe Processing
BribeModule->>FeeModule: Process Unclaimed Bribes
FeeModule->>FeeCollector: Transfer Unclaimed Amounts
For more details and implementation specifics, see the GitHub repository.