@@ -131,44 +131,44 @@ contract ListaAutoBuyback is Initializable, AccessControlUpgradeable {
131131 }
132132
133133 /// @dev buy back tokens using router
134- /// @param router The address of the router.
135- /// @param tokenIn The address of the input token.
136- /// @param tokenOut The address of the output token.
137- /// @param amountIn The amount to sell.
138- /// @param amountOutMin The minimum amount to receive.
139- /// @param swapData The swap data.
134+ /// @param _router The address of the router.
135+ /// @param _tokenIn The address of the input token.
136+ /// @param _tokenOut The address of the output token.
137+ /// @param _amountIn The amount to sell.
138+ /// @param _amountOutMin The minimum amount to receive.
139+ /// @param _swapData The swap data.
140140 function buyback (
141- address router ,
142- address tokenIn ,
143- address tokenOut ,
144- uint256 amountIn ,
145- uint256 amountOutMin ,
146- bytes calldata swapData
141+ address _router ,
142+ address _tokenIn ,
143+ address _tokenOut ,
144+ uint256 _amountIn ,
145+ uint256 _amountOutMin ,
146+ bytes calldata _swapData
147147 ) external onlyRole (BOT) {
148- require (tokenWhitelist[tokenIn ], "token not whitelisted " );
149- require (tokenWhitelist[tokenOut ], "token not whitelisted " );
150- require (routerWhitelist[router ], "router not whitelisted " );
148+ require (tokenWhitelist[_tokenIn ], "token not whitelisted " );
149+ require (tokenWhitelist[_tokenOut ], "token not whitelisted " );
150+ require (routerWhitelist[_router ], "router not whitelisted " );
151151
152- uint256 beforeTokenIn = _getTokenBalance (tokenIn , address (this ));
153- uint256 beforeTokenOut = _getTokenBalance (tokenOut , defaultReceiver);
152+ uint256 beforeTokenIn = _getTokenBalance (_tokenIn , address (this ));
153+ uint256 beforeTokenOut = _getTokenBalance (_tokenOut , defaultReceiver);
154154
155- bool isNativeTokenIn = (tokenIn == SWAP_NATIVE_TOKEN_ADDRESS);
155+ bool isNativeTokenIn = (_tokenIn == SWAP_NATIVE_TOKEN_ADDRESS);
156156 if (! isNativeTokenIn) {
157- IERC20 (tokenIn ).safeApprove (router, amountIn );
157+ IERC20 (_tokenIn ).safeApprove (_router, _amountIn );
158158 }
159- (bool success , ) = router .call {value: isNativeTokenIn ? amountIn : 0 }(swapData );
159+ (bool success , ) = _router .call {value: isNativeTokenIn ? _amountIn : 0 }(_swapData );
160160 require (success, "swap failed " );
161161 if (! isNativeTokenIn) {
162- IERC20 (tokenIn ).safeApprove (router , 0 );
162+ IERC20 (_tokenIn ).safeApprove (_router , 0 );
163163 }
164164
165- uint256 actualAmountIn = beforeTokenIn - _getTokenBalance (tokenIn , address (this ));
166- uint256 actualAmountOut = _getTokenBalance (tokenOut , defaultReceiver) - beforeTokenOut;
165+ uint256 actualAmountIn = beforeTokenIn - _getTokenBalance (_tokenIn , address (this ));
166+ uint256 actualAmountOut = _getTokenBalance (_tokenOut , defaultReceiver) - beforeTokenOut;
167167
168- require (actualAmountIn <= amountIn , "exceed amount in " );
169- require (actualAmountOut >= amountOutMin , "not enough profit " );
168+ require (actualAmountIn <= _amountIn , "exceed amount in " );
169+ require (actualAmountOut >= _amountOutMin , "not enough profit " );
170170
171- emit BoughtBack (router, tokenIn, tokenOut , actualAmountIn, actualAmountOut);
171+ emit BoughtBack (_router, _tokenIn, _tokenOut , actualAmountIn, actualAmountOut);
172172 }
173173
174174 function adminTransfer (address _token , uint256 _amount ) external onlyRole (DEFAULT_ADMIN_ROLE) {
0 commit comments