Skip to content
Merged
7 changes: 1 addition & 6 deletions uniswap/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ def approved(self: Any, *args: Any, **kwargs: Any) -> Any:
is_approved = self._is_approved(token)
# logger.warning(f"Approved? {token}: {is_approved}")
if not is_approved:
self._approve(token)
if token_two:
is_approved = self._is_approved(token_two)
# logger.warning(f"Approved? {token_two}: {is_approved}")
if not is_approved:
self._approve(token_two)
self.approve(token)
return method(self, *args, **kwargs)

return approved
Expand Down
2 changes: 1 addition & 1 deletion uniswap/uniswap.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ def remove_liquidity(self, token: str, max_token: int) -> HexBytes:
return self._build_and_send_tx(function)

# ------ Approval Utils ------------------------------------------------------------
def _approve(self, token: AddressLike, max_approval: Optional[int] = None) -> None:
def approve(self, token: AddressLike, max_approval: Optional[int] = None) -> None:
"""Give an exchange/router max approval of a token."""
max_approval = self.max_approval_int if not max_approval else max_approval
contract_addr = (
Expand Down