Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kartojal committed Oct 30, 2020
2 parents 479aa3e + 6b26e39 commit b3cc9d1
Show file tree
Hide file tree
Showing 110 changed files with 3,798 additions and 8,267 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -9,7 +9,10 @@ build/
.idea
types

deployed-contracts.json

coverage
.coverage_artifacts
.coverage_cache
.coverage_contracts

22 changes: 14 additions & 8 deletions buidler.config.ts
Expand Up @@ -11,20 +11,16 @@ usePlugin('buidler-typechain');
usePlugin('solidity-coverage');
usePlugin('@nomiclabs/buidler-waffle');
usePlugin('@nomiclabs/buidler-etherscan');
//usePlugin('buidler-gas-reporter');
usePlugin('buidler-gas-reporter');

const SKIP_LOAD = process.env.SKIP_LOAD === 'true';
const DEFAULT_BLOCK_GAS_LIMIT = 10000000;
const DEFAULT_BLOCK_GAS_LIMIT = 12450000;
const DEFAULT_GAS_PRICE = 10;
const HARDFORK = 'istanbul';
const INFURA_KEY = process.env.INFURA_KEY || '';
const ETHERSCAN_KEY = process.env.ETHERSCAN_KEY || '';
const MNEMONIC_PATH = "m/44'/60'/0'/0";
const MNEMONICS: {[network: string]: string} = {
[eEthereumNetwork.kovan]: process.env.MNEMONIC || '',
[eEthereumNetwork.ropsten]: process.env.MNEMONIC || '',
[eEthereumNetwork.main]: process.env.MNEMONIC || '',
};
const MNEMONIC = process.env.MNEMONIC || '';

