Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EridianAlpha committed Jun 21, 2024
1 parent 73a14a0 commit ff0c5c9
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/AavePM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ contract AavePM is
_storeEventBlockNumber();
}

/// @notice // TODO: Add comment and move to different heading. How to protect this function?
/// @notice // TODO: Add comment. How to protect this function?
function delegateCallHelper(string memory _targetIdentifier, bytes memory _data) public returns (bytes memory) {
address target = getContractAddress(_targetIdentifier);
(bool success, bytes memory result) = target.delegatecall(_data);
Expand Down
6 changes: 4 additions & 2 deletions src/FlashLoan.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import {ITokenSwapsModule} from "./interfaces/ITokenSwapsModule.sol";
import {IAaveFunctionsModule} from "./interfaces/IAaveFunctionsModule.sol";

// ================================================================
// │ AAVEFUNCTIONS CONTRACT │
// │ FLASH LOAN CONTRACT
// ================================================================

/// @notice // TODO: Add comment
/// @title Flash Loan for the Aave Position Manager
/// @author EridianAlpha
/// @notice This contract contains the functions for AavePM to execute a flash loan to repay debt and withdraw collateral.
contract FlashLoan {
/// @notice Flash loan callback function.
/// @dev This function is called by the Aave pool contract after the flash loan is executed.
Expand Down
4 changes: 3 additions & 1 deletion src/FunctionChecks.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import {IAavePM} from "./interfaces/IAavePM.sol";
// │ FUNCTION CHECKS CONTRACT │
// ================================================================

/// @notice // TODO: Add comment
/// @title Function Checks for the Aave Position Manager
/// @author EridianAlpha
/// @notice This contract contains the functions used inside AavePM modifiers.
contract FunctionChecks {
/// @notice // TODO: Add comment
function _checkOwner(address _owner) internal view {
Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/IAaveFunctionsModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ pragma solidity 0.8.24;

import {IAavePM} from "./IAavePM.sol";

/// @notice // TODO: Add comment
/// @title AaveFunctionsModule interface
/// @notice This interface defines the essential structures and functions for the AaveFunctionsModule contract.
interface IAaveFunctionsModule {
error AaveFunctionsModule__InvalidAavePMProxyAddress();

Expand Down
2 changes: 0 additions & 2 deletions src/interfaces/IAavePM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ interface IAavePM {
function deleverage() external;
function aaveSupplyFromContractBalance() external payable returns (uint256 suppliedCollateral);
function aaveRepayUSDCFromContractBalance() external;

/// TODO: Move to different heading
function delegateCallHelper(string memory _targetIdentifier, bytes memory _data) external returns (bytes memory);

// ================================================================
Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/IBorrowAndWithdrawUSDCModule.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

/// @notice // TODO: Add comment
/// @title BorrowAndWithdrawUSDCModule interface
/// @notice This interface defines the essential structures and functions for the BorrowAndWithdrawUSDCModule contract.
interface IBorrowAndWithdrawUSDCModule {
error BorrowAndWithdrawUSDCModule__InvalidAavePMProxyAddress();

Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/IRebalanceModule.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

/// @notice // TODO: Add comment
/// @title RebalanceModule interface
/// @notice This interface defines the essential structures and functions for the RebalanceModule contract.
interface IRebalanceModule {
error RebalanceModule__InvalidAavePMProxyAddress();

Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/IReinvestModule.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

/// @notice // TODO: Add comment
/// @title ReinvestModule interface
/// @notice This interface defines the essential structures and functions for the ReinvestModule contract.
interface IReinvestModule {
error ReinvestModule__InvalidAavePMProxyAddress();

Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/ITokenSwapsModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ pragma solidity 0.8.24;
import {IAavePM} from "./IAavePM.sol";
import {ISwapRouter} from "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";

/// @notice // TODO: Add comment
/// @title TokenSwapsModule interface
/// @notice This interface defines the essential structures and functions for the TokenSwapsModule contract.
interface ITokenSwapsModule {
error TokenSwapsModule__InvalidAavePMProxyAddress();

Expand Down
6 changes: 4 additions & 2 deletions src/modules/AaveFunctionsModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import {ITokenSwapsModule} from "src/interfaces/ITokenSwapsModule.sol";
import {IAaveFunctionsModule} from "src/interfaces/IAaveFunctionsModule.sol";

// ================================================================
// │ AAVEFUNCTIONS CONTRACT
// │ AAVE FUNCTIONS MODULE CONTRACT
// ================================================================

/// @notice // TODO: Add comment
/// @title Aave Functions Module for the Aave Position Manager
/// @author EridianAlpha
/// @notice This contract contains the functions for AavePM to interact with the Aave protocol.
contract AaveFunctionsModule is IAaveFunctionsModule {
// ================================================================
// │ MODULE SETUP │
Expand Down
6 changes: 4 additions & 2 deletions src/modules/BorrowAndWithdrawUSDCModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import {IAaveFunctionsModule} from "../interfaces/IAaveFunctionsModule.sol";
import {IBorrowAndWithdrawUSDCModule} from "../interfaces/IBorrowAndWithdrawUSDCModule.sol";

// ================================================================
// │ BORROW AND WITHDRAW USDC CONTRACT
// │ BORROW AND WITHDRAW USDC MODULE CONTRACT
// ================================================================

/// @notice // TODO: Add comment
/// @title Borrow and Withdraw USDC Module for the Aave Position Manager
/// @author EridianAlpha
/// @notice This contract contains the functions for AavePM to borrow and withdraw USDC from the Aave protocol.
contract BorrowAndWithdrawUSDCModule is IBorrowAndWithdrawUSDCModule {
// ================================================================
// │ MODULE SETUP │
Expand Down
6 changes: 4 additions & 2 deletions src/modules/RebalanceModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import {IAaveFunctionsModule} from "src/interfaces/IAaveFunctionsModule.sol";
import {IRebalanceModule} from "src/interfaces/IRebalanceModule.sol";

// ================================================================
// │ REBALANCE CONTRACT
// │ REBALANCE MODULE CONTRACT
// ================================================================

/// @notice // TODO: Add comment
/// @title Rebalance Module for the Aave Position Manager
/// @author EridianAlpha
/// @notice This contract contains the functions for AavePM to rebalance the Aave position by repaying debt to increase the health factor.
contract RebalanceModule is IRebalanceModule {
// ================================================================
// │ MODULE SETUP │
Expand Down
9 changes: 6 additions & 3 deletions src/modules/ReinvestModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ import {IAaveFunctionsModule} from "../interfaces/IAaveFunctionsModule.sol";
import {IReinvestModule} from "../interfaces/IReinvestModule.sol";

// ================================================================
// │ REINVEST CONTRACT
// │ REINVEST MODULE CONTRACT
// ================================================================

/// @notice // TODO: Add comment
/// @title Aave Functions Module for the Aave Position Manager
/// @author EridianAlpha
/// @notice This contract contains the functions for AavePM to borrow USDC,
/// swap to wstETH, and supply to Aave maintaining the target health factor.
contract ReinvestModule is IReinvestModule {
// ================================================================
// │ MODULE SETUP │
Expand All @@ -35,7 +38,7 @@ contract ReinvestModule is IReinvestModule {
return VERSION;
}

address immutable public aavePMProxyAddress;
address public immutable aavePMProxyAddress;

constructor(address _aavePMProxyAddress) {
aavePMProxyAddress = _aavePMProxyAddress;
Expand Down
6 changes: 4 additions & 2 deletions src/modules/TokenSwapsModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ import {IERC20Extended} from "../interfaces/IERC20Extended.sol";
import {ITokenSwapsModule} from "../interfaces/ITokenSwapsModule.sol";

// ================================================================
// │ TokenSwapsModule CONTRACT
// │ TOKEN SWAP MODULE CONTRACT
// ================================================================

/// @notice // TODO: Add comment
/// @title Token Swap Module for the Aave Position Manager
/// @author EridianAlpha
/// @notice This contract contains the functions for AavePM to swap tokens using UniswapV3.
contract TokenSwapsModule is ITokenSwapsModule {
// ================================================================
// │ MODULE SETUP │
Expand Down

0 comments on commit ff0c5c9

Please sign in to comment.