fix(demo): align spel CLI args to IDL; remove b58_to_hex conversion

This commit is contained in:
bristinWild 2026-06-25 13:10:21 +05:30
parent aee5372f2a
commit 210e2f4ad7
4 changed files with 44 additions and 7 deletions

View File

@ -1113,6 +1113,14 @@ dependencies = [
"thiserror 2.0.18",
]
[[package]]
name = "lez-authority"
version = "0.1.0"
dependencies = [
"borsh",
"serde",
]
[[package]]
name = "libc"
version = "0.2.186"
@ -2047,6 +2055,7 @@ version = "0.1.0"
dependencies = [
"borsh",
"lee_core",
"lez-authority",
"serde",
"spel-framework-macros",
]

View File

@ -1602,6 +1602,14 @@ dependencies = [
"thiserror 2.0.18",
]
[[package]]
name = "lez-authority"
version = "0.1.0"
dependencies = [
"borsh",
"serde",
]
[[package]]
name = "libc"
version = "0.2.186"
@ -2865,6 +2873,7 @@ version = "0.1.0"
dependencies = [
"borsh",
"lee_core",
"lez-authority",
"serde",
"spel-framework-macros",
]

View File

@ -1079,6 +1079,14 @@ dependencies = [
"thiserror 2.0.18",
]
[[package]]
name = "lez-authority"
version = "0.1.0"
dependencies = [
"borsh",
"serde",
]
[[package]]
name = "libc"
version = "0.2.186"
@ -2027,6 +2035,7 @@ version = "0.1.0"
dependencies = [
"borsh",
"lee_core",
"lez-authority",
"serde",
"spel-framework-macros",
]
@ -2036,6 +2045,7 @@ name = "token_program"
version = "0.1.0"
dependencies = [
"lee_core",
"lez-authority",
"token_core",
]

View File

@ -98,34 +98,43 @@ echo " Supply account: $SUPPLY_ID"
echo " Recipient account: $RECIPIENT_ID"
echo "[4/7] Creating token with mint authority..."
DEF_ID_HEX=$(b58_to_hex "$DEF_ID")
NSSA_WALLET_HOME_DIR="$WALLET_DIR" \
${TIMEOUT:+$TIMEOUT 30} "$SPEL" --idl "$IDL" --program "$TOKEN_BIN" \
"$SPEL" --idl "$IDL" --program "$TOKEN_BIN" \
-- new-fungible-definition \
--definition-target-account "$DEF_ID" \
--holding-target-account "$SUPPLY_ID" \
--name "DemoCoin" \
--total-supply 1000000 \
--mint-authority "$DEF_ID_HEX"
--mint-authority "$DEF_ID" &
SPEL_PID=$!
sleep 15 && kill $SPEL_PID 2>/dev/null || true
wait $SPEL_PID 2>/dev/null || true
echo " Token 'DemoCoin' submitted. Initial supply: 1,000,000"
sleep 2
echo "[5/7] Minting 500,000 additional tokens..."
NSSA_WALLET_HOME_DIR="$WALLET_DIR" \
${TIMEOUT:+$TIMEOUT 30} "$SPEL" --idl "$IDL" --program "$TOKEN_BIN" \
"$SPEL" --idl "$IDL" --program "$TOKEN_BIN" \
-- mint \
--definition-account "$DEF_ID" \
--user-holding-account "$RECIPIENT_ID" \
--amount-to-mint 500000
--amount-to-mint 500000 &
SPEL_PID=$!
sleep 15 && kill $SPEL_PID 2>/dev/null || true
wait $SPEL_PID 2>/dev/null || true
echo " Mint transaction submitted. New total supply: 1,500,000"
sleep 2
echo "[6/7] Revoking mint authority..."
NSSA_WALLET_HOME_DIR="$WALLET_DIR" \
${TIMEOUT:+$TIMEOUT 30} "$SPEL" --idl "$IDL" --program "$TOKEN_BIN" \
"$SPEL" --idl "$IDL" --program "$TOKEN_BIN" \
-- set-authority \
--definition-account "$DEF_ID" \
--new-authority none
--new-authority none &
SPEL_PID=$!
sleep 15 && kill $SPEL_PID 2>/dev/null || true
wait $SPEL_PID 2>/dev/null || true
echo " Authority revoked. Supply permanently fixed at 1,500,000"
sleep 2