// Prevent to load scripts before compilation and typechain
if (!SKIP_LOAD) {
Expand All @@ -44,7 +40,7 @@ const getCommonNetworkConfig = (networkName: eEthereumNetwork, networkId: number
gasMultiplier: DEFAULT_GAS_PRICE,
chainId: networkId,
accounts: {
mnemonic: MNEMONICS[networkName],
mnemonic: MNEMONIC,
path: MNEMONIC_PATH,
initialIndex: 0,
count: 20,
Expand Down Expand Up @@ -90,6 +86,16 @@ const buidlerConfig: any = {
balance,
})),
},
buidlerevm_docker: {
hardfork: 'istanbul',
blockGasLimit: 9500000,
gas: 9500000,
gasPrice: 8000000000,
chainId: BUIDLEREVM_CHAINID,
throwOnTransactionFailures: true,
throwOnCallFailures: true,
url: 'http://localhost:8545',
},
ganache: {
url: 'http://ganache:8545',
accounts: {
Expand Down
2 changes: 1 addition & 1 deletion config/aave.ts
Expand Up @@ -270,7 +270,7 @@ export const AaveConfig: IAaveConfiguration = {
MKR: '0x61e4CAE3DA7FD189e52a4879C7B8067D7C2Cc0FA',
LINK: '0xAD5ce863aE3E4E9394Ab43d4ba0D80f419F61789',
KNC: '0x3F80c39c0b96A0945f9F0E9f55d8A8891c5671A8',
WBTC: '0x3b92f58feD223E2cB1bCe4c286BD97e42f2A12EA',
WBTC: '0xD1B98B6607330172f1D991521145A22BCe793277',
MANA: '0x738Dc6380157429e957d223e6333Dc385c85Fec7',
ZRX: '0xD0d76886cF8D952ca26177EB7CfDf83bad08C00C',
SNX: '0x7FDb81B0b8a010dd4FFc57C3fecbf145BA8Bd947',
Expand Down
7 changes: 7 additions & 0 deletions config/commons.ts
Expand Up @@ -258,4 +258,11 @@ export const CommonsConfig: ICommonConfiguration = {
[eEthereumNetwork.ropsten]: '',
[eEthereumNetwork.main]: '',
},
ProxyPriceProvider: {
[eEthereumNetwork.coverage]: '',
[eEthereumNetwork.buidlerevm]: '',
[eEthereumNetwork.kovan]: '0x276C4793F2EE3D5Bf18C5b879529dD4270BA4814',
[eEthereumNetwork.ropsten]: '',
[eEthereumNetwork.main]: '',
},
};
16 changes: 8 additions & 8 deletions contracts/configuration/LendingPoolAddressesProvider.sol
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;

import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
import {
InitializableAdminUpgradeabilityProxy
} from '../libraries/openzeppelin-upgradeability/InitializableAdminUpgradeabilityProxy.sol';
InitializableImmutableAdminUpgradeabilityProxy
} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol';

import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';

Expand Down Expand Up @@ -153,14 +153,14 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
function _updateImpl(bytes32 id, address newAddress) internal {
address payable proxyAddress = payable(_addresses[id]);

InitializableAdminUpgradeabilityProxy proxy = InitializableAdminUpgradeabilityProxy(
proxyAddress
);

InitializableImmutableAdminUpgradeabilityProxy proxy
= InitializableImmutableAdminUpgradeabilityProxy(proxyAddress);
bytes memory params = abi.encodeWithSignature('initialize(address)', address(this));

if (proxyAddress == address(0)) {
proxy = new InitializableAdminUpgradeabilityProxy();
proxy.initialize(newAddress, address(this), params);
proxy = new InitializableImmutableAdminUpgradeabilityProxy(address(this));
proxy.initialize(newAddress, params);
_addresses[id] = address(proxy);
emit ProxyCreated(id, address(proxy));
} else {
Expand Down
24 changes: 15 additions & 9 deletions contracts/configuration/LendingPoolAddressesProviderRegistry.sol
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;

import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
import {
ILendingPoolAddressesProviderRegistry
} from '../interfaces/ILendingPoolAddressesProviderRegistry.sol';
Expand All @@ -20,7 +20,7 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
/**
* @dev returns if an addressesProvider is registered or not
* @param provider the addresses provider
* @return true if the addressesProvider is registered, false otherwise
* @return The id of the addresses provider or 0 if the addresses provider not registered
**/
function isAddressesProviderRegistered(address provider)
external
Expand All @@ -33,16 +33,18 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP

/**
* @dev returns the list of active addressesProviders
* @return the list of addressesProviders
* @return the list of addressesProviders, potentially containing address(0) elements
**/
function getAddressesProvidersList() external override view returns (address[] memory) {
uint256 maxLength = _addressesProvidersList.length;
address[] memory addressesProvidersList = _addressesProvidersList;

uint256 maxLength = addressesProvidersList.length;

address[] memory activeProviders = new address[](maxLength);

for (uint256 i = 0; i < _addressesProvidersList.length; i++) {
if (_addressesProviders[_addressesProvidersList[i]] > 0) {
activeProviders[i] = _addressesProvidersList[i];
for (uint256 i = 0; i < maxLength; i++) {
if (_addressesProviders[addressesProvidersList[i]] > 0) {
activeProviders[i] = addressesProvidersList[i];
}
}

Expand All @@ -54,6 +56,8 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
* @param provider the pool address to be registered
**/
function registerAddressesProvider(address provider, uint256 id) external override onlyOwner {
require(id != 0, Errors.LPAPR_INVALID_ADDRESSES_PROVIDER_ID);

_addressesProviders[provider] = id;
_addToAddressesProvidersList(provider);
emit AddressesProviderRegistered(provider);
Expand All @@ -74,7 +78,9 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
* @param provider the pool address to be added
**/
function _addToAddressesProvidersList(address provider) internal {
for (uint256 i = 0; i < _addressesProvidersList.length; i++) {
uint256 providersCount = _addressesProvidersList.length;

for (uint256 i = 0; i < providersCount; i++) {
if (_addressesProvidersList[i] == provider) {
return;
}
Expand All @@ -85,7 +91,7 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP

/**
* @dev Returns the id on an `addressesProvider` or address(0) if not registered
* @return The id or address(0)
* @return The id or 0 if the addresses provider is not registered
*/
function getAddressesProviderIdByAddress(address addressesProvider)
external
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit b3cc9d1

Please sign in to comment.