Router
Last updated
Last updated
This contract implements the router and does the management of the pools. Due to the distributed nature of the TON Blockchain router, it can't do many checks, so it's mostly the proxy for the calls. The router contract so far is used as an owner of all the wallets holding the funds invested by liquidity providers.
The main idea is that if malformed or corrupted data is sent to the router it would create a malformed address of the pool and the message sent to it would fail. So if the message reaches the pool it means some criteria are satisfied.
Index | Type | Size (b/r) | Cell | Name | Description |
---|---|---|---|---|---|
(int) getIsLocked ()
This function returns if router is locked
@return0 1 bit unsigned value 0 - not locked, 1 - locked
(slice) getAdminAddress ()
returns router admin address
@return0 router admin address
(slice) getPoolAddress (slice jetton_wallet0, slice jetton_wallet1)
returns pool address for two given jetton_wallets belonging to the router
@param jetton_wallet0 Address of the jetton 0 wallet belonging to router
@param jetton_wallet1 Address of the jetton 1 wallet belonging to router
@return0 pool address
(cell, cell, cell) getChildContracts ()
returns code of the child contracts deprecated
@return0 code of the pool contract
@return1 code of the account contract
@return2 code of the nft position contract
Opcode : 0x2e3034ef
Operation that deploys and inits new Pool contract for two given jettons identified by their wallets. New pool would reorder the jettons to match the invariant slice_hash(jetton0_address) > slice_hash(jetton1_address).
Opcode : 0xa1daa96d
Opcode : 0xf189f909
Opcode : 0x42a0fb43
Opcode : 0xd4deb03b
Name | Size | Free |
---|---|---|
Mnemonic | Type | Description |
---|---|---|
Mnemonic | Type | Description |
---|---|---|
Mnemonic | Type | Description |
---|---|---|
Mnemonic | Type | Description |
---|---|---|
1
uint1
1 / 0
1
router::is_locked
Unused - flag that denotes should denote the router is locked. Currently unused
2
addr
267 / 0
1
router::admin_address
Admin address. Only this address can create new pools
3
uint64
64 / 0
1
router::pool_seqno
Number of pools created. Used by indexer to ensure that none of pools are skipped
4
code
0 / 1
1
router::poolv3_code
The cell with the code of the pool, that is needed to create a pool contract
5
code
0 / 1
1
router::accountv3_code
The cell with the code of the account, that is needed to create initial data for pool contract
6
code
0 / 1
1
router::position_nftv3_code
The cell with the code of the user NFT position, that is needed to create initial data for pool contract
1
332
691
op
Uint(32) op
query_id
Uint(64)
queryid as of the TON documentation
jetton_wallet0
Address()
Address of the jetton0 wallet. Used to compute pool address
jetton_wallet1
Address()
Address of the jetton1 wallet. Used to compute pool address
tick_spacing
Int(24)
Tick spacing to be used in the pool
initial_priceX96
Uint(160),PriceX96
Initial price for the pool
nftv3_content
Cell(),Metadata
nftv3item_content
Cell(),Metadata
jetton0_minter
Address()
Address of the jetton0 minter, used by indexer and frontend
jetton1_minter
Address()
Address of the jetton1 minter, used by indexer and frontend
controller_addr
Address()
Address that is allowed to change the fee. Can always be updated by admin
op
Uint(32) op
query_id
Uint(64)
owner
Address()
exit_code
Uint(32)
seqno
Uint(64), Indexer
hasCoinsInfo
Boolean()
hasIndexerInfo
Boolean()
amount0
Coins()
jetton0_address
Address()
amount1
Coins()
jetton1_address
Address()
op
Uint(32) op
op
Uint(32) op
new_admin
Address()