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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

render.gno

0.99 Kb · 28 lines
 1// Render — public read-only view + audit surface for the fee config.
 2package memba_market_config
 3
 4import (
 5	"strings"
 6
 7	"gno.land/p/nt/ufmt/v0"
 8)
 9
10func Render(path string) string {
11	var sb strings.Builder
12	sb.WriteString("# Memba Marketplace — Fee Config\n\n")
13	sb.WriteString("DAO-owned per-lane protocol fee + treasury. Engines read this at settlement.\n\n")
14	sb.WriteString(ufmt.Sprintf("**Admin:** %s\n", admin.String()))
15	if pendingAdmin != "" {
16		sb.WriteString(ufmt.Sprintf("**Pending admin:** %s\n", pendingAdmin.String()))
17	}
18	sb.WriteString(ufmt.Sprintf("**Treasury:** %s\n", treasury.String()))
19	sb.WriteString(ufmt.Sprintf("**Fee ceiling:** %d bps (5%%)\n\n", MaxFeeBPS))
20
21	sb.WriteString("| Lane | Fee (bps) |\n|------|-----------|\n")
22	feeByLane.Iterate("", "", func(key string, val interface{}) bool {
23		sb.WriteString(ufmt.Sprintf("| %s | %d |\n", key, val.(int64)))
24		return false
25	})
26	sb.WriteString(ufmt.Sprintf("\n*Unset lanes default to %d bps.*\n", DefaultFeeBPS))
27	return sb.String()
28}