testnet
GitHub

Configuration Getters

func BlockedAddresses() map[string]bool func GetMaccPerms() map[string][]string

Utility functions to retrieve Maroo's core security and module configurations. BlockedAddresses returns a set of all system-reserved addresses that cannot receive funds, while GetMaccPerms provides the permission matrix for all module accounts. These are useful for building UIs, wallets, and chain analysis tools.

Parameters

This method has no parameters.

Returns

Type: map[string]bool | map[string][]string

BlockedAddresses returns a map where keys are Bech32 addresses and the value is true. GetMaccPerms returns a map where keys are module names and values are a slice of permissions (e.g., minter, burner).

Examples

Check if an Address is Blocked Before Sending

A simple validation function that uses `BlockedAddresses` to prevent transactions to system accounts.

import "github.com/delight-labs/maroo/config"

func isSendAllowed(recipient string) bool {
    blocked := config.BlockedAddresses()
    if _, isBlocked := blocked[recipient]; isBlocked {
        return false // Do not allow sending to this address
    }
    return true
}

Listing Module Account Permissions

This example iterates through the map returned by `GetMaccPerms` to display the capabilities of each module account.

import (
    "fmt"
    "github.com/delight-labs/maroo/config"
)

func printPermissions() {
    perms := config.GetMaccPerms()
    fmt.Println("Module Account Permissions:")
    for module, permissions := range perms {
        fmt.Printf("- %s: %v\n", module, permissions)
    }
}
ESC
Type to search