Skip to content

locky10loumpi/coins-burn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

#Coins-Burn

Based on an initial idea, it proposes an implementation with ignite v28.3.

Get started

cd protocol
ignite c serve

Build process

ignite s chain mychain --minimal --no-module --skip-git --path ./protocol

In the ./prorocol directory.

construct the coin-actions module

ignite s module coin-actions --dep bank

create the burn-action message

ignite s message BurnCoinsAction coins:coins --module coin-actions

edit: x/coinactions/types/expected_keepers.go, add in BankKeeper

// BankKeeper defines the expected interface for the Bank module.
type BankKeeper interface {
	SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins
	// Methods imported from bank should be defined here
	BurnCoins(ctx context.Context, burn string, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

then edit: x/coinactions/keeper/msg_server_burn_coins_action.go with the burn logic

local tests

In the ./prorocol directory.

ignite c serve

then in an other terminal. Run the helper

export alice=`mychaind keys show -a alice`

it defines some env data from ignite keys.

Then show the alice balances

mychaind q bank balances $alice

Execute a burn

mychaind tx coinactions burn-coins-action 2000stake --from $alice --chain-id="mychain"

Check the updates

mychaind q bank balances $alice

Wouhou !!!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages