LoadingPreparing the Explorer shell…
Skip to contentRealm detail
zdex
gno.land/r/g1mv0052e7r6s09f5t9xsqf00nj3tqsgt9dg52jr/zdex/v2
Indexed deployment identity with independently loaded latest RPC source, functions, and Render.
Indexed deployment
Identity
- Package path
- gno.land/r/g1mv0052e7r6s09f5t9xsqf00nj3tqsgt9dg52jr/zdex/v2
- Deployed (UTC)
package zdex
import "chain"
func SetPaused(cur realm, v bool) {
mustOwner(cur)
paused = v
chain.Emit("Pause", "paused", itoa(btoi(v)))
}
func ProposeAdmin(cur realm, next address) {
mustOwner(cur)
require(next.IsValid(), "zdex: invalid admin")
pendingAdmin = next
chain.Emit("ProposeAdmin", "to", next.String())
}
func AcceptAdmin(cur realm) {
require(pendingAdmin.IsValid(), "zdex: no pending admin")
require(cur.Previous().Address() == pendingAdmin, "zdex: not pending admin")
admin = pendingAdmin
var z address
pendingAdmin = z
chain.Emit("AcceptAdmin", "to", admin.String())
}
func TransferAdmin(cur realm, next address) {
ProposeAdmin(cur, next)
}
func Admin() address {
return admin
}
func RealmAddr() address {
return thisAddr()
}
func PendingAdmin() address {
return pendingAdmin
}
func Paused() bool {
return paused
}
func CollectFees(cur realm, poolID string) (ugnotOut, tokenOut int64) {
p := getPool(poolID)
caller := cur.Previous().Address()
got := false
if caller == p.Creator {
ugnotOut = add64(ugnotOut, p.AccruedCreatorU)
tokenOut = add64(tokenOut, p.AccruedCreatorT)
p.AccruedCreatorU = 0
p.AccruedCreatorT = 0
got = true
}
if caller == admin {
ugnotOut = add64(ugnotOut, p.AccruedProtocolU)
tokenOut = add64(tokenOut, p.AccruedProtocolT)
p.AccruedProtocolU = 0
p.AccruedProtocolT = 0
got = true
}
require(got, "zdex: not fee recipient")
require(ugnotOut > 0 || tokenOut > 0, "zdex: nothing accrued")
if ugnotOut > 0 {
sendUgnot(0, cur, caller, ugnotOut)
}
if tokenOut > 0 {
pushToken(0, cur, poolTokRef(p), caller, tokenOut)
}
chain.Emit("CollectFees", "pool", poolID, "to", caller.String(), "ugnot", itoa(ugnotOut), "token", itoa(tokenOut))
return ugnotOut, tokenOut
}
func btoi(v bool) int64 {
if v {
return 1
}
return 0
}
Latest RPC state
Exported functions
- SetPaused(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, v bool)
- ProposeAdmin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, next string)
- AcceptAdmin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})
- TransferAdmin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, next string)
- Admin() string
- RealmAddr() string
- PendingAdmin() string
- Paused() bool
- CollectFees(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string) (int64, int64)
- PlaceBid(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, giveU int64, wantAmt int64, expireH int64, allOrNone bool) uint64
- PlaceAsk(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, giveT int64, wantU int64, expireH int64, allOrNone bool) uint64
Latest RPC state · Realm Render
zdex v2
GNOT-native AMM generation 2. Two-sided pools, native ugnot (no wrap), escrow limit orders.
Swap fee 0.30% default (tiers 0.05% / 0.30% / 1.00%). Protocol ~1/6 of the fee.
- Version: 2
- Package:
gno.land/r/g1mv0052e7r6s09f5t9xsqf00nj3tqsgt9dg52jr/zdex/v2
- Pools: 1
- Open orders: 0
- Admin:
g1mv0052e7r6s09f5t9xsqf00nj3tqsgt9dg52jr
Pools
| Pair | ugnot | token | virtual | fee | launch |
|---|---:|---:|---:|---:|---|
| ZDEX | 300000000 | 300000000000 | 0 | 30 bps | no |
Swap
Create a pool
Two-sided ugnot/GRC20. Min 1 GNOT. Fee tiers 5 / 30 / 100 bps. Protocol takes ~1/6 of the swap fee; the rest stays as LP.
Order book
FillOrder(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, orderID uint64, giveAmt int64) (int64, int64)CancelOrder(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, orderID uint64)OrderCount() intLaunch(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, name string, symbol string, decimals int64, totalSupply int64, creatorKeepBps int64, virtualUgnot int64, vestBlocks int64, lockBlocks int64, snipeBlocks int64, snipeMaxBps int64) stringClaimVest(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, symbol string) int64VestingOf(symbol string, owner string) (int64, int64, int64)MulDiv(a int64, b int64, d int64) int64Sqrt(n int64) int64MulDivCeil(a int64, b int64, d int64) int64AmountOut(amountIn int64, reserveIn int64, virtualIn int64, reserveOut int64, virtualOut int64, feeBps int64) int64AmountIn(amountOut int64, reserveIn int64, virtualIn int64, reserveOut int64, virtualOut int64, feeBps int64) int64HarvestPoints(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string) int64ClaimFeeShare(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}) int64PointsOf(owner string) (int64, int64, int64)ClaimableFeeShare(owner string) int64EpochInfo() (int64, int64, int64, int64, int64, int64, int64)SetEpochBlocks(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, n int64)SetFeeShareBps(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, bps int64)CreatePool(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, tokenKey string, symbol string, amountU int64, amountT int64, feeBps int64) stringAddLiquidity(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, amountU int64, maxToken int64, minLP int64) int64RemoveLiquidity(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, lp int64, minU int64, minT int64) (int64, int64)PoolInfo(poolID string) (int64, int64, int64, int64, int64)PositionOf(poolID string, owner string) int64PoolCount() intHeight() int64PoolList() stringPoolSnapshot(poolID string) stringOrderList() stringPointsSnapshot(owner string) stringEpochSnapshot() stringTokenCatalog() stringLookupToken(ref string) stringRender(path string) stringQuote(poolID string, tokenIn string, amountIn int64) int64QuoteIn(poolID string, tokenOut string, amountOut int64) int64SwapExactIn(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, tokenIn string, amountIn int64, minOut int64, maxHeight int64) int64SwapExactOut(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, tokenOut string, amountOut int64, maxIn int64, maxHeight int64) int64SpotPrice(poolID string) int64Transfer(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, symbol string, to string, amount int64)Approve(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, symbol string, spender string, amount int64)TransferFrom(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, symbol string, from string, to string, amount int64)BalanceOf(symbol string, owner string) int64TotalSupply(symbol string) int64TokenKey(symbol string) stringVersion() stringCaps() stringThisPkg() stringNextPkg() stringSetNextPkg(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, path string)ModuleOf(name string) stringSetModule(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, name string, pkg string)Modules() stringHubSnapshot() string