func Allowance
ActionAllowance returns how much `spender` may still pull from `owner`.
Package erc20 implements MiniToken, a minimal fungible token modeled on the Solidity ERC-20 idea, ported to gno.land ...
⚠️ Experimental — generated with no human supervision. This realm was produced automatically by an MCP-driven agent to exercise the gno MCP server and tooling, and to generate test content for gno compilers, linters and formatters. Not audited. Not for production. Full context & folder README: r/moul/x/daily
A minimal fungible-token realm for gno.land (gno 0.9 / sapphire), porting the
classic Solidity ERC-20 idea. It keeps package-level state — a balances map, a
total supply, and per-owner allowances — behind gno 0.9 crossing functions that
authenticate the caller via cur.IsCurrent() + cur.Previous(). Render
returns a Markdown dashboard with the token metadata and a table of holders.
Realm path: gno.land/r/REPLACE_ADDR/erc20 (deploy address injected at deploy time).
Mint(cur realm, to address, amount uint64) — create new tokens for to.Transfer(cur realm, to address, amount uint64) — send tokens from the caller.Approve(cur realm, spender address, amount uint64) — grant a spending allowance.TransferFrom(cur realm, from, to address, amount uint64) — spend an allowance.BalanceOf(holder address) uint64 · Allowance(owner, spender address) uint64TotalSupply() uint64 · Name() string · Symbol() stringRender(path string) string — Markdown view for gnoweb.1# Mint 1000 MINI to yourself
2gnokey maketx call -pkgpath "gno.land/r/REPLACE_ADDR/erc20" \
3 -func Mint -args "<your-addr>" -args 1000 \
4 -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid sapphire-1 <key>
5
6# Transfer 250 MINI to another account
7gnokey maketx call -pkgpath "gno.land/r/REPLACE_ADDR/erc20" \
8 -func Transfer -args "<recipient-addr>" -args 250 \
9 -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid sapphire-1 <key>
View the token dashboard at https://gno.land/r/REPLACE_ADDR/erc20 on gnoweb.
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.
Package erc20 implements MiniToken, a minimal fungible token modeled on the Solidity ERC-20 idea, ported to gno.land (gno 0.9 / sapphire).
State is package-level and persistent. All state-mutating exported functions are crossing functions (they take `cur realm` as the first parameter) per the gno 0.9 interrealm convention, and identify the caller via cur.Previous().Address() after checking cur.IsCurrent().
Allowance returns how much `spender` may still pull from `owner`.
Approve authorizes `spender` to pull up to `amount` tokens from the caller. Crossing function.
BalanceOf returns the token balance of `holder`. Read-only, non-crossing.
Mint creates `amount` new tokens and credits them to `to`, increasing the total supply. Crossing function.
Name returns the token name.
Render produces the gnoweb Markdown view of the token: metadata plus a deterministically-ordered table of non-zero balances. Render is NOT a crossing function (no `cur realm` parameter).
Symbol returns the token symbol.
TotalSupply returns the total number of tokens in existence.
Transfer moves `amount` tokens from the caller to `to`. Crossing function.
TransferFrom moves `amount` tokens from `from` to `to`, spending the caller's allowance granted by `from`. Crossing function.