Skip to content

Commit

Permalink
fix: Update to 0.8.6
Browse files Browse the repository at this point in the history
- Update to 0.8.6
- Update `uint256(-1)` to `type(uint256).max`, (WETHGateWay, ValidationLogic,  GenericLogic, WETH9)
- Update to payable (Context, WETH9)
https://docs.soliditylang.org/en/latest/080-breaking-changes.html
  • Loading branch information
LHerskind committed Jul 28, 2021
1 parent 7f55456 commit 932f591
Show file tree
Hide file tree
Showing 105 changed files with 122 additions and 144 deletions.
3 changes: 1 addition & 2 deletions contracts/adapters/BaseUniswapAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol';
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol';
Expand Down
3 changes: 1 addition & 2 deletions contracts/adapters/FlashLiquidationAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

import {BaseUniswapAdapter} from './BaseUniswapAdapter.sol';
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';
Expand Down
3 changes: 1 addition & 2 deletions contracts/adapters/UniswapLiquiditySwapAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

import {BaseUniswapAdapter} from './BaseUniswapAdapter.sol';
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';
Expand Down
3 changes: 1 addition & 2 deletions contracts/adapters/UniswapRepayAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

import {BaseUniswapAdapter} from './BaseUniswapAdapter.sol';
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';
Expand Down
3 changes: 1 addition & 2 deletions contracts/adapters/interfaces/IBaseUniswapAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

import {IPriceOracleGetter} from '../../interfaces/IPriceOracleGetter.sol';
import {IUniswapV2Router02} from '../../interfaces/IUniswapV2Router02.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/dependencies/openzeppelin/contracts/Address.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @dev Collection of functions related to the address type
Expand Down
4 changes: 2 additions & 2 deletions contracts/dependencies/openzeppelin/contracts/Context.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/*
* @dev Provides information about the current execution context, including the
Expand All @@ -13,7 +13,7 @@ pragma solidity 0.7.6;
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
return payable(msg.sender);
}

function _msgData() internal view virtual returns (bytes memory) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/dependencies/openzeppelin/contracts/ERC20.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma solidity 0.8.6;

import './Context.sol';
import './IERC20.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/dependencies/openzeppelin/contracts/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @dev Interface of the ERC20 standard as defined in the EIP.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {IERC20} from './IERC20.sol';

Expand Down
2 changes: 1 addition & 1 deletion contracts/dependencies/openzeppelin/contracts/Ownable.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma solidity 0.8.6;

import './Context.sol';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {IERC20} from './IERC20.sol';
import {SafeMath} from './SafeMath.sol';
Expand Down
10 changes: 5 additions & 5 deletions contracts/dependencies/openzeppelin/contracts/SafeMath.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
Expand All @@ -9,15 +9,15 @@ library SafeMath {
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
unchecked {require((z = x + y) >= x);}
}

/// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x);
unchecked {require((z = x - y) <= x);}
}

/// @notice Returns x - y, reverts if underflows
Expand All @@ -30,15 +30,15 @@ library SafeMath {
uint256 y,
string memory message
) internal pure returns (uint256 z) {
require((z = x - y) <= x, message);
unchecked {require((z = x - y) <= x, message);}
}

/// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(x == 0 || (z = x * y) / x == y);
unchecked {require(x == 0 || (z = x * y) / x == y);}
}

/// @notice Returns x / y, reverts if overflows - no specific check, solidity reverts on division by 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import './BaseAdminUpgradeabilityProxy.sol';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import './UpgradeabilityProxy.sol';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import './Proxy.sol';
import '../contracts/Address.sol';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @title Initializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import './BaseAdminUpgradeabilityProxy.sol';
import './InitializableUpgradeabilityProxy.sol';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import './BaseUpgradeabilityProxy.sol';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @title Proxy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import './BaseUpgradeabilityProxy.sol';

Expand Down
3 changes: 1 addition & 2 deletions contracts/deployments/ATokensAndRatesHelper.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

import {LendingPool} from '../protocol/lendingpool/LendingPool.sol';
import {
Expand Down
3 changes: 1 addition & 2 deletions contracts/deployments/StableAndVariableTokensHelper.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

import {StableDebtToken} from '../protocol/tokenization/StableDebtToken.sol';
import {VariableDebtToken} from '../protocol/tokenization/VariableDebtToken.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/deployments/StringLib.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

library StringLib {
function concat(string memory a, string memory b) internal pure returns (string memory) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/flashloan/base/FlashLoanReceiverBase.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/flashloan/interfaces/IFlashLoanReceiver.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
import {ILendingPool} from '../../interfaces/ILendingPool.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IAToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/IAaveIncentivesController.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

interface IAaveIncentivesController {
event RewardsAccrued(address indexed user, uint256 amount);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IChainlinkAggregator.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

interface IChainlinkAggregator {
function latestAnswer() external view returns (int256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ICreditDelegationToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

interface ICreditDelegationToken {
event BorrowAllowanceDelegated(
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IDelegationToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @title IDelegationToken
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC20WithPermit.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IExchangeAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IInitializableAToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {ILendingPool} from './ILendingPool.sol';
import {IAaveIncentivesController} from './IAaveIncentivesController.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IInitializableDebtToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {ILendingPool} from './ILendingPool.sol';
import {IAaveIncentivesController} from './IAaveIncentivesController.sol';
Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/ILendingPool.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

import {ILendingPoolAddressesProvider} from './ILendingPoolAddressesProvider.sol';
import {DataTypes} from '../protocol/libraries/types/DataTypes.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ILendingPoolAddressesProvider.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @title LendingPoolAddressesProvider contract
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @title LendingPoolAddressesProviderRegistry contract
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ILendingPoolCollateralManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @title ILendingPoolCollateralManager
Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/ILendingPoolConfigurator.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
pragma solidity 0.8.6;

interface ILendingPoolConfigurator {
struct InitReserveInput {
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ILendingRateOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @title ILendingRateOracle interface
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IPriceOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/************
@title IPriceOracle interface
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IPriceOracleGetter.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @title IPriceOracleGetter interface
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IReserveInterestRateStrategy.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/**
* @title IReserveInterestRateStrategyInterface interface
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IScaledBalanceToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

interface IScaledBalanceToken {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IStableDebtToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import {IInitializableDebtToken} from './IInitializableDebtToken.sol';
import {IAaveIncentivesController} from './IAaveIncentivesController.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IUniswapExchange.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

interface IUniswapExchange {
event TokenPurchase(
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IUniswapV2Router02.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma solidity 0.8.6;

interface IUniswapV2Router02 {
function swapExactTokensForTokens(
Expand Down
Loading

0 comments on commit 932f591

Please sign in to comment.