The tokenvm
using the Avalanche HyperSDK allows anyone create any asset, mint more of their asset, modify the metadata of their asset (if they reveal some info), and burn their asset. Additionally, there is an embedded on-chain exchange that allows anyone to create orders and fill (partial) orders of anyone else. To make this example easy to play with, the tokenvm also bundles a powerful CLI tool and serves RPC requests for trades out of an in-memory order book it maintains by syncing blocks.
https://www.loom.com/share/bcc5ab87db9f43948141a8e76edd22a7?sid=8e138c78-207e-4db9-8721-e35d97fc1a89
consts/consts.go
const (
// TODO: choose a human-readable part for your hyperchain
HRP = "Hugo Waters Capitals Chain"
// TODO: choose a name for your hyperchain
Name = "Hugo Waters"
// TODO: choose a token symbol
Symbol = "HWC"
)
registry/registry.go
// TODO: register action: actions.CreateAsset
consts.ActionRegistry.Register(&actions.CreateAsset{}, actions.UnmarshalCreateAsset, false),
// TODO: register action: actions.MintAsset
consts.ActionRegistry.Register(&actions.MintAsset{}, actions.UnmarshalMintAsset, false),
- Step 1
MODE="run-single" ./scripts/run.sh
- Step 2
./scripts/build.sh
- Step 3
./build/token-cli key import demo.pk
- Step 4
./build/token-cli chain import-anr
./build/token-cli action create-asset
./build/token-cli action mint-asset
./build/token-cli key balance
- This smart contract is provided under the MIT license, and users are encouraged to review and understand the code before interacting with it.