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

access source realm

Functions 20

func AssertHasAnyRole

Action
1func AssertHasAnyRole(caller address, roleNames ...string)
source

AssertHasAnyRole panics if the caller does not have any of the specified roles. Also panics if any of the roles do not exist.

func AssertIsAdmin

Action
1func AssertIsAdmin(caller address)
source

AssertIsAdmin panics if the caller is not admin. Used for admin-only functions.

func AssertIsAdminOrGovernance

Action
1func AssertIsAdminOrGovernance(caller address)
source

AssertIsAdminOrGovernance panics if the caller is not admin or governance. Used for functions that require elevated privileges.

func AssertIsAuthorized

Action
1func AssertIsAuthorized(roleName string, caller address)
source

AssertIsAuthorized panics if the caller does not have the specified role. Also panics if the role does not exist.

func AssertIsEmission

Action
1func AssertIsEmission(caller address)
source

AssertIsEmission panics if the caller is not emission. Used for emission-only functions.

func AssertIsGovStaker

Action
1func AssertIsGovStaker(caller address)
source

AssertIsGovStaker panics if the caller is not governance staker. Used for governance staking functions.

func AssertIsGovXGNS

Action
1func AssertIsGovXGNS(caller address)
source

AssertIsGovXGNS panics if the caller is not xGNS governance. Used for xGNS governance functions.

func AssertIsGovernance

Action
1func AssertIsGovernance(caller address)
source

AssertIsGovernance panics if the caller is not governance. Used for governance-only functions.

func AssertIsLaunchpad

Action
1func AssertIsLaunchpad(caller address)
source

AssertIsLaunchpad panics if the caller is not launchpad. Used for launchpad-only functions.

func AssertIsPool

Action
1func AssertIsPool(caller address)
source

AssertIsPool panics if the caller is not pool. Used for pool-only functions.

func AssertIsPosition

Action
1func AssertIsPosition(caller address)
source

AssertIsPosition panics if the caller is not position. Used for position-only functions.

func AssertIsProtocolFee

Action
1func AssertIsProtocolFee(caller address)
source

AssertIsProtocolFee panics if the caller is not protocol fee. Used for protocol fee management functions.

func AssertIsRouter

Action
1func AssertIsRouter(caller address)
source

AssertIsRouter panics if the caller is not router. Used for router-only functions.

func AssertIsStaker

Action
1func AssertIsStaker(caller address)
source

AssertIsStaker panics if the caller is not staker. Used for staker-only functions.

func AssertIsUser

Action
1func AssertIsUser(_ int, rlm realm)
source

AssertIsUser panics if the caller is not a user realm. Used to ensure calls come from user accounts, not other contracts.

func IsAuthorized

Action
1func IsAuthorized(role string, caller address) bool
source

IsAuthorized checks if caller has the specified role.

Parameters:

  • role: role name to check
  • caller: address to verify

Returns true if authorized, false otherwise.

func RemoveRole

crossing Action
1func RemoveRole(cur realm, roleName string)
source

RemoveRole removes a role from the system.

Parameters:

  • roleName: name of the role to remove

Only callable by RBAC contract.

func SetRoleAddress

crossing Action
1func SetRoleAddress(cur realm, roleName string, roleAddress address)
source

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
  • roleName: name of the role
  • roleAddress: address for the role

Only callable by RBAC contract.

Imports 5

Source Files 4