Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

fees source realm

Package fees is the entry-fee rate each account pays on Mimir's pool and VS markets (the gno.land port of contracts/M...

Overview

Package fees is the entry-fee rate each account pays on Mimir's pool and VS markets (the gno.land port of contracts/MimirFees.sol).

Everyone pays BaseBps (0.5%) of what they put in. A lower rate needs a fee ticket signed by the signer: "this account is tier T until `expires`". The account submits it with ApplyTicket, normally in the same transaction as its stake. Mimir's server signs no tickets.

Signatures are ed25519 over TicketMessage(account, tier, expires), which binds the chain id and this realm's path, so a ticket cannot be replayed on another network or another deployment.

Trust: the signer can only lower an account's rate (BaseBps is the most anyone pays), so a stolen signer key costs the protocol revenue, never a user money. The owner revokes it at once (RevokeSigner); a new signer waits SignerTimelock, so a stolen owner key cannot install one quietly. Both retire every ticket the old signer issued (each ticket carries the signer epoch it was applied under).

Constants 2

const Deployer

1const Deployer = address("g12dcsmwccgdxasqde2eumua88tlrkw83kqf6tcz")
source

Deployer is the initial owner, the address that deploys these realms.

Functions 13

func ApplyTicket

crossing Action
1func ApplyTicket(cur realm, tier int, expires int64, sigHex string)
source

ApplyTicket stores a signed tier for the caller: a ticket is bound to the account it was signed for.

func EntryBps

Action
1func EntryBps(account address) int64
source

EntryBps is the account's entry fee in basis points right now.

func ExecuteSigner

crossing Action
1func ExecuteSigner(cur realm)
source

ExecuteSigner is permissionless once due, like the market realms' queued changes.

func RevokeSigner

crossing Action
1func RevokeSigner(cur realm)
source

RevokeSigner is the emergency stop: no ticket verifies any more, and the ones applied stop counting.

func SetInitialSigner

crossing Action
1func SetInitialSigner(cur realm, pubHex string)
source

SetInitialSigner installs the first signer, once, as the Solidity constructor did. Every later change goes through the timelock.

func TicketMessage

Action
1func TicketMessage(account address, tier int, expires int64) string
source

TicketMessage is the exact byte string the signer signs for (account, tier, expires).

Types 1

type Ticket

struct
1type Ticket struct {
2	Tier    int
3	Expires int64
4	Epoch   int64
5}
source

Dependencies

Source Files 3