AccumulateDistributedInfo
Command
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.AccumulateDistributedInfo()"
Result
Package emission manages GNS token emission and distribution for GnoSwap. The emission system controls creation and distribution of new GNS tokens with a deflationary model featuring periodic halvings over 12 years. Emission Schedule: - Year 1-2: 100% emission rate (225,000,000 GNS/year) - Year 3-4: 50% emission rate (112,500,000 GNS/year) - Year 5-6: 25% emission rate (56,250,000 GNS/year) - Year 7-8: 12.5% emission rate (28,125,000 GNS/year) - Year 9-12: 6.25% emission rate (14,062,500 GNS/year) Distribution Targets (configurable via governance): - LIQUIDITY\_STAKER: Rewards for LP providers (default 75%) - DEVOPS: Development and operations fund (default 20%) - COMMUNITY\_POOL: Community-governed treasury (default 5%) - GOV\_STAKER: GNS staking rewards (default 0%) Key Functions: - MintAndDistributeGns: Mints and distributes GNS per emission schedule - SetDistributionStartTime: One-time setup of emission start timestamp - ChangeDistributionPct: Updates distribution percentages - ClearDistributedToStaker/GovStaker: Resets pending distribution amounts
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.AccumulateDistributedInfo()"
ChangeDistributionPct changes distribution percentages for emission targets. This function redistributes how newly minted GNS tokens are allocated across protocol components. Before applying new ratios, it distributes any accumulated emissions using the current ratios, ensuring emissions are distributed according to the ratios in effect when they were generated. This prevents retroactive application of new ratios to past emissions. Parameters: - target01-04: Target identifiers (1=LIQUIDITY\_STAKER, 2=DEVOPS, 3=COMMUNITY\_POOL, 4=GOV\_STAKER) - pct01-04: Percentage in basis points (100 = 1%, 10000 = 100%) Requirements: - All four targets must be specified (use current values if unchanged) - Percentages must sum to exactly 10000 (100%) - Each percentage must be 0-10000 - Targets must be unique (no duplicates) Example: ChangeDistributionPct( 1, 7000, // 70% to liquidity stakers 2, 2000, // 20% to devops 3, 1000, // 10% to community pool 4, 0 // 0% to governance stakers ) Only callable by admin or governance.
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "ChangeDistributionPct" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "ChangeDistributionPct" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
ClearDistributedToGovStaker resets the pending distribution amount for governance stakers. Only callable by governance staker contract.
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "ClearDistributedToGovStaker" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "ClearDistributedToGovStaker" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
ClearDistributedToStaker resets the pending distribution amount for liquidity stakers. Only callable by staker contract.
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "ClearDistributedToStaker" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "ClearDistributedToStaker" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
GetAccuDistributedToCommunityPool returns the total historical GNS distributed to Community Pool.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetAccuDistributedToCommunityPool()"
GetAccuDistributedToDevOps returns the total historical GNS distributed to DevOps.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetAccuDistributedToDevOps()"
GetAccuDistributedToGovStaker returns the total historical GNS distributed to governance stakers.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetAccuDistributedToGovStaker()"
GetAccuDistributedToStaker returns the total historical GNS distributed to liquidity stakers.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetAccuDistributedToStaker()"
GetAllDistributionBpsPct returns all distribution percentages in basis points.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetAllDistributionBpsPct()"
GetDistributableAmount returns distribution amounts by target and the remainder. If timestamp is outside the distribution window, it returns an empty map and the full amount as left.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetDistributableAmount(,)"
GetDistributedToCommunityPool returns the amount of GNS distributed to Community Pool.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetDistributedToCommunityPool()"
GetDistributedToDevOps returns accumulated GNS for DevOps.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetDistributedToDevOps()"
GetDistributedToGovStaker returns the amount of GNS distributed to governance stakers since last clear.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetDistributedToGovStaker()"
GetDistributedToStaker returns pending GNS for liquidity stakers.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetDistributedToStaker()"
GetDistributionBpsPct returns the distribution percentage in basis points for a specific target.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetDistributionBpsPct()"
GetDistributionEndTimestamp returns the timestamp when emission distribution ends. Returns 0 if distribution has not been started yet.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetDistributionEndTimestamp()"
GetDistributionStartTimestamp returns the timestamp when emission distribution started. Returns 0 if distribution has not been started yet.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetDistributionStartTimestamp()"
GetEmissionAmountPerSecondBy returns the emission amount per second for a given timestamp and distribution percentage.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetEmissionAmountPerSecondBy(,)"
GetLastExecutedTimestamp returns the timestamp of the last emission distribution execution.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetLastExecutedTimestamp()"
GetLeftGNSAmount returns the amount of undistributed GNS tokens from previous distributions.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetLeftGNSAmount()"
GetStakerEmissionAmountPerSecond returns the current per-second emission amount allocated to liquidity stakers.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetStakerEmissionAmountPerSecond()"
GetStakerEmissionAmountPerSecondInRange returns emission amounts allocated to liquidity stakers for a time range.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetStakerEmissionAmountPerSecondInRange(,)"
GetTotalAccuDistributed returns the total accumulated distributed GNS amount.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetTotalAccuDistributed()"
GetTotalDistributed returns the total pending distributed GNS amount.
gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/emission.GetTotalDistributed()"
MintAndDistributeGns mints and distributes GNS tokens according to the emission schedule. This function is called automatically by protocol contracts during user interactions to trigger periodic GNS emission. It mints new tokens based on elapsed time since last distribution and distributes them to predefined targets (staker, devops, etc.). Returns: - int64: Total amount of GNS distributed in this call Note: Distribution only occurs if start timestamp is set and reached. Any undistributed tokens from previous calls are carried forward.
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "MintAndDistributeGns" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "MintAndDistributeGns" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
SetDistributionStartTime sets the timestamp when emission distribution starts. This function controls when GNS emission begins. Once set and reached, the protocol starts minting GNS tokens according to the emission schedule. The timestamp can only be set before distribution starts - it becomes immutable once active. Parameters: - startTimestamp: Unix timestamp when emission should begin Requirements: - Must be called before distribution starts (one-time setup) - Timestamp must be in the future - Cannot be negative Effects: - Sets global distribution start time - Initializes GNS emission state if not already started - Emission begins automatically when timestamp is reached Only callable by admin or governance.
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "SetDistributionStartTime" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "SetDistributionStartTime" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
SetOnDistributionPctChangeCallback sets a callback function to be called when distribution percentages change. This allows external contracts (like staker) to update their internal caches when governance changes emission rates. Only callable by the staker contract.
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "SetOnDistributionPctChangeCallback" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/emission" -func "SetOnDistributionPctChangeCallback" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx