This repository implements the full migration flow from a legacy Coin
-based token (Haven Coin - HVC
) to the modern FungibleAsset
standard using the Supra Move Framework.
- Manages the legacy Haven Coin (
HVC
) - Includes minting, transfer, airdrop, and user registration
- Handles the migration of HVC into a
FungibleAsset
- Supports viewing FA balances and metadata object addresses
supra profile new \
--rpc-url "https://rpc-testnet-1262.supra.com/" \
--faucet-url "https://rpc-testnet-1262.supra.com/"
supra move account fund-with-faucet
supra move tool publish
Get the module address from the output, and assign it:
module=YOUR_MODULE_ADDRESS
supra move tool view \
--function-id "0x1::coin::balance" \
--type-args "$module::haven_coin::HVC" \
--args address:<your-address>
supra move tool run \
--function-id "0x1::coin::migrate_to_fungible_store" \
--type-args "$module::haven_coin::HVC"
Legacy Coin Balance:
supra move tool view \
--function-id "$module::haven_coin::get_balance" \
--args address:<user-address>
Fungible Asset Balance (after migration):
supra move tool view \
--function-id "$module::migration::fa_balance" \
--type-args "$module::haven_coin::HVC" \
--args address:<user-address>
Legacy Coin → FA:
supra move tool run \
--function-id "$module::migration::coin_address_to_fa" \
--type-args "$module::haven_coin::HVC" \
--args address:<user-address> u64:<amount>
FA → Legacy Coin:
supra move tool run \
--function-id "$module::migration::fa_address_to_coin3" \
--type-args "$module::haven_coin::HVC" \
--args address:<user-address> u64:<amount>
supra move tool run \
--function-id "$module::haven_coin::airdrop_coin" \
--args address:<receiver-address> u64:100
[Legacy Coin (HVC)]
│
├── mint / airdrop / transfer
│
▼
[Migration Module]
├── Convert Coin → FungibleAsset
├── Deposit into FA Store
└── View FA balance
Built using the Supra Move Framework.
Developer: Meet Rathod