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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

grc721.gno

1.75 Kb · 43 lines
 1package nft
 2
 3import "gno.land/p/nt/grc721/v0"
 4
 5// Token returns the collection as a read-only GRC721 teller.
 6func Token() grc721.Teller { return collection.ReadonlyTeller() }
 7
 8// GetName returns the name of the collection.
 9func GetName() string { return collection.GetName() }
10
11// GetSymbol returns the symbol of the collection.
12func GetSymbol() string { return collection.GetSymbol() }
13
14// ID returns the ID of the collection.
15func ID() string { return collection.ID() }
16
17// TotalSupply returns the number of Settlers minted so far.
18func TotalSupply() int64 { return collection.TotalSupply() }
19
20// BalanceOf returns the number of Settlers of an account, 0 or 1.
21func BalanceOf(owner address) (int64, error) { return collection.BalanceOf(owner) }
22
23// OwnerOf returns the owner account of a Settler.
24func OwnerOf(tid grc721.TokenID) (address, error) { return collection.OwnerOf(tid) }
25
26// GetApproved returns the account allowed to move a Settler on behalf of its owner.
27// Settlers are soulbound, so it always fails.
28func GetApproved(tid grc721.TokenID) (address, error) { return collection.GetApproved(tid) }
29
30// IsApprovedForAll reports whether an account is allowed to move the Settler of another account.
31// Settlers are soulbound, so it is always false.
32func IsApprovedForAll(owner, operator address) bool {
33	return collection.IsApprovedForAll(owner, operator)
34}
35
36// Approve always fails, Settlers are soulbound.
37func Approve(cur realm, to address, tid grc721.TokenID) { panic(ErrSoulbound) }
38
39// SetApprovalForAll always fails, Settlers are soulbound.
40func SetApprovalForAll(cur realm, operator address, approved bool) { panic(ErrSoulbound) }
41
42// TransferFrom always fails, Settlers are soulbound.
43func TransferFrom(cur realm, from, to address, tid grc721.TokenID) { panic(ErrSoulbound) }