PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidators

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/gnoswap/rbac/v1

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v1
Namespace
gnoswap / rbac
Files
8 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/gnoswap/rbac/v1
gno
0.9

Files (8)

  • README.mdmarkdown
  • gnomod.tomltoml
  • doc.gnogno
  • errors.gnogno
  • ownable.gnogno
  • rbac.gnogno
  • role.gnogno
  • types.gnogno
  • role.gnogno
    1package rbac23const zeroAddress = address("")45// Role represents a role with a name and an assigned address.6type Role struct {7	// name represents the role's identifier8	name    string9	address address10}1112// NewRole creates a new Role instance with roleName.13//14// Parameters:15//   - roleName: Role identifier stored in the new Role without normalization.16//   - addr: Address stored as the role's initial assignment without validation.17//18// Returns:19//   - *Role: New role containing roleName and its initially assigned addr.20func NewRole(roleName string, addr address) *Role {21	return &Role{22		name:    roleName,23		address: addr,24	}25}2627// Name returns the role's name.28//29// Returns:30//   - string: Role identifier stored in the Role.31func (r *Role) Name() string { return r.name }3233// Address returns the address assigned to this role. Returns empty address if no address is assigned.34//35// Returns:36//   - address: Address currently assigned to the role, or the empty address when unassigned.37func (r *Role) Address() address {38	return r.address39}4041// IsEmpty returns true if no address is assigned to this role.42//43// Returns:44//   - bool: true when the stored role address equals the empty address; false when an address is assigned.45func (r *Role) IsEmpty() bool {46	return r.Address() == zeroAddress47}4849// IsAuthorized returns true if addr matches the role's assigned address.50//51// Parameters:52//   - addr: Address to compare with the role's stored assignment.53//54// Returns:55//   - bool: true when addr exactly equals the assigned address; false otherwise.56func (r *Role) IsAuthorized(addr address) bool {57	return r.Address() == addr58}5960// setAddress assigns addr to this role.61func (r *Role) setAddress(addr address) {62	r.address = addr63}64

    Functions

    not supported for pure packages by the node (vm/qfuncs)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.