Skip to content

Commit 862c564

Browse files
committed
Minor update of smart contracts
1 parent 71d4e64 commit 862c564

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

contracts/SwapPair/SwapPairContract.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ contract SwapPairContract is ITokensReceivedCallback, ISwapPairInformation, IUpg
302302
external
303303
responsible
304304
view
305-
returns (uint128, uint128)
305+
returns (LiquidityPoolsInfo)
306306
{
307-
return (lps[T1], lps[T2]);
307+
return LiquidityPoolsInfo(lps[T1], lps[T2], liquidityTokensMinted);
308308
}
309309

310310
//============Functions for offchain execution============

contracts/SwapPair/interfaces/swapPair/ISwapPairContract.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface ISwapPairContract is ISwapPairInformation {
1313
uint128 swappableTokenAmount
1414
) external responsible view returns (SwapInfo _swapInfo);
1515

16-
function getCurrentExchangeRate() external responsible view returns (uint128, uint128);
16+
function getCurrentExchangeRate() external responsible view returns (LiquidityPoolsInfo);
1717

1818
function getPairInfo() external responsible view returns (SwapPairInfo info);
1919

contracts/SwapPair/interfaces/swapPair/ISwapPairInformation.sol

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ interface ISwapPairInformation {
2020
uint32 swapPairCodeVersion; // code version of swap pair. can be upgraded using root contract
2121
}
2222

23+
// Information about liquidity pools volumes
24+
struct LiquidityPoolsInfo {
25+
uint128 lp1; // volume of first LP
26+
uint128 lp2; // volume of second LP
27+
uint256 lpTokensMinted; // amount of minted LP tokens
28+
}
29+
2330
// Information about swap operation result
2431
struct SwapInfo {
2532
uint128 swappableTokenAmount; // token amount that will be swapped

0 commit comments

Comments
 (0)