diff --git a/contracts/adapters/BaseParaSwapAdapter.sol b/contracts/adapters/BaseParaSwapAdapter.sol index 849e1f1e..d06e9ec5 100644 --- a/contracts/adapters/BaseParaSwapAdapter.sol +++ b/contracts/adapters/BaseParaSwapAdapter.sol @@ -86,7 +86,8 @@ abstract contract BaseParaSwapAdapter is FlashLoanReceiverBase, Ownable { uint256 amount, PermitSignature memory permitSignature ) internal { - if (_usePermit(permitSignature)) { + // If deadline is set to zero, assume there is no signature for permit + if (permitSignature.deadline != 0) { IERC20WithPermit(reserveAToken).permit( user, address(this), @@ -108,17 +109,6 @@ abstract contract BaseParaSwapAdapter is FlashLoanReceiverBase, Ownable { ); } - /** - * @dev Tells if the permit method should be called by inspecting if there is a valid signature. - * If signature params are set to 0, then permit won't be called. - * @param signature struct containing the permit signature - * @return whether or not permit should be called - */ - function _usePermit(PermitSignature memory signature) internal pure returns (bool) { - return - !(uint256(signature.deadline) == uint256(signature.v) && uint256(signature.deadline) == 0); - } - /** * @dev Emergency rescue for token stucked on this contract, as failsafe mechanism * - Funds should never remain in this contract more time than during transactions