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

access/v1 package

Functions

AssertHasAnyRole

func AssertHasAnyRole(caller address, roleNames ...string)
Ask AI Claude ChatGPT

AssertHasAnyRole checks roleNames in order and panics unless caller matches one. It panics immediately if a checked role is absent, even if a later role might match.

Parameters:

  • caller: address compared against each configured role address
  • roleNames: ordered role identifiers to check; each missing role causes a panic

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertHasAnyRole(,)"

Result

AssertIsAdmin

func AssertIsAdmin(caller address)
Ask AI Claude ChatGPT

AssertIsAdmin panics unless caller is the configured admin address.

Parameters:

  • caller: address whose authorization is checked against the admin role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsAdmin()"

Result

AssertIsAdminOrGovernance

func AssertIsAdminOrGovernance(caller address)
Ask AI Claude ChatGPT

AssertIsAdminOrGovernance panics unless caller is the configured admin or governance address.

Parameters:

  • caller: address whose authorization is checked against the admin and governance roles

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsAdminOrGovernance()"

Result

AssertIsAuthorized

func AssertIsAuthorized(roleName string, caller address)
Ask AI Claude ChatGPT

AssertIsAuthorized panics if caller does not have the specified role or if the role is absent.

Parameters:

  • roleName: role identifier whose configured address is required
  • caller: address that must match the configured address for roleName

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsAuthorized(,)"

Result

AssertIsEmission

func AssertIsEmission(caller address)
Ask AI Claude ChatGPT

AssertIsEmission panics unless caller is the configured emission address.

Parameters:

  • caller: address whose authorization is checked against the emission role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsEmission()"

Result

AssertIsGovStaker

func AssertIsGovStaker(caller address)
Ask AI Claude ChatGPT

AssertIsGovStaker panics unless caller is the configured governance-staker address.

Parameters:

  • caller: address whose authorization is checked against the governance-staker role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsGovStaker()"

Result

AssertIsGovXGNS

func AssertIsGovXGNS(caller address)
Ask AI Claude ChatGPT

AssertIsGovXGNS panics unless caller is the configured xGNS governance address.

Parameters:

  • caller: address whose authorization is checked against the xGNS governance role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsGovXGNS()"

Result

AssertIsGovernance

func AssertIsGovernance(caller address)
Ask AI Claude ChatGPT

AssertIsGovernance panics unless caller is the configured governance address.

Parameters:

  • caller: address whose authorization is checked against the governance role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsGovernance()"

Result

AssertIsLaunchpad

func AssertIsLaunchpad(caller address)
Ask AI Claude ChatGPT

AssertIsLaunchpad panics unless caller is the configured launchpad address.

Parameters:

  • caller: address whose authorization is checked against the launchpad role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsLaunchpad()"

Result

AssertIsPool

func AssertIsPool(caller address)
Ask AI Claude ChatGPT

AssertIsPool panics unless caller is the configured pool address.

Parameters:

  • caller: address whose authorization is checked against the pool role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsPool()"

Result

AssertIsPosition

func AssertIsPosition(caller address)
Ask AI Claude ChatGPT

AssertIsPosition panics unless caller is the configured position address.

Parameters:

  • caller: address whose authorization is checked against the position role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsPosition()"

Result

AssertIsProtocolFee

func AssertIsProtocolFee(caller address)
Ask AI Claude ChatGPT

AssertIsProtocolFee panics unless caller is the configured protocol-fee address.

Parameters:

  • caller: address whose authorization is checked against the protocol-fee role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsProtocolFee()"

Result

AssertIsRlmCurrent

func AssertIsRlmCurrent(_ int, rlm realm)
Ask AI Claude ChatGPT

AssertIsRlmCurrent panics if the realm token is not the current crossing frame.

Parameters:

  • _: leading realm-call discriminator; callers pass 0
  • rlm: realm context token that must represent the current crossing frame

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsRlmCurrent(,)"

Result

AssertIsRouter

func AssertIsRouter(caller address)
Ask AI Claude ChatGPT

AssertIsRouter panics unless caller is the configured router address.

Parameters:

  • caller: address whose authorization is checked against the router role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsRouter()"

Result

AssertIsStaker

func AssertIsStaker(caller address)
Ask AI Claude ChatGPT

AssertIsStaker panics unless caller is the configured staker address.

Parameters:

  • caller: address whose authorization is checked against the staker role

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsStaker()"

Result

AssertIsValidAddress

func AssertIsValidAddress(addr address)
Ask AI Claude ChatGPT

AssertIsValidAddress panics if addr is not a valid address.

Parameters:

  • addr: address value to validate

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.AssertIsValidAddress()"

Result

GetRoleAddresses

func GetRoleAddresses() map[string]address
Ask AI Claude ChatGPT

GetRoleAddresses returns an independent map copy of all stored role addresses.

Returns:

  • roleAddresses: map from normalized role names to their configured addresses

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.GetRoleAddresses()"

Result

IsAuthorized

func IsAuthorized(role string, caller address) bool
Ask AI Claude ChatGPT

IsAuthorized reports whether caller is the address currently mapped to role.

Parameters:

  • role: role name to trim and look up
  • caller: address to compare with the mapped role address

Returns:

  • authorized: true when role exists and caller matches its address; false when the role is absent or does not match

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/access/v1.IsAuthorized(,)"

Result

RemoveRole

func RemoveRole(cur realm, roleName string)
Ask AI Claude ChatGPT

RemoveRole removes a role from the system after trimming its name.

Parameters:

  • cur: current realm context; callers use cross(cur) when crossing into this realm
  • roleName: role identifier to trim and remove; an empty or unknown name panics

Only callable by the RBAC contract.

Param

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/gnoswap/access/v1" -func "RemoveRole" -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/gnoswap/access/v1" -func "RemoveRole" -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
  

SetRoleAddress

func SetRoleAddress(cur realm, roleName string, roleAddress address)
Ask AI Claude ChatGPT

SetRoleAddress sets or updates a role's address. It trims surrounding whitespace from roleName, creates missing roles, and replaces the address for an existing role.

Parameters:

  • cur: current realm context; callers use cross(cur) when crossing into this realm
  • roleName: role identifier; surrounding whitespace is ignored and an empty name panics
  • roleAddress: non-empty, valid address to associate with roleName

Only callable by the RBAC contract.

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/gnoswap/access/v1" -func "SetRoleAddress" -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/gnoswap/access/v1" -func "SetRoleAddress" -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
  

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/gnoswap/access/v1, for example a function call with arguments.