func BalanceOf
ActionBalanceOf returns token balance for address.
Parameters:
- owner: address to check balance for
Returns:
- balance: token balance amount
Package xgns implements the GRC20-compliant xGNS token that represents staked GNS. It manages balances, total supply,...
Non-transferable receipt token for GNS staked through gov/staker.
xGNS is a GRC20 token that mirrors GNS locked in gov/staker. It exists so that
governance and the launchpad can read one staked-GNS balance, and it is minted
and burned only by gov/staker as delegations and launchpad project deposits
change.
xGNS does not maintain a voting-power ledger. A holder's balance is the
staked-GNS receipt of the delegator; the delegatee attribution and the
timestamped history that governance reads for vote weight live in gov/staker.
See gov/staker and governance.
gov/stakerTransfer, TransferFrom,
Approve, or Allowance entry point, so a balance can change only through
Mint and Burn.gov_staker role address onlygno.land/r/gnoswap/gov/xgnsMintCredits xGNS to an address. Only callable by the gov/staker contract.
BurnDebits xGNS from an address. Only callable by the gov/staker contract.
Mint, so issuance and redemption can be halted independentlyTotalSupplyTotal xGNS issued. Governance reads it at proposal creation to derive that proposal's quorum amount, so the figure includes launchpad-held issuance.
BalanceOfxGNS balance of an address. Read by governance for the proposal-creation threshold, and by the launchpad when a project condition names the xGNS token path.
SupplyInfoReturns (totalIssued, issuedByDelegate, issuedByDepositGns, err).
issuedByDepositGns is the balance held by the launchpad role addressissuedByDelegate is the remainder, totalIssued - issuedByDepositGnserr is non-nil when the launchpad address is not registered in access; the
three amounts are zero in that caseRender"" renders the token home viewbalance/<address> renders that address's balance404Only gov/staker moves xGNS, and its mint/burn points are not symmetric with
the delegation calls:
| gov/staker call | xGNS effect |
|---|---|
Delegate |
mints the delegated amount to the delegator (the caller), not to the delegatee |
Redelegate |
no mint or burn; only the delegatee attribution moves |
Undelegate |
no burn; voting power is removed immediately while the xGNS balance stays |
CollectUndelegatedGns |
burns the collected amount from the caller after the lockup |
SetAmountByProjectWallet with add = true |
mints to the launchpad role address |
SetAmountByProjectWallet with add = false |
burns from the launchpad role address |
Because Undelegate does not burn, a holder keeps the xGNS balance for the
duration of the undelegation lockup even though the delegated voting power is
already gone.
| Function | Halt scope |
|---|---|
Mint |
xgns |
Burn |
withdraw |
TotalSupply, BalanceOf, SupplyInfo, Render |
none; read-only |
These snippets call the xGNS realm from a realm function with a current cur
token. Import the package and qualify its function names in integrating code.
1// Read paths take no realm token
2supply := TotalSupply()
3balance := BalanceOf(voterAddress)
4totalIssued, issuedByDelegate, issuedByDepositGns, err := SupplyInfo()
5
6// Write paths are rejected for any caller other than the gov/staker realm
7Mint(cross(cur), delegator, 1_000_000_000)
8Burn(cross(cur), delegator, 1_000_000_000)
Integrating realms should go through gov/staker rather than calling this realm
directly. Delegate and CollectUndelegatedGns keep the GNS ledger, the
delegation history, and the xGNS supply consistent, while a direct Mint or
Burn is rejected for any caller other than gov/staker.
Mint and Burn assert the gov_staker role, so no user and no other realm
can change a balancewithdraw stops
burning, and therefore undelegated-GNS collection, without stopping delegationTotalSupply at proposal creation and includes
launchpad-held issuance; see governance for how the stored
quorum amount is appliedPackage xgns implements the GRC20-compliant xGNS token that represents staked GNS. It manages balances, total supply, and the gov/staker-authorized mint and burn operations used by delegation and launchpad accounting.
xGNS does not maintain a separate voting-power ledger. Governance and gov/staker read xGNS balances and supply, then apply delegation history and proposal rules outside this package.
BalanceOf returns token balance for address.
Parameters:
Returns:
Burn burns tokens from an address.
Parameters:
Only callable by governance staker contract.
Mint mints tokens to an address.
Parameters:
Only callable by governance staker contract.
Render returns a formatted representation of the token state.
Parameters:
Returns:
SupplyInfo returns supply breakdown information.
Returns:
TotalSupply returns the total supply of xGNS tokens.
Returns: