@@ -428,7 +428,7 @@ contract SwapPairContract is ITokensReceivedCallback, ISwapPairInformation, IUpg
428
428
// возврат сдачи
429
429
function _tryToReturnProvidingTokens (
430
430
uint128 needToProvideAmount , uint128 actualAmount , address tokenWallet , address senderTokenWallet , address senderAddress , TvmBuilder payloadTB
431
- ) private {
431
+ ) private pure {
432
432
uint128 a = needToProvideAmount - actualAmount;
433
433
if (a > 0 ) {
434
434
ITONTokenWallet (tokenWallet).transfer {
@@ -533,7 +533,7 @@ contract SwapPairContract is ITokensReceivedCallback, ISwapPairInformation, IUpg
533
533
returns (uint128 )
534
534
{
535
535
uint8 fromK = _getTokenPosition (tokenRoot);
536
- uint128 f = uint256 (lps[fromK]);
536
+ uint256 f = uint256 (lps[fromK]);
537
537
uint128 k = feeNominator+ feeDenominator;
538
538
uint256 b = f* k;
539
539
uint256 v = f * _sqrt ( k* k + math.muldiv (4 * feeDenominator* feeNominator, tokenAmount, f));
@@ -862,7 +862,7 @@ contract SwapPairContract is ITokensReceivedCallback, ISwapPairInformation, IUpg
862
862
TvmSlice tmpArgs = args.toSlice ();
863
863
(bool isPayloadOk , LPWithdrawInfo lpwi ) = _checkAndDecompressWithdrawLiquidityPayload (tmpArgs);
864
864
if ( isPayloadOk ) {
865
- SwapPairContract (this )._withdrawTokensFromLP {flag: 64 , value: 0 }(amount, lpwi, sender_address, sender_wallet, tokensBurnt);
865
+ SwapPairContract (this )._withdrawTokensFromLP {flag: 64 , value: 0 }(amount, lpwi, sender_wallet, tokensBurnt);
866
866
} else {
867
867
if ( tokensBurnt ) {
868
868
IRootTokenContract (lpTokenRootAddress).mint {
@@ -885,7 +885,7 @@ contract SwapPairContract is ITokensReceivedCallback, ISwapPairInformation, IUpg
885
885
// TODO: Антон: проверка
886
886
function _externalWithdrawLiquidityOneToken (
887
887
TvmCell args , uint128 amount , address sender_address , address sender_wallet , bool tokensBurnt
888
- ) external onlySelf {
888
+ ) external view onlySelf {
889
889
TvmSlice tmpArgs = args.toSlice ();
890
890
891
891
(bool isPayloadOk , address tokenRoot , address userWallet ) = _checkAndDecompressWithdrawLiquidityOneTokenPayload (tmpArgs);
@@ -953,7 +953,7 @@ contract SwapPairContract is ITokensReceivedCallback, ISwapPairInformation, IUpg
953
953
function _checkAndDecompressWithdrawLiquidityOneTokenPayload (TvmSlice tmpArgs ) private view returns (bool isPayloadOk , address tokenRoot , address userWallet ) {
954
954
bool isSizeOk = tmpArgs.hasNBitsAndRefs (WithdrawOperationSizeOneToken.bits, WithdrawOperationSizeOneToken.refs);
955
955
(tokenRoot, userWallet) = _decompresskWithdrawLiquidityOneTokenPayload (tmpArgs);
956
- bool isContentOk = tokenRoot.value != 0 && userWallet != 0 ;
956
+ bool isContentOk = ( tokenRoot.value != 0 ) && ( userWallet.value != 0 ) ;
957
957
isPayloadOk = isSizeOk && isContentOk;
958
958
}
959
959
0 commit comments