Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

grc20faucet/v0 package

Overview

Package grc20faucet issues two free GRC20 tokens, RED and BLUE, and gives them away on request.

It exists so that anything needing a token to experiment on has one that is worthless, unlimited and shared. Both tokens are registered in gno.land/r/nt/grc20reg/v0, which is what lets another realm find and move them by key without importing this package: that indirection is the whole point, and it is what gno.land/r/moul/x/grc20wrapdemo/v0 wraps.

Two tokens rather than one, because the interesting patterns start at two: a meta-token over a pair needs a pair.

Functions

Allowance

func Allowance(symbol string, owner, spender address) int64

Allowance returns what `owner` let `spender` draw of `symbol`.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/grc20faucet/v0.Allowance(,,)"

Result

Approve

func Approve(cur realm, symbol string, spender address, amount int64)

Approve lets `spender` draw `amount` of `symbol` from the caller's balance.

This is the call that makes every wrapper in grc20wrapdemo work: the wrapper realm has no authority over anybody's tokens until its address is named here.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/grc20faucet/v0" -func "Approve" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/grc20faucet/v0" -func "Approve" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

BalanceOf

func BalanceOf(symbol string, owner address) int64

BalanceOf returns `owner`'s balance of `symbol`.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/grc20faucet/v0.BalanceOf(,)"

Result

Claim

func Claim(cur realm)

Claim mints ClaimAmount of both RED and BLUE to the caller.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/grc20faucet/v0" -func "Claim" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/grc20faucet/v0" -func "Claim" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

NextClaim

func NextClaim(who address) (int64, bool)

NextClaim returns the block height at which `who` may claim again, and whether they have ever claimed at all.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/grc20faucet/v0.NextClaim()"

Result

Render

func Render(path string) string

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/grc20faucet/v0.Render()"

Result

TotalSupply

func TotalSupply(symbol string) int64

TotalSupply returns how much of `symbol` has been claimed so far.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/grc20faucet/v0.TotalSupply()"

Result

Transfer

func Transfer(cur realm, symbol string, to address, amount int64)

Transfer moves the caller's own units of `symbol`.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/grc20faucet/v0" -func "Transfer" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/grc20faucet/v0" -func "Transfer" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

TransferFrom

func TransferFrom(cur realm, symbol string, from, to address, amount int64)

TransferFrom spends an allowance the caller was granted.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/grc20faucet/v0" -func "TransferFrom" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/grc20faucet/v0" -func "TransferFrom" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx