Skip to content

Commit

Permalink
Merge pull request #26 from Gearbox-protocol/next-cleanup-adapter
Browse files Browse the repository at this point in the history
feat: improve wording in abstract adapter
  • Loading branch information
Van0k authored Feb 17, 2023
2 parents 1b2125c + 81bb160 commit 46efcb0
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions contracts/adapters/AbstractAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ abstract contract AbstractAdapter is IAdapter {
}

/// @dev Executes a swap operation on the target contract from the Credit Account
/// without explicit approval to spend `tokenIn`
/// @param creditAccount Credit Account from which the call is made
/// @param tokenIn The token that the call is expected to spend
/// @param tokenOut The token that the call is expected to produce
/// @param callData Data to call the target contract with
/// @param disableTokenIn Whether the input token should be disabled afterwards
/// (for operations that spend the entire balance)
/// @return result Call output
function _executeSwap(
function _executeSwapNoApprove(
address creditAccount,
address tokenIn,
address tokenOut,
Expand All @@ -96,9 +97,9 @@ abstract contract AbstractAdapter is IAdapter {
);
}

/// @dev Wrapper for `_executeSwap` that computes the Credit Account on the spot
/// @dev Wrapper for `_executeSwapNoApprove` that computes the Credit Account on the spot
/// See params and other details above
function _executeSwap(
function _executeSwapNoApprove(
address tokenIn,
address tokenOut,
bytes memory callData,
Expand All @@ -117,7 +118,7 @@ abstract contract AbstractAdapter is IAdapter {
}

/// @dev Executes a swap operation on the target contract from the Credit Account
/// with maximal allowance, and then resets the allowance back to max
/// with maximal `tokenIn` allowance, and then sets the allowance to max again
/// @param creditAccount Credit Account from which the call is made
/// @param tokenIn The token that the call is expected to spend
/// @param tokenOut The token that the call is expected to produce
Expand All @@ -126,7 +127,7 @@ abstract contract AbstractAdapter is IAdapter {
/// (for operations that spend the entire balance)
/// @return result Call output
/// @notice Must only be used for highly secure and immutable protocols, such as Uniswap & Curve
function _executeSwapMaxAllowance(
function _executeSwapMaxApprove(
address creditAccount,
address tokenIn,
address tokenOut,
Expand All @@ -145,9 +146,9 @@ abstract contract AbstractAdapter is IAdapter {
);
}

/// @dev Wrapper for `_executeSwapMaxAllowance` that computes the Credit Account on the spot
/// @dev Wrapper for `_executeSwapMaxApprove` that computes the Credit Account on the spot
/// See params and other details above
function _executeSwapMaxAllowance(
function _executeSwapMaxApprove(
address tokenIn,
address tokenOut,
bytes memory callData,
Expand All @@ -166,15 +167,15 @@ abstract contract AbstractAdapter is IAdapter {
}

/// @dev Executes a swap operation on the target contract from the Credit Account
/// with maximal allowance, and then sets it to 1
/// with maximal `tokenIn` allowance, and then sets the allowance to 1
/// @param creditAccount Credit Account from which the call is made
/// @param tokenIn The token that the call is expected to spend
/// @param tokenOut The token that the call is expected to produce
/// @param callData Data to call the target contract with
/// @param disableTokenIn Whether the input token should be disabled afterwards
/// (for operations that spend the entire balance)
/// @return result Call output
function _executeSwapSafeAllowance(
function _executeSwapSafeApprove(
address creditAccount,
address tokenIn,
address tokenOut,
Expand All @@ -193,9 +194,9 @@ abstract contract AbstractAdapter is IAdapter {
);
}

/// @dev Wrapper for `_executeSwapSafeAllowance` that computes the Credit Account on the spot
/// @dev Wrapper for `_executeSwapSafeApprove` that computes the Credit Account on the spot
/// See params and other details above
function _executeSwapSafeAllowance(
function _executeSwapSafeApprove(
address tokenIn,
address tokenOut,
bytes memory callData,
Expand Down

0 comments on commit 46efcb0

Please sign in to comment.