package lastcall import "gno.land/p/nt/grc20/v0" // tUSD is the test-USD collateral token. 6 decimals, so one tUSD unit is // 1_000000 and token amounts line up 1:1 with micro-USD price quotes. var ( usd *grc20.Token usdLedger *grc20.PrivateLedger ) func initUSD(cur realm) { usd, usdLedger = grc20.NewToken("Test USD", "tUSD", 6, nextTokID.Next(), cur) } // FaucetUSD mints 10,000 tUSD to the caller. Open faucet — demo only. func FaucetUSD(cur realm) { caller := cur.Previous().Address() if err := usdLedger.Mint(caller, 10_000_000000); err != nil { panic(err.Error()) } } func BalanceUSD(owner address) int64 { return usd.BalanceOf(owner) }