Skip to content

Commit 16e67c0

Browse files
committed
Merge branch 'feat/153-improve-docs' into 'master'
- First iteration of documentation improvement of contracts See merge request aave-tech/protocol-v2!179
2 parents b270a7a + 3e6a9d3 commit 16e67c0

22 files changed

+548
-483
lines changed

contracts/deployments/ATokensAndRatesHelper.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
DefaultReserveInterestRateStrategy
1313
} from '../protocol/lendingpool/DefaultReserveInterestRateStrategy.sol';
1414
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
15-
import {StringLib} from '../protocol/libraries/helpers/StringLib.sol';
15+
import {StringLib} from './StringLib.sol';
1616

1717
contract ATokensAndRatesHelper is Ownable {
1818
address payable private pool;
@@ -108,16 +108,16 @@ contract ATokensAndRatesHelper is Ownable {
108108
}
109109
}
110110

111-
function enableBorrowingOnReserves(address[] calldata tokens, bool[] calldata stableBorrows)
111+
function enableBorrowingOnReserves(address[] calldata tokens, bool[] calldata stableBorrowingEnabled)
112112
external
113113
onlyOwner
114114
{
115-
require(stableBorrows.length == tokens.length);
115+
require(stableBorrowingEnabled.length == tokens.length);
116116

117117
for (uint256 i = 0; i < tokens.length; i++) {
118118
LendingPoolConfigurator(poolConfigurator).enableBorrowingOnReserve(
119119
tokens[i],
120-
stableBorrows[i]
120+
stableBorrowingEnabled[i]
121121
);
122122
}
123123
}

contracts/deployments/StableAndVariableTokensHelper.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {StableDebtToken} from '../protocol/tokenization/StableDebtToken.sol';
66
import {VariableDebtToken} from '../protocol/tokenization/VariableDebtToken.sol';
77
import {LendingRateOracle} from '../mocks/oracle/LendingRateOracle.sol';
88
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
9-
import {StringLib} from '../protocol/libraries/helpers/StringLib.sol';
9+
import {StringLib} from './StringLib.sol';
1010

