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.
- OID
- 057463…de87:3
AssertIsNotHandleNativeCoin details
IsRegistered
func(tokenKey string) .uverse.errorIsRegistered 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.
- OID
- 057463…de87:5
IsRegistered details
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.
- OID
- 057463…de87:7
MustRegistered details
ValidateRegistered
func(tokenKeys []string) .uverse.errorValidateRegistered 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.
- OID
- 057463…de87:8
ValidateRegistered details
TotalSupply
func(tokenKey string) int64TotalSupply 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.
- OID
- 057463…de87:9
TotalSupply details
BalanceOf
func(tokenKey string, addr .uverse.address) int64BalanceOf 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.
- OID
- 057463…de87:10
BalanceOf details
Allowance
func(tokenKey string, owner .uverse.address, spender .uverse.address) int64Allowance 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.
- OID
- 057463…de87:11
Allowance details
Transfer
func(int, rlm .uverse.realm, tokenKey string, to .uverse.address, amount int64) .uverse.errorTransfer 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.
- OID
- 057463…de87:12
Transfer details
TransferFrom
func(int, rlm .uverse.realm, tokenKey string, from .uverse.address, to .uverse.address, amount int64) .uverse.errorTransferFrom 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.
- OID
- 057463…de87:13
TransferFrom details
Approve
func(int, rlm .uverse.realm, tokenKey string, spender .uverse.address, amount int64) .uverse.errorApprove 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.
- OID
- 057463…de87:14
Approve details
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.
- OID
- 057463…de87:15
SafeGRC20Transfer details
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.
- OID
- 057463…de87:16
SafeGRC20TransferFrom details
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.
- OID
- 057463…de87:17
SafeGRC20Approve details
Render
func(path string) stringRender delegates web rendering to the active implementation.
- OID
- 057463…de87:18
Render details
currentAddress
.uverse.addressValue
<gnolang.StringValue>
domainPath
stringValue
"gno.land/r/gnoswap/common"
kvStore
*v1.kvStore- OID
- 057463…de87:36
kvStore details
versionManager
*v1.versionManager- OID
- 057463…de87:40
versionManager details
implementation
*v1.commonV1- OID
- 09b476…9466:16
implementation details
init.19
func()- OID
- 057463…de87:25
init.19 details
initializeDomainStore
func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...}common keeps no domain state; implementations only resolve tokens.
- OID
- 057463…de87:27
initializeDomainStore details
getImplementation
func() common.ICommon- OID
- 057463…de87:28
getImplementation details
updateImplementation
func() .uverse.error- OID
- 057463…de87:29
updateImplementation details
ICommon
typeValue
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
- OID
- 057463…de87:30
RegisterInitializer details
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
- OID
- 057463…de87:32
UpgradeImpl details
GetImplementationPackagePath
func() stringGetImplementationPackagePath returns the package path of the currently selected common implementation. Returns: - packagePath: fully qualified current implementation package path
- OID
- 057463…de87:33