TOKEN_DECIMALS
untyped bigintCurve amounts are whole tokens. Keeping decimals at zero makes the GRC20 display unit match every supply, quote, sell-limit, and UI amount used by the protocol (MAX\_SUPPLY is 300 million tokens, not 300 display tokens).
Value
(0 <untyped> bigint)
FEE_BPS
int64// 1% protocol fee (bonding curve + AMM)
Value
100
LP_FEE_BPS
int64LP\_FEE\_BPS is an additional 1% charged ONLY on graduated-token AMM swaps that is retained in the pool (grows k), so external liquidity providers earn yield. Total AMM swap fee is therefore FEE\_BPS + LP\_FEE\_BPS = 2%.
Value
100
CREATE_FEE
int64// 1 GNOT
Value
1000000
MIN_SYMBOL_LEN
untyped bigintValue
(3 <untyped> bigint)
MAX_SYMBOL_LEN
untyped bigintValue
(4 <untyped> bigint)
MAX_NAME_LEN
untyped bigintValue
(20 <untyped> bigint)
SAFE_SUPPLY_LIMIT
int64// 300M - overflow-safe limit for integral()
Value
300000000
MAX_SUPPLY
int64// 300M (was 1e9; unreachable above the safe limit)
Value
300000000
MAX_BUY_UGNOT
int64// 100 GNOT
Value
100000000
MAX_SELL_TOKENS
int64// 10 Million
Value
10000000
GRADUATION_THRESHOLD
int64Graduation Threshold (10,000 GNOT)
Value
10000000000
MAX_DESCRIPTION_LEN
untyped bigintValue
(280 <untyped> bigint)
MAX_IMAGE_URL_LEN
untyped bigintValue
(256 <untyped> bigint)
MAX_SOCIAL_URL_LEN
untyped bigintValue
(128 <untyped> bigint)
SLOPE_A
int64Pricing: Price(S) = S/A + B
Value
100
BASE_B
int64Value
1
protocolFeeAccumulator
int64Value
1010140
admin
.uverse.addressValue
<gnolang.StringValue>
pendingAdmin
.uverse.addressValue
<zero>
pausedTokensCount
int64Value
0
factoryBanker
banker.banker- OID
- 0e5fd2…f916:98
factoryBanker details
realmAddr
.uverse.addressValue
<gnolang.StringValue>
globalPaused
bool// Emergency global pause - blocks all trading
Value
false
nextTokenID
v0.IDCurrent GRC20 identity includes a realm-local sequence ID. All three token creation paths must share one counter so emitted token IDs remain unique.
Value
<zero>
authorizedPools
map[string].uverse.addressGnoSwap integration: authorized pool addresses per token symbol -> pool address that can call TransferForDEX
- OID
- 0e5fd2…f916:12
authorizedPools details
protocolTokenFees
map[string]int64Protocol token fees accumulated from DEX trades (in tokens, per symbol) These can be withdrawn by admin and sold
- OID
- 0e5fd2…f916:14
protocolTokenFees details
tokenEntry
typeGRC20 token storage
Value
factory.tokenEntry
tokenRegistry
map[string]*factory.tokenEntry- OID
- 0e5fd2…f916:16
tokenRegistry details
TokenMeta
typeValue
factory.TokenMeta
init.30
func()- OID
- 0e5fd2…f916:17
init.30 details
sqrt
func(y int64) int64- OID
- 0e5fd2…f916:19
sqrt details
safeMul
func(a int64, b int64) int64safeMul multiplies two non-negative int64 values and panics on overflow, turning a silent int64 wrap (which the AMM pricing/liquidity math is otherwise exposed to for large pools) into a graceful revert. AMM-OVERFLOW-1.
- OID
- 0e5fd2…f916:20
safeMul details
integral
func(s int64) int64- OID
- 0e5fd2…f916:21
integral details
spotPrice
func(s int64) int64- OID
- 0e5fd2…f916:22
spotPrice details
splitTradeFee
func(fee int64, royaltyRateBps int64, royaltyRecipient .uverse.address) (protocolFee int64, royaltyFee int64)- OID
- 0e5fd2…f916:23
splitTradeFee details
assertDirectPayer
func()assertDirectPayer guards every entry point that reads its ugnot payment from unsafe.OriginSend(). OriginSend() reports the coins attached to the \*origin transaction\*, NOT the coins actually received by this realm. If an intermediary sits between the user and this call (a wrapper realm called with --send, or a \`gnokey maketx run\` ephemeral realm), it can keep the coins while OriginSend() still reports the full amount, letting it credit reserves / mint tokens / receive refunds against funds the realm never received and drain the shared realm account. Requiring the immediate caller to be a pure EOA (IsUserCall, i.e. cur.Previous().PkgPath()=="") guarantees the --send coins landed at realmAddr, so OriginSend() == receipt. See PAY-1 in docs/SECURITY\_AUDIT\_2026-06-13.md and gno docs/resources/effective-gno.md "Verifying inbound Coin payments".
- OID
- 0e5fd2…f916:24
assertDirectPayer details
errorf
func(format string, args []interface{...}) .uverse.errorFMT-1: delegate to ufmt instead of the previous naive strings.Replace formatters, which could not substitute untyped-int constants (no \`case int\`), mangled width verbs, and rendered \`%%\` literally. ufmt handles standard verbs for both int and int64 and collapses \`%%\` -> \`%\`.
- OID
- 0e5fd2…f916:25
errorf details
sprintf
func(format string, args []interface{...}) string- OID
- 0e5fd2…f916:26
sprintf details
safeK
func(x int64, y int64) int64safeK computes the informational KLast = x\*y, saturating at MaxInt64 instead of wrapping to a misleading negative value on overflow (KLAST-OVERFLOW-1). KLast is read only by off-chain UI and feeds no on-chain pricing/fee logic, so saturating here keeps swaps/liquidity ops from ever reverting on this purely cosmetic computation.
- OID
- 0e5fd2…f916:27
safeK details
formatBps
func(bps int64) stringformatBps renders a basis-point value (0-500) as a percentage with two fractional digits, e.g. 500 -> "5.00%", 25 -> "0.25%". ufmt does not apply a width to %d, so the zero-padding of the fractional part is done explicitly.
- OID
- 0e5fd2…f916:28
formatBps details
validateSymbol
func(raw string) (string, .uverse.error)- OID
- 0e5fd2…f916:29
validateSymbol details
validateName
func(raw string) (string, .uverse.error)- OID
- 0e5fd2…f916:30
validateName details
validateDescription
func(raw string) string- OID
- 0e5fd2…f916:31
validateDescription details
validateImageURL
func(raw string) string- OID
- 0e5fd2…f916:32
validateImageURL details
validateSocialURL
func(raw string) string- OID
- 0e5fd2…f916:33
validateSocialURL details
getTokenEntry
func(symbol string) *factory.tokenEntry- OID
- 0e5fd2…f916:34
getTokenEntry details
LaunchToken
func(rawSymbol string, rawName string, rawDescription string, rawImageURL string, rawTwitter string, rawTelegram string, rawDiscord string, rawWebsite string) string- OID
- 0e5fd2…f916:35
LaunchToken details
LaunchTemplate
func(rawSymbol string, rawName string, rawDescription string, rawImageURL string, rawTwitter string, rawTelegram string, rawDiscord string, rawWebsite string, royaltyRateBps int64) stringLaunchTemplate creates a token with a royalty rate, intended to be forked royaltyRateBps: 0-500 (0%-5%) of trade fees paid to creator on forks
- OID
- 0e5fd2…f916:36
LaunchTemplate details
ForkToken
func(parentSymbol string, rawSymbol string, rawName string, rawDescription string, rawImageURL string, rawTwitter string, rawTelegram string, rawDiscord string, rawWebsite string) stringForkToken creates a new token that pays royalties to the parent's creator
- OID
- 0e5fd2…f916:37
ForkToken details
QuoteBuy
func(symbol string, ugnotIn int64) (tokensOut int64, fee int64, ugnotChange int64)- OID
- 0e5fd2…f916:38
QuoteBuy details
QuoteSell
func(symbol string, tokensIn int64) (ugnotOut int64, fee int64)- OID
- 0e5fd2…f916:39
QuoteSell details
Buy
func(symbol string, minTokensOut int64) int64- OID
- 0e5fd2…f916:40
Buy details
Sell
func(symbol string, amount int64, minUgnotOut int64) int64- OID
- 0e5fd2…f916:41
Sell details
Transfer
func(symbol string, to .uverse.address, amount int64)Transfer moves tokens from caller to recipient
- OID
- 0e5fd2…f916:42
Transfer details
Approve
func(symbol string, spender .uverse.address, amount int64)Approve sets allowance for spender to spend caller's tokens
- OID
- 0e5fd2…f916:43
Approve details
TransferFrom
func(symbol string, from .uverse.address, to .uverse.address, amount int64)TransferFrom moves tokens using allowance mechanism
- OID
- 0e5fd2…f916:44
TransferFrom details
Allowance
func(symbol string, owner .uverse.address, spender .uverse.address) int64Allowance returns the remaining allowance
- OID
- 0e5fd2…f916:45
Allowance details
checkGraduation
func(symbol string, reserves int64)checkGraduation marks token as graduated when threshold reached Trading continues until admin initiates migration
- OID
- 0e5fd2…f916:46
checkGraduation details
StartMigration
func(symbol string)StartMigration temporarily locks trading while DEX pool is created This matches pump.fun's model - short pause during liquidity migration
- OID
- 0e5fd2…f916:47
StartMigration details
CompleteMigration
func(symbol string, dexPoolID string)CompleteMigration unlocks trading after DEX pool is live Trading resumes on both GnoPump and GnoSwap (like pump.fun + Raydium)
- OID
- 0e5fd2…f916:48
CompleteMigration details
AbortMigration
func(symbol string)AbortMigration clears a started-but-unfinished migration so bonding-curve trading resumes. MIGRATE-FREEZE-1: StartMigration sets IsMigrating, which panics Buy/Sell; without an abort path a stalled migration freezes the token's market indefinitely with no recourse. Only valid before any internal AMM pool is initialized (after that, finish via CompleteMigration instead).
- OID
- 0e5fd2…f916:49
AbortMigration details
GetMigrationStatus
func(symbol string) (graduated bool, migrating bool, complete bool, poolID string)GetMigrationStatus returns current migration state for a token
- OID
- 0e5fd2…f916:50
GetMigrationStatus details
RegisterDEXPool
func(symbol string, poolAddr .uverse.address)RegisterDEXPool authorizes a GnoSwap pool address to transfer tokens This is called after pool creation on GnoSwap side
- OID
- 0e5fd2…f916:51
RegisterDEXPool details
TransferForDEX
func(symbol string, from .uverse.address, to .uverse.address, amount int64) int64TransferForDEX allows authorized GnoSwap pools to transfer tokens during swaps GnoSwap calls this instead of requiring user approvals Fee Structure (taken from transfer amount, in tokens): - Protocol Fee: 1% (100 bps) → accumulated for protocol - Royalty Fee: 0-5% → paid to parent creator (if forked token) - Net Amount: remainder → sent to recipient
- OID
- 0e5fd2…f916:52
TransferForDEX details
WithdrawReservesToPool
func(symbol string, poolAddr .uverse.address) int64WithdrawReservesToPool sends GNOT reserves to GnoSwap pool for liquidity Called during migration process to seed the AMM pool
- OID
- 0e5fd2…f916:53
WithdrawReservesToPool details
GetAuthorizedPool
func(symbol string) .uverse.address- OID
- 0e5fd2…f916:54
GetAuthorizedPool details
GetDEXInfo
func(symbol string) (supply int64, decimals int, poolAddr .uverse.address, migrated bool)GetDEXInfo returns all info GnoSwap needs to work with a token
- OID
- 0e5fd2…f916:55
GetDEXInfo details
GetProtocolTokenFees
func(symbol string) int64GetProtocolTokenFees returns accumulated token fees from DEX trades
- OID
- 0e5fd2…f916:56
GetProtocolTokenFees details
WithdrawProtocolTokenFees
func(symbol string, to .uverse.address) int64WithdrawProtocolTokenFees lets admin withdraw accumulated token fees Tokens are transferred to specified address (admin can sell them)
- OID
- 0e5fd2…f916:57
WithdrawProtocolTokenFees details
AMMPool
typePool state for graduated tokens
Value
factory.AMMPool
lpBalances
map[string]map[.uverse.address]int64// symbol -> address -> LP amount
- OID
- 0e5fd2…f916:59
lpBalances details
ammPools
map[string]*factory.AMMPool// symbol -> pool
- OID
- 0e5fd2…f916:61
ammPools details
InitializeAMMPool
func(symbol string, tokenAmount int64)InitializeAMMPool creates the AMM pool during migration Called by admin after graduation to seed liquidity
- OID
- 0e5fd2…f916:62
InitializeAMMPool details
SwapGNOTForToken
func(symbol string, minTokensOut int64) int64SwapGNOTForToken buys tokens from the AMM pool Constant product: (x + dx)(y - dy) = k dy = y \* dx / (x + dx)
- OID
- 0e5fd2…f916:63
SwapGNOTForToken details
SwapTokenForGNOT
func(symbol string, tokenAmount int64, minGNOTOut int64) int64SwapTokenForGNOT sells tokens to the AMM pool for GNOT
- OID
- 0e5fd2…f916:64
SwapTokenForGNOT details
QuoteAMMBuy
func(symbol string, ugnotIn int64) (tokensOut int64, fee int64)QuoteAMMBuy returns expected tokens out for GNOT in fee is the TOTAL swap fee (protocol 1% + LP 1% = 2%), matching SwapGNOTForToken.
- OID
- 0e5fd2…f916:65
QuoteAMMBuy details
QuoteAMMSell
func(symbol string, tokenAmount int64) (gnotOut int64, fee int64)QuoteAMMSell returns expected GNOT out for tokens in. fee is the TOTAL swap fee (protocol 1% + LP 1% = 2%), matching SwapTokenForGNOT.
- OID
- 0e5fd2…f916:66
QuoteAMMSell details
GetAMMPoolInfo
func(symbol string) (tokenReserve int64, gnotReserve int64, k int64, totalLP int64, active bool)GetAMMPoolInfo returns pool state for a graduated token
- OID
- 0e5fd2…f916:67
GetAMMPoolInfo details
GetAMMPrice
func(symbol string) int64GetAMMPrice returns current price from pool (GNOT per token, scaled by 1e6)
- OID
- 0e5fd2…f916:68
GetAMMPrice details
AddLiquidity
func(symbol string, tokenAmount int64, minLpOut int64) int64AddLiquidity lets users add liquidity to graduated token pools They send GNOT and equivalent tokens get pulled from their balance. minLpOut is the caller's slippage bound (0 = no bound): the call reverts if fewer LP tokens than minLpOut would be minted.
- OID
- 0e5fd2…f916:69
AddLiquidity details
RemoveLiquidity
func(symbol string, lpAmount int64) (tokensOut int64, gnotOut int64)RemoveLiquidity lets LP holders withdraw their share
- OID
- 0e5fd2…f916:70
RemoveLiquidity details
GetLPBalance
func(symbol string, user .uverse.address) int64GetLPBalance returns user's LP token balance
- OID
- 0e5fd2…f916:71
GetLPBalance details
GetTradeRoute
func(symbol string) stringGetTradeRoute tells the UI which function to call for a given token Returns: "bonding" for Buy/Sell, "amm" for SwapGNOTForToken/SwapTokenForGNOT
- OID
- 0e5fd2…f916:72
GetTradeRoute details
QuoteTrade
func(symbol string, isBuy bool, amountIn int64) (amountOut int64, fee int64, route string)QuoteTrade returns expected output regardless of which route will be used
- OID
- 0e5fd2…f916:73
QuoteTrade details
gnoswapRouterAddr
.uverse.address// TODO: Set real address
Value
<gnolang.StringValue>
SetGnoSwapRouter
func(routerAddr .uverse.address)SetGnoSwapRouter allows admin to configure the GnoSwap router address
- OID
- 0e5fd2…f916:75
SetGnoSwapRouter details
GetGnoSwapRouter
func() .uverse.address- OID
- 0e5fd2…f916:76
GetGnoSwapRouter details
GetGnoSwapPoolInfo
func(symbol string) (poolAddr .uverse.address, migrated bool, tokenReserve int64, gnotReserve int64)GetGnoSwapPoolInfo returns info about our pool for external DEX compatibility
- OID
- 0e5fd2…f916:77
GetGnoSwapPoolInfo details
WithdrawProtocolFees
func(to .uverse.address)- OID
- 0e5fd2…f916:78
WithdrawProtocolFees details
AdminRemoveLiquidity
func(symbol string, lpAmount int64, to .uverse.address) (tokensOut int64, gnotOut int64)AdminRemoveLiquidity withdraws the protocol-owned LP position (the initial liquidity credited to realmAddr in InitializeAMMPool) to a treasury address. LOCKED-PROTOCOL-LP-1: without this, the protocol's seeded GNOT + tokens and its accrued LP-fee yield are permanently stranded, because RemoveLiquidity keys the burn on the immediate caller and realmAddr can never be the immediate caller of an exported function.
- OID
- 0e5fd2…f916:79
AdminRemoveLiquidity details
ProposeAdmin
func(newAdmin .uverse.address)ProposeAdmin / AcceptAdmin implement a two-step admin handover. ADMIN-ROTATE-1: the admin key was previously immutable and unrecoverable. This lets the current admin hand control to a new key (e.g. a multisig) which must confirm, preventing a handover to a wrong or uncontrolled address.
- OID
- 0e5fd2…f916:80
ProposeAdmin details
AcceptAdmin
func()- OID
- 0e5fd2…f916:81
AcceptAdmin details
GetAdmin
func() .uverse.address- OID
- 0e5fd2…f916:82
GetAdmin details
GetPendingAdmin
func() .uverse.address- OID
- 0e5fd2…f916:83
GetPendingAdmin details
GlobalPause
func()GlobalPause halts all trading on the factory (emergency use only)
- OID
- 0e5fd2…f916:84
GlobalPause details
GlobalUnpause
func()GlobalUnpause resumes trading on the factory
- OID
- 0e5fd2…f916:85
GlobalUnpause details
IsGlobalPaused
func() boolIsGlobalPaused returns the global pause state
- OID
- 0e5fd2…f916:86
IsGlobalPaused details
PauseToken
func(symbol string)- OID
- 0e5fd2…f916:87
PauseToken details
UnpauseToken
func(symbol string)- OID
- 0e5fd2…f916:88
UnpauseToken details
GetTokenInfo
func(symbol string) factory.TokenMeta- OID
- 0e5fd2…f916:89
GetTokenInfo details
BalanceOf
func(symbol string, addr .uverse.address) int64- OID
- 0e5fd2…f916:90
BalanceOf details
TotalSupply
func(symbol string) int64- OID
- 0e5fd2…f916:91
TotalSupply details
GetName
func(symbol string) string- OID
- 0e5fd2…f916:92
GetName details
GetSymbol
func(symbol string) string- OID
- 0e5fd2…f916:93
GetSymbol details
GetDecimals
func(symbol string) int- OID
- 0e5fd2…f916:94
GetDecimals details
GetProtocolFees
func() int64- OID
- 0e5fd2…f916:95
GetProtocolFees details
FactoryState
typeValue
factory.FactoryState
GetFactoryState
func() factory.FactoryState- OID
- 0e5fd2…f916:96
GetFactoryState details
Render
func(path string) string- OID
- 0e5fd2…f916:97