This is a smart contract to expand Jetton that is created with every liquidity pair. The Router deploys this as new pool creation is requested. Although the Router actually stores the two tokens of a pair and swapping takes place through it, the Exchange Contract must be called for liquidity to be provided or taken.
Read-Only Functions State-Changing Functions
get_jetton_data
Copy (int, int, slice, cell, cell) get_jetton_data() method_id
cell exchange_wallet_code
get_lp_swap_data
Copy (int, int, slice, slice, slice, int, int, slice, slice, int, int) get_lp_swap_data() method_id
slice jettonA_wallet_address
int jettonA_pending_balance
slice jettonB_wallet_address
int jettonB_pending_balance
get_lp_mining_data
Copy (int, int, int, int, int, int, cell) get_lp_mining_data() method_id
get_lp_user_info_dict
Copy (cell) get_lp_user_info_dict() method_id
cell ( dict ) total_user_info_dict
get_lp_user_info
Copy (int, int, int, int) get_lp_user_info(slice user_address) method_id
get_wallet_address
Copy slice get_wallet_address(slice owner_address) method_id
slice user_wallet_address
How to build transaction
Copy // TL-B schema
// transfer query_id:uint64 amount:VarUInteger 16 destination:MsgAddress response_destination:MsgAddress custom_payload:Maybe ^Cell forward_ton_amount:VarUInteger 16 forward_payload:Either Cell ^Cell = InternalMsgBody
// 1. add liquidity tokenA
await sendInternalMessageWithWallet ({
walletContract ,
secretKey ,
to : userJettonAWalletAddress ,
value : toNano ( 0.7 ) ,
body : beginCell ()
.storeUint ( 0xf8a7ea5 , 32 )
.storeUint (query_id , 64 )
.storeCoins (jettonAAmount)
.storeAddress (lpAddress)
.storeAddress (responseAddress)
.storeDict ( beginCell () .endCell ())
.storeCoins ( toNano ( 0.5 ))
.storeDict ( beginCell ()
.storeCoins (minAmountForJettonA)
.storeCoins (minAmountForJettonB)
.endCell ())
.endCell ()
});
// 2. add liquidity tokenB
await sendInternalMessageWithWallet ({
walletContract ,
secretKey ,
to : userJettonBWalletAddress ,
value : toNano ( 0.7 ) ,
body : beginCell ()
.storeUint ( 0xf8a7ea5 , 32 )
.storeUint (query_id , 64 )
.storeCoins (jettonBAmount)
.storeAddress (lpAddress)
.storeAddress (responseAddress)
.storeDict ( beginCell () .endCell ())
.storeCoins ( toNano ( 0.5 ))
.storeDict ( beginCell ()
.storeCoins (minAmountForJettonA)
.storeCoins (minAmountForJettonB)
.endCell ())
.endCell ()
});
Copy // TL-B schema
// burn query_id:uint64 amount:VarUInteger 16 response_destination:MsgAddress custom_payload:Maybe ^Cell = InternalMsgBody
await sendInternalMessageWithWallet ({
walletContract ,
secretKey ,
to : lpAddress ,
value : toNano ( 0.35 ) ,
body : beginCell ()
.storeUint ( 0x595f07bc , 32 )
.storeUint (query_id , 64 )
.storeCoins (lpAmount)
.storeDict ( beginCell ()
.storeCoins (minAmountForJettonA)
.storeCoins (minAmountForJettonB)
.endCell ())
.endCell ()
});
Copy // TL-B schema
// claim query_id:uint64 = InternalMsgBody
await sendInternalMessageWithWallet ({
walletContract ,
secretKey ,
to : lpAddress ,
value : toNano ( 0.15 ) ,
body : beginCell ()
.storeUint ( 0x6b14cfe1 , 32 )
.storeUint (query_id , 64 )
.endCell ()
});