Skip to content

Commit

Permalink
chore: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Sep 19, 2024
1 parent e8d1d6f commit 3a66f18
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions packages/contracts/src/dollar/amo/AaveAmo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import {IRewardsController} from "@aavev3-periphery/contracts/rewards/interfaces

/**
* @title AaveAmo
* @notice Amo to interact with Aave V3 and manage rewards and borrowing mechanisms.
* @notice Can receive collateral from Ubiquity Amo minter and interact with Aave's V3 pool.
* @notice AMO to interact with Aave V3 and manage rewards and borrowing mechanisms.
* @notice Can receive collateral from UbiquityAmoMinter and interact with Aave's V3 pool.
*/
contract AaveAmo is Ownable {
using SafeERC20 for ERC20;

/// @notice Ubiquity Amo minter instance
/// @notice UbiquityAmoMinter instance
UbiquityAmoMinter public amoMinter;

/// @notice Aave V3 pool instance
Expand Down Expand Up @@ -180,7 +180,7 @@ contract AaveAmo is Ownable {
/* ========== RESTRICTED GOVERNANCE FUNCTIONS ========== */

/**
* @notice Returns collateral back to the Amo minter
* @notice Returns collateral back to the AMO minter
* @param collateralAmount Amount of collateral to return
*/
function returnCollateralToMinter(
Expand All @@ -200,8 +200,8 @@ contract AaveAmo is Ownable {
}

/**
* @notice Sets the Amo minter address
* @param _amoMinterAddress New address of the Amo minter
* @notice Sets the AMO minter address
* @param _amoMinterAddress New address of the AMO minter
*/
function setAmoMinter(address _amoMinterAddress) external onlyOwner {
amoMinter = UbiquityAmoMinter(_amoMinterAddress);
Expand Down
32 changes: 16 additions & 16 deletions packages/contracts/src/dollar/core/UbiquityAmoMinter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {IUbiquityPool} from "../interfaces/IUbiquityPool.sol";

/**
* @title UbiquityAmoMinter
* @notice Contract responsible for managing collateral borrowing from Ubiquity's Pool for Amo.
* @notice Allows owner to move Dollar collateral to Amos, enabling yield generation.
* @notice Contract responsible for managing collateral borrowing from Ubiquity's Pool to AMOs.
* @notice Allows owner to move Dollar collateral to AMOs, enabling yield generation.
* @notice It keeps track of borrowed collateral balances per Amo and the total borrowed sum.
*/
contract UbiquityAmoMinter is Ownable {
using SafeERC20 for ERC20;

/// @notice Collateral token used by the Amo minter
/// @notice Collateral token used by the AMO minter
ERC20 public immutable collateralToken;

/// @notice Ubiquity pool interface
Expand All @@ -27,13 +27,13 @@ contract UbiquityAmoMinter is Ownable {
uint256 public immutable missingDecimals;
int256 public collateralBorrowCap = int256(100_000e18);

/// @notice Mapping for tracking borrowed collateral balances per Amo
/// @notice Mapping for tracking borrowed collateral balances per AMO
mapping(address => int256) public collateralBorrowedBalances;

/// @notice Sum of all collateral borrowed across Amos
int256 public collateralTotalBorrowedBalance = 0;

/// @notice Mapping to track active Amos
/// @notice Mapping to track active AMOs
mapping(address => bool) public Amos;

/* ========== CONSTRUCTOR ========== */
Expand Down Expand Up @@ -73,27 +73,27 @@ contract UbiquityAmoMinter is Ownable {
/* ========== MODIFIERS ========== */

/**
* @notice Ensures the caller is a valid Amo
* @param amoAddress Address of the Amo to check
* @notice Ensures the caller is a valid AMO
* @param amoAddress Address of the AMO to check
*/
modifier validAmo(address amoAddress) {
require(Amos[amoAddress], "Invalid Amo");
_;
}

/* ========== Amo MANAGEMENT FUNCTIONS ========== */
/* ========== AMO MANAGEMENT FUNCTIONS ========== */

/**
* @notice Enables an Amo
* @param amo Address of the Amo to enable
* @notice Enables an AMO
* @param amo Address of the AMO to enable
*/
function enableAmo(address amo) external onlyOwner {
Amos[amo] = true;
}

/**
* @notice Disables an Amo
* @param amo Address of the Amo to disable
* @notice Disables an AMO
* @param amo Address of the AMO to disable
*/
function disableAmo(address amo) external onlyOwner {
Amos[amo] = false;
Expand All @@ -102,8 +102,8 @@ contract UbiquityAmoMinter is Ownable {
/* ========== COLLATERAL FUNCTIONS ========== */

/**
* @notice Transfers collateral to the specified Amo
* @param destinationAmo Address of the Amo to receive collateral
* @notice Transfers collateral to the specified AMO
* @param destinationAmo Address of the AMO to receive collateral
* @param collateralAmount Amount of collateral to transfer
*/
function giveCollateralToAmo(
Expand All @@ -129,14 +129,14 @@ contract UbiquityAmoMinter is Ownable {
// Borrow collateral from the pool
pool.amoMinterBorrow(collateralAmount);

// Transfer collateral to the Amo
// Transfer collateral to the AMO
collateralToken.safeTransfer(destinationAmo, collateralAmount);

emit CollateralGivenToAmo(destinationAmo, collateralAmount);
}

/**
* @notice Receives collateral back from an Amo
* @notice Receives collateral back from an AMO
* @param collateralAmount Amount of collateral being returned
*/
function receiveCollateralFromAmo(
Expand Down

0 comments on commit 3a66f18

Please sign in to comment.