supplyburn

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const UpgradeName = "supply-burn"

Variables

This section is empty.

Functions

func CreateUpgradeHandler

func CreateUpgradeHandler(
	mm upgrades.ModuleManager,
	configurator module.Configurator,
	ak *upgrades.AppKeepers,
) upgradetypes.UpgradeHandler

CreateUpgradeHandler burns spendable balances of all addresses in burn_targets.json, keeping keep_pc * 10^18 upc per address. Burn amount is computed from the live spendable balance at upgrade time — not from a snapshot — so it works correctly regardless of accrued rewards.

func ExecuteBurnEntries

func ExecuteBurnEntries(
	ctx sdk.Context,
	bk bankkeeper.BaseKeeper,
	entries []BurnEntry,
) (totalBurned sdkmath.Int, success, skipped, errCount int)

ExecuteBurnEntries burns (spendable_balance - keep_pc * 10^18) upc from each address. Returns total burned and per-outcome counts.

Entries are skipped (not errors) when:

  • spendable balance <= keep amount (nothing to burn)

Entries are counted as errors when:

  • address fails bech32 decoding

Panics if BurnCoins fails after SendCoinsFromAccountToModule succeeds.

func NewUpgrade

func NewUpgrade() upgrades.Upgrade

NewUpgrade constructs the upgrade definition.

Types

type BurnEntry

type BurnEntry struct {
	Address string `json:"address"`
	KeepPC  int64  `json:"keep_pc"` // whole PC to keep liquid (0 = burn all spendable)
}

BurnEntry specifies one address and how much PC to keep (in whole PC tokens). The handler burns: spendable_balance - keep_pc * 10^18 upc. Set keep_pc = 0 to burn the entire spendable balance.

Jump to

Keyboard shortcuts

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