Skip to content

Commit

Permalink
chore: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Valeri committed Dec 3, 2021
2 parents 88f5c55 + 8e236ec commit 6bf1266
Show file tree
Hide file tree
Showing 59 changed files with 29,940 additions and 3,834 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@aave:registry=https://npm.pkg.github.com
engine-strict=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.13.0
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# Changelog

## [1.7.0](https://www.github.com/aave/aave-v3-core/compare/v1.6.0...v1.7.0) (2021-12-01)


### Features

* Add decimals to MockAggregator to match Chainlink Aggregator interface ([4cf1dac](https://www.github.com/aave/aave-v3-core/commit/4cf1dacd70f11a0c7103ade68bb05c907e846b2d))
* added handleRepayment() in flashloan and liqCall ([6c43820](https://www.github.com/aave/aave-v3-core/commit/6c438201c6ee95b6dc3895b904213b975ce3905d))


### Bug Fixes

* fixed handleRepayment() in flashloan ([80a19bb](https://www.github.com/aave/aave-v3-core/commit/80a19bb7e0d92af0604e67dc6586a0f376bf91a4))

## [1.6.0](https://www.github.com/aave/aave-v3-core/compare/v1.5.2...v1.6.0) (2021-11-27)


### Features

* reduced the number of optimizer runs ([8562a91](https://www.github.com/aave/aave-v3-core/commit/8562a911d04ede756a703be60f985d1916805d46))
* reorganized PoolStorage for gas savings ([87776f7](https://www.github.com/aave/aave-v3-core/commit/87776f757d58ddf20b99cdce752e068602f38389))


### Bug Fixes

* Add `useATokens` param to `Repay` event ([beec3f8](https://www.github.com/aave/aave-v3-core/commit/beec3f86bf1e4024dc74583bb386851b3d212963))
* Add additional constraint to use `eModeAssetPrice` ([ec42295](https://www.github.com/aave/aave-v3-core/commit/ec422953ca60110d98aa3c7c8930f70d88d5b294))
* Add check to `Pool::initializer()` ([8f2b426](https://www.github.com/aave/aave-v3-core/commit/8f2b426962a11c3e289301a341bcdf170b3e763f))
* Add clean ups to VariableDebtToken test ([bc4f314](https://www.github.com/aave/aave-v3-core/commit/bc4f314c85ac59ea84244108e6fc6f7c22d3fb74))
* Add cleanup to StableDebtToken test ([d1eeaa5](https://www.github.com/aave/aave-v3-core/commit/d1eeaa51d19b1e45bfa564fb51e5bd69623450db))
* Add cleanups in eMode tests ([fbf80a8](https://www.github.com/aave/aave-v3-core/commit/fbf80a8092c5807a281ab95b6e54f85790dda9b4))
* Add extra input to MockPoolInherited test deployment ([e7944dc](https://www.github.com/aave/aave-v3-core/commit/e7944dc1f92ea6fada5a31031d3628c7682da0d7))
* Add minor gas optimization for executeFlashLoan ([0d737f5](https://www.github.com/aave/aave-v3-core/commit/0d737f5041649a27a2d97148e625e1d3b211d0e3))
* Add natspec comments to IncentivizedERC20 ([722a8e7](https://www.github.com/aave/aave-v3-core/commit/722a8e7b5c3a2e14f639e6491cb264b8d305508a))
* Add precision to debt ceiling comment ([3d43c02](https://www.github.com/aave/aave-v3-core/commit/3d43c02a8d014e33619ad5d375d1baeac4448cb8))
* Add test exploiting pricing issue ([3457fb8](https://www.github.com/aave/aave-v3-core/commit/3457fb829d094a45f6d056c9893ad0c3b1bef465))
* Add test for incorrect init of pool ([b3cebaf](https://www.github.com/aave/aave-v3-core/commit/b3cebaf6180340378e37257c6ac4e4adab444e2f))
* Bumped Node JS version of Dockerfile to 16 stable version. Update package-lock. ([f0c8787](https://www.github.com/aave/aave-v3-core/commit/f0c8787725ff3fc77b02cf92928f6e79207a93ff))
* Change visibility of `name()` in IncentivizedERC20 ([467a5c1](https://www.github.com/aave/aave-v3-core/commit/467a5c110552bf4ec71449cccc2bb8fd9201806b))
* Do multiplication before devision for `currentStableBorrowRate` ([ca177fb](https://www.github.com/aave/aave-v3-core/commit/ca177fbe5860ae360e4ebf8e93712fa84b1ab2e4))
* Fix typo on credit delegation test case ([0b6a65b](https://www.github.com/aave/aave-v3-core/commit/0b6a65bb109665b1d74bcdc5c5fd04c38dfa4721))
* Handle minor merge issue ([36488c9](https://www.github.com/aave/aave-v3-core/commit/36488c9e86a15bc66047ddf09505dbcf29f79324))
* Make `_addressesProvider` immutable in `Pool` ([b41feab](https://www.github.com/aave/aave-v3-core/commit/b41feabd504c8da527db7fc1e3867519b2c7334e))
* Make `_nonces` internal and add `nonces` getter ([f3d1817](https://www.github.com/aave/aave-v3-core/commit/f3d18176f6250ac255287acaf86aae8f04c22e77))
* Make `MAX_RESERVES_COUNT` constant ([04ced7f](https://www.github.com/aave/aave-v3-core/commit/04ced7fd5582af588ebdcf4d2f755db8998d1b75))
* MockPoolInherited wrong return value on `MAX_NUMBER_RESERVES` ([b724a73](https://www.github.com/aave/aave-v3-core/commit/b724a73790b8fcad67e33df10217da448a4cf953))
* Move `_nonces` to IncentivizedERC20 ([54eb024](https://www.github.com/aave/aave-v3-core/commit/54eb024bef45a8d77a5f856cf1866024d282da7e))
* Move list length check to front of `validateFlashloan` function ([f485be5](https://www.github.com/aave/aave-v3-core/commit/f485be5d9f87d85cef65d816e708741437586280))
* Pair `_avgStableBorrowRate` and `_totalSupplyTimestamp` ([b6c9372](https://www.github.com/aave/aave-v3-core/commit/b6c937292dd7bb2c91eec05940170ac902701a09))
* Refactor tokens, move domain separator function to IncentivizedERC20 ([c033f9d](https://www.github.com/aave/aave-v3-core/commit/c033f9d4d83c08f75b63b972ca02fca27d6afc45))
* Removal of unneeded struct ([262dc7a](https://www.github.com/aave/aave-v3-core/commit/262dc7a525b3e6794b96b904189696773e3787c5))
* Remove unneeded fields from `AvailableCollateralToLiquidateLocalVars` ([f9088b6](https://www.github.com/aave/aave-v3-core/commit/f9088b65a6b3a5c6875f0176f32bda99caf63ee9))
* setup npm registry without file ([91fdc99](https://www.github.com/aave/aave-v3-core/commit/91fdc99b02dffb4924c5078d894f2ca180d8e23c))
* Simplify `_getFirstAssetAsCollateralId()` ([dffc2f6](https://www.github.com/aave/aave-v3-core/commit/dffc2f63275c6d4be780dc4199adace662afb585))
* source setup env for coverage ([fd7de34](https://www.github.com/aave/aave-v3-core/commit/fd7de34862f678aeac426634ba48b1c0afd65f7d))
* Update `user` to `onBehalfOf` for VariabelDebtToken ([7ff840f](https://www.github.com/aave/aave-v3-core/commit/7ff840f36a12ae19372c1f83b9d2ee01ae30de5b))
* Update package.json ([49a8c39](https://www.github.com/aave/aave-v3-core/commit/49a8c39e6137f31aa7a4e05a6ca2556532ddab20))
* update v3 deploy dev dependency to latest deployment scripts ([2aa8f5c](https://www.github.com/aave/aave-v3-core/commit/2aa8f5c3364c518890a12366f4ed6c8747dfe4bc))
* update v3 dev dependencies ([9cb6a47](https://www.github.com/aave/aave-v3-core/commit/9cb6a47393d676d16bd928e8cce5f90db14892ad))
* Use cached value for asset unit instead of recomputation ([335927c](https://www.github.com/aave/aave-v3-core/commit/335927c0493772f68968feb0477d0fad348e5b59))

### [1.5.2](https://www.github.com/aave/aave-v3-core/compare/v1.5.1...v1.5.2) (2021-11-12)


Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM ethereum/solc:0.6.12 as build-deps

FROM node:14
FROM node:16

USER node

COPY --from=build-deps /usr/bin/solc /usr/bin/solc
23 changes: 18 additions & 5 deletions contracts/interfaces/IAToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken {
/**
* @notice Emitted after the mint action
* @param from The address performing the mint
* @param value The amount being
* @param value The amount being minted (user entered amount + balance increase from interest)
* @param balanceIncrease The increase in balance since the last action of the user
* @param index The next liquidity index of the reserve
**/
event Mint(address indexed from, uint256 value, uint256 index);
event Mint(address indexed from, uint256 value, uint256 balanceIncrease, uint256 index);

/**
* @notice Mints `amount` aTokens to `user`
Expand All @@ -37,10 +38,17 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken {
* @notice Emitted after aTokens are burned
* @param from The owner of the aTokens, getting them burned
* @param target The address that will receive the underlying
* @param value The amount being burned
* @param value The amount being burned (user entered amount - balance increase from interest)
* @param balanceIncrease The increase in balance since the last action of the user
* @param index The next liquidity index of the reserve
**/
event Burn(address indexed from, address indexed target, uint256 value, uint256 index);
event Burn(
address indexed from,
address indexed target,
uint256 value,
uint256 balanceIncrease,
uint256 index
);

/**
* @notice Emitted during the transfer action
Expand All @@ -53,6 +61,8 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken {

/**
* @notice Burns aTokens from `user` and sends the equivalent amount of underlying to `receiverOfUnderlying`
* @dev In some instances, the mint event could be emitted from a burn transaction
* if the amount to burn is less than the interest the user earned
* @param user The owner of the aTokens, getting them burned
* @param receiverOfUnderlying The address that will receive the underlying
* @param amount The amount being burned
Expand Down Expand Up @@ -93,7 +103,10 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken {
function transferUnderlyingTo(address user, uint256 amount) external;

/**
* @notice Invoked to execute actions on the aToken side after a repayment.
* @notice Handles the underlying received by the aToken after the transfer has been completed.
* @dev The default implementation is empty as with standard ERC20 tokens, nothing needs to be done after the transfer is concluded.
* However in the future there may be aTokens that allow for example to stake the underlying to receive LM rewards. In that case,
* `handleRepayment()` would perform the staking of the underlying asset.
* @param user The user executing the repayment
* @param amount The amount getting repaid
**/
Expand Down
71 changes: 71 additions & 0 deletions contracts/interfaces/IAaveOracle.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.10;

import {IPriceOracleGetter} from './IPriceOracleGetter.sol';
import {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';

/**
* @title IAaveOracle
* @author Aave
* @notice Defines the basic interface for the Aave Oracle
*/
interface IAaveOracle is IPriceOracleGetter {
/**
* @notice Emitted after the base currency is set
* @param baseCurrency The base currency of used for price quotes
* @param baseCurrencyUnit The unit of the base currency
*/
event BaseCurrencySet(address indexed baseCurrency, uint256 baseCurrencyUnit);

/**
* @notice Emitted after the price source of an asset is updated
* @param asset The address of the asset
* @param source The price source of the asset
*/
event AssetSourceUpdated(address indexed asset, address indexed source);

/**
* @notice Emitted after the address of fallback oracle is updated
* @param fallbackOracle The address of the fallback oracle
*/
event FallbackOracleUpdated(address indexed fallbackOracle);

/**
* @notice Returns the PoolAddressesProvider
* @return The address of the PoolAddressesProvider contract
*/
function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);

/**
* @notice Sets or replaces price sources of assets
* @param assets The addresses of the assets
* @param sources The addresses of the price sources
*/
function setAssetSources(address[] calldata assets, address[] calldata sources) external;

/**
* @notice Sets the fallback oracle
* @param fallbackOracle The address of the fallback oracle
*/
function setFallbackOracle(address fallbackOracle) external;

/**
* @notice Returns a list of prices from a list of assets addresses
* @param assets The list of assets addresses
* @return The prices of the given assets
*/
function getAssetsPrices(address[] calldata assets) external view returns (uint256[] memory);

/**
* @notice Returns the address of the source for an asset address
* @param asset The address of the asset
* @return The address of the source
*/
function getSourceOfAsset(address asset) external view returns (address);

/**
* @notice Returns the address of the fallback oracle
* @return The address of the fallback oracle
*/
function getFallbackOracle() external view returns (address);
}
16 changes: 7 additions & 9 deletions contracts/interfaces/IPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ interface IPool {
* @param user The beneficiary of the repayment, getting his debt reduced
* @param repayer The address of the user initiating the repay(), providing the funds
* @param amount The amount repaid
* @param useATokens True if the repayment is done using aTokens, `false` if done with underlying asset directly
**/
event Repay(
address indexed reserve,
address indexed user,
address indexed repayer,
uint256 amount
uint256 amount,
bool useATokens
);

/**
Expand Down Expand Up @@ -221,7 +223,7 @@ interface IPool {
**/
event UserEModeSet(address indexed user, uint8 categoryId);

/*
/**
* @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
* - E.g. User supplies 100 USDC and gets in return 100 aUSDC
* @param asset The address of the underlying asset to supply
Expand Down Expand Up @@ -352,22 +354,18 @@ interface IPool {
) external returns (uint256);

/**
* @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens held by the repayer, burning the equivalent debt tokens
* - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address
* @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the equivalent debt tokens
* - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens
* @param asset The address of the borrowed underlying asset previously borrowed
* @param amount The amount to repay
* - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
* @param rateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
* @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the
* user calling the function if he wants to reduce/remove his own debt, or the address of any other
* other borrower whose debt should be removed
* @return The final amount repaid
**/
function repayWithATokens(
address asset,
uint256 amount,
uint256 rateMode,
address onBehalfOf
uint256 rateMode
) external returns (uint256);

/**
Expand Down
6 changes: 4 additions & 2 deletions contracts/interfaces/IPriceOracleGetter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ pragma solidity 0.8.10;
interface IPriceOracleGetter {
/**
* @notice Returns the base currency address
* @return Returns the base currency address. MOCK_USD_ADDRESS if usd market
* @dev Address 0x0 is reserved for USD as base currency.
* @return Returns the base currency address.
**/
function BASE_CURRENCY() external view returns (address);

/**
* @notice Returns the base currency unit
* @return Returns the base currency unit. 1 ether if eth market and 100000000 if usd market
* @dev 1 ether for ETH, 1e8 for USD.
* @return Returns the base currency unit.
**/
function BASE_CURRENCY_UNIT() external view returns (uint256);

Expand Down
6 changes: 4 additions & 2 deletions contracts/interfaces/IStableDebtToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface IStableDebtToken is IInitializableDebtToken {
* @notice Emitted when new stable debt is minted
* @param user The address of the user who triggered the minting
* @param onBehalfOf The recipient of stable debt tokens
* @param amount The amount minted
* @param amount The amount minted (user entered amount + balance increase from interest)
* @param currentBalance The current balance of the user
* @param balanceIncrease The increase in balance since the last action of the user
* @param newRate The rate of the debt after the minting
Expand All @@ -36,7 +36,7 @@ interface IStableDebtToken is IInitializableDebtToken {
/**
* @notice Emitted when new stable debt is burned
* @param user The address of the user
* @param amount The amount being burned
* @param amount The amount being burned (user entered amount - balance increase from interest)
* @param currentBalance The current balance of the user
* @param balanceIncrease The the increase in balance since the last action of the user
* @param avgStableRate The next average stable rate after the burning
Expand Down Expand Up @@ -81,6 +81,8 @@ interface IStableDebtToken is IInitializableDebtToken {
* @notice Burns debt of `user`
* @dev The resulting rate is the weighted average between the rate of the new debt
* and the rate of the previous debt
* @dev In some instances, a burn transaction will emit a mint event
* if the amount to burn is less than the interest the user earned
* @param user The address of the user getting his debt burned
* @param amount The amount of debt tokens getting burned
* @return The total stable debt
Expand Down
18 changes: 14 additions & 4 deletions contracts/interfaces/IVariableDebtToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken {
* @notice Emitted after the mint action
* @param from The address performing the mint
* @param onBehalfOf The address of the user on which behalf minting has been performed
* @param value The amount to be minted
* @param value The amount to be minted (user entered amount + balance increase from interest)
* @param balanceIncrease The increase in balance since the last action of the user
* @param index The last index of the reserve
**/
event Mint(address indexed from, address indexed onBehalfOf, uint256 value, uint256 index);
event Mint(
address indexed from,
address indexed onBehalfOf,
uint256 value,
uint256 balanceIncrease,
uint256 index
);

/**
* @notice Mints debt token to the `onBehalfOf` address
Expand All @@ -40,13 +47,16 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken {
/**
* @notice Emitted when variable debt is burnt
* @param user The user which debt has been burned
* @param amount The amount of debt being burned
* @param amount The amount of debt being burned (user entered amount - balance increase from interest)
* @param balanceIncrease The increase in balance since the last action of the user
* @param index The index of the user
**/
event Burn(address indexed user, uint256 amount, uint256 index);
event Burn(address indexed user, uint256 amount, uint256 balanceIncrease, uint256 index);

/**
* @notice Burns user variable debt
* @dev In some instances, a burn transaction will emit a mint event
* if the amount to burn is less than the interest the user earned
* @param user The user which debt is burnt
* @param amount The amount getting burned
* @param index The variable debt index of the reserve
Expand Down
Loading

0 comments on commit 6bf1266

Please sign in to comment.