Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Preaudit #465

Draft
wants to merge 20 commits into
base: init
Choose a base branch
from
Draft

WIP Preaudit #465

wants to merge 20 commits into from

Conversation

moul
Copy link

@moul moul commented Jan 18, 2025

DO NOT MERGE.

This PR allows reviewers to make inline comments on the current codebase in a single location.

Suggested process:

  1. Some members of the core team will review and provide comments, focusing on the most important points, but we won't limit ourselves for now.
  2. We will hold a brainstorming meeting between Onbloc engineers and the reviewers to discuss the comments and identify quick wins that will maximize positive impact with minimal changes.
  3. Profit.

Since this PR is in the main repository and compatible with the main branch, we can expect upcoming changes to be applied to this branch as well. However, please, @dongwon8247, provide us with visibility on what changes to expect and any insights you have on the agenda. I believe most of our feedback will be high-level and still relevant, so I'm fine starting now and reviewing it again after your merges.

)

var (
positions = avl.NewTree() // tokenId[uint64] -> Position
Copy link
Author

@moul moul Jan 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
positions = avl.NewTree() // tokenId[uint64] -> Position
positions = avl.NewTree() // positionID[uint64] -> Position

TokenID is confusing and implies a mapping of denom to number, while it should represent position to number.

h/t @jaekwon

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to have smaller realms by locating such helpers in a p/gnoswap/math package.

@dongwon8247
Copy link
Member

dongwon8247 commented Jan 20, 2025

@moul Please refer to #470 for the expected remaining tasks, and please let us know your thoughts on #471, if you have any 🙏.

@onlyhyde will provide a review guide in the comments below to assist you and your team in navigating and reviewing the codebase effectively.

r3v4s and others added 8 commits January 20, 2025 18:45
* feat: manage accumulated protocol_fee list
* feat: `pool` adds token(+amount) to protocol_fee
* feat: `router` adds token(+amount) to protocol_fee
* feat: `staker` adds token(+amount) to protocol_fee
* fix: amount and balance checking

---------

Co-authored-by: Dongwon <[email protected]>
Co-authored-by: Lee ByeongJun <[email protected]>
* demo: referral

* update considerations

* remove unused

* global getter

* update getter

* time guard
* add reward ratio calculation

* reward ratio logic works

* prototyping

* remove unncesary comments

* callback: emission

* warmup works

* save

* warmup with test works

* add reward ratio calculation

* reward ratio logic works

* warmup works

* warmup with test works

* external reward WIP

* add callbacks

* test works

* remove unused code

* rename

* prototyping

* remove unncesary comments

* callback: emission

* save

* add callbacks

* test works

* remove unused code

* rename

* internal + emission working

* fix: emission callback panic issue

* fix: callbackStakerEmissionChange is nil

* emission change applied works

* external reward works

* fix emission

* external unclaimable works

* test: full test

* fix modifyDeposit

* test: full test update

* fix

* fix

* test : test code update

* fix : pool tier

* fix: full test // wip

* fix: missing init // by @mconcat

* fix: full test // wip

* fix: nil error when pool has only external incentive

* fix: external incentive is not being calculated

* fix: full test // most of tc runs good, reward amount seems ok // wip

* fix: full test // emission reward comparing

* fix: check amount with error range 99.99%

* fix: every test functino to check gns balance (and external reward amount if necessary)

* chore: rename

* test(fix): __TEST_more_01

* test(fix): __TEST_more_02

* test(fix): __TEST_more_04

* test(fix): fix test cases

* fix: when collecting reward, unwrapping should be supported for ugnot coin

* chore: rename

* update canonical env

* fix callback nil

* test(fix): external gnoA

* test(fix): staker full test with all reward calculated

* chore

* test(fix): adjust deposit amount (co-author: @mconcat)

* test(fix): fix internal gnoA

* test(fix): fix test

* add comments, remove unused code

* test(feat): pool with internal reward + external gns

* test(chore): remove duplicated scenario

* remove unnecesary comment

* reimplement api.gno

* feat: remove unused cross (co-author: @mconcat)

* fix: `ApiGetRewardTokens()` not to early return

* remove debug lines

* remove unused lines

* resolve TODOs

* readme wip

* readme

* readme

* readme

---------

Co-authored-by: Lee ByeongJun <[email protected]>
Co-authored-by: 0xTopaz <[email protected]>
Co-authored-by: n3wbie <[email protected]>
* chore: remove function prefix from panic msg

* save

* save

* test: reward handler

* feat: deposit handler

* fix error

* reward distributor

* update test

* update docs

* fix

* refactor deposit, launchpad, reward

* reduce type size

* fix rpc

* refactor: error message

* fix

* fix

* test: json builder

* update deposit test

* test: reward

* fix

* add launchpad new logic

* catch compile errors

* fix: weird interface nil error

* refactor: reward empty

* fix: when collecting deposit, check claimable Time
(not ended height)

* test: fix

* test: fix MultipleDeposit

* test: fix TestValidateRewardCollection
- no such error

* resolved some comments

* remove  unnecessary things

* remove unnecessary json builder functuion

* refactor: event message

* update launchpad test

* fix: reward_calculation

* remove dummy_test file

* additional refactor for `CreateProject`

* fix: prevent throwing nil deref error in `CollectRewardByProjectId`

* validate json creation

* save

* fix fee protocol

* remove: token register

* fix compile error for reward03 test

* paritally fix: `CollectRewardByProjectId` -- update `RewardState`

* fix

* refactor: clean code and add comments for functions

* test: reward calculation

* update reward test

* refactor: deposit refactoring

* refactor: create project

* refactor: deposit

* refactor: reward by projectId

* refactor: deposit and reward

* refactor: left reward

* refactor: reward test

* refactor: move test code into test folder

* refactor: remove unused code

* chore: remove some comments

* chore: remove comments

* remove: hard-coded string

* remove: invalid comments

* fix: check duplicate collect gns

---------

Co-authored-by: 0xTopaz <[email protected]>
Co-authored-by: mconcat <[email protected]>
Co-authored-by: n3wbie <[email protected]>
* test(fix): filetests
Adding links to docs
@moul
Copy link
Author

moul commented Jan 20, 2025

cherry-picked the latest commits from master.

Comment on lines 28 to 41
type FooToken struct{}

func (FooToken) Transfer() func(to pusers.AddressOrName, amount uint64) {
return foo.Transfer
}
func (FooToken) TransferFrom() func(from, to pusers.AddressOrName, amount uint64) {
return foo.TransferFrom
}
func (FooToken) BalanceOf() func(owner pusers.AddressOrName) uint64 {
return foo.BalanceOf
}
func (FooToken) Approve() func(spender pusers.AddressOrName, amount uint64) {
return foo.Approve
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can probably simplify this file by making a token wrapper and then wrapping once per token,

Copy link
Member

@r3v4s r3v4s Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just removed this register_gnodev realm.

FYI, it's something that we used to support multiple grc20 token before grc20reg comes in.

"gno.land/p/demo/grc/grc20"
"gno.land/p/demo/ownable"
"gno.land/p/demo/ufmt"
pusers "gno.land/p/demo/users"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how much do you want username-based transfers?
I'm currently considering to encourage contracts to not care while we expect wallets and gnoweb to be able to perform lookups. This could make all your contracts simpler, only manipulating addresses.

Copy link
Member

@r3v4s r3v4s Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If wallets(adena or gnokey) and gnoweb does perform lookups, We really like to handle only std.Address which makes contracts simpler(same as your thought) and may be cheaper gas.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we can resolve this conversation.
gnolang/gno#3580 has been merged.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can probably reuse an already existing p/ library or move this in a p/ so that r/ is more focused on the logic that can change while "math" is just about pure helpers.

@onlyhyde
Copy link
Member

onlyhyde commented Jan 20, 2025

├── p
│   └── gnoswap
│   ├── gnsmath :
│   ├── int256 :
│  
└── r
└── gnoswap
├── common :
├── community_pool :
├── consts :
├── emission :
├── gnft :
├── gns :
├── gov :
│   ├── governance :
│   ├── staker :
│   └── xgns :
├── launchpad
├── pool
├── position
├── protocol_fee
├── referral
├── router
├── staker
└── test_token :
├── bar
├── baz
├── foo
├── obl
├── qux
└── usdc

review guide

  • Here's a brief description of contracts and their key features. Below is a categorization of contract types. contract is recommended to be viewed as follows, considering the relationship between contracts.
  1. pool -> gnsmath->position ->gnft-> router -> gns -> emission -> staker->communityPool
  2. Governance -> xGNS -> Staker -> Protocol_fee -> Launchpad
  3. etc
  • Contracts
    • Defi
      • Pool
        • Manages all pools in gnoswap. Supports pool creation, depositing/withdrawing assets to/from pools, and swapping
        • Pool Management (pool.gno, pool_manager.gno)
        • Swaps (swap.gno)
        • Liquidity (liquidity_math.gno)
        • Fee related (protocol_fee_*.gno)
      • Position
        • position manages liquidity.
        • Mint & Add Liquidity: Create a new position or add liquidity to an existing position
        • Decrease Liquidity: removes some/all liquidity from a position
        • Manage fees (CollectFee): Collect accrued fees
      • Router
        • Support for Swap. The actual swap is a swap of pools, where Router is the entrypoint function for transactions to enter. Calling Router's ExactInSwapRoute and ExactOutSwapRoute functions will call the pool's swap, allowing assets to be exchanged.
      • Staker
        • Stakers help you earn rewards by staking LP tokens. There are two types of rewards: internal emission reward (gns reward) and external incentive reward. Reward payment targets are positions that exist in the In-Range section, and the final reward is determined by applying a warm-up according to the period of stake. (https://docs.gnoswap.io/references/warm-up-periods)
    • Gov
      • Governance : Support for governance features. You can create proposals, vote, perform results, cancel, etc.
      • Staker : Supports GNS deposits/withdrawals and subsequent minting/burning of xGNS. xGNS is issued 1:1 with GNS, and minting is performed when GNS is deposited to a staker.
    • Launchpad : Manage Launchpad participating projects, tiers, and deposits. There are three tiers per project (30, 90, 180). Deposited assets cannot be withdrawn until the end of the tier, and rewards can be claimed at any time once the claimable height is passed. GNS deposited in launchpad mint xGNS the same as gov's stakers and receive the same rewards as xGNS holders. However, they do not have voting rights in governance.
    • Token
      • gns : grc20 token contract. GNS for reward is minted by emission. The quantity to mint is determined by the calculateAmountToMint function of gns.
      • gnft : LP tokens (NFTs) that prove you've provided liquidity to the pool. It is related to the position contract and staker contract.
      • xgns : xGNS is a token that represents voting rights in governance and does not support transfers.
    • Utils
      • int256(package, p/gnoswap/int256) : int256 type support
      • uint256(package, p/gnoswap/uint256) : uint256 type support
      • gnsmath : Math functions used by pool contracts
      • common : A collection of features that are common across gnoswap contracts (access, math, utils,,)
      • consts : constant support
      • referral : Contracts for managing referrals. Referral is an optional feature of Gnoswap service that allows you to include a referral code (referrer's address) when performing a swap, mint, deposit, etc. and register the address as your referral code. If you do not use a referral code, enter an empty value as input, such as “”, and use the zero address to delete the registered referral code. Currently, the referral contract exists, but the parts used by other contracts need to be implemented further.
    • Reward/fee
      • emission : Requests GNS contracts to be minted and is responsible for distributing minted GNS to payees. When there is a change in the quantity of GNS minted per block from GNS, it delivers the value to the staker through the callback function. The delivered value is used to calculate the reward to be distributed to LP Tokens staked in the staker contract.
      • community_pool : Rewards accumulated in the community_pool by governance vote or admin to users
      • protocol_fee : When a withdrawal is made, a certain percentage of the amount withdrawn is collected as a fee, which is accumulated in protocol_fee. The assets accumulated in Protocol_fee are distributed to xGNS holders.
    • test token
      • bar, baz, foo, obl, qux, usdc

Comment on lines 56 to 70
func GetName() string {
return Token.GetName()
}

func GetSymbol() string {
return Token.GetSymbol()
}

func GetDecimals() uint {
return Token.GetDecimals()
}

func TotalSupply() uint64 {
return Token.TotalSupply()
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is optional since the Token is exposed.

Copy link
Member

@onlyhyde onlyhyde Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above functions are needed for external 3rd parties to learn the name of our contract later, or to get TotalSupply.

Comment on lines 76 to 85
func BalanceOfAddress(owner std.Address) uint64 {
common.AssertValidAddr(owner)
return Token.BalanceOf(owner)
}

func AllowanceOfAddress(owner, spender std.Address) uint64 {
common.AssertValidAddr(owner)
common.AssertValidAddr(spender)
return Token.Allowance(owner, spender)
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems you should just expose the UserTeller, which has, if I'm not mistaken, the same checks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing pr
#482

moul added 2 commits January 21, 2025 14:53
Comment on lines 139 to 152
// EMISSION
// TODO:
// This is a temporary solution to prevent the emission from being refactored.
// 1. After refactoring, remove this var
var (
EMISSION_REFACTORED bool = true
)

func setEmissionRefactored(value bool) {
caller := std.PrevRealm().Addr()
if caller == ADMIN {
EMISSION_REFACTORED = value
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suggest that you move all of the real consts under p/gnoswap/consts

and rename this last non-constant part into r/gnoswap/config

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you suggested, consts were moved to p and unused functions were deleted.
#486

func init() {
gns.SetCallbackEmissionChange(callbackEmissionChange)
}

Copy link
Author

@moul moul Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sharing personal notes if it can help other reviewers

# imports
 staker imports emission
 emission imports gns
 
# calls
 staker.init -> emission.SetCallbackStakerEmissionChange(callbackStakerEmissionChange)
 emission.init -> gns.SetCallbackEmissionChange(callbackEmissionChange)
 emission.callbackEmissionChange -> callbackStakerEmissionChange
 gns.setAvgBlockTimeInMs -> callbackEmissionChange
# grep 'callback'
contract/r/gnoswap/emission/callback.gno:     func SetCallbackStakerEmissionChange(callback func(amount uint64)) {
contract/r/gnoswap/emission/callback.gno:     func callbackEmissionChange(amount uint64) {
contract/r/gnoswap/emission/callback.gno:     callbackStakerEmissionChange(calculateAmount(amount, GetDistributionBpsPct(LIQUIDITY_STAKER)))
contract/r/gnoswap/emission/callback.gno:     gns.SetCallbackEmissionChange(callbackEmissionChange)
contract/r/gnoswap/emission/distribution.gno: callbackStakerEmissionChange(calculateAmount(gns.GetEmission(), pct))
contract/r/gnoswap/gns/halving.gno:           func SetCallbackEmissionChange(callback func(amount uint64)) {
contract/r/gnoswap/gns/halving.gno:           callbackEmissionChange(adjustedAmountPerBlock)
contract/r/gnoswap/staker/callback.gno:       func callbackStakerEmissionChange(emission uint64) {
contract/r/gnoswap/staker/staker.gno:         en.SetCallbackStakerEmissionChange(callbackStakerEmissionChange)

Copy link
Member

@onlyhyde onlyhyde Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to contract deployment issues, we made the following changes

staker.init -> emission.SetCallbackStakerEmissionChange(callbackStakerEmissionChange)
emission.RegisterGnsChangeCallback()

emission.RegisterGnsChangeCallback -> gns.SetCallbackEmissionChange(callbackEmissionChange)

@moul
Copy link
Author

moul commented Jan 23, 2025

EDIT: check next comment for output without test files.

gno mod graph . | go run golang.org/x/exp/cmd/modgraphviz@latest | dot -Tsvg -o graph.svg

graph


gno mod graph . | grep -v /p/ | grep -v /r/onbloc | grep -v /r/demo | go run golang.org/x/exp/cmd/modgraphviz@latest | dot -Tsvg -o graph2.svg

graph2


gno mod graph . | grep -v /p/ | grep -v /r/onbloc | grep -v /r/demo | grep -v /r/gnoswap/v1/consts | grep -v /r/gnoswap/v1/common | go run golang.org/x/exp/cmd/modgraphviz@latest | dot -Tsvg -o graph3.svg

graph3


Depends on gnolang/gno#3588

@moul
Copy link
Author

moul commented Jan 23, 2025

Deps when ignoring test files (more useful):

graph
graph2
graph3

// Called when per-block emission is changed from the gns side.
// It does not process non-immediate emission changes, such as halving.
func callbackEmissionChange(amount uint64) {
callbackStakerEmissionChange(calculateAmount(amount, GetDistributionBpsPct(LIQUIDITY_STAKER)))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first usage of callbackStakerEmissionChange, triggered by gns.setAvgBlockTimeInMs (called by admin or DAO).

}

if oldPct.(uint64) != pct {
callbackStakerEmissionChange(calculateAmount(gns.GetEmission(), pct))
Copy link
Author

@moul moul Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second usage of callbackStakerEmissionChange is triggered by ChangeDistributionPct, which can be called by the admin or DAO.

This makes me feel that the automatic system triggered by gns (first usage) and creating this dependency spaghetti can be easily overridden by a direct emission change. Why not simplify things by removing the dependency spaghetti and allowing the DAO to apply changes? I don't see how having an automatic system, which is still triggered by a DAO or admin, makes Gnoswap safer for the end user.

distributedToGovStaker = 0
}

func setDistributionBpsPct(target int, pct uint64) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need some code comments or documentation to explain the logic here.

leohhhn pushed a commit to gnolang/gno that referenced this pull request Jan 23, 2025
## Description

To make contracts more simpler(and low computation for execution), it is
better for contract to manipulate with only `std.Address` rather than
using `users.AddressOrName` and resolving it. ([Discussed with
@moul](gnoswap-labs/gnoswap#465 (comment)))

Clients such as gnoeky, gnoweb or adena should perform look up(convert
username to address) and pass address value to contract.
stefann-01 pushed a commit to stefann-01/gno that referenced this pull request Jan 24, 2025
## Description

To make contracts more simpler(and low computation for execution), it is
better for contract to manipulate with only `std.Address` rather than
using `users.AddressOrName` and resolving it. ([Discussed with
@moul](gnoswap-labs/gnoswap#465 (comment)))

Clients such as gnoeky, gnoweb or adena should perform look up(convert
username to address) and pass address value to contract.
r3v4s and others added 4 commits January 24, 2025 11:14
* feat: use std.Address (rather then users.AddressOrName)
* refactor: event message change
* refactor: staker event
* refactor: staker and gns event update

---------

Co-authored-by: Dongwon <[email protected]>
* refactor: remove unused code
* refactor: move consts from r to p
@moul
Copy link
Author

moul commented Jan 24, 2025

cherry-picked the latest commits from main.

@moul
Copy link
Author

moul commented Jan 24, 2025

Graph updates after recents commits:

graph
graph2
graph3

Comment on lines +20 to +29
func GetHalt() bool {
return halted
}

// IsHalted checks if the GnoSwap is currently halted.
// If the GnoSwap is halted, the function panics with an errHalted error.
//
// Panics:
// - If the halted flag is true, indicating that the GnoSwap is inactive.
func IsHalted() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func GetHalt() bool {
return halted
}
// IsHalted checks if the GnoSwap is currently halted.
// If the GnoSwap is halted, the function panics with an errHalted error.
//
// Panics:
// - If the halted flag is true, indicating that the GnoSwap is inactive.
func IsHalted() {
func IsHalted() bool {
return halted
}
// IsHalted checks if the GnoSwap is currently halted.
// If the GnoSwap is halted, the function panics with an errHalted error.
//
// Panics:
// - If the halted flag is true, indicating that the GnoSwap is inactive.
func AssertHalted() {

Comment on lines +33 to +42
caller := getPrevAddr()
if err := AdminOnly(caller); err != nil {
panic(newErrorWithDetail(
errNoPermission,
ufmt.Sprintf(
"only Admin can set halt, called from %s",
caller,
)),
)
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
caller := getPrevAddr()
if err := AdminOnly(caller); err != nil {
panic(newErrorWithDetail(
errNoPermission,
ufmt.Sprintf(
"only Admin can set halt, called from %s",
caller,
)),
)
}
assertIsAdmin()

Comment on lines +71 to +81
caller := getPrevAddr()
if err := GovernanceOnly(caller); err != nil {
panic(newErrorWithDetail(
errNoPermission,
ufmt.Sprintf(
"only governance(%s) can set halt, called from %s",
consts.GOV_GOVERNANCE_ADDR,
caller,
),
))
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think that you should globally just use assertIsXXX helpers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i aggree with you. i'll update it

Copy link

@aeddi aeddi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just quickly reviewed the package part. Overall, I think it could be a big help for the reviewers to add more comments (at least on global variables, exported functions, etc.), to consolidate what can be consolidated (helpers, errors, constants, etc.), and to be more consistent in naming (variables, functions, etc.).

Good luck with your audit, guys!

Comment on lines +120 to +131
// TIMESTAMP & DAY
const (
SECOND_IN_MILLISECOND = 1000

// in seconds
TIMESTAMP_MINUTE = 60
TIMESTAMP_HOUR = 3600
TIMESTAMP_DAY = 86400
TIMESTAMP_YEAR = 31536000

DAY_PER_YEAR = 365
)
Copy link

@aeddi aeddi Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timestamp is not the right word as these are duration and It would be better to choose a formulation (e.g., DAYS_PER_YEAR) and adapt it for all the values above (MILLISECONDS_PER_SECOND, SECONDS_PER_MINUTE, etc.).

Like this:

// Time equivalence in different units
const (
	MILLISECONDS_PER_SECOND = 1000

	SECONDS_PER_MINUTE = 60
	SECONDS_PER_HOUR   = 3600
	SECONDS_PER_DAY    = 86400
	SECONDS_PER_YEAR   = 31536000

	DAYS_PER_YEAR = 365
)

"std"
)

// GNOSWAP SERVICE
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The casing of the comments in this file is inconsistent.

@@ -0,0 +1,16 @@
package gnsmath

const (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these constants defined in duplicate? (see file contract/p/gnoswap/consts/consts.gno)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gnsmath is package that we're willing to isolated,
@notJoon is working on refactor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some duplication is occasionally necessary. The gnsmath package must be created to have minimal dependencies with other packages except for p/demo or stdlib when possible.

"testing"
)

func shouldEQ(t *testing.T, got, expected interface{}) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with functions below

Suggested change
func shouldEQ(t *testing.T, got, expected interface{}) {
func shouldEqual(t *testing.T, got, expected interface{}) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have usassert and urequire in the standard examples

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I didn't know that, yes that's even better.

Copy link
Member

@notJoon notJoon Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the _helper_test file has been removed, and it has been modified to use uassert now. I think all comments related to this have been addressed.

https://github.com/gnoswap-labs/gnoswap/blob/00011ea7fb724ad21cc8f7747ea6883913999349/contract/p/gnoswap/gnsmath/bit_math_test.gno

}
}

func shouldNEQ(t *testing.T, got, expected interface{}) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with functions below

Suggested change
func shouldNEQ(t *testing.T, got, expected interface{}) {
func shouldNotEqual(t *testing.T, got, expected interface{}) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aeddi I had to double take your comment

We can simplify this even more, by extracting the comparison to the caller and letting the caller decide. This way we can unify the shouldEQ and shouldNEQ into just func equals bool. The best option is to just use uassert and urequire

u256 "gno.land/p/gnoswap/uint256"
)

var (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these rather be constants?

Copy link
Member

@notJoon notJoon Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

const (
Q96_RESOLUTION uint = 96
Q160_RESOLUTION uint = 160
)

"gno.land/p/gnoswap/uint256"
)

var one = uint256.NewUint(1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the point of this var?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint256.NewUint(1) value is commonly used in int256 package, variable is to avoid declaring it every time.

"testing"
)

func shouldEQ(t *testing.T, got, expected interface{}) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these functions duplicated in several packages?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is old helper function, we'll use uassert or urequire.


package uint256

const ntz8tab = "" +
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment to explain the point of this file and constants?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@notJoon Could you explain it please

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed #490

)

const (
MAX_UINT256 = "115792089237316195423570985008687907853269984665640564039457584007913129639935"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate

@@ -0,0 +1,118 @@
package launchpad
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON handling will eventually be managed by the chain, allowing most contracts to be significantly simplified by removing all contract-side JSON management (boilerplate).

For this audit, one option is to move JSON into a dedicated package, but this may complicate matters. Therefore, I suggest centralizing all JSON elements in a single file (for each package) and adding a comment for the auditor. This comment should explain that this part is temporary, will be removed, and can ultimately be skipped from the audit or managed as a lower priority.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To simplify the review, I suggest organizing a few things by category. I'm particularly interested in having a:

  • types.gno file containing all type structs, type interfaces, other types, errors, and constants.
  • render.gno file with everything related to rendering, which should be considered "readonly."
  • queries.gno file with all front-facing methods intended for use in readonly mode with q_query.
  • json.gno file if you have anything related to JSON.
  • txs.gno file with all front-facing methods intended for use in write mode through a transaction.
  • Finally, you can organize the rest of the code into files that make sense.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a general comment, not just for this launchpad.

@zivkovicmilos
Copy link

Started reviewing 🤞

@zivkovicmilos
Copy link

@onlyhyde @dongwon8247

We need exponentially more txtars (integration tests) for key functionality (high level calls that would simulate the user)

@moul
Copy link
Author

moul commented Jan 27, 2025

If it helps, I created another listing to assist me during my review. It includes all the exposed variables (mixed with constants), functions, and types.

p/gnoswap/consts/consts.gno: var ADMIN std.Address = "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d"
p/gnoswap/consts/consts.gno: var DEV_OPS std.Address = "g1mjvd83nnjee3z2g7683er55me9f09688pd4mj9"
p/gnoswap/consts/consts.gno: var TOKEN_REGISTER std.Address = "g1er355fkjksqpdtwmhf5penwa82p0rhqxkkyhk5"
p/gnoswap/consts/consts.gno: var TOKEN_REGISTER_NAMESPACE string = "gno.land/r/g1er355fkjksqpdtwmhf5penwa82p0rhqxkkyhk5"
p/gnoswap/consts/consts.gno: var BLOCK_GENERATION_INTERVAL int64 = 2
p/gnoswap/consts/consts.gno: var GNOT string = "gnot"
p/gnoswap/consts/consts.gno: var UGNOT string = "ugnot"
p/gnoswap/consts/consts.gno: var WRAPPED_WUGNOT string = "gno.land/r/demo/wugnot"
p/gnoswap/consts/consts.gno: var UGNOT_MIN_DEPOSIT_TO_WRAP uint64 = 1000
p/gnoswap/consts/consts.gno: var POOL_PATH string = "gno.land/r/gnoswap/v1/pool"
p/gnoswap/consts/consts.gno: var POOL_ADDR std.Address = "g148tjamj80yyrm309z7rk690an22thd2l3z8ank"
p/gnoswap/consts/consts.gno: var POSITION_PATH string = "gno.land/r/gnoswap/v1/position"
p/gnoswap/consts/consts.gno: var POSITION_ADDR std.Address = "g1q646ctzhvn60v492x8ucvyqnrj2w30cwh6efk5"
p/gnoswap/consts/consts.gno: var ROUTER_PATH string = "gno.land/r/gnoswap/v1/router"
p/gnoswap/consts/consts.gno: var ROUTER_ADDR std.Address = "g1lm2l7tf49h3mykesct7rhfml30yx8dw5xrval7"
p/gnoswap/consts/consts.gno: var STAKER_PATH string = "gno.land/r/gnoswap/v1/staker"
p/gnoswap/consts/consts.gno: var STAKER_ADDR std.Address = "g1cceshmzzlmrh7rr3z30j2t5mrvsq9yccysw9nu"
p/gnoswap/consts/consts.gno: var GNS_PATH string = "gno.land/r/gnoswap/v1/gns"
p/gnoswap/consts/consts.gno: var GNS_ADDR std.Address = "g1jgqwaa2le3yr63d533fj785qkjspumzv22ys5m"
p/gnoswap/consts/consts.gno: var GNFT_PATH string = "gno.land/r/gnoswap/v1/gnft"
p/gnoswap/consts/consts.gno: var GNFT_ADDR std.Address = "g1wxv2rdfn53qc84nt3nn646f9yh3nly8lm7j89t"
p/gnoswap/consts/consts.gno: var WUGNOT_PATH string = "gno.land/r/demo/wugnot"
p/gnoswap/consts/consts.gno: var WUGNOT_ADDR std.Address = "g1pf6dv9fjk3rn0m4jjcne306ga4he3mzmupfjl6"
p/gnoswap/consts/consts.gno: var EMISSION_PATH string = "gno.land/r/gnoswap/v1/emission"
p/gnoswap/consts/consts.gno: var EMISSION_ADDR std.Address = "g10xg6559w9e93zfttlhvdmaaa0er3zewcr7nh20"
p/gnoswap/consts/consts.gno: var PROTOCOL_FEE_PATH string = "gno.land/r/gnoswap/v1/protocol_fee"
p/gnoswap/consts/consts.gno: var PROTOCOL_FEE_ADDR std.Address = "g1f7wpek7q67tkns27sw495u5yuu3a5wwjxw5l6l"
p/gnoswap/consts/consts.gno: var COMMUNITY_POOL_PATH string = "gno.land/r/gnoswap/v1/community_pool"
p/gnoswap/consts/consts.gno: var COMMUNITY_POOL_ADDR std.Address = "g100fnnlz5eh87p5hvwt8pf279lxaelm8k8md049"
p/gnoswap/consts/consts.gno: var GOV_XGNS_PATH string = "gno.land/r/gnoswap/v1/gov/xgns"
p/gnoswap/consts/consts.gno: var GOV_XGNS_ADDR std.Address = "g1wwh55uwzlz2zzr2qcvvxf83qhcvmx2t8779l9r"
p/gnoswap/consts/consts.gno: var GOV_STAKER_PATH string = "gno.land/r/gnoswap/v1/gov/staker"
p/gnoswap/consts/consts.gno: var GOV_STAKER_ADDR std.Address = "g17e3ykyqk9jmqe2y9wxe9zhep3p7cw56davjqwa"
p/gnoswap/consts/consts.gno: var GOV_GOVERNANCE_PATH string = "gno.land/r/gnoswap/v1/gov/governance"
p/gnoswap/consts/consts.gno: var GOV_GOVERNANCE_ADDR std.Address = "g17s8w2ve7k85fwfnrk59lmlhthkjdted8whvqxd"
p/gnoswap/consts/consts.gno: var COMMON_PATH string = "gno.land/r/gnoswap/v1/common"
p/gnoswap/consts/consts.gno: var COMMON_ADDR std.Address = "g14ytarn5u7h3xywygt8hzhs3m23frljz72ta9xk"
p/gnoswap/consts/consts.gno: var LAUNCHPAD_PATH string = "gno.land/r/gnoswap/v1/launchpad"
p/gnoswap/consts/consts.gno: var LAUNCHPAD_ADDR std.Address = "g122mau2lp2rc0scs8d27pkkuys4w54mdy2tuer3"
p/gnoswap/consts/consts.gno: var INIT_REGISTER_PATH string = "gno.land/r/g1er355fkjksqpdtwmhf5penwa82p0rhqxkkyhk5/v2/register_gnodev"
p/gnoswap/consts/consts.gno: var MAX_UINT8 string = "255"
p/gnoswap/consts/consts.gno: var UINT8_MAX uint8 = 255
p/gnoswap/consts/consts.gno: var MAX_UINT16 string = "65535"
p/gnoswap/consts/consts.gno: var UINT16_MAX uint16 = 65535
p/gnoswap/consts/consts.gno: var MAX_UINT32 string = "4294967295"
p/gnoswap/consts/consts.gno: var UINT32_MAX uint32 = 4294967295
p/gnoswap/consts/consts.gno: var MAX_UINT64 string = "18446744073709551615"
p/gnoswap/consts/consts.gno: var UINT64_MAX uint64 = 18446744073709551615
p/gnoswap/consts/consts.gno: var MAX_UINT128 string = "340282366920938463463374607431768211455"
p/gnoswap/consts/consts.gno: var MAX_UINT160 string = "1461501637330902918203684832716283019655932542975"
p/gnoswap/consts/consts.gno: var MAX_UINT256 string = "115792089237316195423570985008687907853269984665640564039457584007913129639935"
p/gnoswap/consts/consts.gno: var MAX_INT128 string = "170141183460469231731687303715884105727"
p/gnoswap/consts/consts.gno: var MAX_INT256 string = "57896044618658097711785492504343953926634992332820282019728792003956564819968"
p/gnoswap/consts/consts.gno: var MIN_TICK int32 = -887272
p/gnoswap/consts/consts.gno: var MAX_TICK int32 = 887272
p/gnoswap/consts/consts.gno: var MIN_SQRT_RATIO string = "4295128739"
p/gnoswap/consts/consts.gno: var MAX_SQRT_RATIO string = "1461446703485210103287273052203988822378723970342"
p/gnoswap/consts/consts.gno: var MIN_PRICE string = "4295128740"
p/gnoswap/consts/consts.gno: var MAX_PRICE string = "1461446703485210103287273052203988822378723970341"
p/gnoswap/consts/consts.gno: var Q64 string = "18446744073709551616"
p/gnoswap/consts/consts.gno: var Q96 string = "79228162514264337593543950336"
p/gnoswap/consts/consts.gno: var Q128 string = "340282366920938463463374607431768211456"
p/gnoswap/consts/consts.gno: var Q96_RESOLUTION uint = 96
p/gnoswap/consts/consts.gno: var Q128_RESOLUTION uint = 128
p/gnoswap/consts/consts.gno: var Q160_RESOLUTION uint = 160
p/gnoswap/consts/consts.gno: var SECOND_IN_MILLISECOND int = 1000
p/gnoswap/consts/consts.gno: var TIMESTAMP_MINUTE int = 60
p/gnoswap/consts/consts.gno: var TIMESTAMP_HOUR int = 3600
p/gnoswap/consts/consts.gno: var TIMESTAMP_DAY int = 86400
p/gnoswap/consts/consts.gno: var TIMESTAMP_YEAR int = 31536000
p/gnoswap/consts/consts.gno: var DAY_PER_YEAR int = 365
p/gnoswap/consts/consts.gno: var ZERO_ADDRESS std.Address = "g100000000000000000000000000000000dnmcnx"
p/gnoswap/gnsmath/bit_math.gno: func BitMathMostSignificantBit(x *u256.Uint) uint8
p/gnoswap/gnsmath/bit_math.gno: func BitMathLeastSignificantBit(x *u256.Uint) uint8
p/gnoswap/gnsmath/consts.gno: var MAX_UINT8 string = "255"
p/gnoswap/gnsmath/consts.gno: var MAX_UINT16 string = "65535"
p/gnoswap/gnsmath/consts.gno: var MAX_UINT32 string = "4294967295"
p/gnoswap/gnsmath/consts.gno: var MAX_UINT64 string = "18446744073709551615"
p/gnoswap/gnsmath/consts.gno: var MAX_UINT128 string = "340282366920938463463374607431768211455"
p/gnoswap/gnsmath/consts.gno: var MAX_UINT160 string = "1461501637330902918203684832716283019655932542975"
p/gnoswap/gnsmath/consts.gno: var MAX_UINT256 string = "115792089237316195423570985008687907853269984665640564039457584007913129639935"
p/gnoswap/gnsmath/consts.gno: var MAX_INT256 string = "57896044618658097711785492504343953926634992332820282019728792003956564819967"
p/gnoswap/gnsmath/consts.gno: var Q64 string = "18446744073709551616"
p/gnoswap/gnsmath/consts.gno: var Q96 string = "79228162514264337593543950336"
p/gnoswap/gnsmath/consts.gno: var Q128 string = "340282366920938463463374607431768211456"
p/gnoswap/gnsmath/sqrt_price_math.gno: var Q96_RESOLUTION = uint(96)
p/gnoswap/gnsmath/sqrt_price_math.gno: var Q160_RESOLUTION = uint(160)
p/gnoswap/gnsmath/sqrt_price_math.gno: func SqrtPriceMathGetAmount0DeltaStr(sqrtRatioAX96 *u256.Uint, sqrtRatioBX96 *u256.Uint, liquidity *i256.Int) string
p/gnoswap/gnsmath/sqrt_price_math.gno: func SqrtPriceMathGetAmount1DeltaStr(sqrtRatioAX96 *u256.Uint, sqrtRatioBX96 *u256.Uint, liquidity *i256.Int) string
p/gnoswap/gnsmath/swap_math.gno: func SwapMathComputeSwapStepStr(sqrtRatioCurrentX96 *u256.Uint, sqrtRatioTargetX96 *u256.Uint, liquidity *u256.Uint, amountRemaining *i256.Int, feePips uint64) string, string, string, string
p/gnoswap/int256/absolute.gno: func Abs() *uint256.Uint
p/gnoswap/int256/absolute.gno: func AbsGt(x *uint256.Uint) bool
p/gnoswap/int256/absolute.gno: func AbsLt(x *uint256.Uint) bool
p/gnoswap/int256/arithmetic.gno: func Add(x *Int, y *Int) *Int
p/gnoswap/int256/arithmetic.gno: func AddUint256(x *Int, y *uint256.Uint) *Int
p/gnoswap/int256/arithmetic.gno: func AddDelta(z *uint256.Uint, x *uint256.Uint, y *Int)
p/gnoswap/int256/arithmetic.gno: func AddDeltaOverflow(z *uint256.Uint, x *uint256.Uint, y *Int) bool
p/gnoswap/int256/arithmetic.gno: func Sub(x *Int, y *Int) *Int
p/gnoswap/int256/arithmetic.gno: func SubUint256(x *Int, y *uint256.Uint) *Int
p/gnoswap/int256/arithmetic.gno: func Mul(x *Int, y *Int) *Int
p/gnoswap/int256/arithmetic.gno: func MulUint256(x *Int, y *uint256.Uint) *Int
p/gnoswap/int256/arithmetic.gno: func Div(x *Int, y *Int) *Int
p/gnoswap/int256/arithmetic.gno: func DivUint256(x *Int, y *uint256.Uint) *Int
p/gnoswap/int256/arithmetic.gno: func Quo(x *Int, y *Int) *Int
p/gnoswap/int256/arithmetic.gno: func Rem(x *Int, y *Int) *Int
p/gnoswap/int256/arithmetic.gno: func Mod(x *Int, y *Int) *Int
p/gnoswap/int256/bitwise.gno: func Or(x *Int, y *Int) *Int
p/gnoswap/int256/bitwise.gno: func And(x *Int, y *Int) *Int
p/gnoswap/int256/bitwise.gno: func Rsh(x *Int, n uint) *Int
p/gnoswap/int256/bitwise.gno: func Lsh(x *Int, n uint) *Int
p/gnoswap/int256/cmp.gno: func Eq(x *Int) bool
p/gnoswap/int256/cmp.gno: func Neq(x *Int) bool
p/gnoswap/int256/cmp.gno: func Cmp(x *Int) r int
p/gnoswap/int256/cmp.gno: func IsZero() bool
p/gnoswap/int256/cmp.gno: func IsNeg() bool
p/gnoswap/int256/cmp.gno: func Lt(x *Int) bool
p/gnoswap/int256/cmp.gno: func Gt(x *Int) bool
p/gnoswap/int256/cmp.gno: func Clone() *Int
p/gnoswap/int256/conversion.gno: func SetInt64(x int64) *Int
p/gnoswap/int256/conversion.gno: func SetUint64(x uint64) *Int
p/gnoswap/int256/conversion.gno: func Uint64() uint64
p/gnoswap/int256/conversion.gno: func Int64() int64
p/gnoswap/int256/conversion.gno: func Neg(x *Int) *Int
p/gnoswap/int256/conversion.gno: func Set(x *Int) *Int
p/gnoswap/int256/conversion.gno: func SetUint256(x *uint256.Uint) *Int
p/gnoswap/int256/conversion.gno: func ToString() string
p/gnoswap/int256/int256.gno: type Int struct { abs *uint256.Uint; neg bool }
p/gnoswap/int256/int256.gno: func Zero() *Int
p/gnoswap/int256/int256.gno: func One() *Int
p/gnoswap/int256/int256.gno: func Sign() int
p/gnoswap/int256/int256.gno: func New() *Int
p/gnoswap/int256/int256.gno: func NewInt(x int64) *Int
p/gnoswap/int256/int256.gno: func FromDecimal(s string) *Int, error
p/gnoswap/int256/int256.gno: func MustFromDecimal(s string) *Int
p/gnoswap/int256/int256.gno: func SetString(s string) *Int, error
p/gnoswap/int256/int256.gno: func FromUint256(x *uint256.Uint) *Int
p/gnoswap/int256/int256.gno: func NilToZero() *Int
p/gnoswap/uint256/arithmetic.gno: func Add(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/arithmetic.gno: func AddOverflow(x *Uint, y *Uint) *Uint, bool
p/gnoswap/uint256/arithmetic.gno: func Sub(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/arithmetic.gno: func SubOverflow(x *Uint, y *Uint) *Uint, bool
p/gnoswap/uint256/arithmetic.gno: func Neg(x *Uint) *Uint
p/gnoswap/uint256/arithmetic.gno: func Mul(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/arithmetic.gno: func MulOverflow(x *Uint, y *Uint) *Uint, bool
p/gnoswap/uint256/arithmetic.gno: func Div(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/arithmetic.gno: func MulMod(x *Uint, y *Uint, m *Uint) *Uint
p/gnoswap/uint256/arithmetic.gno: func Mod(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/arithmetic.gno: func DivMod(x *Uint, y *Uint, m *Uint) *Uint, *Uint
p/gnoswap/uint256/arithmetic.gno: func Exp(base *Uint, exponent *Uint) *Uint
p/gnoswap/uint256/arithmetic.gno: func IsOverflow() bool
p/gnoswap/uint256/bitwise.gno: func Or(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/bitwise.gno: func And(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/bitwise.gno: func Not(x *Uint) *Uint
p/gnoswap/uint256/bitwise.gno: func AndNot(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/bitwise.gno: func Xor(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/bitwise.gno: func Lsh(x *Uint, n uint) *Uint
p/gnoswap/uint256/bitwise.gno: func Rsh(x *Uint, n uint) *Uint
p/gnoswap/uint256/bitwise.gno: func SRsh(x *Uint, n uint) *Uint
p/gnoswap/uint256/cmp.gno: func Cmp(x *Uint) r int
p/gnoswap/uint256/cmp.gno: func IsZero() bool
p/gnoswap/uint256/cmp.gno: func Sign() int
p/gnoswap/uint256/cmp.gno: func LtUint64(n uint64) bool
p/gnoswap/uint256/cmp.gno: func GtUint64(n uint64) bool
p/gnoswap/uint256/cmp.gno: func Lt(x *Uint) bool
p/gnoswap/uint256/cmp.gno: func Gt(x *Uint) bool
p/gnoswap/uint256/cmp.gno: func Lte(x *Uint) bool
p/gnoswap/uint256/cmp.gno: func Gte(x *Uint) bool
p/gnoswap/uint256/cmp.gno: func Eq(x *Uint) bool
p/gnoswap/uint256/cmp.gno: func Neq(x *Uint) bool
p/gnoswap/uint256/cmp.gno: func Sgt(x *Uint) bool
p/gnoswap/uint256/conversion.gno: func Uint64() uint64
p/gnoswap/uint256/conversion.gno: func Uint64WithOverflow() uint64, bool
p/gnoswap/uint256/conversion.gno: func SetUint64(x uint64) *Uint
p/gnoswap/uint256/conversion.gno: func IsUint64() bool
p/gnoswap/uint256/conversion.gno: func Dec() string
p/gnoswap/uint256/conversion.gno: func Scan(src interface{}) error
p/gnoswap/uint256/conversion.gno: func ToString() string
p/gnoswap/uint256/conversion.gno: func MarshalJSON() []byte, error
p/gnoswap/uint256/conversion.gno: func UnmarshalJSON(input []byte) error
p/gnoswap/uint256/conversion.gno: func MarshalText() []byte, error
p/gnoswap/uint256/conversion.gno: func UnmarshalText(input []byte) error
p/gnoswap/uint256/conversion.gno: func SetBytes(buf []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes1(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes2(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes3(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes4(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes5(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes6(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes7(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes8(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes9(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes10(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes11(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes12(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes13(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes14(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes15(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes16(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes17(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes18(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes19(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes20(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes21(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes22(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes23(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes24(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes25(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes26(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes27(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes28(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes29(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes30(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes31(in []byte) *Uint
p/gnoswap/uint256/conversion.gno: func SetBytes32(in []byte) *Uint
p/gnoswap/uint256/error.gno: var ErrEmptyString = errors.New("empty hex string")
p/gnoswap/uint256/error.gno: var ErrSyntax = errors.New("invalid hex string")
p/gnoswap/uint256/error.gno: var ErrRange = errors.New("number out of range")
p/gnoswap/uint256/error.gno: var ErrMissingPrefix = errors.New("hex string without 0x prefix")
p/gnoswap/uint256/error.gno: var ErrEmptyNumber = errors.New("hex string \"0x\"")
p/gnoswap/uint256/error.gno: var ErrLeadingZero = errors.New("hex number with leading zero digits")
p/gnoswap/uint256/error.gno: var ErrBig256Range = errors.New("hex number > 256 bits")
p/gnoswap/uint256/error.gno: var ErrBadBufferLength = errors.New("bad ssz buffer length")
p/gnoswap/uint256/error.gno: var ErrBadEncodedLength = errors.New("bad ssz encoded length")
p/gnoswap/uint256/error.gno: var ErrInvalidBase = errors.New("invalid base")
p/gnoswap/uint256/error.gno: var ErrInvalidBitSize = errors.New("invalid bit size")
p/gnoswap/uint256/error.gno: func Error() string
p/gnoswap/uint256/error.gno: func Unwrap() error
p/gnoswap/uint256/fullmath.gno: var MAX_UINT256 string = "115792089237316195423570985008687907853269984665640564039457584007913129639935"
p/gnoswap/uint256/fullmath.gno: func MulDiv(a *Uint, b *Uint, denominator *Uint) *Uint
p/gnoswap/uint256/fullmath.gno: func MulDivRoundingUp(a *Uint, b *Uint, denominator *Uint) *Uint
p/gnoswap/uint256/fullmath.gno: func DivRoundingUp(x *Uint, y *Uint) *Uint
p/gnoswap/uint256/gs_pointer.gno: func NilToZero() *Uint
p/gnoswap/uint256/mod.gno: func Reciprocal(m *Uint) mu [5]uint64
p/gnoswap/uint256/uint256.gno: var MaxUint64 int = 1<<64 - 1
p/gnoswap/uint256/uint256.gno: type Uint struct { arr [4]uint64 }
p/gnoswap/uint256/uint256.gno: func NewUint(val uint64) *Uint
p/gnoswap/uint256/uint256.gno: func Zero() *Uint
p/gnoswap/uint256/uint256.gno: func One() *Uint
p/gnoswap/uint256/uint256.gno: func SetAllOne() *Uint
p/gnoswap/uint256/uint256.gno: func Set(x *Uint) *Uint
p/gnoswap/uint256/uint256.gno: func SetOne() *Uint
p/gnoswap/uint256/uint256.gno: func SetFromDecimal(s string) err error
p/gnoswap/uint256/uint256.gno: func FromDecimal(decimal string) *Uint, error
p/gnoswap/uint256/uint256.gno: func MustFromDecimal(decimal string) *Uint
p/gnoswap/uint256/uint256.gno: func Byte(n *Uint) *Uint
p/gnoswap/uint256/uint256.gno: func BitLen() int
p/gnoswap/uint256/uint256.gno: func ByteLen() int
p/gnoswap/uint256/uint256.gno: func Clear() *Uint
p/gnoswap/uint256/uint256.gno: func SetFromHex(hex string) error
p/gnoswap/uint256/uint256.gno: func FromHex(hex string) *Uint, error
p/gnoswap/uint256/uint256.gno: func MustFromHex(hex string) *Uint
p/gnoswap/uint256/uint256.gno: func Clone() *Uint
r/gnoswap/common/access.gno: var ErrNoPermission string = "caller(%s) has no permission"
r/gnoswap/common/access.gno: func AssertCaller(caller std.Address, addr std.Address) error
r/gnoswap/common/access.gno: func SatisfyCond(cond bool) error
r/gnoswap/common/access.gno: func AdminOnly(caller std.Address) error
r/gnoswap/common/access.gno: func GovernanceOnly(caller std.Address) error
r/gnoswap/common/access.gno: func GovStakerOnly(caller std.Address) error
r/gnoswap/common/access.gno: func RouterOnly(caller std.Address) error
r/gnoswap/common/access.gno: func PoolOnly(caller std.Address) error
r/gnoswap/common/access.gno: func PositionOnly(caller std.Address) error
r/gnoswap/common/access.gno: func StakerOnly(caller std.Address) error
r/gnoswap/common/access.gno: func LaunchpadOnly(caller std.Address) error
r/gnoswap/common/access.gno: func EmissionOnly(caller std.Address) error
r/gnoswap/common/access.gno: func UserOnly(prev std.Realm) error
r/gnoswap/common/address_and_username.gno: func AddrToUser(addr std.Address) pusers.AddressOrName
r/gnoswap/common/address_and_username.gno: func UserToAddr(user pusers.AddressOrName) std.Address
r/gnoswap/common/address_and_username.gno: func AssertValidAddr(addr std.Address)
r/gnoswap/common/grc20reg_helper.gno: func GetToken(path string) *grc20.Token
r/gnoswap/common/grc20reg_helper.gno: func GetTokenTeller(path string) grc20.Teller
r/gnoswap/common/grc20reg_helper.gno: func IsRegistered(path string) error
r/gnoswap/common/grc20reg_helper.gno: func MustRegistered(path string)
r/gnoswap/common/grc20reg_helper.gno: func ListRegisteredTokens() []string
r/gnoswap/common/grc20reg_helper.gno: func TotalSupply(path string) uint64
r/gnoswap/common/grc20reg_helper.gno: func BalanceOf(path string, addr std.Address) uint64
r/gnoswap/common/grc20reg_helper.gno: func Allowance(path string, owner std.Address, spender std.Address) uint64
r/gnoswap/common/grc721_token_id.gno: func TokenIdFrom(tokenId interface{}) grc721.TokenID
r/gnoswap/common/halt.gno: func GetHalt() bool
r/gnoswap/common/halt.gno: func IsHalted()
r/gnoswap/common/halt.gno: func SetHaltByAdmin(halt bool)
r/gnoswap/common/halt.gno: func SetHalt(halt bool)
r/gnoswap/common/limit_caller.gno: func GetLimitCaller() bool
r/gnoswap/common/limit_caller.gno: func SetLimitCaller(v bool)
r/gnoswap/common/liquidity_amounts.gno: func GetLiquidityForAmounts(sqrtRatioX96 *u256.Uint, sqrtRatioAX96 *u256.Uint, sqrtRatioBX96 *u256.Uint, amount0 *u256.Uint, amount1 *u256.Uint) *u256.Uint
r/gnoswap/common/liquidity_amounts.gno: func GetAmountsForLiquidity(sqrtRatioX96 *u256.Uint, sqrtRatioAX96 *u256.Uint, sqrtRatioBX96 *u256.Uint, liquidity *u256.Uint) string, string
r/gnoswap/common/math.gno: func I64Min(x int64, y int64) int64
r/gnoswap/common/math.gno: func I64Max(x int64, y int64) int64
r/gnoswap/common/math.gno: func U64Min(x uint64, y uint64) uint64
r/gnoswap/common/math.gno: func U64Max(x uint64, y uint64) uint64
r/gnoswap/common/math.gno: func I256Min(x *i256.Int, y *i256.Int) *i256.Int
r/gnoswap/common/math.gno: func I256Max(x *i256.Int, y *i256.Int) *i256.Int
r/gnoswap/common/math.gno: func U256Min(x *u256.Uint, y *u256.Uint) *u256.Uint
r/gnoswap/common/math.gno: func U256Max(x *u256.Uint, y *u256.Uint) *u256.Uint
r/gnoswap/common/math.gno: func SafeConvertUint256ToInt256(x *u256.Uint) *i256.Int
r/gnoswap/common/math.gno: func SafeConvertUint256ToUint64(x *u256.Uint) uint64
r/gnoswap/common/strings.gno: func Split(input string, sep string, length int) []string, error
r/gnoswap/common/strings.gno: func EncodeUint(num uint64) string
r/gnoswap/common/strings.gno: func DecodeUint(s string) uint64
r/gnoswap/common/tick_math.gno: var MAX_UINT8 string = "255"
r/gnoswap/common/tick_math.gno: var MAX_UINT16 string = "65535"
r/gnoswap/common/tick_math.gno: var MAX_UINT32 string = "4294967295"
r/gnoswap/common/tick_math.gno: var MAX_UINT64 string = "18446744073709551615"
r/gnoswap/common/tick_math.gno: var MAX_UINT128 string = "340282366920938463463374607431768211455"
r/gnoswap/common/tick_math.gno: var MAX_UINT160 string = "1461501637330902918203684832716283019655932542975"
r/gnoswap/common/tick_math.gno: var MAX_UINT256 string = "115792089237316195423570985008687907853269984665640564039457584007913129639935"
r/gnoswap/common/tick_math.gno: var MAX_INT256 string = "57896044618658097711785492504343953926634992332820282019728792003956564819967"
r/gnoswap/common/tick_math.gno: var Q64 string = "18446744073709551616"
r/gnoswap/common/tick_math.gno: var Q96 string = "79228162514264337593543950336"
r/gnoswap/common/tick_math.gno: var Q128 string = "340282366920938463463374607431768211456"
r/gnoswap/common/tick_math.gno: type TreeValue struct { value *u256.Uint }
r/gnoswap/common/tick_math.gno: func String() string
r/gnoswap/common/tick_math.gno: type TickRatioTree struct { tree *avl.Tree }
r/gnoswap/common/tick_math.gno: func NewTickRatioTree() *TickRatioTree
r/gnoswap/common/tick_math.gno: func GetRatio(key int32) *u256.Uint, bool
r/gnoswap/common/tick_math.gno: type BinaryLogTree struct { tree *avl.Tree }
r/gnoswap/common/tick_math.gno: func NewBinaryLogTree() *BinaryLogTree
r/gnoswap/common/tick_math.gno: func GetLog(idx int) *u256.Uint, bool
r/gnoswap/common/tick_math.gno: func TickMathGetSqrtRatioAtTick(tick int32) *u256.Uint
r/gnoswap/common/tick_math.gno: func TickMathGetTickAtSqrtRatio(sqrtPriceX96 *u256.Uint) int32
r/gnoswap/community_pool/community_pool.gno: func TransferTokenByAdmin(tokenPath string, to std.Address, amount uint64)
r/gnoswap/community_pool/community_pool.gno: func TransferToken(tokenPath string, to std.Address, amount uint64)
r/gnoswap/emission/callback.gno: func SetCallbackStakerEmissionChange(callback func(amount uint64))
r/gnoswap/emission/distribution.gno: var LIQUIDITY_STAKER int = iota + 1
r/gnoswap/emission/distribution.gno: var DEVOPS int
r/gnoswap/emission/distribution.gno: var COMMUNITY_POOL int
r/gnoswap/emission/distribution.gno: var GOV_STAKER int
r/gnoswap/emission/distribution.gno: func ChangeDistributionPctByAdmin(target01 int, pct01 uint64, target02 int, pct02 uint64, target03 int, pct03 uint64, target04 int, pct04 uint64)
r/gnoswap/emission/distribution.gno: func ChangeDistributionPct(target01 int, pct01 uint64, target02 int, pct02 uint64, target03 int, pct03 uint64, target04 int, pct04 uint64)
r/gnoswap/emission/distribution.gno: func GetDistributionBpsPct(target int) uint64
r/gnoswap/emission/distribution.gno: func GetDistributedToStaker() uint64
r/gnoswap/emission/distribution.gno: func GetDistributedToDevOps() uint64
r/gnoswap/emission/distribution.gno: func GetDistributedToCommunityPool() uint64
r/gnoswap/emission/distribution.gno: func GetDistributedToGovStaker() uint64
r/gnoswap/emission/distribution.gno: func GetAccuDistributedToStaker() uint64
r/gnoswap/emission/distribution.gno: func GetAccuDistributedToDevOps() uint64
r/gnoswap/emission/distribution.gno: func GetAccuDistributedToCommunityPool() uint64
r/gnoswap/emission/distribution.gno: func GetAccuDistributedToGovStaker() uint64
r/gnoswap/emission/distribution.gno: func ClearDistributedToStaker()
r/gnoswap/emission/distribution.gno: func ClearDistributedToGovStaker()
r/gnoswap/emission/distribution.gno: func GetEmission() uint64
r/gnoswap/emission/distribution.gno: func GetHalvingBlocksInRange(start int64, end int64) []int64, []uint64
r/gnoswap/emission/emission.gno: func MintAndDistributeGns() uint64
r/gnoswap/emission/emission.gno: func GetLeftGNSAmount() uint64
r/gnoswap/emission/emission.gno: func GetLastExecutedHeight() int64
r/gnoswap/emission/utils.gno: var MAX_BPS_PCT uint64 = 10000
r/gnoswap/gnft/gnft.gno: func Name() string
r/gnoswap/gnft/gnft.gno: func Symbol() string
r/gnoswap/gnft/gnft.gno: func TotalSupply() uint64
r/gnoswap/gnft/gnft.gno: func TokenURI(tid grc721.TokenID) string
r/gnoswap/gnft/gnft.gno: func BalanceOf(owner std.Address) uint64, error
r/gnoswap/gnft/gnft.gno: func OwnerOf(tid grc721.TokenID) std.Address, error
r/gnoswap/gnft/gnft.gno: func MustOwnerOf(tid grc721.TokenID) std.Address
r/gnoswap/gnft/gnft.gno: func SetTokenURI(tid grc721.TokenID, tURI grc721.TokenURI) bool, error
r/gnoswap/gnft/gnft.gno: func SafeTransferFrom(from std.Address, to std.Address, tid grc721.TokenID) error
r/gnoswap/gnft/gnft.gno: func TransferFrom(from std.Address, to std.Address, tid grc721.TokenID) error
r/gnoswap/gnft/gnft.gno: func Approve(approved std.Address, tid grc721.TokenID) error
r/gnoswap/gnft/gnft.gno: func SetApprovalForAll(operator std.Address, approved bool) error
r/gnoswap/gnft/gnft.gno: func GetApproved(tid grc721.TokenID) std.Address, error
r/gnoswap/gnft/gnft.gno: func IsApprovedForAll(owner std.Address, operator std.Address) bool
r/gnoswap/gnft/gnft.gno: func SetTokenURIByImageURI(tid grc721.TokenID)
r/gnoswap/gnft/gnft.gno: func SetTokenURILast()
r/gnoswap/gnft/gnft.gno: func Mint(to std.Address, tid grc721.TokenID) grc721.TokenID
r/gnoswap/gnft/gnft.gno: func Burn(tid grc721.TokenID)
r/gnoswap/gnft/gnft.gno: func Render(path string) string
r/gnoswap/gnft/utils.gno: func Exists(tid grc721.TokenID) bool
r/gnoswap/gns/gns.gno: var MAXIMUM_SUPPLY = uint64(1_000_000_000_000_000)
r/gnoswap/gns/gns.gno: var INITIAL_MINT_AMOUNT = uint64(100_000_000_000_000)
r/gnoswap/gns/gns.gno: var MAX_EMISSION_AMOUNT = uint64(900_000_000_000_000)
r/gnoswap/gns/gns.gno: var Token *grc20.Token
r/gnoswap/gns/gns.gno: var UserTeller grc20.Teller
r/gnoswap/gns/gns.gno: func TotalSupply() uint64
r/gnoswap/gns/gns.gno: func GetName() string
r/gnoswap/gns/gns.gno: func GetSymbol() string
r/gnoswap/gns/gns.gno: func GetDecimals() uint
r/gnoswap/gns/gns.gno: func KnownAccounts() int
r/gnoswap/gns/gns.gno: func BalanceOf(owner std.Address) uint64
r/gnoswap/gns/gns.gno: func Allowance(owner std.Address, spender std.Address) uint64
r/gnoswap/gns/gns.gno: func MintGns(address std.Address) uint64
r/gnoswap/gns/gns.gno: func Burn(from std.Address, amount uint64)
r/gnoswap/gns/gns.gno: func Transfer(to std.Address, amount uint64)
r/gnoswap/gns/gns.gno: func Approve(spender std.Address, amount uint64)
r/gnoswap/gns/gns.gno: func TransferFrom(from std.Address, to std.Address, amount uint64)
r/gnoswap/gns/gns.gno: func Render(path string) string
r/gnoswap/gns/gns.gno: func GetLastMintedHeight() int64
r/gnoswap/gns/gns.gno: func GetLeftEmissionAmount() uint64
r/gnoswap/gns/gns.gno: func GetBurnAmount() uint64
r/gnoswap/gns/gns.gno: func GetMintedEmissionAmount() uint64
r/gnoswap/gns/halving.gno: var HALVING_START_YEAR = int64(1)
r/gnoswap/gns/halving.gno: var HALVING_END_YEAR = int64(12)
r/gnoswap/gns/halving.gno: var HALVING_AMOUNTS_PER_YEAR []uint64 = [HALVING_END_YEAR]uint64{18_750_000_000_000 * 12, 18_750_000_000_000 * 12, 9_375_000_000_000 * 12, 9_375_000_000_000 * 12, 4_687_500_000_000 * 12, 4_687_500_000_000 * 12, 2_343_750_000_000 * 12, 2_343_750_000_000 * 12, 1_171_875_000_000 * 12, 1_171_875_000...
r/gnoswap/gns/halving.gno: type HalvingData struct { startBlockHeight []int64; endBlockHeight []int64; startTimestamp []int64; maxAmount []uint64; mintedAmount []uint64; leftAmount []uint64; accumAmount []uint64; amountPerBlock []uint64 }
r/gnoswap/gns/halving.gno: func SetCallbackEmissionChange(callback func(amount uint64))
r/gnoswap/gns/halving.gno: func GetHalvingBlocksInRange(startHeight int64, endHeight int64) []int64, []uint64
r/gnoswap/gns/halving.gno: func GetEmission() uint64
r/gnoswap/gns/halving.gno: type EmissionState struct { startHeight int64; startTimestamp int64; endTimestamp int64; halvingData HalvingData }
r/gnoswap/gns/halving.gno: func GetEmissionState() *EmissionState
r/gnoswap/gns/halving.gno: func NewEmissionState() *EmissionState
r/gnoswap/gns/halving.gno: func GetAvgBlockTimeInMs() int64
r/gnoswap/gns/halving.gno: func SetAvgBlockTimeInMsByAdmin(ms int64)
r/gnoswap/gns/halving.gno: func SetAvgBlockTimeInMs(ms int64)
r/gnoswap/gns/halving.gno: func GetAmountByHeight(height int64) uint64
r/gnoswap/gns/halving.gno: func GetHalvingYearByHeight(height int64) int64
r/gnoswap/gns/halving.gno: func GetHalvingYearStartBlock(year int64) int64
r/gnoswap/gns/halving.gno: func GetHalvingYearEndBlock(year int64) int64
r/gnoswap/gns/halving.gno: func GetHalvingYearTimestamp(year int64) int64
r/gnoswap/gns/halving.gno: func GetHalvingYearMaxAmount(year int64) uint64
r/gnoswap/gns/halving.gno: func GetHalvingYearMintAmount(year int64) uint64
r/gnoswap/gns/halving.gno: func GetHalvingYearLeftAmount(year int64) uint64
r/gnoswap/gns/halving.gno: func GetHalvingYearAccuAmount(year int64) uint64
r/gnoswap/gns/halving.gno: func GetAmountPerBlockPerHalvingYear(year int64) uint64
r/gnoswap/gns/halving.gno: func GetHalvingAmountsPerYear(year int64) uint64
r/gnoswap/gns/halving.gno: func GetEndHeight() int64
r/gnoswap/gns/halving.gno: func GetEndTimestamp() int64
r/gnoswap/gns/halving.gno: func GetHalvingInfo() string
r/gnoswap/gov/governance/api.gno: func GetProposals() string
r/gnoswap/gov/governance/api.gno: func GetProposalById(id uint64) string
r/gnoswap/gov/governance/api.gno: func GetVoteStatusFromProposalById(id uint64) string
r/gnoswap/gov/governance/api.gno: func GetVotesByAddress(addr std.Address) string
r/gnoswap/gov/governance/api.gno: func GetVoteByAddressFromProposalById(addr std.Address, id uint64) string
r/gnoswap/gov/governance/config.gno: func ReconfigureByAdmin(votingStartDelay uint64, votingPeriod uint64, votingWeightSmoothingDuration uint64, quorum uint64, proposalCreationThreshold uint64, executionDelay uint64, executionWindow uint64) uint64
r/gnoswap/gov/governance/config.gno: func GetConfigVersion(version uint64) Config
r/gnoswap/gov/governance/config.gno: func GetLatestConfig() Config
r/gnoswap/gov/governance/config.gno: func GetLatestConfigVersion() uint64
r/gnoswap/gov/governance/config.gno: func GetProposalCreationThreshold() uint64
r/gnoswap/gov/governance/execute.gno: var EXECUTE_SEPARATOR string = "*EXE*"
r/gnoswap/gov/governance/execute.gno: type ParameterHandler func([]string) error
r/gnoswap/gov/governance/execute.gno: type ParameterRegistry struct { handlers *avl.Tree }
r/gnoswap/gov/governance/execute.gno: func NewParameterRegistry() *ParameterRegistry
r/gnoswap/gov/governance/execute.gno: func Register(pkgPath string, function string, hdlr ParameterHandler)
r/gnoswap/gov/governance/execute.gno: func Handler(pkgPath string, function string) ParameterHandler, error
r/gnoswap/gov/governance/execute.gno: func Get(pkgPath string, function string) ParameterHandler, error
r/gnoswap/gov/governance/execute.gno: type ExecutionContext struct { ProposalId uint64; Now uint64; Config *Config; Proposal *ProposalInfo; WindowStart uint64; WindowEnd uint64 }
r/gnoswap/gov/governance/execute.gno: func String() string
r/gnoswap/gov/governance/execute.gno: func Execute(proposalId uint64) error
r/gnoswap/gov/governance/execute.gno: type ExecutionValidator struct { isTextProposal bool; isAlreadyExecuted bool; isAlreadyCanceled bool; isAlreadyRejected bool; hasPassed bool }
r/gnoswap/gov/governance/getter_proposal.gno: func GetProposerByProposalId(proposalId uint64) string
r/gnoswap/gov/governance/getter_proposal.gno: func GetProposalTypeByProposalId(proposalId uint64) string
r/gnoswap/gov/governance/getter_proposal.gno: func GetYeaByProposalId(proposalId uint64) string
r/gnoswap/gov/governance/getter_proposal.gno: func GetNayByProposalId(proposalId uint64) string
r/gnoswap/gov/governance/getter_proposal.gno: func GetConfigVersionByProposalId(proposalId uint64) uint64
r/gnoswap/gov/governance/getter_proposal.gno: func GetQuorumAmountByProposalId(proposalId uint64) uint64
r/gnoswap/gov/governance/getter_proposal.gno: func GetTitleByProposalId(proposalId uint64) string
r/gnoswap/gov/governance/getter_proposal.gno: func GetDescriptionByProposalId(proposalId uint64) string
r/gnoswap/gov/governance/getter_proposal.gno: func GetExecutionStateByProposalId(proposalId uint64) ProposalState
r/gnoswap/gov/governance/getter_vote.gno: func GetVoteByVoteKey(voteKey string) bool
r/gnoswap/gov/governance/getter_vote.gno: func GetVoteYesByVoteKey(voteKey string) bool
r/gnoswap/gov/governance/getter_vote.gno: func GetVoteWeightByVoteKey(voteKey string) uint64
r/gnoswap/gov/governance/getter_vote.gno: func GetVotedHeightByVoteKey(voteKey string) uint64
r/gnoswap/gov/governance/getter_vote.gno: func GetVotedAtByVoteKey(voteKey string) uint64
r/gnoswap/gov/governance/proposal.gno: var GOV_SPLIT string = "*GOV*"
r/gnoswap/gov/governance/proposal.gno: func ProposeText(title string, description string) uint64
r/gnoswap/gov/governance/proposal.gno: func ProposeCommunityPoolSpend(title string, description string, to std.Address, tokenPath string, amount uint64) uint64
r/gnoswap/gov/governance/proposal.gno: func ProposeParameterChange(title string, description string, numToExecute uint64, executions string) uint64
r/gnoswap/gov/governance/type.gno: type Config struct { VotingStartDelay uint64; VotingPeriod uint64; VotingWeightSmoothingDuration uint64; Quorum uint64; ProposalCreationThreshold uint64; ExecutionDelay uint64; ExecutionWindow uint64 }
r/gnoswap/gov/governance/type.gno: type ProposalState struct { Created bool; CreatedAt uint64; Upcoming bool; Active bool; Passed bool; PassedAt uint64; Rejected bool; RejectedAt uint64; Canceled bool; CanceledAt uint64; Executed bool; ExecutedAt uint64; Expired bool; ExpiredAt uint64 }
r/gnoswap/gov/governance/type.gno: type CommunityPoolSpendInfo struct { To std.Address; TokenPath string; Amount uint64 }
r/gnoswap/gov/governance/type.gno: type ExecutionInfo struct { Num uint64; Msgs []string }
r/gnoswap/gov/governance/type.gno: type ParameterChangeInfo struct { PkgPath string; Function string; Params string }
r/gnoswap/gov/governance/type.gno: type ProposalType string
r/gnoswap/gov/governance/type.gno: var Text ProposalType = "TEXT"
r/gnoswap/gov/governance/type.gno: var CommunityPoolSpend ProposalType = "COMMUNITY_POOL_SPEND"
r/gnoswap/gov/governance/type.gno: var ParameterChange ProposalType = "PARAMETER_CHANGE"
r/gnoswap/gov/governance/type.gno: func String() string
r/gnoswap/gov/governance/type.gno: type ProposalInfo struct { Proposer std.Address; ProposalType ProposalType; State ProposalState; Yea *u256.Uint; Nay *u256.Uint; MaxVotingWeight *u256.Uint; PossibleAddressWithWeight map[std.Address]uint64; ConfigVersion uint64; QuorumAmount uint64; Title string; Description string; CommunityPoolSpend CommunityPoolSpendInfo; Execution ExecutionInfo }
r/gnoswap/gov/governance/vote.gno: func Vote(pid uint64, yes bool) string
r/gnoswap/gov/governance/vote.gno: type VoteState struct { isVotingPeriod bool; isProposalValid bool; hasUserVoted bool; userWeight uint64 }
r/gnoswap/gov/governance/vote.gno: type VoteExecutor struct { proposal *ProposalInfo; voter std.Address; weight uint64 }
r/gnoswap/gov/governance/vote.gno: func Cancel(proposalId uint64)
r/gnoswap/gov/staker/api_delegation.gno: func GetTotalxGnsSupply() uint64
r/gnoswap/gov/staker/api_delegation.gno: func GetTotalVoteWeight() uint64
r/gnoswap/gov/staker/api_delegation.gno: func GetTotalDelegated() uint64
r/gnoswap/gov/staker/api_delegation.gno: func GetTotalLockedAmount() uint64
r/gnoswap/gov/staker/api_delegation.gno: func GetTotalDelegatedFrom(from std.Address) uint64
r/gnoswap/gov/staker/api_delegation.gno: func GetTotalDelegatedTo(to std.Address) uint64
r/gnoswap/gov/staker/api_delegation.gno: func GetDelegationAmountFromTo(from std.Address, to std.Address) uint64
r/gnoswap/gov/staker/api_delegation.gno: func GetRealmGnsBalance() uint64
r/gnoswap/gov/staker/api_history.gno: func GetPossibleVotingAddressWithWeight(endTimestamp uint64) uint64, map[std.Address]uint64
r/gnoswap/gov/staker/api_history.gno: func GetPossibleVotingAddressWithWeightJSON(endTimestamp uint64) uint64, string
r/gnoswap/gov/staker/api_staker.gno: func GetLockedAmount() uint64
r/gnoswap/gov/staker/api_staker.gno: func GetLockedInfoByAddress(addr std.Address) string
r/gnoswap/gov/staker/api_staker.gno: func GetClaimableRewardByAddress(addr std.Address) string
r/gnoswap/gov/staker/clean_delegation_stat_history.gno: func CleanDelegationStatHistoryByAdmin()
r/gnoswap/gov/staker/clean_delegation_stat_history.gno: func GetRunning() bool
r/gnoswap/gov/staker/clean_delegation_stat_history.gno: func SetRunning(run bool)
r/gnoswap/gov/staker/clean_delegation_stat_history.gno: func GetThresholdVotingWeightBlockHeight() uint64
r/gnoswap/gov/staker/clean_delegation_stat_history.gno: func SetThresholdVotingWeightBlockHeightByAdmin(height uint64)
r/gnoswap/gov/staker/history.gno: type DelegationHistory struct { to std.Address; amount uint64; timestamp uint64; height uint64; add bool }
r/gnoswap/gov/staker/history.gno: type DelegationSnapShotHistory struct { to std.Address; amount uint64; updatedBlock uint64; updatedAt uint64 }
r/gnoswap/gov/staker/history.gno: func GetDelegatedCumulative(delegator std.Address, endTimestamp uint64) uint64
r/gnoswap/gov/staker/reward_calculation.gno: type StakerRewardInfo struct { StartHeight uint64; PriceDebt *u256.Uint; ProtocolFeePriceDebt map[string]*u256.Uint; Amount uint64; Claimed uint64; ProtocolFeeClaimed map[string]uint64 }
r/gnoswap/gov/staker/reward_calculation.gno: func Debug() string
r/gnoswap/gov/staker/reward_calculation.gno: func PriceDebtUint64() uint64
r/gnoswap/gov/staker/reward_calculation.gno: type RewardState struct { CurrentBalance uint64; CurrentProtocolFeeBalance map[string]uint64; PriceAccumulation *u256.Uint; ProtocolFeePriceAccumulation map[string]*u256.Uint; TotalStake uint64; info *avl.Tree }
r/gnoswap/gov/staker/reward_calculation.gno: func NewRewardState() *RewardState
r/gnoswap/gov/staker/reward_calculation.gno: func Debug() string
r/gnoswap/gov/staker/reward_calculation.gno: func Info(staker std.Address) StakerRewardInfo
r/gnoswap/gov/staker/reward_calculation.gno: func CalculateReward(staker std.Address) uint64, map[string]uint64
r/gnoswap/gov/staker/reward_calculation.gno: func PriceAccumulationUint64() uint64
r/gnoswap/gov/staker/reward_calculation.gno: func AddStake(currentHeight uint64, staker std.Address, amount uint64, currentBalance uint64, currentProtocolFeeBalances map[string]uint64)
r/gnoswap/gov/staker/reward_calculation.gno: func Claim(staker std.Address, currentBalance uint64, currentProtocolFeeBalances map[string]uint64) uint64, map[string]uint64
r/gnoswap/gov/staker/reward_calculation.gno: func RemoveStake(staker std.Address, amount uint64, currentBalance uint64, currentProtocolFeeBalances map[string]uint64) uint64, map[string]uint64
r/gnoswap/gov/staker/reward_calculation.gno: func GetRewardByProjectWallet(addr std.Address) uint64
r/gnoswap/gov/staker/reward_calculation.gno: func SetAmountByProjectWallet(addr std.Address, amount uint64, add bool)
r/gnoswap/gov/staker/staker.gno: var TIMESTAMP_7_DAYS = uint64(604800)
r/gnoswap/gov/staker/staker.gno: func Delegate(to std.Address, amount uint64)
r/gnoswap/gov/staker/staker.gno: func Redelegate(from std.Address, to std.Address, amount uint64)
r/gnoswap/gov/staker/staker.gno: func Undelegate(from std.Address, amount uint64)
r/gnoswap/gov/staker/staker.gno: func CollectUndelegatedGns() uint64
r/gnoswap/gov/staker/staker.gno: func CollectReward()
r/gnoswap/gov/staker/staker.gno: func CollectRewardFromLaunchPad(to std.Address)
r/gnoswap/gov/xgns/xgns.gno: func TotalSupply() uint64
r/gnoswap/gov/xgns/xgns.gno: func VotingSupply() uint64
r/gnoswap/gov/xgns/xgns.gno: func BalanceOf(owner std.Address) uint64
r/gnoswap/gov/xgns/xgns.gno: func Render(path string) string
r/gnoswap/gov/xgns/xgns.gno: func Mint(to std.Address, amount uint64)
r/gnoswap/gov/xgns/xgns.gno: func MintByLaunchPad(to std.Address, amount uint64)
r/gnoswap/gov/xgns/xgns.gno: func Burn(from std.Address, amount uint64)
r/gnoswap/gov/xgns/xgns.gno: func BurnByLaunchPad(from std.Address, amount uint64)
r/gnoswap/launchpad/api_deposit.gno: func ApiGetClaimableDepositByAddress(address std.Address) uint64
r/gnoswap/launchpad/api_deposit.gno: func ApiGetDepositByDepositId(depositId string) string
r/gnoswap/launchpad/api_deposit.gno: func ApiGetDepositFullByDepositId(depositId string) string
r/gnoswap/launchpad/api_project.gno: func ApiGetProjectAndTierStatisticsByProjectId(projectId string) string
r/gnoswap/launchpad/api_project.gno: func ApiGetProjectStatisticsByProjectId(projectId string) string
r/gnoswap/launchpad/api_project.gno: func ApiGetProjectStatisticsByProjectTierId(tierId string) string
r/gnoswap/launchpad/api_reward.gno: func ApiGetProjectRecipientRewardByProjectId(projectId string) string
r/gnoswap/launchpad/api_reward.gno: func ApiGetProjectRecipientRewardByAddress(address std.Address) string
r/gnoswap/launchpad/api_reward.gno: func ApiGetDepositRewardByDepositId(depositId string) uint64
r/gnoswap/launchpad/api_reward.gno: func ApiGetDepositRewardByAddress(address std.Address) uint64
r/gnoswap/launchpad/consts.gno: var TIMESTAMP_180DAYS = uint64(180 * 24 * 60 * 60)
r/gnoswap/launchpad/consts.gno: var TIMESTAMP_14DAYS = uint64(14 * 24 * 60 * 60)
r/gnoswap/launchpad/consts.gno: var TIMESTAMP_90DAYS = uint64(90 * 24 * 60 * 60)
r/gnoswap/launchpad/consts.gno: var TIMESTAMP_7DAYS = uint64(7 * 24 * 60 * 60)
r/gnoswap/launchpad/consts.gno: var TIMESTAMP_30DAYS = uint64(30 * 24 * 60 * 60)
r/gnoswap/launchpad/consts.gno: var TIMESTAMP_3DAYS = uint64(3 * 24 * 60 * 60)
r/gnoswap/launchpad/consts.gno: var TIMESTAMP_DAY = uint64(24 * 60 * 60)
r/gnoswap/launchpad/consts.gno: var TIER30 = uint64(30)
r/gnoswap/launchpad/consts.gno: var TIER90 = uint64(90)
r/gnoswap/launchpad/consts.gno: var TIER180 = uint64(180)
r/gnoswap/launchpad/consts.gno: var TOTAL_TIERS int = 3
r/gnoswap/launchpad/consts.gno: var PAD_SEP string = "*PAD*"
r/gnoswap/launchpad/consts.gno: var MINIMUM_DEPOSIT_AMOUNT = uint64(1_000_000)
r/gnoswap/launchpad/deposit.gno: type DepositState struct { Deposits map[string]Deposit; DepositsByProject map[string]map[string][]string; DepositsByUser map[std.Address][]string; DepositsByUserProject map[std.Address]map[string][]string }
r/gnoswap/launchpad/deposit.gno: type ProjectTierInfo struct { Project Project; Tier Tier; TierType string; CurrentHeight uint64; CurrentTime uint64 }
r/gnoswap/launchpad/deposit.gno: func DepositGns(targetProjectTierId string, amount uint64) string
r/gnoswap/launchpad/deposit.gno: func CollectDepositGns() uint64
r/gnoswap/launchpad/deposit.gno: func CollectDepositGnsByProjectId(projectId string) uint64
r/gnoswap/launchpad/deposit.gno: func CollectDepositGnsByDepositId(depositId string) uint64
r/gnoswap/launchpad/json_builder.gno: func TimeInfoBuilder(b *json.NodeBuilder, prefix string, info TimeInfo) *json.NodeBuilder
r/gnoswap/launchpad/json_builder.gno: func ProjectStatsBuilder(b *json.NodeBuilder, stats ProjectStats) *json.NodeBuilder
r/gnoswap/launchpad/json_builder.gno: func RefundInfoBuilder(b *json.NodeBuilder, info RefundInfo) *json.NodeBuilder
r/gnoswap/launchpad/json_builder.gno: func TierBuilder(b *json.NodeBuilder, prefix string, tier Tier) *json.NodeBuilder
r/gnoswap/launchpad/json_builder.gno: func ProjectBuilder(b *json.NodeBuilder, project Project) *json.NodeBuilder
r/gnoswap/launchpad/json_builder.gno: func DepositBuilder(b *json.NodeBuilder, deposit Deposit) *json.NodeBuilder
r/gnoswap/launchpad/json_builder.gno: func MetaBuilder() *json.NodeBuilder
r/gnoswap/launchpad/launchpad.gno: type ProjectInput struct { Name string; TokenPath string; Recipient std.Address; DepositAmount uint64; ConditionsToken string; ConditionsAmount string; Tier30Ratio uint64; Tier90Ratio uint64; Tier180Ratio uint64; StartTime uint64 }
r/gnoswap/launchpad/launchpad.gno: func NewProjectInput(name string, tokenPath string, recipient std.Address, depositAmount uint64, conditionsToken string, conditionsAmount string, tier30Ratio uint64, tier90Ratio uint64, tier180Ratio uint64, startTime uint64) ProjectInput
r/gnoswap/launchpad/launchpad.gno: func ValidateName() error
r/gnoswap/launchpad/launchpad.gno: func ValidateTokenPath() error
r/gnoswap/launchpad/launchpad.gno: func ValidateRecipient() error
r/gnoswap/launchpad/launchpad.gno: func ValidateDepositAmount() error
r/gnoswap/launchpad/launchpad.gno: func ValidateRatio() error
r/gnoswap/launchpad/launchpad.gno: func ValidateStartTime(now uint64) error
r/gnoswap/launchpad/launchpad.gno: func ParseConditions() map[string]Condition, error
r/gnoswap/launchpad/launchpad.gno: func ValidateAll(now uint64) map[string]Condition, error
r/gnoswap/launchpad/launchpad.gno: func ConvertStartTimeToHeight(now uint64) uint64, error
r/gnoswap/launchpad/launchpad.gno: type ProjectCalculationResult struct { Tier30Amount uint64; Tier90Amount uint64; Tier180Amount uint64; StartHeight uint64 }
r/gnoswap/launchpad/launchpad.gno: func CreateProject(name string, tokenPath string, recipient std.Address, depositAmount uint64, conditionsToken string, conditionsAmount string, tier30Ratio uint64, tier90Ratio uint64, tier180Ratio uint64, startTime uint64) string
r/gnoswap/launchpad/launchpad.gno: func TransferLeftFromProjectByAdmin(projectId string, recipient std.Address) uint64
r/gnoswap/launchpad/reward.gno: type RewardCalculationResult struct { Reward uint64; UpdatedTiers map[string]Tier }
r/gnoswap/launchpad/reward.gno: func CollectProtocolFee()
r/gnoswap/launchpad/reward.gno: func CollectRewardByProjectId(projectId string) uint64
r/gnoswap/launchpad/reward.gno: func CollectRewardByDepositId(depositId string) uint64
r/gnoswap/launchpad/reward_calculation.gno: type StakerRewardInfo struct { StartHeight uint64; PriceDebt *u256.Uint; Amount uint64; Claimed uint64 }
r/gnoswap/launchpad/reward_calculation.gno: func Debug() string
r/gnoswap/launchpad/reward_calculation.gno: func PriceDebtUint64() uint64
r/gnoswap/launchpad/reward_calculation.gno: type RewardState struct { PriceAccumulation *u256.Uint; TotalStake uint64; LastHeight uint64; RewardPerBlock *u256.Uint; EndHeight uint64; TotalEmptyBlock uint64; info *avl.Tree }
r/gnoswap/launchpad/reward_calculation.gno: func NewRewardState(rewardPerBlock *u256.Uint, startHeight uint64, endHeight uint64) *RewardState
r/gnoswap/launchpad/reward_calculation.gno: func PriceAccumulationUint64() uint64
r/gnoswap/launchpad/reward_calculation.gno: func RewardPerBlockUint64() uint64
r/gnoswap/launchpad/reward_calculation.gno: func Debug() string
r/gnoswap/launchpad/reward_calculation.gno: type RewardStates struct { states *avl.Tree }
r/gnoswap/launchpad/reward_calculation.gno: func Get(projectId string, tierStr string) *RewardState, error
r/gnoswap/launchpad/reward_calculation.gno: func Set(projectId string, tierStr string, state *RewardState)
r/gnoswap/launchpad/reward_calculation.gno: func DeleteProject(projectId string) uint64
r/gnoswap/launchpad/reward_calculation.gno: func Info(depositId string) StakerRewardInfo
r/gnoswap/launchpad/reward_calculation.gno: func CalculateReward(depositId string) uint64
r/gnoswap/launchpad/reward_calculation.gno: func AddStake(currentHeight uint64, depositId string, amount uint64)
r/gnoswap/launchpad/reward_calculation.gno: func Claim(depositId string, currentHeight uint64) uint64
r/gnoswap/launchpad/reward_calculation.gno: func RemoveStake(depositId string, amount uint64, currentHeight uint64) uint64
r/gnoswap/launchpad/type.gno: type ProjectStats struct { totalDeposit uint64; actualDeposit uint64; totalParticipant uint64; actualParticipant uint64; totalCollected uint64 }
r/gnoswap/launchpad/type.gno: func NewProjectStats(totalDeposit uint64, actualDeposit uint64, totalParticipant uint64, actualParticipant uint64, totalCollected uint64) *ProjectStats
r/gnoswap/launchpad/type.gno: func TotalDeposit() uint64
r/gnoswap/launchpad/type.gno: func SetTotalDeposit(v uint64)
r/gnoswap/launchpad/type.gno: func ActualDeposit() uint64
r/gnoswap/launchpad/type.gno: func SetActualDeposit(v uint64)
r/gnoswap/launchpad/type.gno: func TotalParticipant() uint64
r/gnoswap/launchpad/type.gno: func SetTotalParticipant(v uint64)
r/gnoswap/launchpad/type.gno: func ActualParticipant() uint64
r/gnoswap/launchpad/type.gno: func SetActualParticipant(v uint64)
r/gnoswap/launchpad/type.gno: func TotalCollected() uint64
r/gnoswap/launchpad/type.gno: func SetTotalCollected(v uint64)
r/gnoswap/launchpad/type.gno: type Project struct { id string; name string; tokenPath string; depositAmount uint64; recipient std.Address; conditions map[string]Condition; tiers map[uint64]Tier; tiersRatios map[uint64]uint64; created TimeInfo; started TimeInfo; ended TimeInfo; stats ProjectStats; refund RefundInfo }
r/gnoswap/launchpad/type.gno: func NewProject(id string, name string, tokenPath string, depositAmount uint64, recipient std.Address, conditions map[string]Condition, tiers map[uint64]Tier, tiersRatios map[uint64]uint64, created TimeInfo, started TimeInfo, ended TimeInfo, stats ProjectStats, refund RefundInfo) *Project
r/gnoswap/launchpad/type.gno: func ID() string
r/gnoswap/launchpad/type.gno: func SetID(v string)
r/gnoswap/launchpad/type.gno: func Name() string
r/gnoswap/launchpad/type.gno: func SetName(v string)
r/gnoswap/launchpad/type.gno: func TokenPath() string
r/gnoswap/launchpad/type.gno: func SetTokenPath(v string)
r/gnoswap/launchpad/type.gno: func DepositAmount() uint64
r/gnoswap/launchpad/type.gno: func SetDepositAmount(v uint64)
r/gnoswap/launchpad/type.gno: func Recipient() std.Address
r/gnoswap/launchpad/type.gno: func SetRecipient(v std.Address)
r/gnoswap/launchpad/type.gno: func Conditions() map[string]Condition
r/gnoswap/launchpad/type.gno: func SetConditions(v map[string]Condition)
r/gnoswap/launchpad/type.gno: func Tiers() map[uint64]Tier
r/gnoswap/launchpad/type.gno: func SetTiers(v map[uint64]Tier)
r/gnoswap/launchpad/type.gno: func TiersRatios() map[uint64]uint64
r/gnoswap/launchpad/type.gno: func SetTiersRatios(v map[uint64]uint64)
r/gnoswap/launchpad/type.gno: func Created() TimeInfo
r/gnoswap/launchpad/type.gno: func SetCreated(v TimeInfo)
r/gnoswap/launchpad/type.gno: func Started() TimeInfo
r/gnoswap/launchpad/type.gno: func SetStarted(v TimeInfo)
r/gnoswap/launchpad/type.gno: func Ended() TimeInfo
r/gnoswap/launchpad/type.gno: func SetEnded(v TimeInfo)
r/gnoswap/launchpad/type.gno: func Stats() *ProjectStats
r/gnoswap/launchpad/type.gno: func SetStats(v ProjectStats)
r/gnoswap/launchpad/type.gno: func Refund() RefundInfo
r/gnoswap/launchpad/type.gno: func SetRefund(v RefundInfo)
r/gnoswap/launchpad/type.gno: func Tier(key uint64) Tier, error
r/gnoswap/launchpad/type.gno: type Tier struct { id string; collectWaitDuration uint64; tierAmount uint64; tierAmountPerBlockX128 *u256.Uint; started TimeInfo; ended TimeInfo; totalDepositAmount uint64; actualDepositAmount uint64; totalParticipant uint64; actualParticipant uint64; userCollectedAmount uint64; calculatedAmount uint64; reward Reward }
r/gnoswap/launchpad/type.gno: func NewTier(id string, collectWaitDuration uint64, tierAmount uint64, tierAmountPerBlockX128 *u256.Uint, started TimeInfo, ended TimeInfo, totalDepositAmount uint64, actualDepositAmount uint64, totalParticipant uint64, actualParticipant uint64, userCollectedAmount uint64, calculatedAmount uint64, reward Reward) *Tier
r/gnoswap/launchpad/type.gno: func ID() string
r/gnoswap/launchpad/type.gno: func SetID(v string)
r/gnoswap/launchpad/type.gno: func CollectWaitDuration() uint64
r/gnoswap/launchpad/type.gno: func SetCollectWaitDuration(v uint64)
r/gnoswap/launchpad/type.gno: func TierAmount() uint64
r/gnoswap/launchpad/type.gno: func SetTierAmount(v uint64)
r/gnoswap/launchpad/type.gno: func TierAmountPerBlockX128() *u256.Uint
r/gnoswap/launchpad/type.gno: func SetTierAmountPerBlockX128(v *u256.Uint)
r/gnoswap/launchpad/type.gno: func Started() TimeInfo
r/gnoswap/launchpad/type.gno: func SetStarted(v TimeInfo)
r/gnoswap/launchpad/type.gno: func Ended() TimeInfo
r/gnoswap/launchpad/type.gno: func SetEnded(v TimeInfo)
r/gnoswap/launchpad/type.gno: func TotalDepositAmount() uint64
r/gnoswap/launchpad/type.gno: func SetTotalDepositAmount(v uint64)
r/gnoswap/launchpad/type.gno: func ActualDepositAmount() uint64
r/gnoswap/launchpad/type.gno: func SetActualDepositAmount(v uint64)
r/gnoswap/launchpad/type.gno: func TotalParticipant() uint64
r/gnoswap/launchpad/type.gno: func SetTotalParticipant(v uint64)
r/gnoswap/launchpad/type.gno: func ActualParticipant() uint64
r/gnoswap/launchpad/type.gno: func SetActualParticipant(v uint64)
r/gnoswap/launchpad/type.gno: func UserCollectedAmount() uint64
r/gnoswap/launchpad/type.gno: func SetUserCollectedAmount(v uint64)
r/gnoswap/launchpad/type.gno: func CalculatedAmount() uint64
r/gnoswap/launchpad/type.gno: func SetCalculatedAmount(v uint64)
r/gnoswap/launchpad/type.gno: func Reward() Reward
r/gnoswap/launchpad/type.gno: func SetReward(v Reward)
r/gnoswap/launchpad/type.gno: type RewardInfo struct { priceDebt *u256.Uint; depositAmount uint64; rewardAmount uint64; claimed uint64; startHeight uint64; EndHeight uint64; LastHeight uint64 }
r/gnoswap/launchpad/type.gno: func NewRewardInfo(priceDebt *u256.Uint, depositAmount uint64, rewardAmount uint64, claimed uint64, startHeight uint64, endHeight uint64, lastHeight uint64) *RewardInfo
r/gnoswap/launchpad/type.gno: func PriceDebt() *u256.Uint
r/gnoswap/launchpad/type.gno: func SetPriceDebt(v *u256.Uint)
r/gnoswap/launchpad/type.gno: func DepositAmount() uint64
r/gnoswap/launchpad/type.gno: func SetDepositAmount(v uint64)
r/gnoswap/launchpad/type.gno: func RewardAmount() uint64
r/gnoswap/launchpad/type.gno: func SetRewardAmount(v uint64)
r/gnoswap/launchpad/type.gno: func Claimed() uint64
r/gnoswap/launchpad/type.gno: func SetClaimed(v uint64)
r/gnoswap/launchpad/type.gno: func StartHeight() uint64
r/gnoswap/launchpad/type.gno: func SetStartHeight(v uint64)
r/gnoswap/launchpad/type.gno: func GetEndHeight() uint64
r/gnoswap/launchpad/type.gno: func SetEndHeight(v uint64)
r/gnoswap/launchpad/type.gno: func GetLastHeight() uint64
r/gnoswap/launchpad/type.gno: func SetLastHeight(v uint64)
r/gnoswap/launchpad/type.gno: type Reward struct { accumRewardPerDeposit *u256.Uint; LastHeight uint64; EndHeight uint64; info *avl.Tree }
r/gnoswap/launchpad/type.gno: func NewReward(accumRewardPerDeposit *u256.Uint, lastHeight uint64, endHeight uint64) *Reward
r/gnoswap/launchpad/type.gno: func AccumRewardPerDeposit() *u256.Uint
r/gnoswap/launchpad/type.gno: func SetAccumRewardPerDeposit(v *u256.Uint)
r/gnoswap/launchpad/type.gno: func GetLastHeight() uint64
r/gnoswap/launchpad/type.gno: func SetLastHeight(v uint64)
r/gnoswap/launchpad/type.gno: func GetEndHeight() uint64
r/gnoswap/launchpad/type.gno: func SetEndHeight(v uint64)
r/gnoswap/launchpad/type.gno: func Info() *avl.Tree
r/gnoswap/launchpad/type.gno: func SetInfo(v *avl.Tree)
r/gnoswap/launchpad/type.gno: func InfoOf(depositId string) *RewardInfo
r/gnoswap/launchpad/type.gno: type Deposit struct { id string; projectId string; tier string; depositor std.Address; amount uint64; depositHeight uint64; depositTime uint64; depositCollectHeight uint64; depositCollectTime uint64; claimableHeight uint64; claimableTime uint64; rewardAmount uint64; rewardCollected uint64; rewardCollectHeight uint64; rewardCollectTime uint64 }
r/gnoswap/launchpad/type.gno: func NewDeposit(id string, projectId string, tier string, depositor std.Address, amount uint64, depositHeight uint64, depositTime uint64, depositCollectHeight uint64, depositCollectTime uint64, claimableHeight uint64, claimableTime uint64, rewardAmount uint64, rewardCollected uint64, rewardCollectHeight uint64, rewardCollectTime uint64) *Deposit
r/gnoswap/launchpad/type.gno: func ID() string
r/gnoswap/launchpad/type.gno: func SetID(v string)
r/gnoswap/launchpad/type.gno: func ProjectID() string
r/gnoswap/launchpad/type.gno: func SetProjectID(v string)
r/gnoswap/launchpad/type.gno: func Tier() string
r/gnoswap/launchpad/type.gno: func SetTier(v string)
r/gnoswap/launchpad/type.gno: func Depositor() std.Address
r/gnoswap/launchpad/type.gno: func SetDepositor(v std.Address)
r/gnoswap/launchpad/type.gno: func Amount() uint64
r/gnoswap/launchpad/type.gno: func SetAmount(v uint64)
r/gnoswap/launchpad/type.gno: func DepositHeight() uint64
r/gnoswap/launchpad/type.gno: func SetDepositHeight(v uint64)
r/gnoswap/launchpad/type.gno: func DepositTime() uint64
r/gnoswap/launchpad/type.gno: func SetDepositTime(v uint64)
r/gnoswap/launchpad/type.gno: func DepositCollectHeight() uint64
r/gnoswap/launchpad/type.gno: func SetDepositCollectHeight(v uint64)
r/gnoswap/launchpad/type.gno: func DepositCollectTime() uint64
r/gnoswap/launchpad/type.gno: func SetDepositCollectTime(v uint64)
r/gnoswap/launchpad/type.gno: func ClaimableHeight() uint64
r/gnoswap/launchpad/type.gno: func SetClaimableHeight(v uint64)
r/gnoswap/launchpad/type.gno: func ClaimableTime() uint64
r/gnoswap/launchpad/type.gno: func SetClaimableTime(v uint64)
r/gnoswap/launchpad/type.gno: func RewardAmount() uint64
r/gnoswap/launchpad/type.gno: func SetRewardAmount(v uint64)
r/gnoswap/launchpad/type.gno: func RewardCollected() uint64
r/gnoswap/launchpad/type.gno: func SetRewardCollected(v uint64)
r/gnoswap/launchpad/type.gno: func RewardCollectHeight() uint64
r/gnoswap/launchpad/type.gno: func SetRewardCollectHeight(v uint64)
r/gnoswap/launchpad/type.gno: func RewardCollectTime() uint64
r/gnoswap/launchpad/type.gno: func SetRewardCollectTime(v uint64)
r/gnoswap/launchpad/type.gno: type TimeInfo struct { height uint64; time uint64 }
r/gnoswap/launchpad/type.gno: func NewTimeInfo(height uint64, t uint64) TimeInfo
r/gnoswap/launchpad/type.gno: func Height() uint64
r/gnoswap/launchpad/type.gno: func SetHeight(v uint64)
r/gnoswap/launchpad/type.gno: func Time() uint64
r/gnoswap/launchpad/type.gno: func SetTime(v uint64)
r/gnoswap/launchpad/type.gno: type RefundInfo struct { amount uint64; height uint64; time uint64 }
r/gnoswap/launchpad/type.gno: func NewRefundInfo(amount uint64, height uint64, t uint64) RefundInfo
r/gnoswap/launchpad/type.gno: func Amount() uint64
r/gnoswap/launchpad/type.gno: func SetAmount(v uint64)
r/gnoswap/launchpad/type.gno: func Height() uint64
r/gnoswap/launchpad/type.gno: func SetHeight(v uint64)
r/gnoswap/launchpad/type.gno: func Time() uint64
r/gnoswap/launchpad/type.gno: func SetTime(v uint64)
r/gnoswap/launchpad/type.gno: type Condition struct { tokenPath string; minAmount uint64 }
r/gnoswap/launchpad/type.gno: func NewCondition(tokenPath string, minAmount uint64) Condition
r/gnoswap/launchpad/type.gno: func TokenPath() string
r/gnoswap/launchpad/type.gno: func SetTokenPath(v string)
r/gnoswap/launchpad/type.gno: func MinAmount() uint64
r/gnoswap/launchpad/type.gno: func SetMinAmount(v uint64)
r/gnoswap/launchpad/util.gno: func GetOrigPkgAddr() std.Address
r/gnoswap/pool/api.gno: type RpcPool struct { PoolPath string; Token0Path string; Token1Path string; Token0Balance string; Token1Balance string; Fee uint32; TickSpacing int32; MaxLiquidityPerTick string; Slot0SqrtPriceX96 string; Slot0Tick int32; Slot0FeeProtocol uint8; Slot0Unlocked bool; FeeGrowthGlobal0X128 string; FeeGrowthGlobal1X128 string; Token0ProtocolFee string; Token1ProtocolFee string; Liquidity string; Ticks RpcTicks; TickBitmaps RpcTickBitmaps; Positions []RpcPosition }
r/gnoswap/pool/api.gno: type RpcTickBitmaps map[int16]string
r/gnoswap/pool/api.gno: type RpcTicks map[int32]RpcTickInfo
r/gnoswap/pool/api.gno: type RpcTickInfo struct { LiquidityGross string; LiquidityNet string; FeeGrowthOutside0X128 string; FeeGrowthOutside1X128 string; TickCumulativeOutside int64; SecondsPerLiquidityOutsideX string; SecondsOutside uint32; Initialized bool }
r/gnoswap/pool/api.gno: type RpcPosition struct { Owner string; TickLower int32; TickUpper int32; Liquidity string; Token0Owed string; Token1Owed string }
r/gnoswap/pool/api.gno: func ApiGetPools() string
r/gnoswap/pool/api.gno: func ApiGetPool(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetPoolList() []string
r/gnoswap/pool/getter.gno: func PoolGetToken0Path(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetToken1Path(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetFee(poolPath string) uint32
r/gnoswap/pool/getter.gno: func PoolGetBalanceToken0(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetBalanceToken1(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetTickSpacing(poolPath string) int32
r/gnoswap/pool/getter.gno: func PoolGetMaxLiquidityPerTick(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetSlot0SqrtPriceX96(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetSlot0Tick(poolPath string) int32
r/gnoswap/pool/getter.gno: func PoolGetSlot0FeeProtocol(poolPath string) uint8
r/gnoswap/pool/getter.gno: func PoolGetSlot0Unlocked(poolPath string) bool
r/gnoswap/pool/getter.gno: func PoolGetFeeGrowthGlobal0X128(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetFeeGrowthGlobal1X128(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetProtocolFeesToken0(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetProtocolFeesToken1(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetLiquidity(poolPath string) string
r/gnoswap/pool/getter.gno: func PoolGetPositionLiquidity(poolPath string, key string) string
r/gnoswap/pool/getter.gno: func PoolGetPositionFeeGrowthInside0LastX128(poolPath string, key string) string
r/gnoswap/pool/getter.gno: func PoolGetPositionFeeGrowthInside1LastX128(poolPath string, key string) string
r/gnoswap/pool/getter.gno: func PoolGetPositionTokensOwed0(poolPath string, key string) string
r/gnoswap/pool/getter.gno: func PoolGetPositionTokensOwed1(poolPath string, key string) string
r/gnoswap/pool/getter.gno: func PoolGetTickLiquidityGross(poolPath string, tick int32) string
r/gnoswap/pool/getter.gno: func PoolGetTickLiquidityNet(poolPath string, tick int32) string
r/gnoswap/pool/getter.gno: func PoolGetTickFeeGrowthOutside0X128(poolPath string, tick int32) string
r/gnoswap/pool/getter.gno: func PoolGetTickFeeGrowthOutside1X128(poolPath string, tick int32) string
r/gnoswap/pool/getter.gno: func PoolGetTickCumulativeOutside(poolPath string, tick int32) int64
r/gnoswap/pool/getter.gno: func PoolGetTickSecondsPerLiquidityOutsideX128(poolPath string, tick int32) string
r/gnoswap/pool/getter.gno: func PoolGetTickSecondsOutside(poolPath string, tick int32) uint32
r/gnoswap/pool/getter.gno: func PoolGetTickInitialized(poolPath string, tick int32) bool
r/gnoswap/pool/pool.gno: func Mint(token0Path string, token1Path string, fee uint32, recipient std.Address, tickLower int32, tickUpper int32, liquidityAmount string, positionCaller std.Address) string, string
r/gnoswap/pool/pool.gno: func Burn(token0Path string, token1Path string, fee uint32, tickLower int32, tickUpper int32, liquidityAmount string) string, string
r/gnoswap/pool/pool.gno: func Collect(token0Path string, token1Path string, fee uint32, recipient std.Address, tickLower int32, tickUpper int32, amount0Requested string, amount1Requested string) string, string
r/gnoswap/pool/pool.gno: func SetFeeProtocolByAdmin(feeProtocol0 uint8, feeProtocol1 uint8)
r/gnoswap/pool/pool.gno: func SetFeeProtocol(feeProtocol0 uint8, feeProtocol1 uint8)
r/gnoswap/pool/pool.gno: func CollectProtocolByAdmin(token0Path string, token1Path string, fee uint32, recipient std.Address, amount0Requested string, amount1Requested string) string, string
r/gnoswap/pool/pool.gno: func CollectProtocol(token0Path string, token1Path string, fee uint32, recipient std.Address, amount0Requested string, amount1Requested string) string, string
r/gnoswap/pool/pool_manager.gno: func Token0Path() string
r/gnoswap/pool/pool_manager.gno: func Token1Path() string
r/gnoswap/pool/pool_manager.gno: func Fee() uint32
r/gnoswap/pool/pool_manager.gno: func TickSpacing() int32
r/gnoswap/pool/pool_manager.gno: func SqrtPriceX96() *u256.Uint
r/gnoswap/pool/pool_manager.gno: func CreatePool(token0Path string, token1Path string, fee uint32, sqrtPriceX96 string)
r/gnoswap/pool/pool_manager.gno: func DoesPoolPathExist(poolPath string) bool
r/gnoswap/pool/pool_manager.gno: func GetPool(token0Path string, token1Path string, fee uint32) *Pool
r/gnoswap/pool/pool_manager.gno: func GetPoolFromPoolPath(poolPath string) *Pool
r/gnoswap/pool/pool_manager.gno: func GetPoolPath(token0Path string, token1Path string, fee uint32) string
r/gnoswap/pool/pool_manager.gno: func GetFeeAmountTickSpacing(fee uint32) int32
r/gnoswap/pool/position.gno: var Q128 = u256.MustFromDecimal(consts.Q128)
r/gnoswap/pool/position.gno: func PositionLiquidity(key string) *u256.Uint
r/gnoswap/pool/position.gno: func PositionFeeGrowthInside0LastX128(key string) *u256.Uint
r/gnoswap/pool/position.gno: func PositionFeeGrowthInside1LastX128(key string) *u256.Uint
r/gnoswap/pool/position.gno: func PositionTokensOwed0(key string) *u256.Uint
r/gnoswap/pool/position.gno: func PositionTokensOwed1(key string) *u256.Uint
r/gnoswap/pool/position.gno: func GetPosition(key string) PositionInfo, bool
r/gnoswap/pool/protocol_fee_pool_creation.gno: func GetPoolCreationFee() uint64
r/gnoswap/pool/protocol_fee_pool_creation.gno: func SetPoolCreationFee(fee uint64)
r/gnoswap/pool/protocol_fee_pool_creation.gno: func SetPoolCreationFeeByAdmin(fee uint64)
r/gnoswap/pool/protocol_fee_withdrawal.gno: var MaxBpsValue = uint64(10000)
r/gnoswap/pool/protocol_fee_withdrawal.gno: var ZeroBps = uint64(0)
r/gnoswap/pool/protocol_fee_withdrawal.gno: func HandleWithdrawalFee(tokenId uint64, token0Path string, amount0 string, token1Path string, amount1 string, poolPath string, positionCaller std.Address) string, string
r/gnoswap/pool/protocol_fee_withdrawal.gno: func GetWithdrawalFee() uint64
r/gnoswap/pool/protocol_fee_withdrawal.gno: func SetWithdrawalFee(fee uint64)
r/gnoswap/pool/protocol_fee_withdrawal.gno: func SetWithdrawalFeeByAdmin(fee uint64)
r/gnoswap/pool/swap.gno: type SwapResult struct { Amount0 *i256.Int; Amount1 *i256.Int; NewSqrtPrice *u256.Uint; NewTick int32; NewLiquidity *u256.Uint; NewProtocolFees ProtocolFees; FeeGrowthGlobal0X128 *u256.Uint; FeeGrowthGlobal1X128 *u256.Uint }
r/gnoswap/pool/swap.gno: type SwapComputation struct { AmountSpecified *i256.Int; SqrtPriceLimitX96 *u256.Uint; ZeroForOne bool; ExactInput bool; InitialState SwapState; Cache SwapCache }
r/gnoswap/pool/swap.gno: func Swap(token0Path string, token1Path string, fee uint32, recipient std.Address, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string, payer std.Address) string, string
r/gnoswap/pool/swap.gno: func DrySwap(token0Path string, token1Path string, fee uint32, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string) string, string, bool
r/gnoswap/pool/tick.gno: func GetTickLiquidityGross(tick int32) *u256.Uint
r/gnoswap/pool/tick.gno: func GetTickLiquidityNet(tick int32) *i256.Int
r/gnoswap/pool/tick.gno: func GetTickFeeGrowthOutside0X128(tick int32) *u256.Uint
r/gnoswap/pool/tick.gno: func GetTickFeeGrowthOutside1X128(tick int32) *u256.Uint
r/gnoswap/pool/tick.gno: func GetTickCumulativeOutside(tick int32) int64
r/gnoswap/pool/tick.gno: func GetTickSecondsPerLiquidityOutsideX128(tick int32) *u256.Uint
r/gnoswap/pool/tick.gno: func GetTickSecondsOutside(tick int32) uint32
r/gnoswap/pool/tick.gno: func GetTickInitialized(tick int32) bool
r/gnoswap/pool/type.gno: type Slot0 struct { sqrtPriceX96 *u256.Uint; tick int32; feeProtocol uint8; unlocked bool }
r/gnoswap/pool/type.gno: type Balances struct { token0 *u256.Uint; token1 *u256.Uint }
r/gnoswap/pool/type.gno: type ProtocolFees struct { token0 *u256.Uint; token1 *u256.Uint }
r/gnoswap/pool/type.gno: type ModifyPositionParams struct { owner std.Address; tickLower int32; tickUpper int32; liquidityDelta *i256.Int }
r/gnoswap/pool/type.gno: type SwapCache struct { feeProtocol uint8; liquidityStart *u256.Uint }
r/gnoswap/pool/type.gno: type SwapState struct { amountSpecifiedRemaining *i256.Int; amountCalculated *i256.Int; sqrtPriceX96 *u256.Uint; tick int32; feeGrowthGlobalX128 *u256.Uint; protocolFee *u256.Uint; liquidity *u256.Uint }
r/gnoswap/pool/type.gno: func SetSqrtPriceX96(sqrtPriceX96 string)
r/gnoswap/pool/type.gno: func SetTick(tick int32)
r/gnoswap/pool/type.gno: func SetFeeGrowthGlobalX128(feeGrowthGlobalX128 *u256.Uint)
r/gnoswap/pool/type.gno: func SetProtocolFee(fee *u256.Uint)
r/gnoswap/pool/type.gno: type StepComputations struct { sqrtPriceStartX96 *u256.Uint; tickNext int32; initialized bool; sqrtPriceNextX96 *u256.Uint; amountIn *u256.Uint; amountOut *u256.Uint; feeAmount *u256.Uint }
r/gnoswap/pool/type.gno: type PositionInfo struct { liquidity *u256.Uint; feeGrowthInside0LastX128 *u256.Uint; feeGrowthInside1LastX128 *u256.Uint; tokensOwed0 *u256.Uint; tokensOwed1 *u256.Uint }
r/gnoswap/pool/type.gno: type TickInfo struct { liquidityGross *u256.Uint; liquidityNet *i256.Int; feeGrowthOutside0X128 *u256.Uint; feeGrowthOutside1X128 *u256.Uint; tickCumulativeOutside int64; secondsPerLiquidityOutsideX128 *u256.Uint; secondsOutside uint32; initialized bool }
r/gnoswap/pool/type.gno: type Pool struct { token0Path string; token1Path string; balances Balances; fee uint32; tickSpacing int32; maxLiquidityPerTick *u256.Uint; slot0 Slot0; feeGrowthGlobal0X128 *u256.Uint; feeGrowthGlobal1X128 *u256.Uint; protocolFees ProtocolFees; liquidity *u256.Uint; ticks *avl.Tree; tickBitmaps *avl.Tree; positions *avl.Tree; tickCrossHook func(poolPath string, tickId int32, zeroForOne bool) }
r/gnoswap/pool/type.gno: func SetTickCrossHook(hook func(poolPath string, tickId int32, zeroForOne bool))
r/gnoswap/pool/type.gno: func PoolPath() string
r/gnoswap/pool/type.gno: func Token0Path() string
r/gnoswap/pool/type.gno: func Token1Path() string
r/gnoswap/pool/type.gno: func Fee() uint32
r/gnoswap/pool/type.gno: func BalanceToken0() *u256.Uint
r/gnoswap/pool/type.gno: func BalanceToken1() *u256.Uint
r/gnoswap/pool/type.gno: func TickSpacing() int32
r/gnoswap/pool/type.gno: func MaxLiquidityPerTick() *u256.Uint
r/gnoswap/pool/type.gno: func Slot0() Slot0
r/gnoswap/pool/type.gno: func Slot0SqrtPriceX96() *u256.Uint
r/gnoswap/pool/type.gno: func Slot0Tick() int32
r/gnoswap/pool/type.gno: func Slot0FeeProtocol() uint8
r/gnoswap/pool/type.gno: func Slot0Unlocked() bool
r/gnoswap/pool/type.gno: func FeeGrowthGlobal0X128() *u256.Uint
r/gnoswap/pool/type.gno: func FeeGrowthGlobal1X128() *u256.Uint
r/gnoswap/pool/type.gno: func ProtocolFeesToken0() *u256.Uint
r/gnoswap/pool/type.gno: func ProtocolFeesToken1() *u256.Uint
r/gnoswap/pool/type.gno: func Liquidity() *u256.Uint
r/gnoswap/position/api.gno: type RpcPosition struct { LpTokenId uint64; Burned bool; Owner string; Operator string; PoolKey string; TickLower int32; TickUpper int32; Liquidity string; FeeGrowthInside0LastX128 string; FeeGrowthInside1LastX128 string; TokensOwed0 string; TokensOwed1 string; Token0Balance string; Token1Balance string; FeeUnclaimed0 string; FeeUnclaimed1 string }
r/gnoswap/position/api.gno: type RpcUnclaimedFee struct { LpTokenId uint64; Fee0 string; Fee1 string }
r/gnoswap/position/api.gno: type ResponseQueryBase struct { Height int64; Timestamp int64 }
r/gnoswap/position/api.gno: type ResponseApiGetPositions struct { Stat ResponseQueryBase; Response []RpcPosition }
r/gnoswap/position/api.gno: func ApiGetPositions() string
r/gnoswap/position/api.gno: func ApiGetPosition(lpTokenId uint64) string
r/gnoswap/position/api.gno: func ApiGetPositionsByPoolPath(poolPath string) string
r/gnoswap/position/api.gno: func ApiGetPositionsByAddress(address std.Address) string
r/gnoswap/position/api.gno: func ApiGetPositionsUnclaimedFee() string
r/gnoswap/position/api.gno: func ApiGetPositionUnclaimedFeeByLpTokenId(lpTokenId uint64) string
r/gnoswap/position/getter.gno: func PositionGetPosition(tokenId uint64) Position
r/gnoswap/position/getter.gno: func PositionGetPositionNonce(tokenId uint64) *u256.Uint
r/gnoswap/position/getter.gno: func PositionGetPositionOperator(tokenId uint64) std.Address
r/gnoswap/position/getter.gno: func PositionGetPositionPoolKey(tokenId uint64) string
r/gnoswap/position/getter.gno: func PositionGetPositionTickLower(tokenId uint64) int32
r/gnoswap/position/getter.gno: func PositionGetPositionTickUpper(tokenId uint64) int32
r/gnoswap/position/getter.gno: func PositionGetPositionLiquidity(tokenId uint64) *u256.Uint
r/gnoswap/position/getter.gno: func PositionGetPositionFeeGrowthInside0LastX128(tokenId uint64) *u256.Uint
r/gnoswap/position/getter.gno: func PositionGetPositionFeeGrowthInside1LastX128(tokenId uint64) *u256.Uint
r/gnoswap/position/getter.gno: func PositionGetPositionTokensOwed0(tokenId uint64) *u256.Uint
r/gnoswap/position/getter.gno: func PositionGetPositionTokensOwed1(tokenId uint64) *u256.Uint
r/gnoswap/position/getter.gno: func PositionGetPositionIsBurned(tokenId uint64) bool
r/gnoswap/position/getter.gno: func PositionIsInRange(tokenId uint64) bool
r/gnoswap/position/getter.gno: func PositionGetPositionOwner(tokenId uint64) std.Address
r/gnoswap/position/getter.gno: func PositionGetPositionNonceStr(tokenId uint64) string
r/gnoswap/position/getter.gno: func PositionGetPositionOperatorStr(tokenId uint64) string
r/gnoswap/position/getter.gno: func PositionGetPositionLiquidityStr(tokenId uint64) string
r/gnoswap/position/getter.gno: func PositionGetPositionFeeGrowthInside0LastX128Str(tokenId uint64) string
r/gnoswap/position/getter.gno: func PositionGetPositionFeeGrowthInside1LastX128Str(tokenId uint64) string
r/gnoswap/position/getter.gno: func PositionGetPositionTokensOwed0Str(tokenId uint64) string
r/gnoswap/position/getter.gno: func PositionGetPositionTokensOwed1Str(tokenId uint64) string
r/gnoswap/position/liquidity_management.gno: type AddLiquidityParams struct { poolKey string; tickLower int32; tickUpper int32; amount0Desired *u256.Uint; amount1Desired *u256.Uint; amount0Min *u256.Uint; amount1Min *u256.Uint; caller std.Address }
r/gnoswap/position/position.gno: var ZERO_LIQUIDITY_FOR_FEE_COLLECTION string = "0"
r/gnoswap/position/position.gno: func MustGetPosition(tokenId uint64) Position
r/gnoswap/position/position.gno: func GetPosition(tokenId uint64) Position, bool
r/gnoswap/position/position.gno: func Mint(token0 string, token1 string, fee uint32, tickLower int32, tickUpper int32, amount0Desired string, amount1Desired string, amount0Min string, amount1Min string, deadline int64, mintTo std.Address, caller std.Address) uint64, string, string, string
r/gnoswap/position/position.gno: func IncreaseLiquidity(tokenId uint64, amount0DesiredStr string, amount1DesiredStr string, amount0MinStr string, amount1MinStr string, deadline int64) uint64, string, string, string, string
r/gnoswap/position/position.gno: type FeeGrowthInside struct { feeGrowthInside0LastX128 *u256.Uint; feeGrowthInside1LastX128 *u256.Uint }
r/gnoswap/position/position.gno: type PositionFeeUpdate struct { tokensOwed0 *u256.Uint; tokensOwed1 *u256.Uint; feeGrowthInside0LastX128 *u256.Uint; feeGrowthInside1LastX128 *u256.Uint }
r/gnoswap/position/position.gno: func DecreaseLiquidity(tokenId uint64, liquidityStr string, amount0MinStr string, amount1MinStr string, deadline int64, unwrapResult bool) uint64, string, string, string, string, string, string
r/gnoswap/position/position.gno: func CollectFee(tokenId uint64, unwrapResult bool) uint64, string, string, string, string, string
r/gnoswap/position/position.gno: func Reposition(tokenId uint64, tickLower int32, tickUpper int32, amount0DesiredStr string, amount1DesiredStr string, amount0MinStr string, amount1MinStr string) uint64, string, int32, int32, string, string
r/gnoswap/position/position.gno: func SetPositionOperator(tokenId uint64, operator std.Address)
r/gnoswap/position/type.gno: type Position struct { nonce *u256.Uint; operator std.Address; poolKey string; tickLower int32; tickUpper int32; liquidity *u256.Uint; feeGrowthInside0LastX128 *u256.Uint; feeGrowthInside1LastX128 *u256.Uint; tokensOwed0 *u256.Uint; tokensOwed1 *u256.Uint; burned bool }
r/gnoswap/position/type.gno: type MintParams struct { token0 string; token1 string; fee uint32; tickLower int32; tickUpper int32; amount0Desired *u256.Uint; amount1Desired *u256.Uint; amount0Min *u256.Uint; amount1Min *u256.Uint; deadline int64; mintTo std.Address; caller std.Address }
r/gnoswap/position/type.gno: type IncreaseLiquidityParams struct { tokenId uint64; amount0Desired *u256.Uint; amount1Desired *u256.Uint; amount0Min *u256.Uint; amount1Min *u256.Uint; deadline int64 }
r/gnoswap/position/type.gno: type DecreaseLiquidityParams struct { tokenId uint64; liquidity string; amount0Min *u256.Uint; amount1Min *u256.Uint; deadline int64; unwrapResult bool }
r/gnoswap/position/type.gno: type MintInput struct { token0 string; token1 string; fee uint32; tickLower int32; tickUpper int32; amount0Desired string; amount1Desired string; amount0Min string; amount1Min string; deadline int64; mintTo std.Address; caller std.Address }
r/gnoswap/position/type.gno: type TokenPair struct { token0 string; token1 string; token0IsNative bool; token1IsNative bool; wrappedAmount uint64 }
r/gnoswap/position/type.gno: type ProcessedMintInput struct { tokenPair TokenPair; amount0Desired *u256.Uint; amount1Desired *u256.Uint; amount0Min *u256.Uint; amount1Min *u256.Uint; tickLower int32; tickUpper int32; poolPath string }
r/gnoswap/position/utils.gno: func GetOrigPkgAddr() std.Address
r/gnoswap/protocol_fee/protocol_fee.gno: func DistributeProtocolFee()
r/gnoswap/protocol_fee/protocol_fee.gno: func GetDevOpsPct() uint64
r/gnoswap/protocol_fee/protocol_fee.gno: func SetDevOpsPctByAdmin(pct uint64)
r/gnoswap/protocol_fee/protocol_fee.gno: func SetDevOpsPct(pct uint64)
r/gnoswap/protocol_fee/protocol_fee.gno: func GetLastTransferToDevOps() uint64
r/gnoswap/protocol_fee/protocol_fee.gno: func GetAccuTransferToGovStaker() *avl.Tree
r/gnoswap/protocol_fee/protocol_fee.gno: func GetAccuTransferToGovStakerByTokenPath(path string) uint64
r/gnoswap/protocol_fee/protocol_fee.gno: func ClearAccuTransferToGovStaker()
r/gnoswap/protocol_fee/token_list_with_amount.gno: func TokenList(positive bool) []string
r/gnoswap/protocol_fee/token_list_with_amount.gno: func TokenListWithAmount() map[string]uint64
r/gnoswap/protocol_fee/token_list_with_amount.gno: func AddToProtocolFee(tokenPath string, amount uint64)
r/gnoswap/protocol_fee/token_list_with_amount.gno: func ClearTokenListWithAmount()
r/gnoswap/protocol_fee/token_list_with_amount.gno: func TransferProtocolFee() map[string]uint64
r/gnoswap/referral/errors.gno: var ErrNone int = iota
r/gnoswap/referral/errors.gno: var ErrInvalidAddress
r/gnoswap/referral/errors.gno: var ErrZeroAddress
r/gnoswap/referral/errors.gno: var ErrSelfReferral
r/gnoswap/referral/errors.gno: var ErrUnauthorized
r/gnoswap/referral/errors.gno: var ErrInvalidCaller
r/gnoswap/referral/errors.gno: var ErrCyclicReference
r/gnoswap/referral/errors.gno: var ErrTooManyRequests
r/gnoswap/referral/errors.gno: var ErrNotFound
r/gnoswap/referral/errors.gno: type ReferralError struct { Code int; Message string; Err error }
r/gnoswap/referral/errors.gno: func Error() string
r/gnoswap/referral/errors.gno: func Unwrap() error
r/gnoswap/referral/errors.gno: func NewError(code int, args ...interface{}) *ReferralError
r/gnoswap/referral/global_keeper.gno: func GetKeeper() ReferralKeeper
r/gnoswap/referral/global_keeper.gno: func GetReferral(addr string) string
r/gnoswap/referral/global_keeper.gno: func HasReferral(addr string) bool
r/gnoswap/referral/global_keeper.gno: func IsEmpty() bool
r/gnoswap/referral/keeper.gno: var MinTimeBetweenUpdates int64 = 24 * 60 * 60
r/gnoswap/referral/keeper.gno: func NewKeeper() ReferralKeeper
r/gnoswap/referral/referral.gno: type Referral struct { keeper ReferralKeeper }
r/gnoswap/referral/referral.gno: func NewReferral() *Referral
r/gnoswap/referral/referral.gno: func Register(addr std.Address, refAddr std.Address) error
r/gnoswap/referral/referral.gno: func Update(addr std.Address, newAddr std.Address) error
r/gnoswap/referral/referral.gno: func Remove(addr std.Address) error
r/gnoswap/referral/referral.gno: func Has(addr std.Address) bool
r/gnoswap/referral/referral.gno: func Get(addr std.Address) std.Address, error
r/gnoswap/referral/type.gno: var EventTypeRegister string = "RegisterReferral"
r/gnoswap/referral/type.gno: var EventTypeUpdate string = "UpdateReferral"
r/gnoswap/referral/type.gno: var EventTypeRemove string = "RemoveReferral"
r/gnoswap/referral/type.gno: type ReferralKeeper interface { register(addr std.Address, refAddr std.Address) error; update(addr std.Address, newRefAddr std.Address) error; remove(addr std.Address) error; has(addr std.Address) bool; get(addr std.Address) (std.Address, error); isEmpty() bool }
r/gnoswap/router/base.gno: var SINGLE_HOP_ROUTE int = 1
r/gnoswap/router/base.gno: var INITIAL_WUGNOT_BALANCE uint64 = 0
r/gnoswap/router/base.gno: var POOL_SEPARATOR string = "*POOL*"
r/gnoswap/router/base.gno: type RouterOperation interface { Validate() error; Process() (*SwapResult, error) }
r/gnoswap/router/base.gno: type BaseSwapParams struct { InputToken string; OutputToken string; RouteArr string; QuoteArr string; Deadline int64 }
r/gnoswap/router/exact_in.gno: type ExactInSwapOperation struct { baseSwapOperation; params ExactInParams }
r/gnoswap/router/exact_in.gno: func NewExactInSwapOperation(pp ExactInParams) *ExactInSwapOperation
r/gnoswap/router/exact_in.gno: func ExactInSwapRoute(inputToken string, outputToken string, amountIn string, RouteArr string, quoteArr string, amountOutMin string, deadline int64) string, string
r/gnoswap/router/exact_in.gno: func Validate() error
r/gnoswap/router/exact_in.gno: func Process() *SwapResult, error
r/gnoswap/router/exact_out.gno: type ExactOutSwapOperation struct { baseSwapOperation; params ExactOutParams }
r/gnoswap/router/exact_out.gno: func NewExactOutSwapOperation(pp ExactOutParams) *ExactOutSwapOperation
r/gnoswap/router/exact_out.gno: func ExactOutSwapRoute(inputToken string, outputToken string, amountOut string, routeArr string, quoteArr string, amountInMax string, deadline int64) string, string
r/gnoswap/router/exact_out.gno: func Validate() error
r/gnoswap/router/exact_out.gno: func Process() *SwapResult, error
r/gnoswap/router/protocol_fee_swap.gno: func GetSwapFee() uint64
r/gnoswap/router/protocol_fee_swap.gno: func SetSwapFeeByAdmin(fee uint64)
r/gnoswap/router/protocol_fee_swap.gno: func SetSwapFee(fee uint64)
r/gnoswap/router/router_dry.gno: func DrySwapRoute(inputToken string, outputToken string, specifiedAmount string, swapKind string, strRouteArr string, quoteArr string, tokenAmountLimit string) string
r/gnoswap/router/type.gno: type SwapType string
r/gnoswap/router/type.gno: var ExactIn SwapType = "EXACT_IN"
r/gnoswap/router/type.gno: var ExactOut SwapType = "EXACT_OUT"
r/gnoswap/router/type.gno: func String() string
r/gnoswap/router/type.gno: type SingleSwapParams struct { tokenIn string; tokenOut string; fee uint32; amountSpecified *i256.Int }
r/gnoswap/router/type.gno: type SwapParams struct { tokenIn string; tokenOut string; fee uint32; recipient std.Address; amountSpecified *i256.Int }
r/gnoswap/router/type.gno: type SwapResult struct { AmountIn *u256.Uint; AmountOut *u256.Uint; Routes []string; Quotes []string; AmountSpecified *i256.Int }
r/gnoswap/router/type.gno: type SwapCallbackData struct { tokenIn string; tokenOut string; fee uint32; payer std.Address }
r/gnoswap/router/type.gno: type ExactInParams struct { BaseSwapParams; AmountIn string; AmountOutMin string }
r/gnoswap/router/type.gno: func NewExactInParams(baseParams BaseSwapParams, amountIn string, amountOutMin string) ExactInParams
r/gnoswap/router/type.gno: type ExactOutParams struct { BaseSwapParams; AmountOut string; AmountInMax string }
r/gnoswap/router/type.gno: func NewExactOutParams(baseParams BaseSwapParams, amountOut string, amountInMax string) ExactOutParams
r/gnoswap/staker/api.gno: type RewardToken struct { PoolPath string; RewardsTokenList []string }
r/gnoswap/staker/api.gno: type ApiExternalIncentive struct { IncentiveId string; PoolPath string; RewardToken string; RewardAmount uint64; RewardLeft uint64; StartTimestamp int64; EndTimestamp int64; Active bool; Refundee string; CreatedHeight int64; DepositGnsAmount uint64 }
r/gnoswap/staker/api.gno: type ApiInternalIncentive struct { PoolPath string; Tier uint64; StartTimestamp int64; RewardPerBlock string }
r/gnoswap/staker/api.gno: func ApiGetRewardTokens() string
r/gnoswap/staker/api.gno: func ApiGetRewardTokensByPoolPath(targetPoolPath string) string
r/gnoswap/staker/api.gno: func ApiGetExternalIncentives() string
r/gnoswap/staker/api.gno: func ApiGetExternalIncentiveById(poolPath string, incentiveId string) string
r/gnoswap/staker/api.gno: func ApiGetExternalIncentivesByPoolPath(targetPoolPath string) string
r/gnoswap/staker/api.gno: func ApiGetExternalIncentivesByRewardTokenPath(rewardTokenPath string) string
r/gnoswap/staker/api.gno: func ApiGetInternalIncentives() string
r/gnoswap/staker/api.gno: func ApiGetInternalIncentivesByPoolPath(targetPoolPath string) string
r/gnoswap/staker/api.gno: func ApiGetInternalIncentivesByTiers(targetTier uint64) string
r/gnoswap/staker/api.gno: type LpTokenReward struct { LpTokenId uint64; Address string; Rewards []ApiReward }
r/gnoswap/staker/api.gno: type ApiReward struct { IncentiveType string; IncentiveId string; TargetPoolPath string; RewardTokenPath string; RewardTokenAmount uint64; StakeTimestamp int64; StakeHeight int64; IncentiveStart int64 }
r/gnoswap/staker/api.gno: type ApiStake struct { TokenId uint64; Owner std.Address; NumberOfStakes uint64; StakeTimestamp int64; StakeHeight int64; TargetPoolPath string }
r/gnoswap/staker/api.gno: type ResponseQueryBase struct { Height int64; Timestamp int64 }
r/gnoswap/staker/api.gno: type ResponseApiGetRewards struct { Stat ResponseQueryBase; Response []LpTokenReward }
r/gnoswap/staker/api.gno: type ResponseApiGetRewardByLpTokenId struct { Stat ResponseQueryBase; Response LpTokenReward }
r/gnoswap/staker/api.gno: type ResponseApiGetStakes struct { Stat ResponseQueryBase; Response []ApiStake }
r/gnoswap/staker/api.gno: func ApiGetRewardsByLpTokenId(targetLpTokenId uint64) string
r/gnoswap/staker/api.gno: func ApiGetRewardsByAddress(targetAddress string) string
r/gnoswap/staker/api.gno: func ApiGetStakes() string
r/gnoswap/staker/api.gno: func ApiGetStakesByLpTokenId(targetLpTokenId uint64) string
r/gnoswap/staker/api.gno: func ApiGetStakesByAddress(targetAddress string) string
r/gnoswap/staker/api.gno: func IsStaked(tokenId uint64) bool
r/gnoswap/staker/calculate_pool_position_reward.gno: type Reward struct { Internal uint64; InternalPenalty uint64; External map[string]uint64; ExternalPenalty map[string]uint64 }
r/gnoswap/staker/calculate_pool_position_reward.gno: type CalcPositionRewardParam struct { CurrentHeight int64; Deposits *Deposits; Pools *Pools; PoolTier *PoolTier; TokenId uint64 }
r/gnoswap/staker/calculate_pool_position_reward.gno: func CalcPositionReward(param CalcPositionRewardParam) []Reward
r/gnoswap/staker/calculate_pool_position_reward.gno: func ProcessUnClaimableReward(poolPath string, endHeight int64) uint64
r/gnoswap/staker/external_deposit_fee.gno: func GetDepositGnsAmount() uint64
r/gnoswap/staker/external_deposit_fee.gno: func SetDepositGnsAmountByAdmin(amount uint64)
r/gnoswap/staker/external_deposit_fee.gno: func SetDepositGnsAmount(amount uint64)
r/gnoswap/staker/external_token_list.gno: func AddToken(tokenPath string)
r/gnoswap/staker/external_token_list.gno: func RemoveToken(tokenPath string)
r/gnoswap/staker/getter.gno: func GetPoolByPoolPath(poolPath string) *Pool
r/gnoswap/staker/getter.gno: func GetPoolIncentiveIdList(poolPath string) []string
r/gnoswap/staker/getter.gno: func GetIncentive(poolPath string, incentiveId string) *ExternalIncentive
r/gnoswap/staker/getter.gno: func GetIncentiveStartTimestamp(poolPath string, incentiveId string) int64
r/gnoswap/staker/getter.gno: func GetIncentiveEndTimestamp(poolPath string, incentiveId string) int64
r/gnoswap/staker/getter.gno: func GetTargetPoolPathByIncentiveId(poolPath string, incentiveId string) string
r/gnoswap/staker/getter.gno: func GetCreatedHeightOfIncentive(poolPath string, incentiveId string) int64
r/gnoswap/staker/getter.gno: func GetIncentiveRewardToken(poolPath string, incentiveId string) string
r/gnoswap/staker/getter.gno: func GetIncentiveRewardAmount(poolPath string, incentiveId string) *u256.Uint
r/gnoswap/staker/getter.gno: func GetIncentiveRewardAmountAsString(poolPath string, incentiveId string) string
r/gnoswap/staker/getter.gno: func GetIncentiveStartHeight(poolPath string, incentiveId string) int64
r/gnoswap/staker/getter.gno: func GetIncentiveEndHeight(poolPath string, incentiveId string) int64
r/gnoswap/staker/getter.gno: func GetIncentiveRewardPerBlock(poolPath string, incentiveId string) uint64
r/gnoswap/staker/getter.gno: func GetIncentiveRefundee(poolPath string, incentiveId string) std.Address
r/gnoswap/staker/getter.gno: func GetDeposit(lpTokenId uint64) *Deposit
r/gnoswap/staker/getter.gno: func GetDepositOwner(lpTokenId uint64) std.Address
r/gnoswap/staker/getter.gno: func GetDepositStakeTimestamp(lpTokenId uint64) int64
r/gnoswap/staker/getter.gno: func GetDepositStakeHeight(lpTokenId uint64) int64
r/gnoswap/staker/getter.gno: func GetDepositTargetPoolPath(lpTokenId uint64) string
r/gnoswap/staker/getter.gno: func GetDepositTickLower(lpTokenId uint64) int32
r/gnoswap/staker/getter.gno: func GetDepositTickUpper(lpTokenId uint64) int32
r/gnoswap/staker/getter.gno: func GetDepositLiquidity(lpTokenId uint64) *u256.Uint
r/gnoswap/staker/getter.gno: func GetDepositLiquidityAsString(lpTokenId uint64) string
r/gnoswap/staker/getter.gno: func GetDepositLastCollectHeight(lpTokenId uint64) int64
r/gnoswap/staker/getter.gno: func GetDepositWarmUp(lpTokenId uint64) []Warmup
r/gnoswap/staker/getter.gno: func GetPoolTier(poolPath string) uint64
r/gnoswap/staker/getter.gno: func GetPoolTierRatio(poolPath string) uint64
r/gnoswap/staker/getter.gno: func GetPoolTierCount(tier uint64) uint64
r/gnoswap/staker/getter.gno: func GetPoolReward(tier uint64) uint64
r/gnoswap/staker/getter.gno: func GetExternalIncentive(incentiveId string) *ExternalIncentive
r/gnoswap/staker/getter.gno: func GetExternalIncentiveByPoolPath(poolPath string) []ExternalIncentive
r/gnoswap/staker/getter.gno: func GetPrintExternalInfo() string
r/gnoswap/staker/getter.gno: type ApiExternalDebugInfo struct { Height int64; Time int64; Position []ApiExternalDebugPosition }
r/gnoswap/staker/getter.gno: type ApiExternalDebugPosition struct { LpTokenId uint64; StakedHeight int64; StakedTimestamp int64; Incentive []ApiExternalDebugIncentive }
r/gnoswap/staker/getter.gno: type ApiExternalDebugIncentive struct { PoolPath string; IncentiveId string; RewardToken string; RewardAmount string; RewardLeft string; StartTimestamp int64; EndTimestamp int64; RewardPerBlockX96 string; RewardPerBlock string; Refundee std.Address; StartHeight int64; EndHeight int64; tokenAmountX96 *u256.Uint; tokenAmount uint64; tokenAmountFull uint64; tokenAmountToGive uint64; full30 uint64; give30 uint64; full50 uint64; give50 uint64; full70 uint64; give70 uint64; full100 uint64 }
r/gnoswap/staker/manage_pool_tier_and_warmup.gno: var NOT_EMISSION_TARGET_TIER uint64 = 0
r/gnoswap/staker/manage_pool_tier_and_warmup.gno: func SetPoolTierByAdmin(poolPath string, tier uint64)
r/gnoswap/staker/manage_pool_tier_and_warmup.gno: func SetPoolTier(poolPath string, tier uint64)
r/gnoswap/staker/manage_pool_tier_and_warmup.gno: func ChangePoolTierByAdmin(poolPath string, tier uint64)
r/gnoswap/staker/manage_pool_tier_and_warmup.gno: func ChangePoolTier(poolPath string, tier uint64)
r/gnoswap/staker/manage_pool_tier_and_warmup.gno: func RemovePoolTierByAdmin(poolPath string)
r/gnoswap/staker/manage_pool_tier_and_warmup.gno: func RemovePoolTier(poolPath string)
r/gnoswap/staker/manage_pool_tier_and_warmup.gno: func SetWarmUpByAdmin(pct int64, blockDuration int64)
r/gnoswap/staker/manage_pool_tier_and_warmup.gno: func SetWarmUp(pct int64, blockDuration int64)
r/gnoswap/staker/mint_stake.gno: func MintAndStake(token0 string, token1 string, fee uint32, tickLower int32, tickUpper int32, amount0Desired string, amount1Desired string, amount0Min string, amount1Min string, deadline int64) uint64, string, string, string, string
r/gnoswap/staker/protocol_fee_unstaking.gno: func GetUnstakingFee() uint64
r/gnoswap/staker/protocol_fee_unstaking.gno: func SetUnStakingFeeByAdmin(fee uint64)
r/gnoswap/staker/protocol_fee_unstaking.gno: func SetUnStakingFee(fee uint64)
r/gnoswap/staker/query.gno: type PoolData struct { PoolPath string; Tier uint64; ActiveIncentives []string; StakedLiquidity *u256.Uint }
r/gnoswap/staker/query.gno: type IncentiveData struct { IncentiveID string; StartTimestamp int64; EndTimestamp int64; RewardToken string; RewardAmount *u256.Uint; Refundee std.Address; PoolPath string }
r/gnoswap/staker/query.gno: type DepositData struct { TokenID uint64; Owner std.Address; TargetPoolPath string; StakeTimestamp int64; Liquidity *u256.Uint; WarmupCount int }
r/gnoswap/staker/query.gno: func QueryPoolData(poolPath string) *PoolData, error
r/gnoswap/staker/query.gno: func QueryIncentiveData(incentiveId string) *IncentiveData, error
r/gnoswap/staker/query.gno: func QueryDepositData(lpTokenId uint64) *DepositData, error
r/gnoswap/staker/reward_calculation_incentives.gno: type Incentives struct { byTime *avl.Tree; byHeight *avl.Tree; byEndHeight *avl.Tree; byCreator *avl.Tree; unclaimablePeriods *UintTree }
r/gnoswap/staker/reward_calculation_incentives.gno: func NewIncentives() Incentives
r/gnoswap/staker/reward_calculation_incentives.gno: func Get(startTime int64, endTime int64, creator std.Address, rewardToken string) *ExternalIncentive, bool
r/gnoswap/staker/reward_calculation_incentives.gno: func GetByIncentiveId(incentiveId string) *ExternalIncentive, bool
r/gnoswap/staker/reward_calculation_incentives.gno: func GetAllInHeights(startHeight int64, endHeight int64) map[string]*ExternalIncentive
r/gnoswap/staker/reward_calculation_pool.gno: type Pools struct { tree *avl.Tree }
r/gnoswap/staker/reward_calculation_pool.gno: func NewPools() *Pools
r/gnoswap/staker/reward_calculation_pool.gno: func Get(poolPath string) *Pool, bool
r/gnoswap/staker/reward_calculation_pool.gno: func GetOrCreate(poolPath string) *Pool
r/gnoswap/staker/reward_calculation_pool.gno: func Set(poolPath string, pool *Pool)
r/gnoswap/staker/reward_calculation_pool.gno: func Has(poolPath string) bool
r/gnoswap/staker/reward_calculation_pool.gno: func IterateAll(fn func(key string, pool *Pool) bool)
r/gnoswap/staker/reward_calculation_pool.gno: type Pool struct { poolPath string; stakedLiquidity *UintTree; lastUnclaimableHeight int64; unclaimableAcc uint64; rewardCache *UintTree; incentives Incentives; ticks Ticks; globalRewardRatioAccumulation *UintTree; historicalTick *UintTree }
r/gnoswap/staker/reward_calculation_pool.gno: func NewPool(poolPath string, currentHeight int64) *Pool
r/gnoswap/staker/reward_calculation_pool.gno: func CurrentGlobalRewardRatioAccumulation(currentHeight int64) int64, *u256.Uint
r/gnoswap/staker/reward_calculation_pool.gno: func CurrentTick(currentHeight int64) int32
r/gnoswap/staker/reward_calculation_pool.gno: func CurrentStakedLiquidity(currentHeight int64) *u256.Uint
r/gnoswap/staker/reward_calculation_pool.gno: func IsExternallyIncentivizedPool() bool
r/gnoswap/staker/reward_calculation_pool.gno: func CurrentReward(currentHeight int64) uint64
r/gnoswap/staker/reward_calculation_pool.gno: type RewardState struct { pool *Pool; deposit *Deposit; rewards []uint64; penalties []uint64 }
r/gnoswap/staker/reward_calculation_pool.gno: func RewardStateOf(deposit *Deposit) *RewardState
r/gnoswap/staker/reward_calculation_pool.gno: func CalculateInternalReward(startHeight int64, endHeight int64) []uint64, []uint64
r/gnoswap/staker/reward_calculation_pool.gno: func CalculateExternalReward(startHeight int64, endHeight int64, incentive *ExternalIncentive) []uint64, []uint64
r/gnoswap/staker/reward_calculation_pool.gno: func ApplyWarmup()
r/gnoswap/staker/reward_calculation_pool.gno: func RewardPerWarmup(startHeight int64, endHeight int64, rewardPerBlock uint64)
r/gnoswap/staker/reward_calculation_pool.gno: func CalculateRawRewardForPosition(currentHeight int64, currentTick int32, deposit *Deposit) *u256.Uint
r/gnoswap/staker/reward_calculation_pool.gno: func CalculateRewardForPosition(startHeight int64, startTick int32, endHeight int64, endTick int32, deposit *Deposit) *u256.Uint
r/gnoswap/staker/reward_calculation_pool_tier.gno: var AllTierCount int = 4
r/gnoswap/staker/reward_calculation_pool_tier.gno: var Tier1 int = 1
r/gnoswap/staker/reward_calculation_pool_tier.gno: var Tier2 int = 2
r/gnoswap/staker/reward_calculation_pool_tier.gno: var Tier3 int = 3
r/gnoswap/staker/reward_calculation_pool_tier.gno: type TierRatio struct { Tier1 uint64; Tier2 uint64; Tier3 uint64 }
r/gnoswap/staker/reward_calculation_pool_tier.gno: func TierRatioFromCounts(tier1Count uint64, tier2Count uint64, tier3Count uint64) TierRatio
r/gnoswap/staker/reward_calculation_pool_tier.gno: func Get(tier uint64) uint64
r/gnoswap/staker/reward_calculation_pool_tier.gno: type PoolTier struct { membership *avl.Tree; tierRatio TierRatio; lastRewardCacheHeight int64; currentEmission uint64; getEmission func() uint64; getHalvingBlocksInRange func(start, end int64) ([]int64, []uint64) }
r/gnoswap/staker/reward_calculation_pool_tier.gno: func NewPoolTier(pools *Pools, currentHeight int64, initialPoolPath string, getEmission func() uint64, getHalvingBlocksInRange func(start, end int64) ([]int64, []uint64)) *PoolTier
r/gnoswap/staker/reward_calculation_pool_tier.gno: func CurrentReward(tier uint64) uint64
r/gnoswap/staker/reward_calculation_pool_tier.gno: func CurrentCount(tier uint64) int
r/gnoswap/staker/reward_calculation_pool_tier.gno: func CurrentAllTierCounts() []uint64
r/gnoswap/staker/reward_calculation_pool_tier.gno: func CurrentTier(poolPath string) uint64
r/gnoswap/staker/reward_calculation_pool_tier.gno: func IsInternallyIncentivizedPool(poolPath string) bool
r/gnoswap/staker/reward_calculation_pool_tier.gno: func CurrentRewardPerPool(poolPath string) uint64
r/gnoswap/staker/reward_calculation_tick.gno: func EncodeInt(num int32) string
r/gnoswap/staker/reward_calculation_tick.gno: type Ticks struct { tree *avl.Tree }
r/gnoswap/staker/reward_calculation_tick.gno: func NewTicks() Ticks
r/gnoswap/staker/reward_calculation_tick.gno: func Get(tickId int32) *Tick
r/gnoswap/staker/reward_calculation_tick.gno: func Set(tickId int32, tick *Tick)
r/gnoswap/staker/reward_calculation_tick.gno: func Has(tickId int32) bool
r/gnoswap/staker/reward_calculation_tick.gno: type Tick struct { id int32; stakedLiquidityGross *u256.Uint; stakedLiquidityDelta *i256.Int; outsideAccumulation *UintTree }
r/gnoswap/staker/reward_calculation_tick.gno: func CurrentOutsideAccumulation(blockNumber int64) *u256.Uint
r/gnoswap/staker/reward_calculation_tick.gno: func TickCrossHook(pools *Pools, height func() int64) func(poolPath string, tickId int32, zeroForOne bool)
r/gnoswap/staker/reward_calculation_types.gno: func EncodeUint(num uint64) string
r/gnoswap/staker/reward_calculation_types.gno: func DecodeUint(s string) uint64
r/gnoswap/staker/reward_calculation_types.gno: type UintTree struct { tree *avl.Tree }
r/gnoswap/staker/reward_calculation_types.gno: func NewUintTree() *UintTree
r/gnoswap/staker/reward_calculation_types.gno: func Get(key int64) interface{}, bool
r/gnoswap/staker/reward_calculation_types.gno: func Set(key int64, value interface{})
r/gnoswap/staker/reward_calculation_types.gno: func Has(key int64) bool
r/gnoswap/staker/reward_calculation_types.gno: func Remove(key int64)
r/gnoswap/staker/reward_calculation_types.gno: func Iterate(start int64, end int64, fn func(key int64, value interface{}) bool)
r/gnoswap/staker/reward_calculation_types.gno: func ReverseIterate(start int64, end int64, fn func(key int64, value interface{}) bool)
r/gnoswap/staker/reward_calculation_warmup.gno: type Warmup struct { Index int; BlockDuration int64; NextWarmupHeight int64; WarmupRatio uint64 }
r/gnoswap/staker/reward_calculation_warmup.gno: func DefaultWarmupTemplate() []Warmup
r/gnoswap/staker/reward_calculation_warmup.gno: func InstantiateWarmup(currentHeight int64) []Warmup
r/gnoswap/staker/reward_calculation_warmup.gno: func Apply(poolReward uint64, positionLiquidity *u256.Uint, stakedLiquidity *u256.Uint) uint64, uint64
r/gnoswap/staker/reward_calculation_warmup.gno: func FindWarmup(currentHeight int64) int
r/gnoswap/staker/reward_calculation_warmup.gno: func GetWarmup(index int) Warmup
r/gnoswap/staker/reward_pool_store.gno: var TIER1_INDEX int = 0
r/gnoswap/staker/reward_pool_store.gno: var TIER2_INDEX int = 1
r/gnoswap/staker/reward_pool_store.gno: var TIER3_INDEX int = 2
r/gnoswap/staker/reward_pool_store.gno: var TIER_TYPE_NUM int = 3
r/gnoswap/staker/reward_pool_store.gno: type RewardPool struct { tier uint64; rewardAmount uint64; distributedAmount uint64; leftAmount uint64 }
r/gnoswap/staker/reward_pool_store.gno: func NewRewardPool() *RewardPool
r/gnoswap/staker/reward_pool_store.gno: func SetTier(tier uint64)
r/gnoswap/staker/reward_pool_store.gno: func SetRewardAmount(rewardAmount uint64)
r/gnoswap/staker/reward_pool_store.gno: func SetDistributedAmount(distributedAmount uint64)
r/gnoswap/staker/reward_pool_store.gno: func SetLeftAmount(leftAmount uint64)
r/gnoswap/staker/reward_pool_store.gno: func GetTier() uint64
r/gnoswap/staker/reward_pool_store.gno: func GetRewardAmount() uint64
r/gnoswap/staker/reward_pool_store.gno: func GetDistributedAmount() uint64
r/gnoswap/staker/reward_pool_store.gno: func GetLeftAmount() uint64
r/gnoswap/staker/reward_pool_store.gno: type RewardPoolMap struct { rewardPools map[string]*RewardPool; rewardAmountForTier [TIER_TYPE_NUM]uint64; rewardAmountForTierEachPool [TIER_TYPE_NUM]uint64; leftAmountForTier [TIER_TYPE_NUM]uint64 }
r/gnoswap/staker/reward_pool_store.gno: func NewRewardPoolMap() *RewardPoolMap
r/gnoswap/staker/reward_pool_store.gno: func SetRewardPoolMap(rewardPools map[string]*RewardPool)
r/gnoswap/staker/reward_pool_store.gno: func SetRewardPool(poolPath string, rewardPool *RewardPool)
r/gnoswap/staker/reward_pool_store.gno: func SetPoolTier(poolPath string, tier uint64)
r/gnoswap/staker/reward_pool_store.gno: func SetPoolRewardAmount(poolPath string, rewardAmount uint64)
r/gnoswap/staker/reward_pool_store.gno: func SetRewardAmountForTier(tierIndex int, amount uint64)
r/gnoswap/staker/reward_pool_store.gno: func SetRewardAmountForTierEachPool(tierIndex int, amount uint64)
r/gnoswap/staker/reward_pool_store.gno: func SetLeftAmountForTier(tierIndex int, amount uint64)
r/gnoswap/staker/reward_pool_store.gno: func GetRewardPools() map[string]*RewardPool
r/gnoswap/staker/reward_pool_store.gno: func GetRewardPoolByPoolPath(poolPath string) *RewardPool
r/gnoswap/staker/reward_pool_store.gno: func GetPoolTier(poolPath string) uint64
r/gnoswap/staker/reward_pool_store.gno: func GetPoolRewardAmount(poolPath string) uint64
r/gnoswap/staker/reward_pool_store.gno: func GetRewardAmountForTier(tierIndex int) uint64
r/gnoswap/staker/reward_pool_store.gno: func GetRewardAmountForTierEachPool(tierIndex int) uint64
r/gnoswap/staker/reward_pool_store.gno: func GetLeftAmountForTier(tierIndex int) uint64
r/gnoswap/staker/staker.gno: type Deposits struct { tree *avl.Tree }
r/gnoswap/staker/staker.gno: func NewDeposits() *Deposits
r/gnoswap/staker/staker.gno: func Get(tokenId uint64) *Deposit
r/gnoswap/staker/staker.gno: func Set(tokenId uint64, deposit *Deposit)
r/gnoswap/staker/staker.gno: func Has(tokenId uint64) bool
r/gnoswap/staker/staker.gno: func Remove(tokenId uint64)
r/gnoswap/staker/staker.gno: func Iterate(start uint64, end uint64, fn func(tokenId uint64, deposit *Deposit) bool)
r/gnoswap/staker/staker.gno: func Size() int
r/gnoswap/staker/staker.gno: type ExternalIncentives struct { tree *avl.Tree }
r/gnoswap/staker/staker.gno: func NewExternalIncentives() *ExternalIncentives
r/gnoswap/staker/staker.gno: func Get(incentiveId string) *ExternalIncentive
r/gnoswap/staker/staker.gno: func Set(incentiveId string, incentive *ExternalIncentive)
r/gnoswap/staker/staker.gno: func Has(incentiveId string) bool
r/gnoswap/staker/staker.gno: func Remove(incentiveId string)
r/gnoswap/staker/staker.gno: func Size() int
r/gnoswap/staker/staker.gno: type Stakers struct { tree *avl.Tree }
r/gnoswap/staker/staker.gno: func NewStakers() *Stakers
r/gnoswap/staker/staker.gno: func IterateAll(address std.Address, fn func(depositId uint64, deposit *Deposit) bool)
r/gnoswap/staker/staker.gno: func AddDeposit(address std.Address, depositId uint64, deposit *Deposit)
r/gnoswap/staker/staker.gno: func RemoveDeposit(address std.Address, depositId uint64)
r/gnoswap/staker/staker.gno: var TIMESTAMP_90DAYS int = 7776000
r/gnoswap/staker/staker.gno: var TIMESTAMP_180DAYS int = 15552000
r/gnoswap/staker/staker.gno: var TIMESTAMP_365DAYS int = 31536000
r/gnoswap/staker/staker.gno: var MAX_UNIX_EPOCH_TIME int = 253402300799
r/gnoswap/staker/staker.gno: var MUST_EXISTS_IN_TIER_1 string = "gno.land/r/demo/wugnot:gno.land/r/gnoswap/v1/gns:3000"
r/gnoswap/staker/staker.gno: var INTERNAL bool = true
r/gnoswap/staker/staker.gno: var EXTERNAL bool = false
r/gnoswap/staker/staker.gno: func StakeToken(tokenId uint64) string, string, string
r/gnoswap/staker/staker.gno: func CollectReward(tokenId uint64, unwrapResult bool) string, string
r/gnoswap/staker/staker.gno: func UnStakeToken(tokenId uint64, unwrapResult bool) string, string, string
r/gnoswap/staker/staker_external_incentive.gno: func CreateExternalIncentive(targetPoolPath string, rewardToken string, rewardAmount uint64, startTimestamp int64, endTimestamp int64)
r/gnoswap/staker/staker_external_incentive.gno: func EndExternalIncentive(refundee std.Address, targetPoolPath string, rewardToken string, startTimestamp int64, endTimestamp int64, height int64)
r/gnoswap/staker/type.gno: type ExternalIncentive struct { incentiveId string; startTimestamp int64; endTimestamp int64; createdHeight int64; depositGnsAmount uint64; targetPoolPath string; rewardToken string; rewardAmount uint64; rewardLeft uint64; startHeight int64; endHeight int64; rewardPerBlock uint64; refundee std.Address; unclaimableRefunded bool }
r/gnoswap/staker/type.gno: func StartTimestamp() int64
r/gnoswap/staker/type.gno: func EndTimestamp() int64
r/gnoswap/staker/type.gno: func RewardToken() string
r/gnoswap/staker/type.gno: func RewardAmount() uint64
r/gnoswap/staker/type.gno: func RewardSpent(currentHeight uint64) uint64
r/gnoswap/staker/type.gno: func RewardLeft(currentHeight uint64) uint64
r/gnoswap/staker/type.gno: func NewExternalIncentive(incentiveId string, targetPoolPath string, rewardToken string, rewardAmount uint64, startTimestamp int64, endTimestamp int64, refundee std.Address, createdHeight int64, depositGnsAmount uint64, currentTime int64, msPerBlock int64) *ExternalIncentive
r/gnoswap/staker/type.gno: type Deposit struct { owner std.Address; stakeTimestamp int64; stakeHeight int64; targetPoolPath string; tickLower int32; tickUpper int32; liquidity *u256.Uint; lastCollectHeight int64; warmups []Warmup }
r/gnoswap/staker/utils.gno: func GetOrigPkgAddr() std.Address
r/gnoswap/test_token/bar/bar.gno: var Token = grc20.NewToken("Bar", "BAR", 6)
r/gnoswap/test_token/bar/bar.gno: var UserTeller = Token.CallerTeller()
r/gnoswap/test_token/bar/bar.gno: func TotalSupply() uint64
r/gnoswap/test_token/bar/bar.gno: func BalanceOf(owner std.Address) uint64
r/gnoswap/test_token/bar/bar.gno: func Allowance(owner std.Address, spender std.Address) uint64
r/gnoswap/test_token/bar/bar.gno: func Transfer(to std.Address, amount uint64)
r/gnoswap/test_token/bar/bar.gno: func Approve(spender std.Address, amount uint64)
r/gnoswap/test_token/bar/bar.gno: func TransferFrom(from std.Address, to std.Address, amount uint64)
r/gnoswap/test_token/bar/bar.gno: func Burn(from std.Address, amount uint64)
r/gnoswap/test_token/bar/bar.gno: func Render(path string) string
r/gnoswap/test_token/baz/baz.gno: var Token = grc20.NewToken("Baz", "BAZ", 6)
r/gnoswap/test_token/baz/baz.gno: var UserTeller = Token.CallerTeller()
r/gnoswap/test_token/baz/baz.gno: func TotalSupply() uint64
r/gnoswap/test_token/baz/baz.gno: func BalanceOf(owner std.Address) uint64
r/gnoswap/test_token/baz/baz.gno: func Allowance(owner std.Address, spender std.Address) uint64
r/gnoswap/test_token/baz/baz.gno: func Transfer(to std.Address, amount uint64)
r/gnoswap/test_token/baz/baz.gno: func Approve(spender std.Address, amount uint64)
r/gnoswap/test_token/baz/baz.gno: func TransferFrom(from std.Address, to std.Address, amount uint64)
r/gnoswap/test_token/baz/baz.gno: func Burn(from std.Address, amount uint64)
r/gnoswap/test_token/baz/baz.gno: func Render(path string) string
r/gnoswap/test_token/foo/foo.gno: var Token = grc20.NewToken("Foo", "FOO", 6)
r/gnoswap/test_token/foo/foo.gno: var UserTeller = Token.CallerTeller()
r/gnoswap/test_token/foo/foo.gno: func TotalSupply() uint64
r/gnoswap/test_token/foo/foo.gno: func BalanceOf(owner std.Address) uint64
r/gnoswap/test_token/foo/foo.gno: func Allowance(owner std.Address, spender std.Address) uint64
r/gnoswap/test_token/foo/foo.gno: func Transfer(to std.Address, amount uint64)
r/gnoswap/test_token/foo/foo.gno: func Approve(spender std.Address, amount uint64)
r/gnoswap/test_token/foo/foo.gno: func TransferFrom(from std.Address, to std.Address, amount uint64)
r/gnoswap/test_token/foo/foo.gno: func Burn(from std.Address, amount uint64)
r/gnoswap/test_token/foo/foo.gno: func Render(path string) string
r/gnoswap/test_token/obl/obl.gno: var Token = grc20.NewToken("Obl", "OBL", 6)
r/gnoswap/test_token/obl/obl.gno: var UserTeller = Token.CallerTeller()
r/gnoswap/test_token/obl/obl.gno: func TotalSupply() uint64
r/gnoswap/test_token/obl/obl.gno: func BalanceOf(owner std.Address) uint64
r/gnoswap/test_token/obl/obl.gno: func Allowance(owner std.Address, spender std.Address) uint64
r/gnoswap/test_token/obl/obl.gno: func Transfer(to std.Address, amount uint64)
r/gnoswap/test_token/obl/obl.gno: func Approve(spender std.Address, amount uint64)
r/gnoswap/test_token/obl/obl.gno: func TransferFrom(from std.Address, to std.Address, amount uint64)
r/gnoswap/test_token/obl/obl.gno: func Burn(from std.Address, amount uint64)
r/gnoswap/test_token/obl/obl.gno: func Render(path string) string
r/gnoswap/test_token/qux/qux.gno: var Token = grc20.NewToken("Qux", "QUX", 6)
r/gnoswap/test_token/qux/qux.gno: var UserTeller = Token.CallerTeller()
r/gnoswap/test_token/qux/qux.gno: func TotalSupply() uint64
r/gnoswap/test_token/qux/qux.gno: func BalanceOf(owner std.Address) uint64
r/gnoswap/test_token/qux/qux.gno: func Allowance(owner std.Address, spender std.Address) uint64
r/gnoswap/test_token/qux/qux.gno: func Transfer(to std.Address, amount uint64)
r/gnoswap/test_token/qux/qux.gno: func Approve(spender std.Address, amount uint64)
r/gnoswap/test_token/qux/qux.gno: func TransferFrom(from std.Address, to std.Address, amount uint64)
r/gnoswap/test_token/qux/qux.gno: func Burn(from std.Address, amount uint64)
r/gnoswap/test_token/qux/qux.gno: func Render(path string) string
r/gnoswap/test_token/usdc/usdc.gno: var Token = grc20.NewToken("Usd Coin", "USDC", 6)
r/gnoswap/test_token/usdc/usdc.gno: var UserTeller = Token.CallerTeller()
r/gnoswap/test_token/usdc/usdc.gno: func TotalSupply() uint64
r/gnoswap/test_token/usdc/usdc.gno: func BalanceOf(owner std.Address) uint64
r/gnoswap/test_token/usdc/usdc.gno: func Allowance(owner std.Address, spender std.Address) uint64
r/gnoswap/test_token/usdc/usdc.gno: func Transfer(to std.Address, amount uint64)
r/gnoswap/test_token/usdc/usdc.gno: func Approve(spender std.Address, amount uint64)
r/gnoswap/test_token/usdc/usdc.gno: func TransferFrom(from std.Address, to std.Address, amount uint64)
r/gnoswap/test_token/usdc/usdc.gno: func Burn(from std.Address, amount uint64)
r/gnoswap/test_token/usdc/usdc.gno: func Render(path string) string

(generated with go run moul.io/revbro@latest -ext=.gno -exclude=_test.gno,_filetest.gno -max-length=256 ./...)

Copy link

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving the initial batch of comments -- I have more to go 🙏

Starting at launchpad tomorrow 🫡

@@ -0,0 +1 @@
module gno.land/p/gnoswap/uint256

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this differ from gno.land/p/demo/uint256, and why not use that one (from the examples)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@notJoon we need your support

Copy link
Member

@notJoon notJoon Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember it was because there were additional functions specialized for overflow calculations. Actually, we first created the gnoswap package and then removed those functions in p/demo.

I also think it would be better to use what's in p/demo if possible.

related with #475

@@ -0,0 +1 @@
module gno.land/p/gnoswap/int256

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this differ from gno.land/p/demo/int256, and why not use that one (from the examples)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above comment.


TOKEN_REGISTER_NAMESPACE string = "gno.land/r/g1er355fkjksqpdtwmhf5penwa82p0rhqxkkyhk5"

BLOCK_GENERATION_INTERVAL int64 = 2 // seconds

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is potentially very dangerous -- block time is a variable protocol trait that you should not hardcode or anticipate in any manner. Imagine a chain halt. If we don't already, we should have protocol-level support in Gno for fetching the block time, and deriving the interval accordingly.

I see you use this in the halving code, so please revise this 🙏

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have a function in place to regulate this time, which will collect the time at which 1 block is created and update it to an average value, which will be managed. Adjusting the time will be modified through transactions with external contracts, and due to the nature of the service, services that need to be provided based on a time value require the time value when a block is created. For example, proposals in governance, projects in launchpad, and external incentives in staker need to be managed when they end. To calculate this only by the time value, there is a problem that when the chain stops, as you said, the time is passing, so the reward should be paid. Considering that the chain can stall, we need to calculate based on block height rather than time, in which case we need to generate a termination point at which block it should end and have a system to distribute it evenly, which requires a value for the creation time of the block, which is initially the Default value.


// CONTRACT PATH & ADDRESS
const (
POOL_PATH string = "gno.land/r/gnoswap/v1/pool"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all of your realm paths should be modifiable through some kind of structure, and with proper ownership handling (ex. see the govdao bridge realm in the examples), and not hardcoded

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally agree, but given the current codebase, I prefer redeploying everything except the components that will own assets. Attempting to partially upgrade the codebase, which has many levels of interdependency, seems:

  1. undoable
  2. untrustworthy

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All contracts are dependent on the emission. The minting and distribution of GNS is done by emission, and the addresses that are distributed are determined by emission. As you said, it is correct to modify the whitelist or update of contract addresses to be able to distribute updated versions of contracts individually, not hard-coded.

LAUNCHPAD_PATH string = "gno.land/r/gnoswap/v1/launchpad"
LAUNCHPAD_ADDR std.Address = "g122mau2lp2rc0scs8d27pkkuys4w54mdy2tuer3"

INIT_REGISTER_PATH string = "gno.land/r/g1er355fkjksqpdtwmhf5penwa82p0rhqxkkyhk5/v2/register_gnodev"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this address?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean INIT_REGISTER_PATH, right?
This is the address that was used to register token contracts before there was a grc20reg. It is currently deprecated and should be deleted. It will be updated.

lockedAmount = uint64(0)
)

var minimumAmount = uint64(1_000_000)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use std.Coins?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think std.Coins deals with legacy denom and quantity. minimumAmount deals with gns token quantity, so I only need to manage the quantity, because you can only delegate gns tokens to a staker in gov.

SetRunning(true)

std.TestSetRealm(userRealm)
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop these scopes, they just clutter the code and serve no purpose here

}

/*
func TestEmptyRewardPool(t *testing.T) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test case for requesting to collect rewards when there are no rewards to collect.

}

// getPrevRealm returns the previous realm's package path
func getPrevRealm() std.Realm {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've seen this before... :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if you extract this function into a common contract, the prevRealm will change, so there will be a common function in each contract. If you call them separately as a common function, the prev will be the contract that called it, and the prev of the prev will be the caller that called the current contract. If you have another way to solve this, please share :)

@@ -0,0 +1,2 @@
// Package gov manages the governance of the gnoswap protocol, including proposal creation, voting, and execution.
package gov

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have detailed docs here

@moul
Copy link
Author

moul commented Jan 28, 2025

Thank you, @zivkovicmilos 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE do not merge this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants