AssertHasAnyRole
func AssertHasAnyRole(caller address, roleNames ...string)
Link
Execute
AssertHasAnyRole panics if the caller does not have any of the specified roles. Also panics if any of the roles do not exist.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertHasAnyRole( , )"
AssertIsAdmin
func AssertIsAdmin(caller address)
Link
Execute
AssertIsAdmin panics if the caller is not admin. Used for admin-only functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsAdmin( )"
AssertIsAdminOrGovernance
func AssertIsAdminOrGovernance(caller address)
Link
Execute
AssertIsAdminOrGovernance panics if the caller is not admin or governance. Used for functions that require elevated privileges.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsAdminOrGovernance( )"
AssertIsAuthorized
func AssertIsAuthorized(roleName string, caller address)
Link
Execute
AssertIsAuthorized panics if the caller does not have the specified role. Also panics if the role does not exist.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsAuthorized( , )"
AssertIsEmission
func AssertIsEmission(caller address)
Link
Execute
AssertIsEmission panics if the caller is not emission. Used for emission-only functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsEmission( )"
AssertIsGovStaker
func AssertIsGovStaker(caller address)
Link
Execute
AssertIsGovStaker panics if the caller is not governance staker. Used for governance staking functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsGovStaker( )"
AssertIsGovXGNS
func AssertIsGovXGNS(caller address)
Link
Execute
AssertIsGovXGNS panics if the caller is not xGNS governance. Used for xGNS governance functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsGovXGNS( )"
AssertIsGovernance
func AssertIsGovernance(caller address)
Link
Execute
AssertIsGovernance panics if the caller is not governance. Used for governance-only functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsGovernance( )"
AssertIsLaunchpad
func AssertIsLaunchpad(caller address)
Link
Execute
AssertIsLaunchpad panics if the caller is not launchpad. Used for launchpad-only functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsLaunchpad( )"
AssertIsPool
func AssertIsPool(caller address)
Link
Execute
AssertIsPool panics if the caller is not pool. Used for pool-only functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsPool( )"
AssertIsPosition
func AssertIsPosition(caller address)
Link
Execute
AssertIsPosition panics if the caller is not position. Used for position-only functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsPosition( )"
AssertIsProtocolFee
func AssertIsProtocolFee(caller address)
Link
Execute
AssertIsProtocolFee panics if the caller is not protocol fee. Used for protocol fee management functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsProtocolFee( )"
AssertIsRouter
func AssertIsRouter(caller address)
Link
Execute
AssertIsRouter panics if the caller is not router. Used for router-only functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsRouter( )"
AssertIsStaker
func AssertIsStaker(caller address)
Link
Execute
AssertIsStaker panics if the caller is not staker. Used for staker-only functions.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsStaker( )"
AssertIsUser
func AssertIsUser(r runtime.Realm)
Link
Execute
AssertIsUser panics if the caller is not a user realm. Used to ensure calls come from user accounts, not other contracts.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsUser( )"
AssertIsValidAddress
func AssertIsValidAddress(addr address)
Link
Execute
AssertIsValidAddress panics if the provided address is invalid.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.AssertIsValidAddress( )"
GetRoleAddresses
func GetRoleAddresses() map[string]address
Link
Execute
GetRoleAddresses returns a copy of all role addresses.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.GetRoleAddresses()"
IsAuthorized
func IsAuthorized(role string, caller address) bool
Link
Execute
IsAuthorized checks if caller has the specified role.
Parameters:
- role: role name to check
- caller: address to verify
Returns true if authorized, false otherwise.
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land " -data "gno.land/r/gnoswap/access.IsAuthorized( , )"
RemoveRole
func RemoveRole(cur realm, roleName string)
Link
Execute
RemoveRole removes a role from the system.
Parameters:
- roleName: name of the role to remove
Only callable by RBAC contract.
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" -func "RemoveRole" -args $' ' -gas-fee 1000000ugnot -gas-wanted 5000000 -send " " -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESS gnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/access" -func "RemoveRole" -args $' ' -gas-fee 1000000ugnot -gas-wanted 5000000 -send " " ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
SetRoleAddress
func SetRoleAddress(cur realm, roleName string, roleAddress address)
Link
Execute
SetRoleAddress sets or updates a role's address. Creates the role if it doesn't exist, updates it if it does.
Parameters:
- cur: current realm (required by interrealm spec; not used directly)
- roleName: name of the role
- roleAddress: address for the role
Only callable by RBAC contract.
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" -func "SetRoleAddress" -args $' ' -args $' ' -gas-fee 1000000ugnot -gas-wanted 5000000 -send " " -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESS gnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/access" -func "SetRoleAddress" -args $' ' -args $' ' -gas-fee 1000000ugnot -gas-wanted 5000000 -send " " ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx