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

common state

Back to all declarations

AssertIsNotHandleNativeCoin

func()

AssertIsNotHandleNativeCoin validates that no native coins were sent with the transaction. Use this when a function should only work with GRC20 tokens and not accept native coins.

Open
OID
057463…de87:3
AssertIsNotHandleNativeCoin details

Inspect func

IsRegistered

func(tokenKey string) .uverse.error

IsRegistered checks whether a token key is registered. Parameters: - tokenKey: registry key identifying the GRC20 token to inspect. Returns: - error: nil when tokenKey is valid and registered; non-nil when the key is invalid or unregistered.

Open
OID
057463…de87:5
IsRegistered details

Inspect func

MustRegistered

func(tokenKeys []string)

MustRegistered checks whether all provided tokens are registered and panics if any is not registered. Parameters: - tokenKeys: token registry keys to check; an empty list performs no checks. Panics if any of the provided tokens is not registered.

Open
OID
057463…de87:7
MustRegistered details

Inspect func

ValidateRegistered

func(tokenKeys []string) .uverse.error

ValidateRegistered checks whether all provided tokens are registered, returning an error instead of panicking when a token is not registered. Parameters: - tokenKeys: token registry keys to check; an empty list is valid. Returns: - error: nil when every token is registered; otherwise the first registration failure.

Open
OID
057463…de87:8
ValidateRegistered details

Inspect func

TotalSupply

func(tokenKey string) int64

TotalSupply returns the total supply of the specified token. Parameters: - tokenKey: registry key identifying the GRC20 token. Returns: - totalSupply: current token supply for tokenKey, in the token's base units; panics if tokenKey is invalid or unregistered.

Open
OID
057463…de87:9
TotalSupply details

Inspect func

BalanceOf

func(tokenKey string, addr .uverse.address) int64

BalanceOf returns the token balance for the specified address. Parameters: - tokenKey: registry key identifying the GRC20 token. - addr: address whose token balance is queried. Returns: - balance: token balance held by addr, in the token's base units; panics if tokenKey is invalid or unregistered.

Open
OID
057463…de87:10
BalanceOf details

Inspect func

Allowance

func(tokenKey string, owner .uverse.address, spender .uverse.address) int64

Allowance returns the token allowance from owner to spender. Parameters: - tokenKey: registry key identifying the GRC20 token. - owner: address that owns the tokens. - spender: address authorized to spend owner's tokens. Returns: - allowance: amount owner has approved spender to use, in the token's base units; panics if tokenKey is invalid or unregistered.

Open
OID
057463…de87:11
Allowance details

Inspect func

Transfer

func(int, rlm .uverse.realm, tokenKey string, to .uverse.address, amount int64) .uverse.error

Transfer forwards a token transfer to the implementation bound to the current realm. Parameters: - \_: leading integer discriminator for the realm-crossing ABI; pass 0. - rlm: propagated realm context used to resolve and invoke the registered token implementation. - tokenKey: registry key identifying the GRC20 token to transfer. - to: recipient address. - amount: number of token base units to transfer. Returns: - error: nil when the implementation completes the transfer; otherwise a token validation or transfer-rule error.

Open
OID
057463…de87:12
Transfer details

Inspect func

TransferFrom

func(int, rlm .uverse.realm, tokenKey string, from .uverse.address, to .uverse.address, amount int64) .uverse.error

TransferFrom forwards an allowance-backed token transfer to the implementation bound to the current realm. Parameters: - \_: leading integer discriminator for the realm-crossing ABI; pass 0. - rlm: propagated realm context used to resolve and invoke the registered token implementation. - tokenKey: registry key identifying the GRC20 token to transfer. - from: address whose allowance and balance are debited. - to: recipient address. - amount: number of token base units to transfer. Returns: - error: nil when the implementation completes the transfer; otherwise a token validation, allowance, or balance-rule error.

Open
OID
057463…de87:13
TransferFrom details

Inspect func

Approve

func(int, rlm .uverse.realm, tokenKey string, spender .uverse.address, amount int64) .uverse.error

Approve forwards an allowance update to the implementation bound to the current realm. Parameters: - \_: leading integer discriminator for the realm-crossing ABI; pass 0. - rlm: propagated realm context used to resolve and invoke the registered token implementation. - tokenKey: registry key identifying the GRC20 token. - spender: address authorized to spend the caller's tokens. - amount: number of token base units to authorize. Returns: - error: nil when the implementation records the allowance; otherwise a token validation or approval-rule error.

Open
OID
057463…de87:14
Approve details

Inspect func

SafeGRC20Transfer

func(int, rlm .uverse.realm, tokenKey string, to .uverse.address, amount int64)

SafeGRC20Transfer transfers tokens as the current realm and panics if it fails. Parameters: - \_: leading integer discriminator for the realm-crossing ABI; pass 0. - rlm: propagated realm context used to resolve and invoke the registered token implementation. - tokenKey: registry key identifying the GRC20 token to transfer. - to: recipient address. - amount: number of token base units to transfer. Panics if the underlying transfer returns an error.