1111
contract StableAndVariableTokensHelper is Ownable {
1212
address payable private pool;

contracts/interfaces/ILendingPool.sol

Lines changed: 194 additions & 146 deletions
Large diffs are not rendered by default.

contracts/interfaces/ILendingPoolAddressesProvider.sol

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,26 @@
22
pragma solidity 0.6.12;
33

44
/**
5-
@title ILendingPoolAddressesProvider interface
6-
@notice provides the interface to fetch the Aave protocol address
7-
*/
8-
5+
* @title LendingPoolAddressesProvider contract
6+
* @dev Main registry of addresses part of or connected to the protocol, including permissioned roles
7+
* - Acting also as factory of proxies and admin of those, so with right to change its implementations
8+
* - Owned by the Aave Governance
9+
* @author Aave
10+
**/
911
interface ILendingPoolAddressesProvider {
1012
event LendingPoolUpdated(address indexed newAddress);
1113
event ConfigurationAdminUpdated(address indexed newAddress);
1214
event EmergencyAdminUpdated(address indexed newAddress);
1315
event LendingPoolConfiguratorUpdated(address indexed newAddress);
1416
event LendingPoolCollateralManagerUpdated(address indexed newAddress);
15-
event EthereumAddressUpdated(address indexed newAddress);
1617
event PriceOracleUpdated(address indexed newAddress);
1718
event LendingRateOracleUpdated(address indexed newAddress);
1819
event ProxyCreated(bytes32 id, address indexed newAddress);
1920
event AddressSet(bytes32 id, address indexed newAddress, bool hasProxy);
2021

21-
function setAddress(
22-
bytes32 id,
23-
address newAddress
24-
) external;
22+
function setAddress(bytes32 id, address newAddress) external;
2523

26-
function setAddressAsProxy(
27-
bytes32 id,
28-
address impl
29-
) external;
24+
function setAddressAsProxy(bytes32 id, address impl) external;
3025

3126
function getAddress(bytes32 id) external view returns (address);
3227

contracts/interfaces/ILendingPoolAddressesProviderRegistry.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
pragma solidity 0.6.12;
33

44
/**
5-
* @title ILendingPoolAddressesProvider interface
6-
* @notice provides the interface to fetch the LendingPoolCore address
5+
* @title LendingPoolAddressesProviderRegistry contract
6+
* @dev Main registry of LendingPoolAddressesProvider of multiple Aave protocol's markets
7+
* - Used for indexing purposes of Aave protocol's markets
8+
* - The id assigned to a LendingPoolAddressesProvider refers to the market it is connected with,
9+
* for example with `0` for the Aave main market and `1` for the next created
10+
* @author Aave
711
**/
812
interface ILendingPoolAddressesProviderRegistry {
913
event AddressesProviderRegistered(address indexed newAddress);
1014
event AddressesProviderUnregistered(address indexed newAddress);
1115

1216
function getAddressesProvidersList() external view returns (address[] memory);
1317

14-
function isAddressesProviderRegistered(address provider) external view returns (uint256);
15-
1618
function getAddressesProviderIdByAddress(address addressesProvider)
1719
external
1820
view
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// SPDX-License-Identifier: agpl-3.0
2+
pragma solidity 0.6.12;
3+
4+
/**
5+
* @title ILendingPoolCollateralManager interface
6+
* @author Aave
7+
* @notice Defines the actions involving management of collateral in the protocol.
8+
**/
9+
interface ILendingPoolCollateralManager {
10+
/**
11+
* @dev emitted when a borrower is liquidated
12+
* @param collateral the address of the collateral being liquidated
13+
* @param principal the address of the reserve
14+
* @param user the address of the user being liquidated
15+
* @param debtToCover the total amount liquidated
16+
* @param liquidatedCollateralAmount the amount of collateral being liquidated
17+
* @param liquidator the address of the liquidator
18+
* @param receiveAToken true if the liquidator wants to receive aTokens, false otherwise
19+
**/
20+
event LiquidationCall(
21+
address indexed collateral,
22+
address indexed principal,
23+
address indexed user,
24+
uint256 debtToCover,
25+
uint256 liquidatedCollateralAmount,
26+
address liquidator,
27+
bool receiveAToken
28+
);
29+
30+
/**
31+
* @dev emitted when a user disables a reserve as collateral
32+
* @param reserve the address of the reserve
33+
* @param user the address of the user
34+
**/
35+
event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user);
36+
37+
/**
38+
* @dev users can invoke this function to liquidate an undercollateralized position.
39+
* @param collateral the address of the collateral to liquidated
40+
* @param principal the address of the principal reserve
41+
* @param user the address of the borrower
42+
* @param debtToCover the amount of principal that the liquidator wants to repay
43+
* @param receiveAToken true if the liquidators wants to receive the aTokens, false if
44+
* he wants to receive the underlying asset directly
45+
**/
46+
function liquidationCall(
47+
address collateral,
48+
address principal,
49+
address user,
50+
uint256 debtToCover,
51+
bool receiveAToken
52+
) external virtual returns (uint256, string memory);
53+
}

contracts/interfaces/IReserveInterestRateStrategy.sol

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,15 @@
22
pragma solidity 0.6.12;
33

44
/**
5-
@title IReserveInterestRateStrategyInterface interface
6-
@notice Interface for the calculation of the interest rates.
7-
*/
8-
5+
* @title IReserveInterestRateStrategyInterface interface
6+
* @dev Interface for the calculation of the interest rates
7+
* @author Aave
8+
*/
99
interface IReserveInterestRateStrategy {
10-
/**
11-
* @dev returns the base variable borrow rate, in rays
12-
*/
1310
function baseVariableBorrowRate() external view returns (uint256);
1411

15-
/**
16-
* @dev returns the maximum variable borrow rate
17-
*/
1812
function getMaxVariableBorrowRate() external view returns (uint256);
1913

20-
/**
21-
* @dev calculates the liquidity, stable, and variable rates depending on the current utilization rate
22-
* and the base parameters
23-
*
24-
*/
2514
function calculateInterestRates(
2615
address reserve,
2716
uint256 utilizationRate,

contracts/misc/interfaces/IUniswapV2Router01.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: agpl-3.0
12
pragma solidity >=0.6.2;
23

34
interface IUniswapV2Router01 {

contracts/misc/interfaces/IUniswapV2Router02.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: agpl-3.0
12
pragma solidity >=0.6.2;
23

34
import './IUniswapV2Router01.sol';

0 commit comments

Comments
 (0)