Open
OID
057463…de87:15
SafeGRC20Transfer details

Inspect func

SafeGRC20TransferFrom

func(int, rlm .uverse.realm, tokenKey string, from .uverse.address, to .uverse.address, amount int64)

SafeGRC20TransferFrom transfers tokens as the current realm and panics if it fails. Parameters: - \_: leading integer discriminator for the realm-crossing ABI; pass 0. - rlm: propagated realm context used to resolve and invoke the registered token implementation. - tokenKey: registry key identifying the GRC20 token to transfer. - from: address whose allowance and balance are debited. - to: recipient address. - amount: number of token base units to transfer. Panics if the underlying transfer returns an error.

Open
OID
057463…de87:16
SafeGRC20TransferFrom details

Inspect func

SafeGRC20Approve

func(int, rlm .uverse.realm, tokenKey string, spender .uverse.address, amount int64)

SafeGRC20Approve approves tokens as the current realm and panics if it fails. Parameters: - \_: leading integer discriminator for the realm-crossing ABI; pass 0. - rlm: propagated realm context used to resolve and invoke the registered token implementation. - tokenKey: registry key identifying the GRC20 token. - spender: address authorized to spend the caller's tokens. - amount: number of token base units to authorize. Panics if the underlying approval returns an error.

Open
OID
057463…de87:17
SafeGRC20Approve details

Inspect func

Render

func(path string) string

Render delegates web rendering to the active implementation.

Open
OID
057463…de87:18
Render details

Inspect func

currentAddress

.uverse.address

Value

<gnolang.StringValue>

domainPath

string

Value

"gno.land/r/gnoswap/common"

initializeDomainStore

func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...}

common keeps no domain state; implementations only resolve tokens.

Open
OID
057463…de87:27
initializeDomainStore details

Inspect func

getImplementation

func() common.ICommon
Open
OID
057463…de87:28
getImplementation details

Inspect func

updateImplementation

func() .uverse.error
Open
OID
057463…de87:29
updateImplementation details

Inspect func

ICommon

type

Value

common.ICommon

RegisterInitializer

func(initializer func(...))

RegisterInitializer registers the versioned common implementation initializer and activates the implementation returned by it. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - initializer: callback invoked with discriminator 0 and the propagated implementation realm, returning the version's ICommon implementation

Open
OID
057463…de87:30
RegisterInitializer details

Inspect func

UpgradeImpl

func(packagePath string)

UpgradeImpl changes the active common implementation package and refreshes the cached implementation. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - packagePath: fully qualified package path of the replacement implementation

Open
OID
057463…de87:32
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently selected common implementation. Returns: - packagePath: fully qualified current implementation package path

Open
OID
057463…de87:33
GetImplementationPackagePath details

Inspect func
AssertIsNotHandleNativeCoin : func() Inspect
IsRegistered : func(tokenKey string) .uverse.error Inspect
MustRegistered : func(tokenKeys []string) Inspect
ValidateRegistered : func(tokenKeys []string) .uverse.error Inspect
TotalSupply : func(tokenKey string) int64 Inspect
BalanceOf : func(tokenKey string, addr .uverse.address) int64 Inspect
Allowance : func(tokenKey string, owner .uverse.address, spender .uverse.address) int64 Inspect
Transfer : func(int, rlm .uverse.realm, tokenKey string, to .uverse.address, amount int64) .uverse.error Inspect
TransferFrom : func(int, rlm .uverse.realm, tokenKey string, from .uverse.address, to .uverse.address, amount int64) .uverse.error Inspect
Approve : func(int, rlm .uverse.realm, tokenKey string, spender .uverse.address, amount int64) .uverse.error Inspect
SafeGRC20Transfer : func(int, rlm .uverse.realm, tokenKey string, to .uverse.address, amount int64) Inspect
SafeGRC20TransferFrom : func(int, rlm .uverse.realm, tokenKey string, from .uverse.address, to .uverse.address, amount int64) Inspect
SafeGRC20Approve : func(int, rlm .uverse.realm, tokenKey string, spender .uverse.address, amount int64) Inspect
Render : func(path string) string Inspect
currentAddress : .uverse.address =<gnolang.StringValue>
domainPath : string ="gno.land/r/gnoswap/common"
kvStore : *v1.kvStore Inspect
versionManager : *v1.versionManager Inspect
implementation : *v1.commonV1 Inspect
init.19 : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...} Inspect
getImplementation : func() common.ICommon Inspect
updateImplementation : func() .uverse.error Inspect
ICommon : type =common.ICommon
RegisterInitializer : func(initializer func(...)) Inspect
UpgradeImpl : func(packagePath string) Inspect
GetImplementationPackagePath : func() string Inspect